Repository navigation
Conversation
Retain the optional access at the exact receiver hop so route callbacks can resolve a unique method through imported dependencies. Check both direct and nested access and reject paths with an unguarded optional hop. Bump the AST cache schema to re-extract older caller facts. Refs Graphify-Labs#5654. 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 
No issues reported · High impact
The TypeScript extractor now follows typed property paths through optional-chain and non-null guards.
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.
- Part of a file with a line too long to show was not read.
- A changed file's diff was too long to show in full, so the review may not have seen every changed line in it; the in-depth pass still reviewed every changed file.
- 4 of 4 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 6555 functions depend on this change
- 665 of 665 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed a4ac850
This branch has not been deployed
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.
What does this PR do?
Fixes #5654. A route factory can capture a parameter typed as
Pick<Dependencies, 'service' | 'config'>and call eitherdeps.service?.get()ordeps.config?.store.get(). Graphify already knows how to follow the declared dependency types across files. The TypeScript extractor dropped that evidence when it encountered optional member access, so neither method showed the route as a caller.Record each
?.on the receiver immediately to its left while reading the property path. The existing resolver can then infer the exact declared method using the same evidence it uses for a non-null assertion. This represents a possible call when the receiver exists. A guard for one hop cannot satisfy a different optional hop. For example,deps.service.get?.()guards the method invocation and leaves an optionalserviceunguarded.Verification & invariants
d249de367). All three new regression cases fail on that commit.get. It asserts the exact caller, declaration file, owner, member, call-site line andINFERREDconfidence for full extraction and a caller-only incremental extraction.graphify extract . --code-only --no-cluster --forceonce. Verified that a subsequent caller-only edit preserves both targets and updates the source lines.How was this tested?
INFERREDedge to its declared method, including two identically named methods on different stores.python -m pytest -q tests/test_ts_typed_property_receivers.py tests/test_ts_receiver_member_calls.pypassed on Python 3.11 and 3.13 (77 tests each). The typed-property regression file also passed on Python 3.14.uv run --locked --all-extras ruff check .,git diff --checkanduv run --locked --all-extras graphify update .passed.uv run --locked --all-extras pyright --outputjsonreported the same 767 diagnostics on base and head, compared by file, severity and message.pytest tests -q --tb=short -n 6 --dist worksteal -m 'not serial', excluding the worker-size and three language-override modules from that invocation and running their non-serial cases in one process. Ranpytest tests -q --tb=short -m serialfor the serial set.