Skip to content

test(mcp): Phase 4 — integration tests (stacked on #55)#56

Merged
silversurfer562 merged 2 commits into
mainfrom
test/mcp-integration
May 23, 2026
Merged

test(mcp): Phase 4 — integration tests (stacked on #55)#56
silversurfer562 merged 2 commits into
mainfrom
test/mcp-integration

Conversation

@silversurfer562
Copy link
Copy Markdown
Member

Summary

Closes Phase 4 (tasks 4.1, 4.2) of docs/specs/mcp-server-scope/. With this merged, the whole MCP spec is shipped end-to-end (Phases 1–5).

⚠️ Stacked on #55 so the round-trip test can exercise gui_set_spec_status. Merge order: #55 first, then this PR. After #55 merges, this branch may need a no-op rebase but the diff is clean.

Tests added — sidecar/tests/test_mcp_integration.py (3 tests)

Test What it locks in
4.1 test_gui_list_specs_matches_fastapi_route MCP gui_list_specs returns the same specs and specs_roots lists as GET /api/cowork/specs on the same isolated root
4.2 test_gui_get_spec_returns_disk_truth gui_get_spec content matches disk byte-for-byte for every phase file; the FastAPI listing agrees on most-advanced phase + status
bonus test_set_spec_status_round_trips_to_fastapi_route Flip status via MCP → FastAPI listing reflects the change immediately (no cache between the surfaces)

Implementation note

The spec's "test that starts the MCP server" wording was reinterpreted as in-process dispatch via AttuneGuiMCPServer.call_tool(...). That's the same code path the MCP SDK hits at runtime, so the surface-parity guarantee is identical, but the test is significantly lighter than spawning a stdio subprocess and wiring JSON-RPC framing.

Recorded in tasks.md and the test file's module docstring.

Test plan

  • pytest sidecar/tests/test_mcp_integration.py — 3/3 green
  • Full sidecar suite: 534 passed (was 531 → +3 new), 1 pre-existing unrelated fail (version == 'dev' in worktree env)
  • ruff check sidecar/ — clean

🤖 Generated with Claude Code

silversurfer562 and others added 2 commits May 23, 2026 11:32
Closes Phase 4 of docs/specs/mcp-server-scope/. Three new tests in
sidecar/tests/test_mcp_integration.py prove the MCP tool surface
stays in sync with the FastAPI routes on a shared isolated specs
root:

  - 4.1 — gui_list_specs returns the same `specs` and `specs_roots`
         lists as GET /api/cowork/specs
  - 4.2 — gui_get_spec content matches disk bytes for every phase
         file; the FastAPI listing agrees on most-advanced phase
         and status
  - Bonus — gui_set_spec_status round-trip: flip status via MCP,
            FastAPI listing reflects the change immediately
            (no cache between the two surfaces)

Implementation note — the spec's "test that starts the MCP server"
wording was reinterpreted as in-process dispatch via
`AttuneGuiMCPServer.call_tool(...)`. That's the same code path the
MCP SDK hits at runtime, so the surface-parity guarantee is identical,
but the test is significantly lighter than spawning a stdio
subprocess and wiring JSON-RPC framing. The choice is recorded in
tasks.md and in the test file's module docstring.

This stacks on top of #55 (Phase 3 — gui_set_spec_status) so the
round-trip test can exercise the write tool. Merge order: #55 first,
then this PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Auto-regen triggered by the new sidecar/tests/test_mcp_integration.py
file. source_hash drift only.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@silversurfer562 silversurfer562 merged commit d282f21 into main May 23, 2026
5 checks passed
silversurfer562 added a commit that referenced this pull request May 25, 2026
attune-rag 0.2.0 shipped 2026-05-25 as the first SemVer-binding
cut — purely additive (new measure_corpus module + alias-file
helpers; no breaking API changes). The current core pin caps at
<0.2, silently locking fresh installs to attune-rag 0.1.23 even
when 0.2.x is available.

Widen the cap to <0.3 to unblock attune-rag 0.2.x installs.

The cap widen is the trigger for promoting the pending
[Unreleased] content to a real release. That content has been
queued on `main` since v0.7.1 (2026-05-22):

  - MCP server Phases 1-5 (PRs #49-#56) — new attune-gui-mcp
    console script with 6 tools (5 read-mostly + gui_set_spec_status
    write); 30+ tests across test_mcp_tools.py and
    test_mcp_integration.py
  - **Status:** parser fix (PR #57)
  - Living-docs regen automation Phase 1 (PRs #60-#63)
  - Home interpreter snapshot (PR #59)
  - Stacked-rebase README note (PR #58)

Bumped 0.7.1 → 0.8.0 (minor) for the new MCP tool surface.

Local smoke (python 3.10, fresh venv):
  pip install -e .[dev]
  → attune-gui 0.8.0, attune-rag 0.2.0
  545/545 sidecar tests pass (1 playwright skip, unrelated).
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