Skip to content

test(serve): lock in per-edge evidence for same-relation parallel edges - #4506

Open
rtmalikian wants to merge 1 commit into
Graphify-Labs:v8from
rtmalikian:test/parallel-edge-evidence-4503-followup
Open

rtmalikian wants to merge 1 commit into
Graphify-Labs:v8from
rtmalikian:test/parallel-edge-evidence-4503-followup

Conversation

@rtmalikian

Copy link
Copy Markdown
Contributor

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.py with a fixture of two parallel calls edges between one pair, from two different call sites (src/App.tsx:163 and src/App.tsx:201):

  • the filtered neighbor response (rel_filter="calls", the same path the MCP get_neighbors tool uses) returns both edges, not just the first
  • each returned edge keeps its own source_location, so the evidence behind every relationship stays attached to the right edge

Type of change

  • Tests or CI

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 only App.tsx:163. Both tests fail there and pass with the fix.

  • Read the CONTRIBUTING.md guide.
  • Reproduced the issue and identified the invariant.
  • Made the smallest fix necessary (test-only, no source changes).
  • Added a regression test.
  • Kept the PR description synchronized with the final implementation.
  • Documented any limitations / unsupported cases explicitly (none new).

How was this tested?

.venv/bin/python -m pytest tests/test_parallel_edge_evidence.py -v
# 2 passed

.venv/bin/python -m pytest tests/test_serve.py tests/test_build.py tests/test_cli_export.py -q
# 323 passed, 1 skipped

Graphify-specific checklist

  • I updated generated skill artifacts (uv run python -m tools.skillgen --bless) when changing their source fragments. (n/a - test-only, no source fragments changed)
  • I confirmed that AST/structural extraction remains deterministic (unaffected - test-only).
  • I reviewed changes for security implications (no unsafe interpolation into shell/Python - test-only).
  • I confirmed no API keys or local-only graph data are included.
  • (If applicable) I disclosed AI authorship in my commit messages.

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

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>
@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the contributor Pull request from a returning community contributor label Oct 16, 2026

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor Pull request from a returning community contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant