From 93e8e445ddc51e21ebb63d52f018c9af963efabd Mon Sep 17 00:00:00 2001 From: tpateeq Date: Sun, 28 Jun 2026 16:39:07 +0530 Subject: [PATCH] =?UTF-8?q?docs(build):=20correct=20deduplicate=5Fby=5Flab?= =?UTF-8?q?el=20docstring=20=E2=80=94=20dormant,=20not=20auto-called?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- graphify/build.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/graphify/build.py b/graphify/build.py index 258036f8f..2de02b2ae 100644 --- a/graphify/build.py +++ b/graphify/build.py @@ -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