Architecture Decision Records
An Architecture Decision Record captures one architecturally significant decision: the forces that produced it, the decision itself, and what it costs. Not a design document, not a spec — a record of a choice, written once, never edited after acceptance.
Why they exist
Code shows what was built. Git history shows when. Neither reliably shows why, and "why" is what determines whether a future change is safe.
Two examples from this repo where the reasoning is genuinely non-obvious from the code:
LaborAssignmentis keyed byAssociateId, not by anAssignmentId. Reading the aggregate, that looks like a modelling shortcut. It is the mechanism that makes "exactly one active assignment per associate" structurally impossible to violate. Without ADR 0003, a future refactor to "proper" per-assignment identity would silently downgrade a hard invariant into a hopeful query.- There is no
taskIdanywhere in this service. That reads as incompleteness. It is ADR 0002, and it is the most consequential decision in the codebase.
The template
These records use Michael Nygard's
format,
the de facto standard: one Markdown file per decision, numbered 0001-,
0002-, …, with five sections.
# NNNN. Short noun phrase naming the decision
## Status
Proposed | Accepted | Deprecated | Superseded by [ADR-NNNN](./nnnn-....md)
## Context
The forces at play: technical, organisational, domain. Written in
value-neutral language — describe the situation, do not argue for the
outcome yet.
## Decision
"We will ..." — active voice, one clear choice.
## Consequences
What becomes easier, what becomes harder, what is now true that was not
before. Include the costs. An ADR with only benefits is marketing.
Records are immutable once accepted. A decision that no longer holds is not
edited — it is marked Superseded by ADR-NNNN, and the new record explains what
changed.
Proposing a new one
- Copy the template above into
docs/docs/adr/NNNN-short-title.md, taking the next free number. - Write it with status
Proposed. - Add it to the
Architecture Decision Recordscategory indocs/sidebars.ts. - Open a pull request. The discussion happens on the PR, not in the document.
- On merge, flip the status to
Accepted.
If a decision turns out to be wrong, write a new ADR that supersedes it. Do not quietly delete the old one — the fact that it was tried is itself information.
The records
| # | Title | Status |
|---|---|---|
| 0001 | Hexagonal (ports and adapters) architecture | Accepted |
| 0002 | Stop at the path boundary — no associate-to-task link | Accepted |
| 0003 | Certification-gated assignment with exactly one active assignment per associate | Accepted |
| 0004 | Kafka for integration events, with a CloudEvents catalog ahead of the wire format | Accepted; envelope superseded by 0026 |
| 0005 | RFC 7807 Problem Details for every error response | Accepted |
| 0006 | godog acceptance specs driven through the real HTTP surface | Accepted |
| 0007 | arch-go fitness tests to make the layering rule executable | Accepted |
| 0008 | Model Context Protocol as an inbound adapter, not a new service | Accepted; auth/static-bearer sections superseded by 0018 |
| 0009 | Hazmat handling via the existing path-name-equals-certification-name gate | Accepted; superseded in part by 0013 |
| 0010 | Per-service analytical data product (report) via a separate analytics topic | Accepted; Envelope v1 superseded by 0026 |
| 0011 | Adopt the fleet-wide micro-frontend console architecture (workforce-mfe) | Accepted; deferred all-paths endpoint recorded in 0029 |
| 0012 | Close-the-loop measured rate feed from labor-performance into ProposePathPlan | Accepted |
| 0013 | Process-path catalogue validation, mirroring fulfillment-execution's ADR-0017 | Accepted |
| 0014 | Live installed-capacity ceiling on CommitShiftPlan, sourced from fulfillment-execution | Accepted |
| 0015 | Standard metrics convention across the fleet | Accepted |
| 0016 | Transactional outbox feeding both Kafka topics from one table | Accepted; relay retry amended by 0036 |
| 0017 | Adopt the fleet REST identity — static bearer keys with read/read-write scopes | Superseded by 0018 |
| 0018 | Remove the fleet REST identity layer (revert ADR-0017) | Accepted |
| 0019 | Replace the synchronous labor-performance MeasuredRateClient with an event-fed local cache | Accepted |
| 0020 | Consume labor-performance's idle-share signal for staffing surfacing and proposal trim | Accepted |
| 0021 | Optimistic concurrency (version column) on AssociateShift and LaborAssignment | Accepted |
| 0022 | Per-dependency circuit breakers, read-only retry, Kafka DLQ, and graceful shutdown hardening | Accepted |
| 0023 | Key the integration Kafka publisher by ShiftPlan aggregate id | Accepted |
| 0024 | Per-workload HorizontalPodAutoscaler and pgxpool MaxConns/statement_timeout tuning | Accepted |
| 0025 | Run golang-migrate against a direct Postgres connection, not PgBouncer | Accepted |
| 0026 | CloudEvents 1.0 as the mandatory event envelope | Accepted |
| 0027 | Transactional Idempotency-Key middleware on the creation POSTs | Accepted |
| 0028 | Housekeeping sweeper for idempotency keys and published outbox rows | Accepted |
| 0029 | All-paths staffing-gap list endpoint for a building/shift | Accepted |
| 0030 | Kafka-sourced process-path catalogue (PATH_CATALOGUE_SOURCE=kafka) | Accepted |
| 0031 | Kafka writer durability: RequireAll acks and a 10ms batch timeout | Accepted |
| 0032 | Boot-time retry for the first outbound dial (Istio sidecar warm-up) | Accepted |
| 0033 | Corrections from the 2026-10-05 docs audit (idempotent-request atomicity, measured-rate unit, idle-share naming, /readyz) | Accepted |
| 0034 | Site-scoped staffing gap (optional canonical siteCode) | Accepted |
| 0035 | siteCode is the canonical name of the ShiftPlan key; buildingId is a deprecated alias | Accepted |
| 0036 | The outbox relay stops claiming a row after OUTBOX_MAX_ATTEMPTS failures | Accepted |
| 0037 | The reports binary's routes are specified in apis/openapi-reports.yaml | Accepted |
| 0038 | Postgres and Kafka are the only runtime (no in-memory, log, file-catalogue or permissive mode) | Accepted; supersedes the fallbacks of 0008, 0013, 0016, 0019 and 0030 |
| 0039 | A2A inbound adapter (third driving adapter): two curated skills, staffing_status (read) and assign_labor (write), over the same use cases as REST and MCP; message-only, problems answered in-band, delegation only (facts stay on Kafka via the outbox) | Accepted |
| 0040 | Adopt the fleet REST API guideline: noun routes (shift-starts, shift-ends, break-starts, break-ends, plan-proposals), every POST idempotent (global key, 409 idempotency-key-reused, Idempotency-Replayed), keyset-paged {items,nextCursor} collections | Accepted |
| 0041 | Agent authority levels and attributable assignments: every MCP tool and A2A skill declares one level (L1 to L3 here; com.warehouse/authority meta, authority:L<n> tag), the MCP server is stateless (serves the 2026-07-28 revision), and an agent-initiated assign_labor stamps an additive initiated_by on LaborAssigned / LaborReassigned | Accepted |
| 0042 | The IdempotencyKey pattern describes the header as sent (the key, then optional trailing HTTP whitespace that the stack drops); validIdempotencyKey enforces the key exactly (1-128 printable ASCII, visible first and last character) | Accepted; amends 0040 and 0027 |
| 0043 | Local copy of warehouse-planning's LabourPlanCommitted; ProposePathPlan without a charge proposes the required heads (rateSource: labour-plan); staffing-gap and committed lines show requiredHeads; the charge-based proposal stays, deprecated | Accepted; extends 0012 and 0029 |
| 0044 | Every problem type has an idempotency replay class (FINAL/OUTCOME/RETRYABLE) declared on its catalogue entry; a RETRYABLE refusal is not stored — the key is released and a retry executes; no OUTCOME entry can exist in this savepoint store | Accepted; amends 0027 |