fix: treat a negated re-statement as a conflict, not a duplicate - #135
Merged
Grivn merged 6 commits intoSep 14, 2026
Merged
Conversation
Tokenize drops "not"/"no" as stopwords, so "X is allowed" and "X is not allowed" produce identical token sets and classifySuggestion returned DUPLICATE above 0.9 token similarity — remember then silently skipped the correction. Compare polarity from the raw text inside the near-duplicate branches only, so a bare "not" in scientific prose still cannot force CONFLICT. A polarity mismatch on a near-verbatim re-statement now returns CONFLICT and both facts are kept. Verified with go test ./internal/memory/search/... -count=1.
Recognize straight and curly apostrophes consistently and use Unicode word boundaries so names such as Noté do not imply negation. Remove the character-only CJK check, which falsely classified ordinary words such as 非常 and 未来 as conflicts. Validated with the full memory search suite. New regression cases fail on the original PR and pass with the fix, and a synthetic embedding case covers the second near-duplicate branch without a provider.
Import classified conflicts as added memories so heuristic conflicts preserve the existing record and its edges, matching remember. This intentionally changes the previous conflict replacement behavior; update the English and Chinese import docs while retaining ordinary updates and exact-duplicate skips. Validated with go build -o mnemon ., make test, focused SQLite import tests, and fresh-store CLI comparisons. Tests cover old and newly negated conflict signals, duplicate and no-diff outcomes, update replacement, and explicit edges through skipped and added draft indices.
5 tasks
added 2 commits
September 15, 2026 02:10
Merge current master while retaining the original negation fix and both review commits. The mainline exact-content write policy subsumes the earlier import-conflict fix: keep imports and documentation on that policy and adapt the old UPDATE control to preserve both facts. Retain both sets of SQLite and edge-mapping tests, and assert that forward and reverse negated corrections still report advisory CONFLICT. Validated with go test ./cmd/memory ./internal/memory/search -count=1.
Merge the released Homebrew postflight changes on top of the exact-content write-policy adaptation. Preserve the original PR and review commit ancestry while keeping the current mainline import behavior. Validated with go build -o mnemon ., make test, and the Memory CLI E2E suite (258 checks passed), with embedding probes directed to an unavailable loopback endpoint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Near-duplicate statements that flip an explicit English negation marker now report
CONFLICTinstead ofDUPLICATE. This preserves the original contribution while recognizing straight and curly apostrophes consistently, respecting Unicode word boundaries, and avoiding false polarity changes from individual CJK characters.Current
masteralready preserves distinct facts during writes through #139. This PR keeps that exact-content identity rule: different text remains a separate memory, andUPDATE/CONFLICTsuggestions do not delete records. The earlier import-preservation follow-up is retained in history and reconciled with the broader mainline policy. Both sets of import tests remain, with the superseded automatic-update expectation adjusted to preserve the new policy.The original commit
4c31eb89d0a602ca37d75a3008ed7d3613b35930and both follow-up commits are preserved without rebasing or squashing. The classifier remains advisory; this does not claim general multilingual contradiction detection.Validation: product build,
make test, focused search/import/write tests, Memory CLI E2E, and checks that the new multilingual recall intent behavior remains intact. All behavioral checks use scratch stores with the embedding provider disabled; no paid provider calls.The original author disclosed AI assistance for the initial implementation and regression tests. Related issue: #133.