---
id: w1/m21/t003
title: REST/GraphQL/MCP static-site surface (create/read/update, routes, headers)
worker: worker1
status: done
estimate: 60m
depends_on: [w1/m21/t002]
---

## Objective

Expose static sites over all three bex-api surfaces with Render-identical shape: create/read/update a `static_site` service (with `publishPath` and build config), and manage its `/routes` (redirects/rewrites) and `/headers`. One core, thin adapters.

## Context

- `lego/backend/` imports `types/`; feature-package-per-feature (m2.5).
- Render endpoints: the service create/update carries the static-site fields; `routes` and `headers` are sub-resources — match field names + error shapes.

## Steps

1. Add the static-site core (create/read/update over the CR) + routes + headers management.
2. Wire REST, GraphQL, and MCP adapters over that core.
3. Match Render's field names, defaults, ordering semantics, and error shapes.

## Files

- `lego/backend/internal/<feature>/…` (core + REST/GraphQL/MCP adapters)

## Acceptance criteria

- [ ] Create/read/update a static site + routes + headers over REST; GraphQL + MCP expose identical fields/semantics.
- [ ] Backend `go build`/`go test` green; `make lint-backend` clean.

## Out of scope

- Mechanism (t001/t002); dashboard (t004).
