2.6 KiB
2.6 KiB
Context Manager Task 3 Fix Report
Status
- Done
- Fixed the Task 3 review findings in the extractor and strengthened coverage around extractor/ledger interaction.
Changes
-
Stopped cross-slice subject collisions in extracted memory
- Updated
.pi/agent/extensions/context-manager/src/extract.tsso synthetic subjects for decisions, constraints, and active tasks include the sourceentryId(for exampledecision-u1-0). - This keeps independently extracted facts from different transcript slices in separate ledger slots without changing public APIs or the ledger merge contract.
- Updated
-
Refined user-constraint scoping
- Added a small
inferConstraintScope()heuristic. - User constraints now default to
branchscope unless they include durable session-wide signals. - Branch-local cues such as
this branch,for now,in this file, or explicit file references stay branch-scoped. - Durable cues such as
whole session,across branches,MVP, orcontext windowstay session-scoped.
- Added a small
-
Strengthened regression coverage
- Expanded
.pi/agent/extensions/context-manager/src/extract.test.tsto verify source metadata, stable per-slice subject generation, extractor/ledger interaction, and the refined scope heuristic. - Added regression coverage proving independently extracted constraints, decisions, and active tasks all remain active after
mergeCandidates().
- Expanded
Tests
- Focused extractor tests:
cd /home/alex/dotfiles/.worktrees/context-manager-extension/.pi/agent/extensions/context-manager && npx tsx --test src/extract.test.ts- Result: 4 tests passed
- Full extension suite:
cd /home/alex/dotfiles/.worktrees/context-manager-extension/.pi/agent/extensions/context-manager && npm test- Result: 15 tests passed
Files Changed
- Modified:
.pi/agent/extensions/context-manager/src/extract.ts - Modified:
.pi/agent/extensions/context-manager/src/extract.test.ts - Created:
.pi/reviews/context-manager-task3-fix-report.md
Self-Review Findings
- The fix stays focused on Task 3 behavior and keeps all public function signatures unchanged.
- No ledger changes were needed; Task 2 deterministic merge behavior remains covered by the existing ledger tests and the full suite still passes.
- The new interaction test exercises the real extractor-to-ledger path that the review flagged as missing.
Concerns
- The extractor still uses heuristic subject generation for independently extracted items, so semantically related decisions restated in different messages will coexist unless a future task adds stronger semantic matching. That is intentional for this focused fix and avoids the reported overwrite bug.