Repository navigation
fix(dedup): pick pass-2 winner from the verified pair only (#1247) - #1248
Merged
Merged
Conversation
…Labs#1247) Pass 2 selected the merge winner from the union of both normalized-label groups, so never-compared same-label/cross-file nodes could be pulled into the union, bypassing the Graphify-Labs#1046/Graphify-Labs#1178 guards. Pick the winner from [node, neighbor] only; group members that belong together still merge via pass 1 (same file) or their own verified comparison. Co-authored-by: Cursor <[email protected]>
PerryLin-0420
pushed a commit
to PerryLin-0420/graphify-decouple
that referenced
this pull request
Aug 13, 2026
…ner-union fix(dedup): pick pass-2 winner from the verified pair only (Graphify-Labs#1247)
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.
Fixes #1247.
Summary
deduplicate_entitiesselected the merge winner from the union of both normalized-label groups (norm_to_nodes[norm_label] + norm_to_nodes[neighbor_norm]). Since those groups contain every node sharing a normalized label — including same-label/different-source_filenodes deliberately kept separate by the Pass 2 fuzzy dedup merges identical-label nodes across unrelated source_files (leaks #895's fix) #1046/Bug Report —graphify --updateperforms a destructive, net-negative fuzzy node merge on an already-current code graph #1178 guards —_pick_winnercould select a never-compared node, and the subsequentuf.unioncalls merged it with both members of the verified pair.[node, neighbor]only. Group members that genuinely belong together are still reachable — same-file duplicates were already unioned in pass 1, and any other member must win its own guarded comparison to join.Test
Regression test in
tests/test_dedup.py: A ("Session Manager", auth.md), B ("Session Manager", billing.md, shortest id), C ("Session Managr", notes.md). Only A–C is a verified fuzzy match; before the fix all three collapsed into B, after the fix the A–C pair merges and B stays distinct.Full suite: 1985 passed, 27 skipped (
uv run --frozen pytest tests/ -q).Made with Cursor