Commit ffc806e
authored
feat!: align hot-path session memory with context-mode (#2)
## Summary
- re-center the branch on an MCP-first `session_*` runtime, with
in-process bounded execution, file processing, local indexing/search,
and per-root-session corpus storage on Redis/FalkorDB
- keep session continuity and long-term memory split correctly: plugin
hooks own canonical root-session resolution, event capture,
`<session_memory>` injection, and native-tool enforcement, while
Graphiti stays asynchronous and off the hot path
- harden runtime lifecycle and session-state behavior with shared
teardown, temporary-root to canonical-root migration, bounded
artifact/corpus overflow handling, and follow-up docs/config cleanup
## Key Changes
- register an in-process `session_*` MCP surface from the plugin
runtime: `session_execute`, `session_execute_file`,
`session_batch_execute`, `session_index`, `session_search`,
`session_fetch_and_index`, `session_stats`, and `session_doctor`
- add the local session corpus layer for normalized indexing, bounded
search/snippet retrieval, fetched-content ingestion, artifact storage,
and per-root-session stats in Redis/FalkorDB
- route large or risky work toward the MCP-first path via
`tool.execute.before` / `tool.execute.after`, including native-tool
guidance, argument rewriting, denial paths, and routing outcome metadata
- preserve shared session state across parent/child and
temporary/canonical root transitions by wiring runtime-state migration
through `SessionManager`, the session MCP runtime, and corpus storage
- retain the Redis-backed short-term memory + async Graphiti model:
hot-path injection remains local/cache-backed, while Graphiti drain and
cache refresh stay background-only
- refresh README/plans/tests to describe the MCP-first architecture,
local-first injection semantics, Graphiti-optional behavior, and current
validation surface
- update release workflow behavior in `.github/workflows/publish.yml`
and `.github/scripts/version.ts` so publish gating, skip behavior, and
tag/release creation stay consistent and idempotent even when npm
publish is skipped
## Testing
- add and expand focused Deno coverage for the MCP runtime, corpus,
routing, runtime teardown, session migration, and hook integration paths
- covered suites now include `src/services/session-mcp-runtime.test.ts`,
`src/services/session-corpus.test.ts`,
`src/services/tool-routing.test.ts`,
`src/services/tool-guidance-cache.test.ts`,
`src/services/tool-routing-outcome-cache.test.ts`,
`src/handlers/tool-before.test.ts`, `src/handlers/tool-after.test.ts`,
`src/session.test.ts`, and related index/handler/service tests
- release/versioning coverage includes `.github/scripts/version.test.ts`
## Notes
- this PR is no longer just the original Redis hot-tier rewrite; it now
reflects the follow-up MCP-first replacement work and the later
hardening passes on runtime lifecycle, corpus behavior, root-session
migration, and release workflow handling
- current docs intentionally describe hooks as enforcement/continuity
plumbing, not the primary execution surface; the primary path is the
in-process `session_*` MCP runtime1 parent ada7c0b commit ffc806e
101 files changed
Lines changed: 40165 additions & 7094 deletions
File tree
- .github
- scripts
- workflows
- docs
- superpowers
- plans
- specs
- plans
- scripts
- src
- handlers
- services
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
21 | 107 | | |
22 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
23 | 116 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 117 | + | |
29 | 118 | | |
30 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
31 | 125 | | |
32 | 126 | | |
33 | 127 | | |
| |||
111 | 205 | | |
112 | 206 | | |
113 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
114 | 219 | | |
115 | 220 | | |
116 | 221 | | |
| |||
121 | 226 | | |
122 | 227 | | |
123 | 228 | | |
124 | | - | |
| 229 | + | |
125 | 230 | | |
126 | 231 | | |
127 | 232 | | |
| |||
151 | 256 | | |
152 | 257 | | |
153 | 258 | | |
154 | | - | |
155 | | - | |
| 259 | + | |
| 260 | + | |
156 | 261 | | |
157 | 262 | | |
158 | 263 | | |
| |||
185 | 290 | | |
186 | 291 | | |
187 | 292 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
199 | 298 | | |
200 | | - | |
| 299 | + | |
201 | 300 | | |
202 | | - | |
| 301 | + | |
203 | 302 | | |
204 | | - | |
| 303 | + | |
205 | 304 | | |
206 | 305 | | |
207 | 306 | | |
208 | 307 | | |
209 | 308 | | |
210 | 309 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
215 | 315 | | |
216 | 316 | | |
217 | 317 | | |
218 | 318 | | |
219 | 319 | | |
220 | 320 | | |
221 | 321 | | |
222 | | - | |
| 322 | + | |
223 | 323 | | |
224 | 324 | | |
225 | | - | |
226 | | - | |
| 325 | + | |
| 326 | + | |
227 | 327 | | |
228 | 328 | | |
229 | 329 | | |
| |||
250 | 350 | | |
251 | 351 | | |
252 | 352 | | |
253 | | - | |
254 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
255 | 356 | | |
256 | 357 | | |
257 | 358 | | |
| |||
267 | 368 | | |
268 | 369 | | |
269 | 370 | | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
276 | 379 | | |
277 | 380 | | |
278 | 381 | | |
279 | | - | |
| 382 | + | |
280 | 383 | | |
281 | 384 | | |
282 | 385 | | |
| |||
291 | 394 | | |
292 | 395 | | |
293 | 396 | | |
294 | | - | |
| 397 | + | |
295 | 398 | | |
296 | 399 | | |
297 | 400 | | |
298 | 401 | | |
299 | 402 | | |
300 | | - | |
| 403 | + | |
301 | 404 | | |
302 | 405 | | |
303 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
67 | 82 | | |
68 | 83 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
0 commit comments