---
id: w1/m24/t008
title: Test coverage — schema validation, fromDatabase resolution, all-or-nothing + idempotency
worker: worker1
status: todo
estimate: 30m
depends_on: [w1/m24/t006]
---

## Objective

Standing closing task. Meaningful tests: duplicate service names rejected, unknown `fromDatabase` reference names the offender, legacy single-service files parse byte-identically (regression fixture), all-or-nothing (invalid entry N ⇒ zero writes — assert against a spy store), apply ordering (DBs before dependents), idempotent re-apply (no spec diff, no deploy records), and no plaintext connection string in any produced spec (planted-credential grep). Assert real behavior and failure modes — never tautological.

## Acceptance criteria

- [ ] The all-or-nothing, idempotency, and no-plaintext contracts each have explicit tests; `go test ./...` green in `lego/backend`.
