2.0 KiB
2.0 KiB
Context Manager Task 6 Fix 2 Report
Status
Done. Fixed the remaining branch rehydration and /ctx-mode persistence regressions and verified them with targeted and full test runs.
Changes
- Updated
.pi/agent/extensions/context-manager/index.tsrehydration to restore the latest valid snapshot ledger as the base state and replay only tracked messages that occur after that snapshot entry. - Kept empty-ledger startup behavior when a branch has no valid snapshot.
- Preserved live in-memory mode changes during
turn_endso/ctx-mode aggressivewins over an older persisted snapshot mode before the next snapshot is appended. - Strengthened
.pi/agent/extensions/context-manager/src/extension.test.tswith integration-style regressions for:session_treeon a snapshot-only branch producing a hidden packet from snapshot-backed ledger state./ctx-mode aggressivepersistingmode: "aggressive"and the corresponding aggressive-zone token classification on the nextturn_end.
Tests
cd /home/alex/dotfiles/.worktrees/context-manager-extension/.pi/agent/extensions/context-manager && npx tsx --test src/extension.test.ts✅cd /home/alex/dotfiles/.worktrees/context-manager-extension/.pi/agent/extensions/context-manager && npm test✅
Files Changed
.pi/agent/extensions/context-manager/index.ts.pi/agent/extensions/context-manager/src/extension.test.ts.pi/reviews/context-manager-task6-fix-2-report.md
Self-review Findings
- Snapshot-only branches now retain snapshot ledger contents for packet injection and command inspection instead of dropping to an empty ledger.
- Rehydration no longer replays pre-snapshot transcript entries, which avoids rebuilding stale state on top of a newer snapshot.
- The
/ctx-modefix is narrowly scoped toturn_end; public commands and extension hook API stay unchanged.
Concerns
- None with the fix itself.
- The worktree still contains unrelated untracked historical review files under
.pi/reviews/; they were left untouched and excluded from the focused commit.