mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-20 00:11:37 +00:00
Python repos were producing 0 CALLS edges for module-qualified constructor calls like `models.User()` where `import models` is a bare module import. Root causes: 1. `SupportedLanguages.Python` was absent from `WILDCARD_IMPORT_LANGUAGES`, so `synthesizeWildcardImportBindings` never ran for Python files — bare module imports never received per-symbol namedImportMap bindings. 2. Synthesis only ran in the Phase 14 pre-pass, after all chunks had already been call-resolved. When `models.User()` was processed in Phase 3+4, `namedImportMap` was empty for Python → Tier 2a-named fell through to Tier 2a which found both `models.py:User` and `auth.py:User` (ambiguous). 3. `filterCallableCandidates` with `callForm='member'` excluded `Class` nodes (only `CALLABLE_SYMBOL_TYPES` = Function/Method/Constructor/…). With 2 ambiguous Class candidates both were dropped, producing 0 CALLS edges. Fixes: - Add `SupportedLanguages.Python` to `WILDCARD_IMPORT_LANGUAGES` so that `import models` expands to per-symbol namedImportMap entries (first-seen semantics: `User→models.py:User`, `Admin→auth.py:Admin`). - Call `synthesizeWildcardImportBindings` inline in the chunk loop, after `processImportsFromExtracted` but BEFORE `processCallsFromExtracted`. This ensures Tier 2a-named can disambiguate `module.ClassName()` at initial call-resolution time. The Phase 14 pre-pass remains as a final safety net. - Add a fallback in `resolveCallTarget`: if `callForm='member'` yields 0 filtered candidates, retry with `callForm='constructor'`. This handles the case where a module-qualified class instantiation (e.g. `models.User()`) is syntactically an attribute-access call but semantically a constructor call. The fallback only triggers for 0-candidate member calls, so it cannot over-eagerly promote normal member calls. Tests: add `python-module-import` fixture (models.py/auth.py/app.py) with 4 regression tests covering IMPORTS edges, name-collision disambiguation for `models.User()`, and `auth.Admin()`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| resolvers | ||
| augmentation.test.ts | ||
| cli-e2e.test.ts | ||
| cross-file-binding.test.ts | ||
| csv-pipeline.test.ts | ||
| enrichment.test.ts | ||
| filesystem-walker.test.ts | ||
| has-method.test.ts | ||
| hooks-e2e.test.ts | ||
| ignore-and-skip-e2e.test.ts | ||
| lbug-core-adapter.test.ts | ||
| lbug-lock-retry.test.ts | ||
| lbug-pool-stability.test.ts | ||
| lbug-pool.test.ts | ||
| local-backend-calltool.test.ts | ||
| local-backend.test.ts | ||
| parsing.test.ts | ||
| pipeline.test.ts | ||
| query-compilation.test.ts | ||
| search-core.test.ts | ||
| search-pool.test.ts | ||
| setup-skills.test.ts | ||
| skills-e2e.test.ts | ||
| staleness-and-stability.test.ts | ||
| tree-sitter-languages.test.ts | ||
| worker-pool.test.ts | ||