GitNexus/gitnexus/src/core
Gergo Magyar 38df89d03e feat(python-scope): propagate return-type bindings across imports
Closes the cross-file return-type propagation gap that left tests
like `u = get_user(); u.save()` (where get_user lives in another
file) with `u` typed as the function name instead of its return type.

The shared finalize pass copies callable bindings (`from x import f`
puts `f` in the importer's bindings) but typeBindings stay file-local
because they live on `Scope.typeBindings`, not on the index. Mutate
post-finalize:

- For each module-scope import binding (`origin: 'import'` or
  `'reexport'`), look up the source file's module-scope typeBinding
  for the def's simple name. If present (return-annotation source),
  mirror it under the importer's local alias. Skip when the importer
  already has its own typeBinding for the name (explicit local always
  wins).
- After propagation, re-run a chain-follow on every scope's
  typeBindings — pass-4 ran before propagation and missed any chain
  whose terminal lived in a foreign file. Same algorithm as
  `followChainedRef` in scope-extractor, but operates on the
  finalized scopes so propagated entries are visible.

Mutating `Scope.typeBindings` is safe — `draftToScope` constructs a
plain `new Map(...)`, not a frozen one.

Verification:
- Flag-off: 191/191 (identical baseline).
- Flag-on: 16 fail / 175 pass (was 20/171; +4 — both cross-file
  return-type tests, plus two related propagation cases).
- tsc --noEmit clean.
2026-04-20 09:59:27 +01:00
..
augmentation feat(group): add group infrastructure and contract matching 2026-04-02 00:39:43 +03:00
embeddings feat(embeddings): AST-aware chunking with offset-based splitting (#889) 2026-04-16 22:55:04 +01:00
graph feat: configure prettier with pre-commit hook (#563) 2026-03-28 14:58:04 +00:00
group feat(extractors): detect jQuery $.ajax/$.get/$.post and axios object-form as HTTP consumers (#887) 2026-04-16 18:36:24 +01:00
ingestion feat(python-scope): propagate return-type bindings across imports 2026-04-20 09:59:27 +01:00
lbug feat(embeddings): AST-aware chunking with offset-based splitting (#889) 2026-04-16 22:55:04 +01:00
search feat(search): per-phase timing instrumentation for the query pipeline (#953) 2026-04-18 16:30:07 +01:00
tree-sitter feat(embeddings): AST-aware chunking with offset-based splitting (#889) 2026-04-16 22:55:04 +01:00
wiki Merge pull request #626 from ivkond/feat/intra-repo-service-tracking-clean 2026-04-03 17:04:24 +05:30
git-staleness.ts feat(group): add group infrastructure and contract matching 2026-04-02 00:39:43 +03:00
run-analyze.ts feat(embeddings): AST-aware chunking with offset-based splitting (#889) 2026-04-16 22:55:04 +01:00