Skip to content

fix(ts): extract callable properties typed via indexed access (#5599) - #5604

Closed
m3lonxd wants to merge 4 commits into
Graphify-Labs:v8from
m3lonxd:fix/ts-indexed-access-callable-property-5599
Closed

m3lonxd wants to merge 4 commits into
Graphify-Labs:v8from
m3lonxd:fix/ts-indexed-access-callable-property-5599

Conversation

@m3lonxd

@m3lonxd m3lonxd commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #5599.

What changed

  • Added same-file indexed-access (lookup_type) resolution in graphify/extractors/engine.py (_ts_unwrap_type, _ts_lookup_key_name, _ts_resolve_indexed_target, _ts_indexed_callable_property) so TypeScript property_signature members typed as Store['run'] (or chained Store['leaf']['exec'], double-quoted, or parenthesized) are recognized as callable when the referenced same-file interface or type alias member is a method_signature or callable property.
  • Wired _ts_indexed_callable_property into _js_member_nid collision salting, type_alias_declaration callable member extraction, and interface_body property_signature extraction (leaving non-lookup interface properties such as callback: () => number untouched and keeping graphify/cache.py unchanged).
  • Fails closed on shadowed generic type parameters, imported/unknown base types, unapplied generic declarations, missing members, non-callable property types, union/non-literal keys, and cyclic lookups (CycleA['f'] -> CycleB['g']).

Verification

  • Verified new tests in tests/test_ts_indexed_access_properties.py fail on origin/v8 (3 failed) and pass after the fix (40 passed across test_ts_indexed_access_properties.py, test_ts_object_alias_methods.py, test_ts_typed_property_receivers.py, test_cross_language_call_resolution.py).
  • pytest -q tests/test_extract.py -k "ts or typescript or interface or property": 386 passed, 1 xfailed.
  • ruff check, pyright tests/test_ts_indexed_access_properties.py (0 errors), and python -m tools.skillgen --check (134 artifacts match) passed cleanly.

@m3lonxd
m3lonxd requested a review from safishamsi as a code owner November 28, 2026 22:14
@github-actions

Copy link
Copy Markdown

Thanks for the pull request, @m3lonxd. 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 · 1 possible issue to check · Merge confidence 5/5

1 possible issue to check · High impact

The added tests create TypeScript fixtures and check extracted method and call edges, including cases that should not resolve.

1 possible issue we couldn't confirm

They don't change the score.

Code graph · 4837 functions depend on this change
  • 3 functions became more coupled. extract() (1431 callers), extract_js() (106 callers), walk() (1 callers).
  • 58 of 659 test files are affected by this change.
  • Gate, test list and every flagged function: in the Graphify check.

Reviewed e8d7625 · 1 of 1 earlier findings resolved · 2 earlier findings not re-checked

Comment thread graphify/extractors/engine.py Resolved
Comment thread graphify/extractors/engine.py Resolved
Comment thread graphify/extractors/engine.py Resolved
safishamsi added a commit that referenced this pull request Nov 30, 2026
Extractor accuracy (Swift #5641, Apex #5627, Python #5647, TypeScript
#5604/#5614/#5612, Bash caller-var #5602), GitHub Actions run-step
extraction (#5603), incremental correctness (#5634/#5638/#5636), symlink
and semantic-cache fixes (#5617/#5618), export/report hardening and perf
(#5643/#5644/#5645/#5646/#5619/#5620/#5621), and CLI/docs/skill/install
work (#5629/#5628/#5626/#5624/#5623/#5625/#5642/#5583). AST cache schema
59 to 60; Swift/Apex/Python/Bash/GHA inputs re-extract on first build.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@safishamsi

Copy link
Copy Markdown
Member

Landed in v0.9.124 (just released to PyPI), cherry-picked with your authorship preserved so it shows under your name in the history. Thanks @m3lonxd for extracting callable properties typed via indexed access — verified green in the full suite and, where applicable, smoke-tested against the published package. 🙏

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]: TypeScript calls to properties typed via indexed access are missing

2 participants