Skip to content

Fix/external id collision - #57

Merged
rahlk merged 1 commit into
mainfrom
fix/external-id-collision
Nov 29, 2026
Merged

rahlk merged 1 commit into
mainfrom
fix/external-id-collision

Conversation

@lamwassi

Copy link
Copy Markdown
Contributor

Motivation and Context

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the Codellm-Devkit Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@lamwassi
lamwassi requested a review from rahlk November 23, 2026 16:14
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
rahlk force-pushed the fix/external-id-collision branch from 062f377 to 3885ead Compare November 29, 2026 20:09
@rahlk
rahlk changed the base branch from main to fix/cache-dir-sibling-leak November 29, 2026 20:09
rahlk pushed a commit that referenced this pull request Nov 29, 2026
A stacked PR targets another PR's branch, not main, so the pull_request
filter skipped it: #55, #56 and #57 got no CI run after they were
retargeted onto #64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rahlk
rahlk changed the base branch from fix/cache-dir-sibling-leak to main November 29, 2026 21:27
@rahlk
rahlk merged commit 971a969 into main Nov 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants