Skip to content

test(mcp): per-mode parity for 6 consolidated tools#139

Merged
aksOps merged 1 commit into
mainfrom
test/mcp-consolidated-mode-parity
May 13, 2026
Merged

test(mcp): per-mode parity for 6 consolidated tools#139
aksOps merged 1 commit into
mainfrom
test/mcp-consolidated-mode-parity

Conversation

@aksOps
Copy link
Copy Markdown
Contributor

@aksOps aksOps commented May 13, 2026

Summary

  • 32 new mode-dispatch sub-tests across all 6 consolidated tools (graph_summary, find_in_graph, inspect_node, trace_relationships, analyze_impact, topology_view)
  • Table-driven; in-memory Kuzu fixture (topology-fixture reuse + Flow engine wired for topology_view/flow)
  • Pins envelope shapes so silent mode regressions become visible

Bugs documented (not fixed — DO NOT fix in this PR)

Three dispatch parameter mismatches in tools_consolidated.go are asserted explicitly as INVALID_INPUT:

  1. trace_relationships/{callers,consumers,producers,dependencies,dependents} — passes node_id but consumerLikeTool reads target_id
  2. trace_relationships/shortest_path — passes from/to but find_shortest_path reads source/target
  3. find_in_graph/by_endpoint — passes node_id but find_related_endpoints reads identifier

Test plan

  • CGO_ENABLED=1 go test ./internal/mcp/... -count=1 — 115 passed (38 new)
  • CGO_ENABLED=1 go test ./... -count=1 — 866 passed across 45 packages

🤖 Generated with Claude Code

Adds table-driven tests over every mode of every consolidated tool —
32 mode dispatches total. Each asserts the envelope shape;
payload contents verified for non-emptiness against an in-memory
Kuzu fixture (topology-fixture reuse + Flow engine).

Three known bugs in tools_consolidated.go dispatch are pinned as
explicit INVALID_INPUT assertions (see BUG comments):
  - trace_relationships/{callers,consumers,producers,dependencies,
    dependents} pass node_id but consumerLikeTool reads target_id
  - trace_relationships/shortest_path passes from/to but underlying
    tool reads source/target
  - find_in_graph/by_endpoint passes node_id but find_related_endpoints
    reads identifier

Closes ultraplan §2 mode-by-mode coverage mandate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aksOps aksOps merged commit 094cffd into main May 13, 2026
13 checks passed
@aksOps aksOps deleted the test/mcp-consolidated-mode-parity branch May 13, 2026 10:09
aksOps added a commit that referenced this pull request May 13, 2026
`tools_consolidated.go` was passing arg names to underlying tool
handlers that the handlers didn't unmarshal, producing permanent
INVALID_INPUT envelopes for 7 modes:

- trace_relationships/{callers,consumers,producers,dependencies,dependents}
  passed `node_id` to consumerLikeTool handlers that only read
  `target_id`.
- trace_relationships/shortest_path passed `from`/`to` but
  find_shortest_path reads `source`/`target`.
- find_in_graph/by_endpoint passed `node_id` but
  find_related_endpoints reads `identifier`.

Parity test (PR #139) documented but didn't fix these. This patch
corrects the dispatch sites and flips the test expectations from
`CodeInvalidInput` to dispatch-reached-handler shapes.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant