mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-17 23:52:36 +00:00
Codex round-3 adversarial review raised three concerns about scope-resolution passes assuming module-scope semantics that would contradict `pythonImportOwningScope`'s documented per-scope contract. Empirical verification via scope-dump probes resolved each: Plan: docs/plans/2026-04-21-003-fix-codex-round3-scope-aware-resolution-plan.md 1. Function- and class-local namespace imports: VERIFIED WORKING. `def outer(): import svc as s; s.call()` and `class A: import mod; def use(self): mod.helper()` both emit CALLS edges with reason "scope-resolution: namespace-receiver". finalize-algorithm hoists the ImportEdges onto `indexes.imports[moduleScope]` regardless of where the `import` statement appears, so collectNamespaceTargets' module-scope read finds them. 2. Imported return-type propagation module-scope-only: VERIFIED WORKING (already pinned in round 2). `from svc import get_user` inside a function body lands in indexes.bindings[moduleScope], so propagateImportedReturnTypes' module-scope read still finds it. 3. Nested method-local defs stamped as class members: VERIFIED FALSE. The scope extractor creates nested Function scopes for inner `def`s; `def helper` inside `def save` inside `class User` lives in helper's own Function scope whose parent is save's Function scope (NOT the Class scope). populateClassOwnedMembers' `parentScope.kind === 'Class'` branch correctly skips it; helper.ownerId stays undefined. Instead of implementing speculative scope-aware refactors that the tests would pass regardless, this commit: - Adds regression fixtures and integration assertions that pin each working behavior. If finalize routing ever changes to honor the hook's per-scope contract, these assertions flip red and signal the need for the scope-chain-aware refactor. - Adds defensive JSDoc to the three flagged call sites (collectNamespaceTargets, propagateImportedReturnTypes, populateClassOwnedMembers) documenting the empirical invariant so future reviewers don't re-derive Codex's theoretical concern without the benefit of the probe. Files: - Two new fixtures under test/fixtures/lang-resolution/ covering the function-local and class-body namespace-import patterns. - Two new describe blocks in test/integration/resolvers/python.test.ts (3 assertions, positive-pin intent). - Defensive comments in namespace-targets.ts, imported-return-types.ts, and scope-resolution/scope/walkers.ts. Verification: 204/204 test/integration/resolvers/python.test.ts both REGISTRY_PRIMARY_PYTHON=0 and =1. tsc 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 | ||