Repository navigation
Conversation
Refs Graphify-Labs#5611 Co-Authored-By: Codex <codex@openai.com>
|
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 
1 bug · 9 possible issues to check · High impact
The change adds extraction and resolution support for calls through destructured TypeScript methods.
Destructured method calls are discarded because their declaration counts as a write ·
engine.py:4345
9 possible issues we couldn't confirm
- Destructured interface callbacks do not resolve to their methods ·
graphify/extractors/engine.py:4431 - Reassigning a typed receiver inside a nested block still resolves destructured calls to the old type ·
graphify/extractors/engine.py:4426 - Destructured-method calls can crash the whole extraction with a KeyError when the resolved type id is missing from node_by_id ·
graphify/extract.py:7199 - +6 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.
- A changed file's diff was too long to show in full, so the review may not have seen every changed line in it.
- Some findings could not be double-checked.
- +1 more notes in Graphify.
- 6 of 6 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 6855 functions depend on this change
- 6 functions became more coupled. Largest:
main()(137 callers),_extract_generic()(23 callers),_js_receiver_binding_scope()(4 callers). - 658 of 658 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed 9c18be7
| def _ts_destructuring_facts(root, source: bytes) -> tuple[set[str], dict[str, list[Node]]]: | ||
| """Index names that need a lexical lookup and potential writes to bindings.""" | ||
| names: set[str] = set() |
There was a problem hiding this comment.
Destructured method calls are discarded because their declaration counts as a write
A function that destructures a typed method into a const alias and calls it gets no call edge.
Exclude const destructuring declarations from write detection in _ts_destructuring_facts.
Evidence · checked against the code
- Independent source review: Checked the downstream local-call handling: the call offset is retained as a local call and skipped by the later symbol-use walk. No route-level guard that preserves the typed-method resolution was found. The other member-call resolution path requires the destructured-method marker, which this failed binding lookup does not set.
Prompt to fix with AI
In graphify/extractors/engine.py, _ts_destructuring_facts (lines 4343-4345):
Problem: Destructured method calls are discarded because their declaration counts as a write
Fix it at the cause, and add a test that fails without the fix.
Graphify · Checked against the code · View in Graphify
What does this PR do?
Resolve calls through a local immutable destructuring binding such as
const { retire: finish } = owner; finish(). The receiver is an explicitly typed, required TypeScript parameter. The existing typed receiver resolver links the original call site to the declared member withINFERREDconfidence.Closes #5611. Related to #5586 and #5530.
Type of change
Verification & Invariants
How was this tested?
v8and pass with the fix. The focused TypeScript, JS member and Astro suites passed on Python 3.14 (124 tests), and the typed receiver suite passed on Python 3.11 (21 tests).ruff check .,git diff --check, andgraphify update .passed. Pyright adds no diagnostics relative tov8.Graphify-specific checklist