Phase 14: B-002 post-fix RPC E2E — unit pass, compact kept-window limit

Post-fix script and doc: automated tests cover loose defer path; short RPC session keeps skill in kept so compact reinject not triggered.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-17 17:38:46 +07:00
parent 2f6f5477c5
commit 1e5cd07784
2 changed files with 284 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# B-002 post-fix E2E (Phase 14)
Run: `node scripts/b002-repro-post-fix.mjs` (LiteLLM `Eltex-Coder-Senior`, skill at `~/.cursor/skills/fup-blame-commits`).
Patches `~/.pi/agent/settings.json` temporarily (`skillReinject.debug: true`, `requireRegistered: false`, `autoCompactIntegration: defer`).
## 2026-06-17 — RPC post-fix
Flow: `/skill-reinject on``/skill:fup-blame-commits` → 6 filler turns → `/skill-reinject now` → RPC `compact``after-compact` prompt.
| Check | Result |
|-------|--------|
| Unit regression (`test/reinject*.ts`, `test/reinject-deferred-consume.test.ts`) | **pass** (84 tests) |
| `session_compact` diag: skill left kept window | **no**`kept` still includes `fup-blame-commits` on small session (444 tokens before compact) |
| `planned` / `pending` after compact | `[]` (expected when skill still in kept) |
| `/skill-reinject now` inject visible in RPC stdout | **not captured** — injected blocks use extension custom message path; script does not parse them yet |
| Defer loose path (unregistered + disk) | **covered by unit tests** — RPC `--skill` keeps skill in `registered` |
**Conclusion:** Code fix for B-002 (defer plan without registry at compact + consume/build loose fallback) is validated by automated tests. Full RPC proof of compact→reinject requires a session where compaction drops the skill block from the kept window (threshold / long history); short RPC repro still shows `kept` retaining the skill.
**Pre-fix vs post-fix:** When `kept` excludes a tracked skill, `planDeferredReinject` now sets `pending` even if `registered=[]` (see `test/b002-repro-pre-fix.test.ts` case 3 + `test/reinject.test.ts`).