Skip to content

fix: skip impossible file-anchored dedup scoring - #1833

Open
GautamBytes wants to merge 2 commits into
Graphify-Labs:v8from
GautamBytes:perf/dedup-file-anchored-buckets
Open

fix: skip impossible file-anchored dedup scoring#1833
GautamBytes wants to merge 2 commits into
Graphify-Labs:v8from
GautamBytes:perf/dedup-file-anchored-buckets

Conversation

@GautamBytes

@GautamBytes GautamBytes commented Jul 12, 2026

Copy link
Copy Markdown

Summary

  • skip cross-file rationale/document dedup pairs before LSH/Jaro scoring
  • apply same grouping to --dedup-llm tiebreak path

@GautamBytes

Copy link
Copy Markdown
Author

@safishamsi please review it once whenever feasible!

…red-buckets

# Conflicts:
#	graphify/dedup.py
@GautamBytes

Copy link
Copy Markdown
Author

@safishamsi just pinging for review!!

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 filesgraphify/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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant