Repository navigation
test(serve): lock in per-edge evidence for same-relation parallel edges - #4506
rtmalikian wants to merge 1 commit into
Conversation
Follow-up to Graphify-Labs#4503: the contains-then-calls fixture pairs two different relations, so a relation filter matching several parallel edges with the *same* relation was untested. These tests pin the MCP neighbor response to return every matching parallel edge (not just the first) and to keep each edge's own source_location attached. Signed-off-by: Raphael Malikian <rtmalikian@gmail.com>
|
Thanks for the pull request, @rtmalikian. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.10 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify reviewed this change.
No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.
Not checked: tests were not run; no formal proof of the changed code.
Graphify review — findings
Adds regression tests for the #4503 follow-up: when a relation filter matches several parallel edges with the same relation, _neighbor_lines must return every one of them, not just the first as the old edge_data() code did. The fixture is a graph.json with two calls edges between one node pair from different call sites, serialized with multigraph: false. It checks both the edge count and that each edge cites its own source location (App.tsx:163 and App.tsx:201), so evidence is never merged or attached to the wrong edge.
No blocking issues surfaced.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 6 functions depend on the 6 functions this change touches.
Health — grade A; no new coupling hotspots.
Verification — 6 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 6 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
1 of 345 test file(s) selected (0%) via static blast radius.
tests/test_parallel_edge_evidence.py— impact, changed-test
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
What does this PR do?
Follow-up to #4503. That PRs regression fixture pairs two different relations (contains + calls), which left a gap: when a relation filter matches several parallel edges carrying the same relation, nothing pinned the MCP neighbor response to returning every one of them instead of just the first. Edge count alone would not catch that either.
This adds
tests/test_parallel_edge_evidence.pywith a fixture of two parallelcallsedges between one pair, from two different call sites (src/App.tsx:163andsrc/App.tsx:201):rel_filter="calls", the same path the MCPget_neighborstool uses) returns both edges, not just the firstsource_location, so the evidence behind every relationship stays attached to the right edgeType of change
Verification & Invariants
The invariant: one output line per relationship, each carrying its own source evidence. I proved the tests guard it by running them against the pre-fix behavior: with the multigraph repair disabled the load collapses to 1 edge, and with the old first-only
edge_data()the filtered response returns onlyApp.tsx:163. Both tests fail there and pass with the fix.How was this tested?
Graphify-specific checklist
uv run python -m tools.skillgen --bless) when changing their source fragments. (n/a - test-only, no source fragments changed)Raphael Malikian - rtmalikian@gmail.com. I work on code-graph and medical-AI open source and Im open to collaborate with anyone wanting similar help. Im also currently looking for a role: https://github.com/rtmalikian