---
id: w8/m2/t008
title: Test coverage — adapter consistency + authz denial
worker: worker8
status: todo
estimate: 45m
depends_on: [w8/m2/t006]
---

## Objective

Meaningful tests for the shipped surface: a cross-adapter consistency test (REST, GraphQL, MCP return identical quantities from one fake store), authz-denial per adapter, store-unset 503/unavailable per adapter, and `period` parsing edge cases. Assert behavior and failure modes — no snapshot-everything.

## Context

- Standing closing task (`.claude/commands/pm.md`); `internal/api/server_test.go` shows the server-level test harness.

## Steps

1. Build the consistency test over one seeded fake store.
2. Cover the failure modes above.
3. `cd lego/backend && go test ./...` + `make lint-backend` green.

## Files

- `lego/backend/internal/usage/*_test.go`, `lego/backend/internal/api/server_test.go`

## Acceptance criteria

- [ ] One test proves the three adapters agree; denial/unavailable paths covered per adapter.
- [ ] `go test ./...` + `make lint-backend` pass.

## Out of scope

- UI tests (m3).
