Files
Ralph Chang ff4639d153 fix: PR-2 memory plugin behavior improvements
## Task 5: Canonical exact dedupe
- Already implemented in PR-1 with enforceLongTermLimits()
- Source priority: explicit > manual > compaction
- Same source: higher confidence wins

## Task 6: Structured negative guard
- Add isNegatedMemoryRequest() for adjacency detection
- "不要記住" / "don't remember" are now properly ignored
- "not forget to remember" no longer false positive (not a directive)
- Restrict patterns to line-start (^|\n) to avoid mid-sentence matches

## Task 7: Compaction quality gate
- Add shouldAcceptWorkspaceMemoryCandidate() predicate
- Reject low-quality candidates: git hashes, errors, stack traces
- Reject temporary progress, code signatures, path-heavy facts
- Only accept entries with >= 20 chars

## Pattern improvements
- All patterns use matchAll() with proper g flag
- Dedupe by canonical text in extractExplicitMemories()
- Line-start anchor prevents "to remember" mid-sentence matches
- Add more trigger patterns: save/add to memory, commit to memory

Tests: 36 passing
2026-04-26 13:06:36 +08:00
..