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
serve: query/shortest_path endpoint resolution lacks the sourced-beats-sourceless rule that explain/affected now enforce (#49 gap) #54
Surfaced during #49's review (fork PR #51). _score_nodes / _pick_scored_endpoint did not learn #49's sourced-preference rule, so graphify query and shortest_path can still land on a sourceless stub while explain and affected agree on the sourced declaration.
Measured by the reviewer: graph [{id: aaa_stub, label: FooRepository, source_file: ""}, {id: zzz_src, label: FooRepository, source_file: app/bindings.php}] → both score identically (5619.08), _pick_scored_endpoint returns aaa_stub, while _find_node()[0] and resolve_seed return zzz_src. The comment at graphify/serve.py:515-520 states the design intent that path/query resolve the same node explain does — this widens a gap that comment names.
Post-0.9.38 blast radius is small (1,031 residual stubs, all vendor externals, per the #46 grading) but the inconsistency is structural. Candidate fix: apply the same sourced-preference (or a scoring penalty for source_file == "") in the scored-endpoint path, with the same lone-stub carve-out #49 pinned with tests.
Triage decision (2026-08-07): accepted for the current fix cycle
Spec: apply #49's sourced-beats-sourceless rule to the scored-endpoint path so query/shortest_path resolve the same node explain/affected do (the design intent stated at graphify/serve.py:515-520).
_find_node already has the rule (serve.py:1338-1346: drop sourceless nodes from the exact tier when a sourced exact match exists). _score_nodes / _pick_scored_endpoint (serve.py:428/609) do not — the reviewer's measured repro: [{id: aaa_stub, label: FooRepository, source_file: ""}, {id: zzz_src, source_file: app/bindings.php}] → identical scores (5619.08), id-sort returns aaa_stub while _find_node/resolve_seed return zzz_src.
Fixed on the cycle branch fix/resolution-gaps-52-53-54 (integrated as the cherry-pick of slice commit a72956c), shipping in 0.9.39 via the cycle PR into v8.
Acceptance criteria, all verified locally (serve-side, synthetic graphs — no api corpus needed):
✅ The reviewer's two-node repro (identical scores 5619.081861425897) — _pick_scored_endpoint now returns the sourced zzz_src; was aaa_stub. Test red on base (14/20 of the new file fail on 18c17d8:graphify/serve.py), green after.
✅ Lone-stub carve-out holds by construction and is pinned (source_file: "" and missing-key variants; N=2,18 all-sourceless fields; query-over-stubs traversal).
✅ query/shortest_path agree with explain's _find_node on the repro shapes (incl. a false "No directed path found" on base that is now a 1-hop path).
Mechanism: a tie-break, not a scoring penalty — a sourceless node can never out-score an identical sourced one (the only source-derived term is additive), so the shadowing case always arrives as an exact tie; the sourced flag sits directly under the score in both tie-break keys (combined sort + per-term singleton winner). No live score changes, all score-sensitive baselines hold unedited. _find_node untouched per scope.
Adversarial review: APPROVE (fresh session; base-red verified in a detached worktree, half-patch experiment proved both keys live, 10-case probe: scored-vs-_find_node agreement 4/10 → 8/10). One deliberate asymmetry documented in the CHANGELOG bullet: the scored path demotes stubs on any score tie while _find_node does so in its exact tier only — closing that would mean changing _find_node, out of scope here.
Activity
filipechagas commentedon Aug 7, 2026
Triage decision (2026-08-07): accepted for the current fix cycle
Spec: apply #49's sourced-beats-sourceless rule to the scored-endpoint path so
query/shortest_pathresolve the same nodeexplain/affecteddo (the design intent stated atgraphify/serve.py:515-520)._find_nodealready has the rule (serve.py:1338-1346: drop sourceless nodes from the exact tier when a sourced exact match exists)._score_nodes/_pick_scored_endpoint(serve.py:428/609) do not — the reviewer's measured repro:[{id: aaa_stub, label: FooRepository, source_file: ""}, {id: zzz_src, source_file: app/bindings.php}]→ identical scores (5619.08), id-sort returnsaaa_stubwhile_find_node/resolve_seedreturnzzz_src._pick_scored_endpoint's tie-break — implementer's choice, mirroring Stub-shadow fix 3/4: find_node_ambiguity must not collapse sourceless rivals into one group (RC3 of #46) #49's semantics), with Stub-shadow fix 3/4: find_node_ambiguity must not collapse sourceless rivals into one group (RC3 of #46) #49's lone-stub carve-out: when every candidate is sourceless, the stub still wins (never return nothing where today something returns).Acceptance criteria (red-first):
_pick_scored_endpointreturns the sourced node (currently the stub — red first).queryandshortest_pathendpoint resolution agree withexplain's_find_nodepick on the repro graph.uv run --frozen pytest tests/ -q --tb=short.filipechagas commentedon Aug 7, 2026
Fixed on the cycle branch
fix/resolution-gaps-52-53-54(integrated as the cherry-pick of slice commita72956c), shipping in 0.9.39 via the cycle PR into v8.Acceptance criteria, all verified locally (serve-side, synthetic graphs — no api corpus needed):
_pick_scored_endpointnow returns the sourcedzzz_src; wasaaa_stub. Test red on base (14/20 of the new file fail on18c17d8:graphify/serve.py), green after.source_file: ""and missing-key variants; N=2,18 all-sourceless fields; query-over-stubs traversal).query/shortest_pathagree withexplain's_find_nodeon the repro shapes (incl. a false "No directed path found" on base that is now a 1-hop path).tests/test_scored_endpoint_sourced_preference.py); full suite green on the slice (4391 passed / 3 skipped) and on the integration branch after cherry-pick (4399 passed / 3 skipped).Mechanism: a tie-break, not a scoring penalty — a sourceless node can never out-score an identical sourced one (the only source-derived term is additive), so the shadowing case always arrives as an exact tie; the sourced flag sits directly under the score in both tie-break keys (combined sort + per-term singleton winner). No live score changes, all score-sensitive baselines hold unedited.
_find_nodeuntouched per scope.Adversarial review: APPROVE (fresh session; base-red verified in a detached worktree, half-patch experiment proved both keys live, 10-case probe: scored-vs-
_find_nodeagreement 4/10 → 8/10). One deliberate asymmetry documented in the CHANGELOG bullet: the scored path demotes stubs on any score tie while_find_nodedoes so in its exact tier only — closing that would mean changing_find_node, out of scope here.Merge pull request #57 from lawnstarter/fix/resolution-gaps-52-53-54
Merge upstream/v8 (v0.9.42) into consolidated/php-support-1682