docs(build): correct deduplicate_by_label docstring — dormant, not auto-called

deduplicate_by_label is never wired into build(); the active dedup path is
deduplicate_entities (imported and called in build). Its docstring claimed
"Called in build() automatically," which was never true. Correct it to say the
helper is dormant/unused and to warn that it merges by label alone with no
file_type guard, so it must not be enabled for code nodes — same-label symbols
from different files/packages (e.g. two Account types) would collapse, the
cross-file conflation deduplicate_entities deliberately avoids for code (#1205).

Docstring only; no behavior change. The function is unused and superseded, so it
could reasonably be deleted instead — left in place here, flagged for your call.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
tpateeq
2026-07-01 10:46:59 +01:00
committed by safishamsi
co-authored by Claude Opus 4.8
parent 20547c4767
commit 93e8e445dd
+9 -1
View File
@@ -666,7 +666,15 @@ def deduplicate_by_label(nodes: list[dict], edges: list[dict]) -> tuple[list[dic
"""Merge nodes that share a normalised label, rewriting edge references.
Prefers IDs without chunk suffixes (_c\\d+) and shorter IDs when tied.
Drops self-loops created by the merge. Called in build() automatically.
Drops self-loops created by the merge.
Dormant: this is NOT wired into ``build()`` — the active dedup path is
``deduplicate_entities`` (imported and called in ``build``), which supersedes
it. The previous "Called in build() automatically" note was never true. It
also merges by label alone with no ``file_type`` guard, so it must not be
enabled for code nodes: same-label symbols from different files/packages
(e.g. two ``Account`` types) would collapse into one — the cross-file
conflation ``deduplicate_entities`` deliberately avoids for code (#1205).
"""
_CHUNK_SUFFIX = re.compile(r"_c\d+$")
canonical: dict[str, dict] = {} # norm_label -> surviving node