Skip to content

fix(extract): scope member-call resolvers to the sources they own (#10) - #28

Merged
filipechagas merged 2 commits into
v8from
fix/member-call-lang-scoping-10
Aug 5, 2026
Merged

fix(extract): scope member-call resolvers to the sources they own (#10)#28
filipechagas merged 2 commits into
v8from
fix/member-call-lang-scoping-10

Conversation

@filipechagas

Copy link
Copy Markdown
Collaborator

Fixes #10 (sibling of #8; found in independent review of the Graphify-Labs#1682 feature branch).

What

The Swift, Python, and TypeScript member-call resolvers claimed every untagged raw call — including each other's — so a TypeScript receiver could mint an edge into a Python method at EXTRACTED (the issue's measured repro). The negative if rc.get("lang"): continue skips could not close this by construction, and their comments asserted a protection that did not hold.

Follow-up filed

#24 — Swift, Python, TypeScript, and C++ receiver-type indexes are still unscoped (outside this ticket's AC); C++ needs the .h both-sets treatment.

Test evidence

🤖 Generated with Claude Code

filipechagas and others added 2 commits August 5, 2026 20:04
The Swift, Python and TypeScript member-call resolvers skipped raw calls
carrying a `lang` tag, and each site claimed that guard kept another
language's data out. It did not: `lang` is stamped only on the cpp, csharp,
java, objc and php raw calls, and those three resolvers are themselves
untagged — so they consumed each other's raw calls. A TypeScript
`Lead.search({})` reached the Python resolver's capitalized-receiver class
arm and minted an EXTRACTED edge into a Python method with no TypeScript
`Lead` anywhere in the corpus. A negative tag check cannot close that by
construction.

Replace it with a positive source-file suffix filter (prior art:
`ruby_resolution._ruby_raw_calls`) and correct the comments at all three
sites. The tagged languages keep matching on `lang`, because C++ and ObjC
share `.h` and a suffix alone cannot tell their raw calls apart.

Also language-scope the Java and C# `type_def_nids` indexes, the last
unfixed copies of the shape #8 fixed for PHP/ObjC: an unscoped index let a
Python `class Lead` type the receiver of a Java `Lead lead; lead.search()`
at INFERRED, and let a foreign class merely sharing the name push the
single-definition guard to 2 and suppress the correct same-language edge.
The suffix tuples now feed both the resolver registration and the scoping,
so the two cannot drift.

Pre-existing defects, not regressions from the Graphify-Labs#1682 work.

Tests: 8 new mixed-corpus cases through the `extract()` seam, each built so
only one resolver can be the miner — the resolver that owns the raw call
refuses it on its own terms, so any surviving edge is a foreign resolver
reaching across. 7 of the 8 were red before this change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Brings in the #9 (union/intersection + DNF receiver types) and #15
(first-class callables as `indirect_call`) fixes.

CHANGELOG.md was the only conflict: both sides edited the "Known open
items" bullet, each deleting the clause its own work fixed. Between them
every clause is now gone — #9 and #15 on v8's side, #10 on this branch's —
so the bullet is deleted outright rather than resolved. All three of v8's
new bullets and this branch's #10 bullet are kept.

graphify/extract.py auto-merged: v8's changes are confined to
`_resolve_php_member_calls`, which this branch does not touch. Verified
both sides landed byte-for-byte and that v8's engine.py receiver-table and
first-class-callable work is gated on `tree_sitter_php`, so it cannot reach
the Swift/Python/TypeScript raw-call filters or the Java/C# type indexes.

Full suite: 4049 passed, 36 skipped (4041 on v8 + 8 from this branch).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Member-call resolvers consume each other's raw calls: untagged languages leak (TS receiver mints a Python edge)

1 participant