Skip to content

fix(program): disambiguate repeated Python symbols#46

Merged
forhappy merged 1 commit into
mainfrom
codex/fix-python-symbol-collisions
Jul 26, 2026
Merged

fix(program): disambiguate repeated Python symbols#46
forhappy merged 1 commit into
mainfrom
codex/fix-python-symbol-collisions

Conversation

@forhappy

Copy link
Copy Markdown
Contributor

Summary

  • disambiguate repeated Python function symbol IDs by occurrence
  • preserve the existing stable ID for the first definition and derive deterministic IDs for later collisions
  • add a Django-shaped regression test for conditional mogrify() definitions

Root cause

The Python Program IR extractor hashed source path, qualified name, and signature. Conditional implementations with the same name and signature in one file therefore emitted duplicate IDs and failed provider validation. Rust and TypeScript already applied occurrence-based disambiguation; Python did not.

Impact

Large Python repositories with conditional alternative definitions, including Django's psycopg 2/3 mogrify() implementations, can now complete compass init and compass update successfully.

Validation

  • cargo fmt --all -- --check
  • cargo test -p compass-languages (40 tests passed)
  • Django full initialization: 6,051 files indexed, 3,038 Program IR modules, 0 conflicts
  • Django cached update completed successfully

@forhappy
forhappy marked this pull request as ready for review July 26, 2026 06:44
@forhappy
forhappy merged commit 7be71a4 into main Jul 26, 2026
4 of 10 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.

1 participant