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: _php_non_class_types receiver refusal is now redundant conservatism — recoverable member-call fan-in left unrealized #53
Surfaced during #47 (fork PR #51). Now that interfaces/traits/enums mint canonical declaration nodes, the _php_pre_scan_non_class_declarations marker (graphify/extractors/engine.py) still makes the member-call resolver REFUSE to bind a receiver typed with an interface/trait/enum name.
Measured during #47's review (probe, not speculation): App\Contracts\Notifier interface + private Notifier $n receiver + $this->n->send() → no calls edge on base AND on the fixed branch; the marker is still stamped. Not a regression — base had no node at all — but it is recoverable fan-in left on the table.
The original collision the pre-scan guarded against (App\Contracts\Notifier vs App\Support\Notifier) now presents two definitions and would be refused by the single-definition guard on its own.
Why it needs care: lifting it is a behavior change colliding with the #11/#12 test contracts, and upstream has no such pre-scan at all (see the port notes on fork PR #51 / upstream PR 2536) — so fork and upstream would diverge on PHP graph content until reconciled.
Triage decision (2026-08-07): accepted for the current fix cycle — lift the refusal, fork-first
Scope call: remove the _php_non_class_types receiver refusal (graphify/extract.py:3485-3489) and let interface/enum-typed receivers resolve through the normal path. Rationale, verified on current v8 @ 18c17d8:
The collision the pre-scan guarded (App\Contracts\Notifier vs App\Support\Notifier) now presents 2 definitions and is refused by the existing single-definition guard (len(type_defs) != 1, extract.py:3501) on its own.
Lift consumption only (the refusal continue). Keep the _php_non_class_types / _php_interfaces persisted-marker channel (pre-scan, stamping, context replay) intact this cycle — old graphs still replay, watch/update paths untouched. Channel removal, if ever, is a follow-up.
Fixture: interface Notifier with send() in one file, class with private Notifier $n + $this->n->send() in another → a calls edge onto the interface's send() declaration node (currently refused — red first).
Same for an enum with a method; enum-typed receiver binds to the enum's method node.
Collision fixture (two same-short-named types) → still no edge (single-definition guard).
Fixed on the cycle branch fix/resolution-gaps-52-53-54 (final slice commit 3338523, integrated as 26f7b03), shipping in 0.9.39 via the cycle PR into v8.
Scope landed (as triaged: lift, fork-first — plus one review-mandated extension): the _php_non_class_types receiver refusal is removed; interface/enum-typed receivers resolve through PhpNameResolver → single-definition guard → method_index. The marker channel (pre-scan, stamping, context replay) is kept intact but no longer drives resolution. The adversarial review found the refusal had been masking a real hole: _php_pre_scan_class_namespaces recorded FQNs for class_declaration only, so on incremental rebuilds a vendor use Illuminate\Contracts\...\Notifier import wrongly bound to a same-short-named in-corpus interface (full build refused — parity break, measured with the repo's own _full_then_incremental harness). Fixed by extending the pre-scan to all four declaration kinds through the existing php_class_fqns channel; mutation-tested (reverting only that line makes exactly the regression tests fail on the incremental assertion). Bonus from the same fix: a use-claimed in-corpus interface with a colliding class short name now resolves decisively to the interface (23 tests flipped red-first to the correct-edge expectation; every one still asserts the same-short-named stranger gets nothing).
Measured on the rebuilt 46,636-node api graph: +2,398 calls edges net of the #52 family, ~2,071 of them onto methods — spot-verified in source as genuine interface-typed receiver bindings (e.g. interface DisputeCompletionRepository::creditDisputeCompletion, interface ScheduleRepository::getOngoingSchedulesForProperty), the rest EXTRACTED type-corroborated static/new binds enabled by the FQN/namespace extension. Zero stranger-bindings found in sampling; zero INFERRED gains to non-method targets.
Verification trail: 2 review rounds (round 1 raised the major above), final verdict APPROVE; collateral check ran the amended source against the base test suite — every failure confined to the slice's own updated test files, so no class-resolution behavior shifted anywhere else the suite reaches. Full suite green: 4411 passed / 3 skipped on the integration branch. Follow-up #55 filed for a pre-existing short-name-conflict drop in the pre-scan whose trigger set this widened.
Fork/upstream note: upstream has no such pre-scan; divergence recorded for the next port cycle rather than ported now. Requires re-extraction (version-namespaced AST cache); the 0.9.39 bump rolls the namespace.
Activity
filipechagas commentedon Aug 7, 2026
Triage decision (2026-08-07): accepted for the current fix cycle — lift the refusal, fork-first
Scope call: remove the
_php_non_class_typesreceiver refusal (graphify/extract.py:3485-3489) and let interface/enum-typed receivers resolve through the normal path. Rationale, verified on current v8 @ 18c17d8:interface/trait/enumdeclarations mint canonical, sourced definition nodes, and their methods attach to those nodes (tests/test_php_declaration_nodes.py, "interface method should attach to the interface node").App\Contracts\NotifiervsApp\Support\Notifier) now presents 2 definitions and is refused by the existing single-definition guard (len(type_defs) != 1, extract.py:3501) on its own.Slice boundaries:
continue). Keep the_php_non_class_types/_php_interfacespersisted-marker channel (pre-scan, stamping, context replay) intact this cycle — old graphs still replay,watch/updatepaths untouched. Channel removal, if ever, is a follow-up.callsedge onto the declaration node's method; colliding short name → still refused (now by the single-definition guard).Acceptance criteria (red-first):
interface Notifierwithsend()in one file, class withprivate Notifier $n+$this->n->send()in another → acallsedge onto the interface'ssend()declaration node (currently refused — red first).enumwith a method; enum-typed receiver binds to the enum's method node.uv run --frozen pytest tests/ -q --tb=short.filipechagas commentedon Aug 7, 2026
Fixed on the cycle branch
fix/resolution-gaps-52-53-54(final slice commit3338523, integrated as26f7b03), shipping in 0.9.39 via the cycle PR into v8.Scope landed (as triaged: lift, fork-first — plus one review-mandated extension): the
_php_non_class_typesreceiver refusal is removed; interface/enum-typed receivers resolve throughPhpNameResolver→ single-definition guard →method_index. The marker channel (pre-scan, stamping, context replay) is kept intact but no longer drives resolution. The adversarial review found the refusal had been masking a real hole:_php_pre_scan_class_namespacesrecorded FQNs forclass_declarationonly, so on incremental rebuilds a vendoruse Illuminate\Contracts\...\Notifierimport wrongly bound to a same-short-named in-corpus interface (full build refused — parity break, measured with the repo's own_full_then_incrementalharness). Fixed by extending the pre-scan to all four declaration kinds through the existingphp_class_fqnschannel; mutation-tested (reverting only that line makes exactly the regression tests fail on the incremental assertion). Bonus from the same fix: ause-claimed in-corpus interface with a colliding class short name now resolves decisively to the interface (23 tests flipped red-first to the correct-edge expectation; every one still asserts the same-short-named stranger gets nothing).Measured on the rebuilt 46,636-node api graph: +2,398
callsedges net of the #52 family, ~2,071 of them onto methods — spot-verified in source as genuine interface-typed receiver bindings (e.g.interface DisputeCompletionRepository::creditDisputeCompletion,interface ScheduleRepository::getOngoingSchedulesForProperty), the rest EXTRACTED type-corroborated static/newbinds enabled by the FQN/namespace extension. Zero stranger-bindings found in sampling; zero INFERRED gains to non-method targets.Verification trail: 2 review rounds (round 1 raised the major above), final verdict APPROVE; collateral check ran the amended source against the base test suite — every failure confined to the slice's own updated test files, so no class-resolution behavior shifted anywhere else the suite reaches. Full suite green: 4411 passed / 3 skipped on the integration branch. Follow-up #55 filed for a pre-existing short-name-conflict drop in the pre-scan whose trigger set this widened.
Fork/upstream note: upstream has no such pre-scan; divergence recorded for the next port cycle rather than ported now. Requires re-extraction (version-namespaced AST cache); the 0.9.39 bump rolls the namespace.
Merge pull request #57 from lawnstarter/fix/resolution-gaps-52-53-54
chore: consolidate CHANGELOG under 0.9.40 for the single upstream PR (G…