Skip to main content

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:

SectionContains
TitleA short noun phrase naming the decision
StatusProposed / Accepted / Deprecated / Superseded by ADR-NNNN
ContextThe forces at play — technical, organisational, domain. Written in value-neutral language: what was true, not what we wanted.
DecisionThe response to those forces, stated actively: "We will…"
ConsequencesWhat 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​

#TitleStatus
0001Hexagonal (ports and adapters) architectureAccepted
0002Industry-standard hierarchical location code over a flat identifierAccepted
0003PlacementRules enforced once at registration timeAccepted
0004RFC 7807 problem details from the first commitAccepted
0005One-way decommission, no reactivation in v1Accepted (concurrency guarantee added by ADR-0025)
0006Bulk import reports partial success per rowAccepted
0007Model Context Protocol as an inbound adapter, not a new serviceAccepted (auth section superseded by ADR-0015)
0008Location classification read endpointAccepted
0009Kafka integration publisher for the Published LanguageAccepted (envelope superseded by ADR-0024)
0010Per-service analytical data product (the "report")Accepted (analytics envelope superseded by ADR-0024)
0011Adoption of the fleet-wide micro-frontend console architecture (warehouse-ops-agent ADR-0002)Accepted
0012Standard metrics convention across the fleetAccepted
0013inventory-storage is the first real consumer of the Published LanguageAccepted
0014Adopt the fleet REST identity standard (static bearer keys, read/read-write scopes; warehouse-ops-agent ADR 0005)Superseded by ADR-0015
0015Remove the static-bearer REST/MCP auth layer (reverts 0014 and the auth portion of 0007)Accepted
0016Functional location roles beyond storage (Dock, Yard, WorkCenter, Drop, QC, Consolidation, Shipping)Accepted
0017Physical geometry and a travel-distance read modelAccepted (amended in place, 2026-10)
0018Transactional outbox + relay for atomic event publishingAccepted (per-key ordering amended by ADR-0036)
0019Transactional Idempotency-Key middleware for resource-creation POSTsAccepted
0020Kafka consumer dead-letter queue and graceful shutdown hardeningAccepted
0021Kafka writer Balancer switched from LeastBytes to HashAccepted
0022Per-workload HorizontalPodAutoscaler and pgxpool MaxConns/statement_timeout tuningAccepted
0023Run golang-migrate against a direct Postgres connection, not PgBouncerAccepted
0024CloudEvents 1.0 as the mandatory event envelopeAccepted
0025Optimistic concurrency (version column) on LocationSlotAccepted (extended to Site by ADR-0035)
0026Housekeeping sweeper for idempotency_keys and published outbox rowsAccepted
0027Write-capable console screens (extends ADR-0011's read-only adoption)Accepted
0028Boot retry for Istio sidecar resets and a matching startupProbeAccepted
0029Gateway API HTTPRoute exposure templateAccepted
0030DLQ topic-not-ready bounded retry and the slog-to-OTel bridgeAccepted
0031Kafka writer durability: RequireAll acks with a 10ms batch timeoutAccepted
0032Key geometry, structure and cross-aisle events by aggregate identity (extends ADR-0021)Accepted (import-event key confirmed by ADR-0034)
0033MCP tool errors follow the fleet convention: <slug>: detail (refines ADR-0007, reuses ADR-0004 slugs)Accepted
0034FacilityLayoutImported stays keyed by its CloudEvents id (confirms ADR-0032)Accepted
0035Site transfer-capability command raises SiteCapabilityChanged (extends ADR-0025 to Site; payload casing kept)Accepted
0036Outbox relay attempt cap: OUTBOX_MAX_ATTEMPTS (default 20) excludes a poison row and logs it at ERROR (amends ADR-0018 per-key ordering)Accepted
0037Site 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
0038The W3C trace context crosses the outbox in outbox_events.headers (migration 0010; D27 / gap 15d, after order-management ADR 0041)Accepted
0039Postgres 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
0040A slot declares the handling unit it accepts: optional handlingUnit (EACH|CASE|PALLET) on LocationSlot, PUT /locations/{code}/handling-unit, additive on LocationSlotRegistered, new LocationSlotHandlingUnitDeclared eventAccepted
0041Site 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
0042The 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 itAccepted
0043A2A 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 8093Accepted
0044Adopt 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 cutoverAccepted
0045GS1 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-allowedAccepted
0046Every 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 0044Accepted
0047Exactly 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
0048The 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​

  1. Copy the most recent record and renumber it. Numbers are never reused, even if a record is later withdrawn.
  2. Write the Context first, and write it neutrally. If the context section already argues for the outcome, the decision was not really open.
  3. Write Consequences honestly, including the ones you dislike. That section is what makes the record useful to whoever has to revisit it.
  4. Open it as Proposed. Flip it to Accepted when it is agreed, or leave it Proposed and supersede it later if the discussion goes elsewhere.
  5. Add it to the table above and to sidebars.ts.