Parent
E2E test infrastructure initiative.
Problem
The three workspaces (MCP server, Plugin, Rules) have inter-dependencies that are only validated by convention:
- Plugin → MCP: Plugin calls `activate`, `search_rules`, `parse_mode` — but no test verifies the MCP server actually returns what the plugin expects.
- Rules → MCP: Agent JSON files in `packages/rules/.ai-rules/agents/` must match the schema the MCP server uses to parse them — currently only ajv validates the schema, not the runtime behavior.
- Root orchestration: There is no single command to run all E2E tests across workspaces.
A breaking change in the MCP server's tool response format would silently break the plugin with no test catching it.
Scope
Contract tests (~5-8 tests)
MCP ↔ Plugin contract
- `activate` tool returns `{mode, rules, primaryAgent, specialists}` structure
- `search_rules` returns `{results: [{name, content, relevance}]}` structure
- `get_agent_details` returns agent with required fields (name, description, expertise)
- Tool names match what plugin code references (no typos in tool name strings)
Rules ↔ MCP contract
- Every agent JSON in `packages/rules/.ai-rules/agents/*.json` loads successfully via MCP server's RulesService
- Rule markdown files referenced by `activate` actually exist on disk
- Agent count matches between filesystem and MCP `resources/list`
Root orchestrator
- Add `test:e2e` to root `package.json` that runs:
- `yarn workspace codingbuddy test:e2e` (MCP E2E — Phase 1)
- `python3 -m pytest tests/e2e/plugin-hooks/ -v` (Plugin E2E — existing)
- `yarn workspace landing-page test:e2e` (Landing E2E — Phase 2)
- Contract tests (this phase)
Technical approach
- Location: `tests/e2e/contracts/` at repo root (cross-workspace)
- Framework: Vitest (can import from both MCP server and rules package)
- MCP interaction: Spawn MCP server in stdio mode, send JSON-RPC calls
- CI: Add `e2e-contracts` job to `dev.yml`, depends on `build`
Test commands
# Individual
yarn test:e2e:contracts # Contract tests only
# Root orchestrator
yarn test:e2e # ALL e2e across workspaces
Acceptance criteria
Dependencies
- Phase 1 (MCP E2E) — reuses the stdio spawn infrastructure
- Phase 2 (Landing E2E) — needed for root orchestrator completeness
Out of scope
- Plugin Python ↔ MCP server live integration (requires running both)
- CDC (Consumer-Driven Contracts) tooling like Pact — overkill for current scale
Parent
E2E test infrastructure initiative.
Problem
The three workspaces (MCP server, Plugin, Rules) have inter-dependencies that are only validated by convention:
A breaking change in the MCP server's tool response format would silently break the plugin with no test catching it.
Scope
Contract tests (~5-8 tests)
MCP ↔ Plugin contract
Rules ↔ MCP contract
Root orchestrator
Technical approach
Test commands
Acceptance criteria
Dependencies
Out of scope