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
Stub-shadow fix 3/4: find_node_ambiguity must not collapse sourceless rivals into one group (RC3 of #46) #49
find_node_ambiguity (graphify/serve.py:1382-1389) stops treating N sourceless stubs as one rival: it groups the winning tier by source_file, so all sourceless stubs share the "" bucket and N stubs count as one file — no ambiguity reported, and explain silently answers with matches[0] (graph-iteration order). Fix by not collapsing sourceless rivals into a single group, and/or excluding sourceless stubs from the exact tier when a sourced match exists.
explain and affected must agree: affected's resolve_seed (graphify/affected.py:99-143) refuses on a non-unique label match, which is the whole explain-vs-affected inconsistency in #46's symptom.
Acceptance criteria
Red-first: on a graph with a sourced node + N≥2 sourceless stubs in the exact-match tier (Q4 shape, e.g. BalanceitemRepository with 18 exact-tier stubs on the pinned corpus), explain currently returns an arbitrary stub silently; after the fix it either resolves to the sourced node or reports the ambiguity — never a silent arbitrary pick
Q2 shape (1 sourced + 1 sourceless in the tier) does not regress: still reports ambiguity or resolves to the sourced node
explain and affected give consistent outcomes for both shapes
None — serve-side only, independent of the extraction slices. Worth keeping even after #47/#48 land: it removes the silent-wrong-answer failure mode generally.
Fixed on the fork feature branch fix/stub-shadowing-46 (commit 313a168, cherry-picked from fix/49-ambiguity-guard), headed for the single PR into v8.
What landed (three coordinated changes):
_find_node_tiers (serve.py): when the exact tier holds both sourced and sourceless nodes, the sourceless ones are dropped — the sourced declaration wins.
find_node_ambiguity (serve.py): sourceless nodes are keyed per-node instead of sharing the "" source bucket, so N stubs count as N rivals — an all-sourceless tier now reports ambiguity instead of silently answering with matches[0].
affected.resolve_seed (affected.py): same sourced-preference applied to the exact-label and bare-name passes, so explain and affected agree.
Acceptance criteria:
Q4 shape (sourced + N≥2 sourceless exact-tier rivals): no silent arbitrary pick — resolves to the sourced node; parametrized at N = 2, 3, 18, plus order-independence (tests/test_stub_shadow_ambiguity.py, 17/18 tests verified red on base by an independent review session).
Q2 shape (1 sourced + 1 sourceless): resolves to the sourced node (criterion allowed either outcome; nothing in the repo depended on the old ambiguity report — verified by review).
explain and affected consistent on both shapes, including the all-sourceless refusal case.
Review verdict: APPROVE (4 minors, all addressed in the amended commit or noted below). Known related gap kept out of scope per the issue text: graphify query/shortest_path resolve endpoints via _score_nodes, which has no sourced-preference — follow-up issue to be filed. Full suite on the integrated branch: 4310 passed / 3 skipped.
Activity
filipechagas commentedon Aug 7, 2026
Fixed on the fork feature branch
fix/stub-shadowing-46(commit 313a168, cherry-picked fromfix/49-ambiguity-guard), headed for the single PR into v8.What landed (three coordinated changes):
_find_node_tiers(serve.py): when the exact tier holds both sourced and sourceless nodes, the sourceless ones are dropped — the sourced declaration wins.find_node_ambiguity(serve.py): sourceless nodes are keyed per-node instead of sharing the""source bucket, so N stubs count as N rivals — an all-sourceless tier now reports ambiguity instead of silently answering withmatches[0].affected.resolve_seed(affected.py): same sourced-preference applied to the exact-label and bare-name passes, soexplainandaffectedagree.Acceptance criteria:
tests/test_stub_shadow_ambiguity.py, 17/18 tests verified red on base by an independent review session).explainandaffectedconsistent on both shapes, including the all-sourceless refusal case.source_file, never a count threshold; lone-stub-no-rival resolution is pinned by dedicated tests (including the attributeless-endpoint variant serve materializes at load).BalanceitemRepositoryon the pinned api corpus — deferred to Stub-shadow fix 4/4: release + acceptance grading on the pinned api corpus #50's grading rebuild, as specced (covered synthetically at N=18; review traced that pre-Stub-shadow fix 1/4: PHP interface/trait/enum declarations mint canonical nodes (RC1 of #46) #47 the exact tier is 18 stubs with no sourced rival → ambiguity, post-Stub-shadow fix 1/4: PHP interface/trait/enum declarations mint canonical nodes (RC1 of #46) #47 the minted declaration wins → resolves).Review verdict: APPROVE (4 minors, all addressed in the amended commit or noted below). Known related gap kept out of scope per the issue text:
graphify query/shortest_pathresolve endpoints via_score_nodes, which has no sourced-preference — follow-up issue to be filed. Full suite on the integrated branch: 4310 passed / 3 skipped.Merge upstream/v8 (v0.9.40) into chore/sync-upstream-0940
Merge upstream/v8 (v0.9.42) into consolidated/php-support-1682