fix: skip impossible file-anchored dedup scoring - #1833
Conversation
|
@safishamsi please review it once whenever feasible! |
…red-buckets # Conflicts: # graphify/dedup.py
|
@safishamsi just pinging for review!! |
There was a problem hiding this comment.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR refactors the fuzzy-dedup phase in graphify/dedup.py to group candidates before running them through LSH, so that file-anchored non-code nodes (rationale/document) are only compared against nodes sharing the same source_file, while other node types keep global comparison. It introduces helper functions _is_file_anchored_noncode and _fuzzy_candidate_groups, restructures the main loop to iterate over these groups with a per-group LSH index and a shared seen_pairs set to avoid re-evaluating pairs. The test file tests/test_dedup.py is updated with numerous new/modified test cases and rationale fixtures covering cross-file merge behavior and determinism.
Worth a look
- Empty source_file ("") anchored nodes grouped together across unrelated files —
graphify/dedup.py· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 307 functions depend on the 155 node(s) this change touches.
Health — this change adds coupling hotspots:
- worse:
deduplicate_entities()— 51 callers, 22 callees - worse:
_llm_tiebreak()— 1 callers, 12 callees
Verification — 307 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 172 function(s) in the blast radius were not formally verified this run
· 2 more finding(s) on lines outside this diff (see the check run).
Summary