---
id: w2/m10/t008
title: Test coverage — state machine, non-cancelable 409s, rollback-target integrity
worker: worker2
status: todo
estimate: 30m
depends_on: [w2/m10/t006]
---

## Objective

Standing closing task. Meaningful tests: the cancel CAS transition (cancel-vs-complete race never clobbers `live`), non-cancelable states return the spec's code, double-cancel idempotency, rollback provenance recorded, target-less/unknown-id refusals, rollback-while-suspended honors the replica contract, and authz on both verbs (`TestAuthzGuardsEveryVerb`). Assert real behavior and failure modes — never tautological.

## Acceptance criteria

- [ ] The cancel/complete race has an explicit test; every refusal path asserted; `go test ./...` green in `lego/backend`.
