---
id: w1/m2.5/t009
title: Test coverage — three-surface parity + registration-wiring tests
worker: worker1
status: done
estimate: 30m
depends_on: [w1/m2.5/t007]
---

## Objective

Add meaningful tests for the behavior this refactor must guarantee: that after recomposition every feature's verbs are still reachable and consistent across REST, GraphQL, and MCP, and that each feature actually registers into the single shared roots. These tests turn the "one Core, three adapters can't drift" invariant from prose into something CI enforces.

## Context

- The refactor's whole risk is a dropped registration — a feature whose GraphQL field or MCP tool silently isn't wired into the root schema/registry. A parity test is the direct guard.
- Tests must assert real behavior/failure modes, not snapshot everything or tautologically re-state the code.

## Steps

1. Add a parity test: for the verb set, assert it is invocable over REST, GraphQL, and MCP against a fake client, with matching results (extend/relocate the existing adapter tests rather than duplicating them).
2. Add a wiring test: build the root schema + MCP registry and assert each feature's expected fields/tools are present (catches an unregistered fragment).
3. Add a cycle/boundary guard if cheap (e.g. assert feature packages don't import the composition root).

## Files

- `lego/backend/internal/server/*_test.go` (or the composition root's package)
- feature-package `*_test.go` where a surface-specific assertion fits better

## Acceptance criteria

- [ ] A failing/missing registration for any feature fails the parity or wiring test.
- [ ] Tests assert real behavior (invocation + result shape), not trivial/snapshot coverage.
- [ ] `go test ./...` green.

## Out of scope

- Testing unchanged verb business logic already covered by moved tests.
