Repository navigation
fix: stop observation dedup from merging "port 80" into "port 8080" - #2
Merged
Merged
Conversation
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.
Summary
containsSimilarused a plain substring check, sodeduplicateObservationstreated an observation as a duplicate whenever its text appeared anywhere inside another one, even in the middle of a word or number. Distinct facts were silently merged and the shorter one was dropped when they were written throughn2n_add_observations/n2n_create_entities:The containment check now only matches when the contained text does not start or end in the middle of a Latin word or a number. Intended merges still work (
"version 2.4"vs"version 2.4.1","version 2.4.1"vs"version 2.4.1 released"), and text written without spaces (e.g. Chinese,使用redisvs使用redis缓存) keeps plain substring matching.Testing
src/test/similarity.test.ts; the new word-boundary tests fail onmainand pass with this change.npm run lint,npm test(111 passed),npm run buildandnpm run pack:dry-runpass locally.npm run checkstops atnpm run auditbecause of existing advisories in transitive dependencies of@modelcontextprotocol/sdk(body-parser, fast-uri, qs); this is also the case onmainand is unrelated to this change.Checklist
npm run checkpasses locally. (see audit note above)