mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-16 23:43:12 +00:00
Review feedback from PR #980 reviewer flagged a BLOCKING correctness bug: when two classes in the same file define a method with the same simple name (e.g. class User: def save + class Document: def save), every d.save() CALLS edge silently resolved to User.save because the graph node lookup keyed only by (filePath, simpleName) and first-wins took User's method. Three-layer fix: 1. populateClassOwnedMembers now promotes a nested def's qualifiedName from `save` to `ClassName.save` when the def sits inside a class scope. Python's scopes.scm doesn't emit @declaration.qualified_name for methods, so without this the finalized SymbolDefinition carried only the simple name. 2. buildGraphNodeLookup adds a second key per node: (filePath, qualifiedName). For Method/Function nodes the qualifier is parsed deterministically out of the node id (`Method:file.py:User.save#N` → `User.save`), which is robust to Windows-style filePath colons. Simple-name key retained as a fallback for callers that don't know the qualifier. 3. resolveDefGraphId now tries the qualified key first, then falls back to the simple-name lookup. Also addresses the non-blocking review items: - scopeResolutionPhase.deps now includes `crossFile` so the Kahn's runner can't schedule scope-resolution before crossFile finishes writing heritage edges that buildMro consumes. - run.ts no longer mutates the finalized ScopeResolutionIndexes via `as` cast — spreads into a fresh object with the populated methodDispatch field instead. - Doc nits: scope-resolver.ts registry path + phase.ts Ring number. Test coverage: - New fixture test/fixtures/lang-resolution/python-same-file-method-collision with User.save + Document.save in one file and app.py calling both through typed receivers. - Three new integration assertions pin that u.save() and d.save() target the correct qualified node id. Fail before the fix, pass after. Confirmed by running once without populateClassOwnedMembers qualifier promotion — reproduces the original User.save-for-both bug. Verification: 194/194 test/integration/resolvers/python.test.ts pass both REGISTRY_PRIMARY_PYTHON=0 and =1. 523/523 related unit tests. tsc --noEmit clean. |
||
|---|---|---|
| .. | ||
| group | ||
| resolvers | ||
| api-impact-e2e.test.ts | ||
| augmentation.test.ts | ||
| class-impact-all-languages.test.ts | ||
| cli-e2e.test.ts | ||
| cross-file-binding.test.ts | ||
| csv-pipeline.test.ts | ||
| enrichment.test.ts | ||
| expo-routes.test.ts | ||
| filesystem-walker.test.ts | ||
| has-method.test.ts | ||
| heritage-extractor-wiring.test.ts | ||
| hooks-e2e.test.ts | ||
| ignore-and-skip-e2e.test.ts | ||
| java-class-impact.test.ts | ||
| lbug-core-adapter.test.ts | ||
| lbug-lock-retry.test.ts | ||
| lbug-pool-stability.test.ts | ||
| lbug-pool.test.ts | ||
| lbug-vector-extension.test.ts | ||
| local-backend-calltool.test.ts | ||
| local-backend.test.ts | ||
| orm-dataflow.test.ts | ||
| parsing.test.ts | ||
| pipeline-graph-golden.test.ts | ||
| pipeline.test.ts | ||
| qualified-class-lookups.test.ts | ||
| query-compilation.test.ts | ||
| search-core.test.ts | ||
| search-pool.test.ts | ||
| server-analyze.test.ts | ||
| setup-skills.test.ts | ||
| shape-check-regression.test.ts | ||
| skills-e2e.test.ts | ||
| staleness-and-stability.test.ts | ||
| tree-sitter-languages.test.ts | ||
| worker-pool.test.ts | ||