Repository navigation
Fix/external id collision - #57
Merged
Merged
Conversation
ExternalID maps every dot in a callee's signature to a path segment, so two different library callees can share one id. A method Box.Put in package example.com/dep and a function Put in package example.com/dep/Box both give example.com/dep/Box/Put. external_symbols is keyed by that id, so one entry overwrote the other: the method's call edge pointed at the function's metadata (module example.com/dep/Box, signature Put) and the method's own symbol was gone. The schema is shared with the other language analyzers, so changing the id grammar (a marker segment, say) would change every external id. That is a schema decision and is not made here. Instead, a callee keeps its plain id unless another callee in the same run has the same one. Then both get a suffix of ":" and the first 16 hex digits of the SHA-256 of their own full signature. Ids that were already unique are unchanged, and a colliding callee's suffix depends only on that callee, so it does not move when unrelated callees come and go. The id is now computed once (externalIDs). The call-edge index and external_symbols both read it, where they used to compute it separately. An edge and its symbol therefore always agree. Tests: TestExternalIDs_TypeMethodAndFunctionKeepSeparateSymbols runs the real analyzer on a replaced dependency with the collision, and fails on the old code (no symbol for box.Put). The unit tests cover the unchanged unique case, the distinct colliding case, and stability across sets. Not covered: an import-level Neo4j ghost (ExternalID with an empty signature) can still share an id with a package-level function whose package path is the import path's parent. That needs the projector to know the symbol set, so it is left for its own change. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
rahlk
force-pushed
the
fix/external-id-collision
branch
from
November 29, 2026 20:09
062f377 to
3885ead
Compare
rahlk
pushed a commit
that referenced
this pull request
Nov 29, 2026
9 tasks done
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.
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context