You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does fork issue #445 reproduce despite keyed facts and the near-twin cap? Measure duplicate share on a copy of the live store, and whether dedup at write time changes Recall. Upstream: rohitg00#1793, rohitg00#1812.
Verdict: APPLY, partial scope (unkeyed new facts only).
Defect exists: consolidateSemantic (src/functions/consolidation-pipeline.ts) matches only on exact lower-cased text or an identical (subject, relation, object) key. A reworded unkeyed fact is always a new row; the merge prompt lists no existing facts.
Repro: test/semantic-restatement.test.ts > "reinforces a live fact of the same project instead of writing its reworded restatement" fails 1/1 on base (3 rows instead of 1). The other 3 tests (other project's twin is not merged; a keyed fact is not folded into an unkeyed one-word-different twin; same-key different-object still supersedes) pass on base and after the fix, as guards.
Fix: new helper restatedFact in consolidateSemantic. After the text and key matches miss, an UNKEYED new fact reinforces the best live fact of the same project (word-set Jaccard >= RESTATEMENT_OVERLAP, ties keep the first) through the existing reinforce branch (existing wording kept, accessCount++, confidence max, source ids capped). Candidates: unkeyed live facts whose project is this one, or project-less facts citing only this project's Sessions (same guard as the text match). Keyed new facts are never matched by overlap: "indents with tabs" vs "indents with spaces" overlaps 0.6 and is a supersession, which the key handles (test/semantic-supersession.test.ts "leaves unkeyed facts alone" caught that the first, wider draft broke it). Passing: semantic-restatement, semantic-supersession, consolidation-pipeline, consolidate-dedup, consolidation-default, semantic-fact-index (63/63); typecheck clean.
Difference from the AC: existing wording is kept (Lessons take the new wording since an Agent restated it; a re-emitting LLM is not the Operator restating).
Live facts with an earlier live same-project fact at overlap >= 0.5: 16,372 = 42.0% overall (upper bound: includes one-word-contradiction pairs). By project: agentmemory-sqlite 47.8% (1,747/3,652), devex 40.7%, homelab 37.7%, medical-researcher 39.2%, inference-runtime-broker 39.8%, glydr 28.7%, template 24.8%.
18,231 live facts (47%) have no project and cite Sessions of several or evicted projects ("mixed/unknown" bucket, 45.9% duplicated within it); the fix cannot dedupe those against new writes unless every cited Session is the current project's.
Class 2: YES. Changes what Consolidation stores and which facts Recall sees (fewer near-twin rows, higher accessCount/strength). Bar (tmp/verify/445-verify.log, branch verify/445-reworded-dup-facts): typecheck 0 errors; npm test 272 files, 3,120 passed, 1 skipped; build ok; eval:gate and eval:gate:rules pass; eval:suite --tier fast against base-fdc3d459: all 15 metrics unchanged (Δ 0.000), so no recall drop. The benches do not run Consolidation, so they show that nothing regressed, not the dedup gain; that gain is the live-store count above. Left for apply time: the docs/experiments.md row the AC asks for, carrying the live-store measurement above.
Retry if: a replay or decision-key run shows a recall drop after apply; then restrict the merge to overlap >= 0.7.
Activity
possiblyneal commentedon Nov 18, 2026
#460 / fork #445: consolidation writes reworded near-duplicate Semantic Facts
Verdict: APPLY, partial scope (unkeyed new facts only).
Defect exists:
consolidateSemantic(src/functions/consolidation-pipeline.ts) matches only on exact lower-cased text or an identical (subject, relation, object) key. A reworded unkeyed fact is always a new row; the merge prompt lists no existing facts.Repro:
test/semantic-restatement.test.ts> "reinforces a live fact of the same project instead of writing its reworded restatement" fails 1/1 on base (3 rows instead of 1). The other 3 tests (other project's twin is not merged; a keyed fact is not folded into an unkeyed one-word-different twin; same-key different-object still supersedes) pass on base and after the fix, as guards.Fix: new helper
restatedFactin consolidateSemantic. After the text and key matches miss, an UNKEYED new fact reinforces the best live fact of the same project (word-set Jaccard >= RESTATEMENT_OVERLAP, ties keep the first) through the existing reinforce branch (existing wording kept, accessCount++, confidence max, source ids capped). Candidates: unkeyed live facts whose project is this one, or project-less facts citing only this project's Sessions (same guard as the text match). Keyed new facts are never matched by overlap: "indents with tabs" vs "indents with spaces" overlaps 0.6 and is a supersession, which the key handles (test/semantic-supersession.test.ts "leaves unkeyed facts alone" caught that the first, wider draft broke it). Passing: semantic-restatement, semantic-supersession, consolidation-pipeline, consolidate-dedup, consolidation-default, semantic-fact-index (63/63); typecheck clean.Difference from the AC: existing wording is kept (Lessons take the new wording since an Agent restated it; a re-emitting LLM is not the Operator restating).
Live-store measurement (copy, read-only; script tmp/wt/verify-445/tmp/dup.ts, repo jaccardText/jaccardOverlap, case-sensitive tokens, live = isLatest !== false):
Class 2: YES. Changes what Consolidation stores and which facts Recall sees (fewer near-twin rows, higher accessCount/strength). Bar (
tmp/verify/445-verify.log, branchverify/445-reworded-dup-facts): typecheck 0 errors;npm test272 files, 3,120 passed, 1 skipped; build ok; eval:gate and eval:gate:rules pass;eval:suite --tier fastagainst base-fdc3d459: all 15 metrics unchanged (Δ 0.000), so no recall drop. The benches do not run Consolidation, so they show that nothing regressed, not the dedup gain; that gain is the live-store count above. Left for apply time: the docs/experiments.md row the AC asks for, carrying the live-store measurement above.Retry if: a replay or decision-key run shows a recall drop after apply; then restrict the merge to overlap >= 0.7.