---
id: w2/m5/t007
title: Test coverage — meaningful tests for deploy history behavior
worker: worker2
status: done
estimate: 30m
depends_on: [w2/m5/t005]
---

## Objective

Add meaningful tests for what m5 shipped: recording transitions (open → live, open → failed), trigger semantics (new row, restart intent through the store, suspended-service refusal), store-less 503s, and three-adapter delegation. Assert real behavior and failure modes — never trivial or tautological tests.

## Context

- Standing closing task; the store reconciler already has unit + regression tests (w1/m2 t005) to extend.

## Steps

1. Recording unit tests over simulated status write-backs (healthy, never-healthy, revision bump mid-flight).
2. Trigger tests: row created, intent written once, suspended refusal.
3. Adapter tests: REST envelopes/status codes; MCP round-trip parity with REST.

## Files

- `lego/backend/internal/store/*_test.go`
- feature `*_test.go` files

## Acceptance criteria

- [ ] Every t001–t004 acceptance criterion has a regression test; `go test ./...` green in `lego/backend`.

## Out of scope

- Coverage-percentage gaming; duplicate e2e beyond t005.
