fix(extract): apply interop guard to type-match stub rewire (#2343) - #2365
fix(extract): apply interop guard to type-match stub rewire (#2343)#2365HaoChiBao wants to merge 1 commit into
Conversation
…-Labs#2343) The language-family gate from Graphify-Labs#1781 only ran on the unique-function fallback in _rewire_unique_stub_nodes, so Swift/Python Path stubs still bound to a lone JS class Path. Hoist the gate to every unique match and cover type/same-family/native-family cases in tests.
There was a problem hiding this comment.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR modifies the _rewire_unique_stub_nodes function in graphify/extract.py to apply the existing language-family interop gate to all unique-stub rewire matches (type exact, type case-insensitive, and function fallback), rather than only to the function fallback path. The intent, per referenced issue #2343, is to prevent a stub type reference in one language from binding to a same-named definition in an unrelated language family. The test file is updated to change an existing fixture from a cross-language (Python→C#) pair to a same-language (C#) pair, and adds three new tests covering cross-language type rewire blocking, same-family type rewiring, and native-family (Swift/ObjC) interop rewiring.
No blocking issues surfaced. 3 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 1366 functions depend on the 467 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
_rewire_unique_stub_nodes()— 9 callers, 6 callees
Verification — 1366 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 1239 function(s) in the blast radius were not formally verified this run
· 1 more finding(s) on lines outside this diff (see the check run).
Summary
_rewire_unique_stub_nodesso it applies to unique type matches (exact + case-insensitive), not only the function fallback.Pathstubs from binding to a lone JSclass Path, which was inventing phantom cross-language edges and inflating betweenness/god-nodes.Pathbinds to a JS class #2343. Legitimate same-family and native-family (Swift↔ObjC) rewires are unchanged.Test plan
three.js+Shape.swift+build.py): 0 cross-lang edges to JSPath; three distinctPathnodespytest tests/test_cross_language_call_resolution.py+ rewire/inheritance extract tests