You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PHP: global function calls (event()-family) bare-matching method nodes cross-file — needs a resolution policy #52
Deferred out of #39 by explicit scope decision; the relative-scope half landed there (fork PR #51), this is the remaining family.
Measured (pinned api graph @ d2d4bed7ae, diagnosis in #39's 2026-08-07 triage comment): every Laravel event(...) global-helper call in production code — 848 edges — bound to GetProviderBillingEventsTest.event(), a unit-test helper method, because the unresolved raw call reaches the shared cross-file pass (graphify/extract.py label match) where the tie-break picked the method over the 3 Event classes.
Policy question for a maintainer: may a PHP function_call_expression (global helper) ever bare-match a method node cross-file? Refusing method candidates for function-call sites would kill this family, but interacts with legitimate global-function resolution — that interaction is why #39 refused to fold it in.
Post-0.9.38 note: the #46 fixes did not touch this path; re-measure on a current graph before speccing.
Triage decision (2026-08-07): accepted for the current fix cycle
Policy (maintainer call): a PHP function_call_expression (global helper call) never binds to a method node cross-file. In PHP, a bare name(...) can only invoke a global/namespaced function — a method requires $obj->, Class::, or callable syntax — so refusing method candidates at function-call sites is language-semantically sound, not a heuristic. Legitimate global-function resolution is unaffected: real function definitions remain candidates.
Re-measured post-0.9.38 (graph built with v0.9.38 on the pinned api clone, cache/ast/v0.9.38/): unchanged — exactly 848 incoming calls edges on GetProviderBillingEventsTest.event(), 308 from non-test files, 368 distinct source files.
Mechanism (from code reading, current v8 @ 18c17d8): the shared cross-file pass (graphify/extract.py:6104+) skips is_member_call sites but lets PHP function-call sites through. The label index normalizes labels with raw.strip("()").lstrip(".") (extract.py:6019-6025), so the method labeled .event() keys as exact-case event — the sole exact-case candidate for callee event (the three Event classes key as Event and the case-insensitive fallback only fires when exact-case is empty). Single candidate → immediate bind, INFERRED 0.8.
Spec / acceptance criteria (red-first):
A PHP fixture with event(...) in one file and a class methodevent() in another file must produce nocalls edge between them (currently binds — red first).
A PHP fixture with event(...) and a global functionfunction event(...) in another file must still resolve (guard against killing legitimate global-function resolution).
The exclusion applies to method candidates in both the exact-case and case-insensitive index paths, for PHP function-call sites only (other languages' behavior unchanged).
Full suite green: uv run --frozen pytest tests/ -q --tb=short.
Post-fix measurement on the pinned api graph: 0 calls edges into GetProviderBillingEventsTest.event() from event(...) call sites.
Fixed on the cycle branch fix/resolution-gaps-52-53-54 (final slice commit a7fb03c, integrated as 9069df5), shipping in 0.9.39 via the cycle PR into v8.
Policy landed (as triaged, then widened during review): a PHP function_call_expression site never binds to a method node cross-file — and, extended during the cycle by the same language-semantic argument, never to a class-like node (class/interface/enum/trait) either. Only plausible function targets survive, on both the exact-case index path and the case-insensitive folded retry.
Measured on the rebuilt 46,636-node api graph (cold-then-warm cache, integrated code):
GetProviderBillingEventsTest.event() incoming calls edges: 848 → 2, and 0 cross-file (the 2 residuals are same-file in-file-pass binds, documented out of scope).
The same fix killed the rest of the family nobody had counted: config() −290, dispatch() −186, request() → class Request −15, plus sleep/view/mock — all 1,341 lost edges attributable to this family, zero collateral losses.
Regression caught by grading and fixed in rework 2: the CI-retry briefly created 7 report(...) → class Report INFERRED edges; final build has 0, and 0 INFERRED gains to any non-method target corpus-wide.
Verification trail: 12 red-first tests (each rework round verified red on the exact commit carrying the defect it fixes); 3 adversarial review rounds, final verdict APPROVE with mutation testing (weakening the refusal to amendment-1 behavior makes exactly the 4 class-refusal tests fail, including the positive function-reachability guarantee) and 16 collateral probes (non-PHP Widget() → class binds intact in Python/Ruby; scoped calls and FCC unaffected). Full suite green: 4411 passed / 3 skipped on the integration branch.
Requires re-extraction to take effect (raw_calls live in the version-namespaced AST cache); the 0.9.39 bump in this cycle's release commit rolls the namespace.
Activity
filipechagas commentedon Aug 7, 2026
Triage decision (2026-08-07): accepted for the current fix cycle
Policy (maintainer call): a PHP
function_call_expression(global helper call) never binds to a method node cross-file. In PHP, a barename(...)can only invoke a global/namespaced function — a method requires$obj->,Class::, or callable syntax — so refusing method candidates at function-call sites is language-semantically sound, not a heuristic. Legitimate global-function resolution is unaffected: real function definitions remain candidates.Re-measured post-0.9.38 (graph built with v0.9.38 on the pinned api clone,
cache/ast/v0.9.38/): unchanged — exactly 848 incomingcallsedges onGetProviderBillingEventsTest.event(), 308 from non-test files, 368 distinct source files.Mechanism (from code reading, current v8 @ 18c17d8): the shared cross-file pass (
graphify/extract.py:6104+) skipsis_member_callsites but lets PHP function-call sites through. The label index normalizes labels withraw.strip("()").lstrip(".")(extract.py:6019-6025), so the method labeled.event()keys as exact-caseevent— the sole exact-case candidate for calleeevent(the threeEventclasses key asEventand the case-insensitive fallback only fires when exact-case is empty). Single candidate → immediate bind, INFERRED 0.8.Spec / acceptance criteria (red-first):
event(...)in one file and a class methodevent()in another file must produce nocallsedge between them (currently binds — red first).event(...)and a global functionfunction event(...)in another file must still resolve (guard against killing legitimate global-function resolution).uv run --frozen pytest tests/ -q --tb=short.callsedges intoGetProviderBillingEventsTest.event()fromevent(...)call sites.filipechagas commentedon Aug 7, 2026
Fixed on the cycle branch
fix/resolution-gaps-52-53-54(final slice commita7fb03c, integrated as9069df5), shipping in 0.9.39 via the cycle PR into v8.Policy landed (as triaged, then widened during review): a PHP
function_call_expressionsite never binds to a method node cross-file — and, extended during the cycle by the same language-semantic argument, never to a class-like node (class/interface/enum/trait) either. Only plausible function targets survive, on both the exact-case index path and the case-insensitive folded retry.Measured on the rebuilt 46,636-node api graph (cold-then-warm cache, integrated code):
GetProviderBillingEventsTest.event()incomingcallsedges: 848 → 2, and 0 cross-file (the 2 residuals are same-file in-file-pass binds, documented out of scope).config()−290,dispatch()−186,request()→class Request−15, plussleep/view/mock— all 1,341 lost edges attributable to this family, zero collateral losses.report(...)→class ReportINFERRED edges; final build has 0, and 0 INFERRED gains to any non-method target corpus-wide.Verification trail: 12 red-first tests (each rework round verified red on the exact commit carrying the defect it fixes); 3 adversarial review rounds, final verdict APPROVE with mutation testing (weakening the refusal to amendment-1 behavior makes exactly the 4 class-refusal tests fail, including the positive function-reachability guarantee) and 16 collateral probes (non-PHP
Widget()→ class binds intact in Python/Ruby; scoped calls and FCC unaffected). Full suite green: 4411 passed / 3 skipped on the integration branch.Requires re-extraction to take effect (
raw_callslive in the version-namespaced AST cache); the 0.9.39 bump in this cycle's release commit rolls the namespace.Merge pull request #57 from lawnstarter/fix/resolution-gaps-52-53-54
Merge upstream/v8 (v0.9.37) into chore/sync-upstream-0937
Merge upstream/v8 (v0.9.40) into chore/sync-upstream-0940