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: clearly-wrong calls edges in the repro neighborhood (.parent() --calls--> .setUp(); .handle() --calls--> test methods) — failure mode #3 evidence #39
Measured 2026-08-06 on the api.lawnstarter.com repro graph @ d2d4bed7ae (48,529 nodes), probing call-context edges around ChargeCustomerService:
app_servicecategory_servicecategory_parent (.parent()) --calls-->.setUp() of bothChargeCustomerServiceTest variants and of BalanceCustomerAccountServiceTest — a model accessor does not call test fixtures.
app_services_billing_chargecustomerservice_chargecustomerservice_handle (.handle()) --calls--> several ChargeCustomerServiceTesttest methods (e.g. .test_integration_execute_payment_failure_charge_successfully_charges_the_customer()) — production code does not call tests; the direction/target is wrong.
Repro: load the graph and list edges with context == "call" whose endpoint ids contain chargecustomerservice / balancecustomeraccountservice (probe script preserved in #37's step-through notes).
Why it matters
These edges feed the "all test noise" impression in #37's phrasing-A output and inflate every call-filtered traversal near billing. This is the PE-78803 spike's failure mode #3 (node-identity / wrong-edge territory) — kept deliberately separate from #37's seeding fix per its scope decision.
Next step
Diagnose the minting path (bare-name legacy resolution vs. member-call resolver vs. stub shadowing) before proposing a fix; this issue exists to carry the measured evidence and keep #37 unconflated.
Diagnosed during the #46 triage sweep, probing the raw pinned graph (/tmp/api-d2d4bed/graphify-out/graph.json, 46,406 nodes / 139,497 links — the 48,529 figure in the body was the loaded graph, i.e. raw + the 2,123 dangling endpoints serve materializes, per #46). Fork code referenced @ a9adfc6.
Correction: the evidence edges were direction-flipped by the probe
The step-through drivers used a CLI-faithful undirected load, so both evidence items printed in arbitrary orientation. In the raw graph:
.handle() --calls--> test methods is actually test method --calls--> .handle() — correct edges (tests do call handle()). Not a bug.
.parent() --calls--> .setUp() is actually *Test.setUp() --calls--> ServiceCategory.parent() — genuinely wrong, and far bigger than the anecdote: app_servicecategory_servicecategory_parent has 1,698 inbound calls edges, one for every parent::__construct() / parent::setUp() / parent::boot() in the corpus.
Same mechanism, second family found during the probe: GetProviderBillingEventsTest.event() (a unit-test helper) has 848 inbound calls edges — every Laravel event(...) global-helper call in production code (e.g. ChargeCustomerService.php:76).
Minting path (root-caused)
The scoped_call_expression handler takes the scope text as the callee name (graphify/extractors/engine.py:4807-4811): parent::setUp() → callee parent. It never checks the scope against _PHP_NON_CONCRETE_TYPE_NAMES (engine.py:714 — which already contains parent/self/static), even though the (new X())->m() branch at engine.py:4858 applies exactly that refusal.
Unresolved in-file, the raw call reaches the shared cross-file pass (graphify/extract.py:6092), which matches by normalized label — strip("()").lstrip("."), case-folded for PHP (extract.py:6006-6014). parent has effectively one callable candidate corpus-wide (ServiceCategory::parent(), label .parent()) → 1,698 confident wrong edges. event has 4 candidates (3 Event classes + the test's .event() method); the tie-break picked the test method → 848 wrong edges.
Not #46 territory: every endpoint here is a real sourced node — no sourceless stubs involved. Independent bug, none of #47–#49 touches it.
Scope for ready-for-agent
Fix the relative-scope family: in the scoped_call_expression branch, refuse parent/self/static (and the rest of _PHP_NON_CONCRETE_TYPE_NAMES) as callee names, matching the engine.py:4858 precedent. (self::/static:: calls that should resolve within the declaring class would need inheritance context the raw-call facts don't carry — refusal over guessing, same discipline as #4/#38.)
Acceptance:
Red-first: fixture with class A { function setUp() { parent::setUp(); } } + unrelated class B { function parent() {} } currently mints A.setUp --calls--> B.parent; after the fix, no such edge
api-scale: inbound calls on ServiceCategory::parent() drops from 1,698 to genuine callers only
Deliberately out of scope (needs a maintainer policy call before spec): whether a PHP function_call_expression (global helper like event()) may ever bare-match a method node cross-file — the 848-edge family. That policy interacts with legitimate global-function resolution; propose separately once the relative-scope fix lands.
Fixed on the fork feature branch fix/stub-shadowing-46 (commit 075038e, cherry-picked from fix/39-relative-scope-refusal), headed for the single PR into v8.
What landed: the scoped_call_expression branch (graphify/extractors/engine.py) now refuses any scope whose written text is in _PHP_NON_CONCRETE_TYPE_NAMES (parent/self/static and the rest of the set) as a callee name, matching the (new X())->m() refusal precedent. No resolution attempt for self::/static:: — refusal over guessing.
Acceptance criteria:
Red-first fixture (A.setUp() calling parent::setUp() + unrelated B.parent()): base minted A.setUp --calls--> B.parent (INFERRED/0.8); after the fix, no such edge. Same shape covered for self:: and static:: (tests/test_php_relative_scope_calls.py, verified red on base by an independent review session).
Legit scoped calls unaffected: Helper::format() and \App\Helper::format() still resolve (positive controls green on base and slice).
Out of scope, untouched as agreed: the event() global-helper family (848 edges) — function_call_expression and the cross-file matching in extract.py are unmodified; still pending a maintainer policy call.
Adversarial review verdict: APPROVE (full trace of the refusal path, empirical probe of base vs slice, base-red verification of the new tests, full suite green: 4288 passed / 3 skipped on the integrated branch).
Activity
filipechagas commentedon Aug 7, 2026
Triage + diagnosis (2026-08-07)
Diagnosed during the #46 triage sweep, probing the raw pinned graph (
/tmp/api-d2d4bed/graphify-out/graph.json, 46,406 nodes / 139,497 links — the 48,529 figure in the body was the loaded graph, i.e. raw + the 2,123 dangling endpoints serve materializes, per #46). Fork code referenced @a9adfc6.Correction: the evidence edges were direction-flipped by the probe
The step-through drivers used a CLI-faithful undirected load, so both evidence items printed in arbitrary orientation. In the raw graph:
.handle() --calls--> test methodsis actuallytest method --calls--> .handle()— correct edges (tests do callhandle()). Not a bug..parent() --calls--> .setUp()is actually*Test.setUp() --calls--> ServiceCategory.parent()— genuinely wrong, and far bigger than the anecdote:app_servicecategory_servicecategory_parenthas 1,698 inboundcallsedges, one for everyparent::__construct()/parent::setUp()/parent::boot()in the corpus.GetProviderBillingEventsTest.event()(a unit-test helper) has 848 inboundcallsedges — every Laravelevent(...)global-helper call in production code (e.g.ChargeCustomerService.php:76).Minting path (root-caused)
scoped_call_expressionhandler takes the scope text as the callee name (graphify/extractors/engine.py:4807-4811):parent::setUp()→ calleeparent. It never checks the scope against_PHP_NON_CONCRETE_TYPE_NAMES(engine.py:714— which already containsparent/self/static), even though the(new X())->m()branch atengine.py:4858applies exactly that refusal.graphify/extract.py:6092), which matches by normalized label —strip("()").lstrip("."), case-folded for PHP (extract.py:6006-6014).parenthas effectively one callable candidate corpus-wide (ServiceCategory::parent(), label.parent()) → 1,698 confident wrong edges.eventhas 4 candidates (3Eventclasses + the test's.event()method); the tie-break picked the test method → 848 wrong edges.Not #46 territory: every endpoint here is a real sourced node — no sourceless stubs involved. Independent bug, none of #47–#49 touches it.
Scope for
ready-for-agentFix the relative-scope family: in the
scoped_call_expressionbranch, refuseparent/self/static(and the rest of_PHP_NON_CONCRETE_TYPE_NAMES) as callee names, matching theengine.py:4858precedent. (self::/static::calls that should resolve within the declaring class would need inheritance context the raw-call facts don't carry — refusal over guessing, same discipline as #4/#38.)Acceptance:
class A { function setUp() { parent::setUp(); } }+ unrelatedclass B { function parent() {} }currently mintsA.setUp --calls--> B.parent; after the fix, no such edgecallsonServiceCategory::parent()drops from 1,698 to genuine callers onlyHelper::format()→ calleeHelper) unaffectedDeliberately out of scope (needs a maintainer policy call before spec): whether a PHP
function_call_expression(global helper likeevent()) may ever bare-match a method node cross-file — the 848-edge family. That policy interacts with legitimate global-function resolution; propose separately once the relative-scope fix lands.filipechagas commentedon Aug 7, 2026
Fixed on the fork feature branch
fix/stub-shadowing-46(commit 075038e, cherry-picked fromfix/39-relative-scope-refusal), headed for the single PR into v8.What landed: the
scoped_call_expressionbranch (graphify/extractors/engine.py) now refuses any scope whose written text is in_PHP_NON_CONCRETE_TYPE_NAMES(parent/self/staticand the rest of the set) as a callee name, matching the(new X())->m()refusal precedent. No resolution attempt forself::/static::— refusal over guessing.Acceptance criteria:
A.setUp()callingparent::setUp()+ unrelatedB.parent()): base mintedA.setUp --calls--> B.parent(INFERRED/0.8); after the fix, no such edge. Same shape covered forself::andstatic::(tests/test_php_relative_scope_calls.py, verified red on base by an independent review session).Helper::format()and\App\Helper::format()still resolve (positive controls green on base and slice).callsonServiceCategory::parent()drops from 1,698 to genuine callers) — deferred to Stub-shadow fix 4/4: release + acceptance grading on the pinned api corpus #50's grading rebuild, as specced.Out of scope, untouched as agreed: the
event()global-helper family (848 edges) —function_call_expressionand the cross-file matching inextract.pyare unmodified; still pending a maintainer policy call.Adversarial review verdict: APPROVE (full trace of the refusal path, empirical probe of base vs slice, base-red verification of the new tests, full suite green: 4288 passed / 3 skipped on the integrated branch).