API overview
| Interface | Source of truth | Notes |
|---|---|---|
| REST | apis/openapi.yaml (OpenAPI 3.0.3) | Pages under REST are generated from the spec; do not edit them by hand. Default server http://localhost:8080. |
| Events | apis/asyncapi.yaml (AsyncAPI 2.6.0) | Summarised on the event catalogue. |
| MCP | .claude/rules/mcp.md | 14 tools over Streamable HTTP on :8090; same use cases as REST. |
Conventions
- Errors are RFC 7807
application/problem+json, with a stable slug such asprocess-path-not-found,missing-step-capacityorcapacity-plan-already-published. - Auth: none. The fleet reverted REST and MCP auth on 2026-09-11, and a fitness test fails CI if auth middleware is reintroduced.
- JSON field names are snake_case; timestamps are RFC 3339; quantities of
assigned demand and shortage are orders;
path_capacityis ORDER per hour.
Endpoint groups (tags)
| Tag | Endpoints |
|---|---|
process-capacities | POST /process-capacities, GET /process-capacities |
process-paths | GET /process-paths, POST /process-paths, GET /process-paths/{id}/capacity |
capacity-plans | GET /capacity-plans, POST /capacity-plans, GET /capacity-plans/comparisons, GET /capacity-plans/{id}, POST /capacity-plans/{id}/publications |
station-capacity | PUT /station-standards/{location}/{process_type}, GET /station-standards, GET /storage-capacity |
demand | GET /demand |
reports | GET /reports/bottleneck-frequency, GET /reports/shortage-trend, GET /reports/plan-throughput, GET /reports/freshness (served by cmd/planning-reports on :8092, not by cmd/api) |
cmd/api also serves GET /healthz (liveness) and GET /readyz (readiness,
503 once shutdown has started); neither is in the spec.
Regenerating the REST reference
The reference is generated by docusaurus-plugin-openapi-docs into
docs/docs/api-reference/rest and committed. After changing
apis/openapi.yaml, run inside docs/:
npm run clean-api-docs warehouse-planning
npm run gen-api-docs warehouse-planning
The docs-api-drift CI job repeats this and fails if the committed output
differs. Always run the clean step first: the generator skips files it believes
are unchanged.