Architecture Decision Records
An Architecture Decision Record captures one architecturally significant decision: what was decided, what was going on at the time that made the decision necessary, and what the team now has to live with as a result.
The records here are not aspirational design documents. Each one reconstructs
a decision that is actually visible in this repository — in the code, in
CLAUDE.md, in TASKS.md, or in the shape of the API. If you can't point at
the consequence in the tree, it isn't an ADR.
Why keep them
The alternative is that the reasoning lives in somebody's head, or in a review thread nobody can find. Six months later the code says what the system does and nothing says why, so the next person either preserves a constraint that stopped mattering or removes one that still does.
For this service specifically the stakes are higher than usual: it is a Generic Subdomain that five other contexts conform to. Decisions about its coded address format and its enforcement points are expensive to reverse once anyone depends on them, so the reasoning behind them is worth writing down.
The template
These follow Michael Nygard's lightweight format — the de facto standard
— one markdown file per decision, numbered 0001-, 0002-, and so on:
| Section | Contains |
|---|---|
| Title | A short noun phrase naming the decision |
| Status | Proposed / Accepted / Deprecated / Superseded by ADR-NNNN |
| Context | The forces at play — technical, organisational, domain. Written in value-neutral language: what was true, not what we wanted. |
| Decision | The response to those forces, stated actively: "We will…" |
| Consequences | What becomes easier and what becomes harder. Both. A consequences section with no downsides is a sales pitch. |
Records are immutable once accepted. A decision that changes gets a new record that supersedes the old one; the old one stays, with its status updated. The history of what was believed and when is the point.
The records
| # | Title | Status |
|---|---|---|
| 0001 | Hexagonal (ports and adapters) architecture | Accepted |
| 0002 | Industry-standard hierarchical location code over a flat identifier | Accepted |
| 0003 | PlacementRules enforced once at registration time | Accepted |
| 0004 | RFC 7807 problem details from the first commit | Accepted |
| 0005 | One-way decommission, no reactivation in v1 | Accepted (concurrency guarantee added by ADR-0025) |
| 0006 | Bulk import reports partial success per row | Accepted |
| 0007 | Model Context Protocol as an inbound adapter, not a new service | Accepted (auth section superseded by ADR-0015) |
| 0008 | Location classification read endpoint | Accepted |
| 0009 | Kafka integration publisher for the Published Language | Accepted (envelope superseded by ADR-0024) |
| 0010 | Per-service analytical data product (the "report") | Accepted (analytics envelope superseded by ADR-0024) |
| 0011 | Adoption of the fleet-wide micro-frontend console architecture (warehouse-ops-agent ADR-0002) | Accepted |
| 0012 | Standard metrics convention across the fleet | Accepted |
| 0013 | inventory-storage is the first real consumer of the Published Language | Accepted |
| 0014 | Adopt the fleet REST identity standard (static bearer keys, read/read-write scopes; warehouse-ops-agent ADR 0005) | Superseded by ADR-0015 |
| 0015 | Remove the static-bearer REST/MCP auth layer (reverts 0014 and the auth portion of 0007) | Accepted |
| 0016 | Functional location roles beyond storage (Dock, Yard, WorkCenter, Drop, QC, Consolidation, Shipping) | Accepted |
| 0017 | Physical geometry and a travel-distance read model | Accepted (amended in place, 2026-10) |
| 0018 | Transactional outbox + relay for atomic event publishing | Accepted (per-key ordering amended by ADR-0036) |
| 0019 | Transactional Idempotency-Key middleware for resource-creation POSTs | Accepted |
| 0020 | Kafka consumer dead-letter queue and graceful shutdown hardening | Accepted |
| 0021 | Kafka writer Balancer switched from LeastBytes to Hash | 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 |
| 0025 | Optimistic concurrency (version column) on LocationSlot | Accepted (extended to Site by ADR-0035) |
| 0026 | Housekeeping sweeper for idempotency_keys and published outbox rows | Accepted |
| 0027 | Write-capable console screens (extends ADR-0011's read-only adoption) | Accepted |
| 0028 | Boot retry for Istio sidecar resets and a matching startupProbe | Accepted |
| 0029 | Gateway API HTTPRoute exposure template | Accepted |
| 0030 | DLQ topic-not-ready bounded retry and the slog-to-OTel bridge | Accepted |
| 0031 | Kafka writer durability: RequireAll acks with a 10ms batch timeout | Accepted |
| 0032 | Key geometry, structure and cross-aisle events by aggregate identity (extends ADR-0021) | Accepted (import-event key confirmed by ADR-0034) |
| 0033 | MCP tool errors follow the fleet convention: <slug>: detail (refines ADR-0007, reuses ADR-0004 slugs) | Accepted |
| 0034 | FacilityLayoutImported stays keyed by its CloudEvents id (confirms ADR-0032) | Accepted |
| 0035 | Site transfer-capability command raises SiteCapabilityChanged (extends ADR-0025 to Site; payload casing kept) | Accepted |
| 0036 | Outbox relay attempt cap: OUTBOX_MAX_ATTEMPTS (default 20) excludes a poison row and logs it at ERROR (amends ADR-0018 per-key ordering) | Accepted |
| 0037 | Site role: an explicit network role on the Site aggregate, PUT /sites/{siteCode}/role, SiteRoleChanged, one-time name backfill and GET /site-roles/transfer-defaults (extends ADR-0035) | Accepted |
| 0038 | The W3C trace context crosses the outbox in outbox_events.headers (migration 0010; D27 / gap 15d, after order-management ADR 0041) | Accepted |
| 0039 | Postgres and Kafka are the only runtime: no in-memory mode, no log publisher, no optional relay; mandatory config is a boot error naming the variable; /readyz checks Postgres and a broker; sensors, the contract job and the chart enforce it (fleet decision 2026-10-17) | Accepted |
| 0040 | A slot declares the handling unit it accepts: optional handlingUnit (EACH|CASE|PALLET) on LocationSlot, PUT /locations/{code}/handling-unit, additive on LocationSlotRegistered, new LocationSlotHandlingUnitDeclared event | Accepted |
| 0041 | Site capability heartbeat: every SITE_CAPABILITY_HEARTBEAT_INTERVAL (default 5m) the current SiteCapabilityChanged of each active, declared site is re-published through the outbox with a fresh time and capability_revision + 1 (NIP only supersedes on a strictly greater revision), so its 10 minute freshness window holds; a PUT of the current value stays a no-op (extends ADR-0035) | Accepted |
| 0042 | The case-pick zone is a convention on the free-form zone class: CPK (alongside FWD, BLK, RSV), not a new type; no schema or event change, nothing validates it | Accepted |
| 0043 | A2A inbound adapter (third driving adapter): two curated read skills, site_layout and travel_distance, over the same read use cases as REST and MCP; no write skill because the MCP surface is read-only; message-only, problems answered in-band with the REST status; cmd/a2a on 8093 | Accepted |
| 0044 | Adopt the fleet REST API guideline: noun routes (/location-imports, /locations/{code}/decommissionings), every POST keyed with a global Idempotency-Key (409 on reuse, Idempotency-Replayed), keyset-paginated {items,nextCursor} collections; hard cutover | Accepted |
| 0045 | GS1 location identity: optional gln (13 digits, mod-10 check digit, unique across every site, zone and slot) on Site, Zone and LocationSlot, and optional spotKind on Yard slots (PARKING, HOLDING, REEFER_PLUG, HAZMAT, STAGING_LANE); set at registration, carried additively on SiteRegistered, ZoneRegistered and LocationSlotRegistered; invalid-gln, gln-already-assigned, spot-kind-not-allowed | Accepted |
| 0046 | Every problem type has an idempotency replay class (FINAL, OUTCOME, RETRYABLE) declared on its catalogue entry; a RETRYABLE refusal (concurrent-modification, a parent not registered yet, a rule defined later) and a 5xx are not stored and release the key; narrows ADR 0019 and ADR 0044 | Accepted |
| 0047 | Exactly one concurrent creation of the same code wins: a new Site/LocationSlot carries version 0 so the version-guarded upsert can never overwrite a committed row; the non-versioned creation repos get a narrow Create (INSERT ... ON CONFLICT DO NOTHING) answering ports.ErrNaturalKeyTaken; every register use case maps the lost race to its FINAL duplicate-* refusal (fixes the ADR 0046 follow-up; no wire change, no migration) | Accepted |
| 0048 | The AutomatedStorage location type: well-known AutomatedStorage (role Storage), AsrsPort and HandoffPoint (role Drop) with a canonical-role check (422 location-type-role-mismatch); one active AutomatedStorage slot per aisle (409 automated-storage-already-in-aisle, partial unique index) and AsrsPort slots only in such an aisle (422 asrs-port-without-automated-storage); WorkCenter activity Pick. No new role, field or event. | Accepted |
The Kafka record that was deferred until the adapter existed
Earlier revisions of this index noted that, unlike the sibling services, this
repository had no Kafka/CloudEvents ADR — because it published no
integration events. It had an in-process log publisher, a buffered test
publisher, and a Postgres events outbox that nothing drained. Writing that
ADR then would have documented a decision nobody had made.
That moment has now arrived: ADR 0009
adds the broker adapter that publishes this service's full Published Language to
warehouse.facility.events, selected by EVENT_PUBLISHER=kafka. The unused
events table was later replaced by a drained transactional outbox
(outbox_events + relay, ADR 0018), and
the envelope became CloudEvents 1.0
(ADR 0024). The
CloudEvents type naming convention (see
Domain events) is now backed by an actual publisher.
See Context map.
Proposing a new one
- Copy the most recent record and renumber it. Numbers are never reused, even if a record is later withdrawn.
- Write the Context first, and write it neutrally. If the context section already argues for the outcome, the decision was not really open.
- Write Consequences honestly, including the ones you dislike. That section is what makes the record useful to whoever has to revisit it.
- Open it as
Proposed. Flip it toAcceptedwhen it is agreed, or leave itProposedand supersede it later if the discussion goes elsewhere. - Add it to the table above and to
sidebars.ts.