Architecture Decision Records
What these are
An Architecture Decision Record (ADR) captures a single architecturally significant decision, its context, and its consequences — at the moment it was made, in the words that were true then.
The value is not the decision; it is the context. Six months later, the code shows what was chosen and can never show why, or what the alternatives were, or what was known at the time. A reader who does not know the why has two bad options: assume the decision was arbitrary and change it, or assume it was sacred and work around it. An ADR gives them a third.
The format
These records use Michael Nygard's template — the de facto standard:
# NNNN. Title (a short noun phrase)
## Status
Accepted | Proposed | Deprecated | Superseded by ADR-XXXX
## Context
The forces at play: technical, business, operational. What is true that makes
this a decision rather than an obvious default? Written in full sentences and
in the present tense, describing the situation as it is.
## Decision
The response to those forces, stated actively: "We will…"
## Consequences
What becomes easier and what becomes harder — both. A record with only
positive consequences has not been thought about.
One decision per file, numbered 0001-, 0002-, … Numbers are never reused
and files are never deleted.
Immutability
An accepted ADR is never edited to change its decision. If a decision is reversed, write a new ADR that supersedes it, and update the old one's Status line to point at the successor. The historical record of what was believed at the time is the entire asset.
Typos, broken links and formatting are of course fair game.
The records
| # | Title | Status |
|---|---|---|
| 0001 | Hexagonal (ports & adapters) architecture | Accepted |
| 0002 | Chaotic (random) stow over fixed slotting | Accepted |
| 0003 | Revocable reservations over hard allocation | Accepted (amended by 0050 s3) |
| 0004 | Kafka and a shared envelope for integration events | Superseded by 0024 (envelope) |
| 0005 | RFC 7807 Problem Details for all error responses | Accepted |
| 0006 | arch-go fitness tests to enforce the dependency rule | Accepted |
| 0007 | godog/Gherkin acceptance tests as executable specification | Accepted |
| 0008 | Model Context Protocol as an inbound adapter, not a new service | Accepted — auth/bearer/OAuth/mcp.readKey sections superseded by 0015 |
| 0009 | Product classification as SKU-level master data, enforced at stow time | Accepted — ownership superseded by 0034 |
| 0010 | Optional DOT hazard class and same-bin DOT segregation at stow time | Accepted |
| 0011 | Per-service analytical data product (report) via a separate analytics topic | Accepted (envelope superseded by 0024) |
| 0012 | Adopt the fleet's micro-frontend console architecture (ADR-0002 in warehouse-ops-agent) | Accepted |
| 0013 | Location classification from facility-layout's events, not a synchronous call | Accepted |
| 0014 | Adopt the fleet REST identity standard (static bearer keys, read/read-write scopes; warehouse-ops-agent ADR 0005) | Superseded by 0015 |
| 0015 | Remove the fleet REST identity layer (static bearer keys, read/read-write scopes) | Accepted |
| 0016 | Standard metrics convention across the fleet | Accepted |
| 0017 | Transactional outbox + relay for Kafka publishing | Accepted — per-key ordering amended by 0038 |
| 0018 | Transactional Idempotency-Key middleware for POST /stock-receipts and POST /reservations | Accepted |
| 0019 | Optimistic concurrency (version column) for StockUnit, Bin, Reservation | Accepted |
| 0020 | Circuit breaker, read-only retry, Kafka DLQ, and graceful shutdown hardening | Accepted |
| 0021 | Key every integration/analytics Kafka message by its aggregate id, and route by Hash not LeastBytes | Accepted |
| 0022 | Per-workload HorizontalPodAutoscaler and pgxpool MaxConns/statement_timeout tuning | Accepted |
| 0023 | Run golang-migrate against a direct Postgres connection, not PgBouncer | Accepted |
| 0024 | CloudEvents 1.0 as the mandatory event envelope | Accepted — type catalogue extended by 0039 |
| 0025 | Declarative bin registration over REST (PUT /bins/{binId}), and the pick location (binId) on every reservation allocation | Accepted |
| 0026 | Housekeeping sweeper for idempotency keys and published outbox rows | Accepted |
| 0027 | MCP governance gate and eval suite (E1–E3) | Accepted |
| 0028 | Boot-time dial retry (bootretry) | Accepted |
| 0029 | Additional architecture fitness tests beyond the dependency rule | Accepted |
| 0030 | Site-scoped transfer allocation as a command/reply consumer | Accepted |
| 0031 | Publish ProductClassified through the outbox on both topics | Accepted — publication superseded by 0034 |
| 0032 | Confirm picks from a pick-completion event, not from a REST call | Superseded by 0035 |
| 0033 | Destination transfer receipt custody — stage, quarantine, stow | Accepted |
| 0034 | product-master owns product classification; this service keeps a local copy | Accepted |
| 0035 | Confirm an order's picks from fulfillment-execution's TaskCompleted, on the last pick | Accepted; per-line path added by 0036 |
| 0036 | Reservations store the order line; picks are confirmed per line | Accepted |
| 0037 | Stock receipts from inbound-receiving: Good ReceiptLineReceived lines are booked as staged stock | Accepted |
| 0038 | Outbox relay attempt cap: OUTBOX_MAX_ATTEMPTS (default 20) excludes a poison row and logs it at ERROR | Accepted |
| 0039 | Intra-site stock relocation: POST /relocations, StockRelocated, RELOCATE tasks from TaskCompleted (slotting-optimization ADR 0010) | Accepted |
| 0040 | BinStockLevelChanged: absolute per-(bin, sku) levels with a persisted version, raised from the ledger's own transaction (pick-face-replenishment) | Accepted |
| 0041 | A completed REPLENISH task (TaskCompleted with request_ref) is applied as a REPLENISHMENT relocation: StockRelocated + BinStockLevelChanged (pick-face-replenishment) | Accepted |
| 0042 | Postgres and Kafka are the only runtime: no in-memory mode, log publisher or permissive lookup; the relay and all four consumers are always on; a dead consumer ends the process; /readyz checks Postgres and Kafka | Accepted |
| 0043 | Promote DiscrepancyDetected, ItemUnlocated and ItemStowed to warehouse.inventory.events with byte-identical data, for exception-management and returns-processing | Accepted |
| 0044 | Consume returns-processing's ReturnLineStaged through the same staged-receipt use case | Accepted |
| 0045 | Container (LPN), sealed cases and BreakCase; stock and reservations segregated by ownerRef | Accepted (amended by 0046, 0047 s4) |
| 0046 | Containers as built: the container site comes from the bin (no site_id on the carton), a local PackagingView of product-master pack levels, snake_case wire shapes, per-owner BinStockLevelChanged versions (amends 0045) | Accepted |
| 0047 | The bin handling unit arrives on LocationSlotRegistered (optional handlingUnit) and the new LocationSlotHandlingUnitDeclared; the facility cache reads both; amends 0045 section 4 (fail-closed unchanged) | Accepted |
| 0048 | A2A inbound adapter: a third driving adapter over the same use cases as REST and MCP; two curated skills derived from the MCP tools, check_availability (read) and revoke_reservation (write), in a message-only agent served by cmd/a2a on 8093; in-band RFC 7807 problems with REST's classification; A2A carries delegation only, facts still leave through the outbox | Accepted |
| 0049 | Adopt the fleet REST API guideline: noun routes (/stock-receipts, /stowages, /pick-confirmations, /cycle-counts, /case-breaks), an Idempotency-Key on every POST with 409 idempotency-key-reused and Idempotency-Replayed on replay, keyset-paged {items, nextCursor} collections; amends 0018 | Accepted |
| 0050 | Reservations draw a SKU's forward pick face (from the approved slot plan, a local read model fed by SlotPlanApproved) before its reserve bins, then smaller usable first, bin id, stock unit id; the order is the domain policy allocation.Order, not SQL; transfer allocation and sealed-case reservation unchanged; amends 0003 section 3 | Accepted |
| 0051 | Transfer allocation release: the cancel-after-allocation compensation leg — consume TransferAllocationReleaseRequested, resolve the origin reservation via RevokeReservation's logic, answer TransferStockAllocationReleased (RELEASED | ALREADY_RESOLVED, both settle the saga), idempotent by transfer_line_id through the transfer_allocation_releases ledger; closes the gap network-inventory-planning's ADR-0003 documented | Accepted |
| 0052 | Held stock and disposition: the Damaged lines of ReceiptLineReceived are booked as HELD units (reason DAMAGED) instead of dropped; a held unit has no usable quantity and cannot be reserved; dispositions RELEASE, RETURN_TO_VENDOR, SCRAP, REWORK; events StockHeld, StockReleased, StockDispositioned; REST list + disposition, MCP list_held_stock (L1); audit of every usable-quantity reader; supersedes 0037's "Damaged is not booked" | Accepted |
| 0053 | Idempotency replay classes: every problem type declares FINAL, OUTCOME or RETRYABLE on its catalogue entry; a RETRYABLE refusal rolls the request back, key row included, so a retry under the same key executes; OUTCOME refusals (reservation-already-resolved, transfer-scan-quarantined) commit their writes with the stored answer. Narrows ADR 0018 and ADR 0049. | Accepted |
| 0054 | Tote containers for the WCS: a Tote aggregate beside the sealed-case Container, one LPN namespace (license_plates), stock units tagged with their container, the tote's bin as its logical location, allocations[].containerId, a container-aware draw that amends ADR 0050 for container units only, and no loose stock in an AutomatedStorage bin. Additive. | Accepted |
Each of these reconstructs a decision that is actually visible in this
repository's history, CLAUDE.md, TASKS.md or code — none is a generic
placeholder.
Proposing a new one
- Copy the template above into
docs/docs/adr/NNNN-short-kebab-title.md, taking the next free number. - Open it with Status: Proposed.
- Write the Context before the Decision. If the context does not make the decision feel inevitable, the context is incomplete — or the decision is wrong.
- Fill in Consequences honestly, including the ones you dislike.
- Add it to the table above and to
sidebars.ts. - Raise it as a pull request; the discussion belongs on the PR, not inside the record.
- On merge, flip the status to Accepted.
What deserves an ADR
Something is architecturally significant if reversing it later would be expensive — it constrains the structure of the code, pins a contract other teams depend on, or is costly to undo.
Yes: the layering rule; how allocation works; the integration transport and envelope; the error format on a public API; a quality gate that blocks merges.
No: which linter rules are enabled; a library upgrade; a refactor with no external consequence. Padding the log with trivia makes the significant records harder to find.