Files
dotfiles/.pi/reviews/context-manager-task3-scope-fix-report.md
2026-04-09 23:14:57 +01:00

43 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Context Manager Task 3 Scope Fix Report
## Status
- Done
- Tightened the remaining user-constraint scope heuristic so ambiguous constraint lines stay `branch` scoped.
- Preserved the source-stable subject behavior introduced in the prior Task 3 fix.
## Changes
1. **Narrowed durable session promotion in `.pi/agent/extensions/context-manager/src/extract.ts`**
- Removed the bare-keyword session promotion behavior for terms such as `MVP` and `context window`.
- Kept `session` scope promotion limited to clearer durability signals such as `whole session`, `across branches`, `session-wide`, `project-wide`, and similar explicit phrasing.
2. **Strengthened local-scope detection**
- Treated `this module` / `in this module` as branch-local cues so module-local rename instructions do not leak across branch switches.
3. **Added regression coverage in `.pi/agent/extensions/context-manager/src/extract.test.ts`**
- Updated the existing extraction expectation so `We must adapt to the active model context window.` remains `branch` scoped.
- Added explicit regression assertions for the reviewers false-positive examples:
- `We should keep the MVP branch experimental.``branch`
- `We should rename the context window helper in this module.``branch`
- Kept a durable-session control case to verify explicit session phrasing still promotes correctly.
## 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, 0 failed
- `cd /home/alex/dotfiles/.worktrees/context-manager-extension/.pi/agent/extensions/context-manager && npm test`
- Result: 15 tests passed, 0 failed
## 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-scope-fix-report.md`
## Self-Review Findings
- The fix stays narrowly scoped to `inferConstraintScope()` heuristics and targeted regression coverage.
- Public APIs and exported function signatures are unchanged.
- The previously fixed source-stable `subject` generation remains untouched.
- The updated tests cover both the reviewers concrete false positives and an existing ambiguous `context window` example.
## Concerns
- Constraint scoping remains heuristic-based by design, so the extractor is intentionally conservative: unclear user constraints now stay `branch` scoped unless the text explicitly signals broader durability.
- No additional blocking concerns found after the targeted and full test runs.