---
id: w8/m5/t004
title: Adapter-consistency tests for the new usage rows
worker: worker8
status: todo
estimate: 30m
depends_on: [w8/m5/t003]
---

## Objective

Verify REST, GraphQL, and MCP all return the new Database/KeyValue usage rows identically — the thin-adapter design (`docs/ADR006-bex-api.md`) means no adapter code should need to change, but that needs a test proving it, not an assumption.

## Context

- `lego/backend/internal/usage/{rest,graphql,mcp}.go` are thin wrappers over the one core `Usage` verb.
- Existing adapter-consistency tests from `w8/m2` (t008) are the pattern to extend.

## Steps

1. Add/extend adapter-consistency tests so a workspace with metered App + Database + KeyValue rows gets the same `services[]` content (fields, kinds, totals) from all three surfaces.
2. If any adapter needs a change to pass the new field through (t003), make it here and re-verify parity.

## Files

- `lego/backend/internal/usage/adapters_test.go`

## Acceptance criteria

- [ ] A single fixture with App + Database + KeyValue usage rows produces byte-identical `services[]` content across REST/GraphQL/MCP (modulo envelope differences already accounted for).

## Out of scope

- Dashboard rendering of the new rows (t005).
