# fix(dedup): merge same-ID node attributes instead of discarding them (#2091)#2104
Open
SinghAman21 wants to merge 1 commit into
Open
# fix(dedup): merge same-ID node attributes instead of discarding them (#2091)#2104SinghAman21 wants to merge 1 commit into
SinghAman21 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On the default
dedup=Truepath, when two nodes share an ID the pre-dedup stepkept one whole node dict and threw the other away. In the AST↔semantic case
(where
_semantic_id_remapforces the AST node and the LLM node onto one ID sothey merge), the LLM's
summary/confidence_score/referencesweresilently dropped — even though
build()'s docstring promises a key-wise union.The user already paid API credits for those summaries, and the only output was a
note:about the label, never mentioning the lost attributes.How
The survivor now gap-fills from the loser instead of replacing it wholesale:
setdefault).label,source_file) still resolve to the survivor, so_collision_rankordering and the collision reporting are unchanged.dict(node)) so caller-owned node dicts are nevermutated.
Before:
dedup=True→summary=None. After:dedup=True→summarypreserved,survivor's label still wins the conflict.
Files
graphify/dedup.py— gap-fill merge in the same-ID pre-dedup loop.tests/test_dedup.py— 3 tests: gap-fill preserves disjoint attrs,survivor wins on conflict, input nodes are not mutated.
CHANGELOG.md— entry under0.9.24 (unreleased).Reference
dedup=Truediscards a same-ID node's attributes instead of merging them — LLM semantic summaries are silently lost #2091graphify/dedup.pysame-ID collapse loop.Conclusion
dedup=Truenow yields at least the attribute setdedup=Falsedoes, with thesurvivor winning genuine conflicts. No public API change; full suite green
(pre-existing unrelated
test_ollama_retry_cap.pyfailures aside).