Summary
The dedup summary line silently drops the fuzzy-merge count when the run has zero exact merges.
Where
graphify/dedup.py:419-425:
msg = f"[graphify] Deduplicated {total} node(s)"
if exact_merges:
msg += f" ({exact_merges} exact"
if fuzzy_merges:
msg += f", {fuzzy_merges} fuzzy"
msg += ")"
print(msg + ".", flush=True)
The if fuzzy_merges branch is nested inside if exact_merges, so when exact_merges == 0 and fuzzy_merges > 0 the fuzzy count is never printed. The message reads Deduplicated N node(s). with no breakdown, even though there were N fuzzy merges. Both counters are collected correctly upstream (see lines 263 / 282 for exact, 300 / 394 for fuzzy) — only the summary line is wrong.
Reproduction
Any run where Pass 1 (same-source_file, exact-normalized-label) finds nothing but Pass 2 (Jaro-Winkler over normalized labels across files) does — typical for doc-heavy or semantic-only corpora. Result:
- Actual:
[graphify] Deduplicated 12 node(s).
- Expected:
[graphify] Deduplicated 12 node(s) (12 fuzzy).
The reverse case (only exact merges) prints correctly.
Suggested fix
Build the breakdown as a list and only wrap in parens when at least one component is present:
msg = f"[graphify] Deduplicated {total} node(s)"
parts: list[str] = []
if exact_merges:
parts.append(f"{exact_merges} exact")
if fuzzy_merges:
parts.append(f"{fuzzy_merges} fuzzy")
if parts:
msg += f" ({', '.join(parts)})"
print(msg + ".", flush=True)
Happy to open a PR.
Summary
The dedup summary line silently drops the fuzzy-merge count when the run has zero exact merges.
Where
graphify/dedup.py:419-425:The
if fuzzy_mergesbranch is nested insideif exact_merges, so whenexact_merges == 0andfuzzy_merges > 0the fuzzy count is never printed. The message readsDeduplicated N node(s).with no breakdown, even though there were N fuzzy merges. Both counters are collected correctly upstream (see lines 263 / 282 for exact, 300 / 394 for fuzzy) — only the summary line is wrong.Reproduction
Any run where Pass 1 (same-
source_file, exact-normalized-label) finds nothing but Pass 2 (Jaro-Winkler over normalized labels across files) does — typical for doc-heavy or semantic-only corpora. Result:[graphify] Deduplicated 12 node(s).[graphify] Deduplicated 12 node(s) (12 fuzzy).The reverse case (only exact merges) prints correctly.
Suggested fix
Build the breakdown as a list and only wrap in parens when at least one component is present:
Happy to open a PR.