Skip to content

fix(typescript): resolve imported calls through scoped const aliases - #5614

Open
rvitaliy wants to merge 1 commit into
Graphify-Labs:v8from
rvitaliy:fix/typescript-scoped-callable-aliases
Open

rvitaliy wants to merge 1 commit into
Graphify-Labs:v8from
rvitaliy:fix/typescript-scoped-callable-aliases

Conversation

@rvitaliy

Copy link
Copy Markdown
Contributor

What does this PR do?

Resolve an imported callable reached by a local const alias inside an indexed TypeScript callable. The existing import and export facts must identify a single target. The edge keeps the lexical caller and the actual call line, including a call inside an anonymous callback.

Closes #5613. Follow-up to #5594.

Type of change

  • Bug fix

Verification & Invariants

  • An alias from an indexed body cannot bind calls in a sibling scope. Shadowed, mutable, type-only, cyclic and ambiguous cases stay unresolved.
  • Full extraction and caller-only incremental extraction agree. A target-only change can require a forced rebuild under the existing JS/TS invalidation rules, which also apply to direct imported calls.
  • A real email persistence caller now links to the exported persistence function at its original call site.

How was this tested?

  • The scoped-alias regression fails on v8 with both full and incremental contexts. The focused extractor and architecture suites passed on Python 3.14 (223 tests), and the factory and typed receiver suites passed on Python 3.11 (41 tests).
  • Full Python 3.14 suite split across xdist (12,093 passed), the two worker-sensitive files without xdist (93 passed), and the serial group (282 passed).
  • ruff check ., git diff --check, and graphify update . passed. Pyright adds no diagnostics relative to v8.

Graphify-specific checklist

  • Verified lexical ownership and exact export resolution.
  • Reviewed the diff for credentials and generated graph files.
  • Disclosed AI assistance in the commit trailer.

@rvitaliy
rvitaliy requested a review from safishamsi as a code owner November 28, 2026 23:32
@github-actions

Copy link
Copy Markdown

Thanks for the pull request, @rvitaliy. A maintainer will review it soon.

Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions.

A couple of things that speed up review: make sure the test suite passes on Python 3.11 and 3.13, and that the change keeps extraction deterministic.

@github-actions github-actions Bot added the contributor Pull request from a returning community contributor label Nov 28, 2026

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify review View in Graphify

Nothing blocking · 5 possible issues to check · Merge confidence 5/5

5 possible issues to check · High impact

The change tracks imported-function aliases inside TypeScript callable bodies and resolves their calls through exported symbols.

5 possible issues we couldn't confirm

They don't change the score.

What this review covered
  • We didn't review 1 file that isn't source code, such as docs, config, images, or generated or third-party code.
  • 5 of 5 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 6385 functions depend on this change
  • 4 functions became more coupled. Largest: extract() (1428 callers), _collect_js_symbol_resolution_facts() (5 callers), _js_receiver_binding_scope() (5 callers).
  • 658 of 658 test files are affected by this change.
  • Gate, test list and every flagged function: in the Graphify check.

Reviewed 178fa02

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor Pull request from a returning community contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Calls through a local const alias disappear inside indexed TypeScript callables

1 participant