Repository navigation
fix(memory-core): filter junk topics from REM phase extraction (#111923) - #117248
Conversation
|
Codex review: needs changes before merge. Reviewed August 27, 2026, 1:29 PM ET / 17:29 UTC. ClawSweeper reviewWhat this changesThe PR shares concept-tag normalization between fresh extraction and stored REM inputs, filtering numeric/date noise and deduplicating equivalent tag spellings per memory. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open: the Memory Core repair uses the correct shared normalization boundary, but the introduced release-owned changelog entry must be removed before merge. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherMemory Core derives concept tags from recalled memory content and later aggregates stored tags into REM reflection topics. The shared normalizer determines which input topics can appear in those reflections. flowchart LR
A[Recalled memory] --> B[Concept tag extraction]
C[Stored recall tags] --> D[Shared topic normalization]
B --> D
D --> E[REM aggregation]
E --> F[Reflection topics]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -30, Tests +5, Docs +1. Total -24 across 5 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Land the canonical normalization repair without modifying CHANGELOG.md; retain the user-facing release context already recorded in the PR body and commit message. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the base directly aggregates legacy stored tags, while the current CLI and focused tests expose the REM path that consumes them. Is this the best way to solve the issue? No as submitted: the shared normalizer is the best repair, but the release-owned changelog hunk should be removed from this PR. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 53380e5ca735. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (33 earlier review cycles; latest 8 shown)
|
4a0ff10 to
4f11722
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Re-scoped from current head ( The fix in
Separately, ClawSweeper's real-behavior-proof gate still applies: a redacted REM-path harness run (or persisted-memory result) showing |
4f11722 to
01ff838
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
01ff838 to
e79e0e0
Compare
Real Behavior Proof — Legacy tag filtering in REM aggregationWhat this fixes (P1)The junk-topic filter only ran on NEW concept tags. Existing recall entries already had junk tags ( Changes
Live test evidenceKey tests:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
8b520f7 to
ef9f59f
Compare
Runtime Proof Generated ✓Rebased onto latest main. All tests pass. Vitest ResultsThe fix correctly filters junk topics from REM phase extraction:
The filter is pure and stateless with no configuration surface. Note on CI: The previous Ready for re-review. 🦞 |
ef9f59f to
4cc1e7d
Compare
4cc1e7d to
a92ace5
Compare
a92ace5 to
823cd7f
Compare
Share canonical concept normalization across extraction and REM; reject numeric noise, preserve protected technical terms, and avoid duplicate normalized counts. Co-authored-by: synthclaw <[email protected]>
823cd7f to
ae06208
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
REM reflections can promote numeric/date noise from both freshly extracted concepts and saved recall entries. Junk can consume the bounded topic list and displace meaningful concepts. This addresses the verified numeric/normalization portion of #111923; it does not claim to resolve every historical feedback-loop case in that report.
Why This Change Was Made
Maintainer rewrite of @synthalorian's fix, preserving contributor credit.
normalizeConceptTokenis the single policy owner for new extraction and REM topic selection. It rejects numeric compounds after Unicode NFKC normalization, retains date-with-suffix filtering and protected short technical terms, and deduplicates normalized spellings per memory. The stored rows themselves are neither rewritten nor migrated.The same owner cleanup replaces the UTF-16 index walker with precomputed Unicode word-boundary expressions:
kvands3must not match inside a longer word containing astral letters. Long glossary terms retain their existing substring behavior. Removed paths include the separate REM blacklist, glossary-origin boolean plumbing, one-use accumulator and unreachable overflow trimming, and manual boundary walker. No new dependency, configuration option, schema change, migration, QMD glossary entry, or public SDK surface.User Impact
Valid technical and multilingual topics remain visible. One memory contributes once to each canonical topic even when it contains spellings such as
kvandKV. Existing topic limits, strength thresholds, storage layout, and default configuration remain unchanged.Evidence
AI-assisted with Codex. Trusted proof baseline:
0b652b009107c7c4a6516f26ba7a96a0cb168881; current headae06208a7206aa591806a2072051e1f8fb150d2dmechanically rebases the rewrite onto newer main. Only a changelog conflict was resolved; all four changed TypeScript files are byte-identical to the reviewed first head823cd7fefd464e39d65b0d6927a1ed4c40691c9f, and production hashes match the real CLI proof. No contributor branch code was executed locally or on the credentialed proof runner.memory rem-harness --json, reopened it, and separately ranmemory rem-harness --path <disposable-history> --jsonagainst baseline and candidate source snapshots. The entrypoint wasnode --import tsx src/entry.ts, not a direct helper call or mocked manager.kv, exhausting the ten-topic limit. Candidate returned exactlykv=2,s3=2,ollama=1,provider=1,router=1,备份=1. Every raw-row readback remained byte-equivalent after canonical JSON serialization: SHA-25677ebd1a9f9ec63ad11d996e0567c4e018875b5713db7f7ba9520a3fd2f3fdab5.1.00and51-54on baseline; candidate retainedbackup,kv,router, ands3only. Source owner hashes were verified against the frozen candidate. Disposable state/workspaces were removed and the exact lease was stopped and independently verified completed.ae06208a7206aa591806a2072051e1f8fb150d2d.Production LOC: +29/-59 (net -30). Tests: +33/-28 (net +5). Maintainer changelog: +1. Total: +63/-87 (net -24).
Review Decisions and Scope
The August 25 ClawSweeper findings and rank-up moves are addressed: the legacy REM predicate now uses the canonical policy, date/NFKC cases are covered, unrelated QMD promotion is absent, and real persisted/reopened CLI proof is recorded above. The stale contributor branch is replaced with a focused trusted-main rewrite; exact-head CI remains required. The maintainer changelog entry follows the explicit landing instructions and credits the contributor.
The fresh August 27 review of
ae06208a7206confirms the shared owner repair and persisted-state proof; its only finding and first rank-up move concern the changelog. That removal is intentionally skipped under explicit maintainer direction to add a contributor-credited entry for this user-facing fix, using the existing per-operation changelog exception without changing release policy or publishing anything. Its other rank-up move is satisfied by completed exact-head CI run 33097914464. The review's separate help-only probe timed out after 30 seconds; it is not counted as passing evidence. The completed real CLI runs above exercise the actual persisted and fresh-history behavior, not just help output.The malformed numeric policy and UTF-16 boundary walker also exist in stable
v2026.7.1-2. The glossary work in #96304 (code/PR author @ly-wang19, merged June 24 by @vincentkoc; commitbea3d292c7327883663dfced869f8a124e6693d0) established the short-term boundary context. Local blame of the implicated current lines ends at the shallow-history boundary, so this does not attribute the original numeric-filter defect to that PR or to the shallow-boundary committer.Alternatives rejected: another blacklist duplicates and drifts from extraction policy; rewriting persisted rows would introduce an unnecessary storage migration; globally banning ordinary words such as
keptorthemewould confuse content with generated-output provenance. Existing ingestion excludes managed dreaming blocks. Broader historical feedback-loop handling remains tracked by #111923; that issue stays open. Legacy tags displayed by the separate deep-candidate projection are unchanged, not claimed repaired here.