Repository navigation
Conversation
Give named local and returned callable bodies distinct owners. Carry their original call sites through the symbol resolver and keep local bindings out of module-level candidate lookup. Refs Graphify-Labs#5593 Co-Authored-By: Codex <[email protected]>
|
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. |
There was a problem hiding this comment.
Graphify review 
6 possible issues to check · High impact
The extractor now represents factory-local functions and methods returned from TypeScript factories, and tracks calls within their owning scopes.
6 possible issues we couldn't confirm
- Whole extraction run crashes when a TypeScript file reports callable bodies without local call offsets ·
graphify/extract.py:13062 - Locally scoped TypeScript callables are excluded from name-based call matching, and the comment above the check does not mention them ·
graphify/extract.py:13852 - Ownership check collects members into a set, so duplicate
containsormethodedges to the same member pass unnoticed ·tests/test_ts_factory_call_ownership.py:43 - +3 more in Graphify
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.
- 4 of 4 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 6314 functions depend on this change
- 2 functions became more coupled.
extract()(1420 callers),_extract_generic()(23 callers). - 653 of 653 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed e983a30
Member
|
Shipped in v0.9.123, landed via authorship-preserving cherry-pick so your commits keep your name. Thanks @rvitaliy! |
This was referenced Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Give directly declared TypeScript function-valued
constbindings their own callable nodes. Capture named function properties and method declarations in a directly returned object, including concise arrow factories.Attribute each call to the body that makes it. Match local callees by lexical scope and use the same caller for imported aliases. An arrow in the returned object still captures the factory's receiver.
The scope is inline member definitions with identifier keys and direct local
constdeclarations. Resolving returned aliases or dispatch through a factory's result is separate.The reproduction in #2143 points at the same caller attribution problem. In a real TypeScript application factory, this recovers seven methods and two local callables, including the call chain from a staff read through two local helpers.
Closes #5593. Related to #2143 and #4767.
Verification
uv run --locked pytest -q tests/test_ts_*.py tests/test_js_*.py tests/test_owned_type_sources.py tests/test_resolution_one_parse_per_file.pypassed all 420 tests. The four new cases fail on the base commit.uv run --locked pytest tests/ -q --tb=short -n 6 -m 'not serial'passed 12,054 tests. One worker-pool test failed under macOS xdist with an initialized spawn context. The failure reproduced with the same context on the base commit, and the test passed when run alone.uv run --locked pytest tests/ -q --tb=short -m serialpassed 282 tests.uv run --locked ruff check .anduv run --locked graphify update .passed.uv run --locked pyrightreported the same 785 errors as the base commit.