Skip to main content

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​

#TitleStatus
0001Hexagonal (ports & adapters) architectureAccepted
0002A new bounded context, not an extension of workforce-management or fulfillment-executionAccepted
0003Kafka choreography consumer of fulfillment-execution, no REST dependencyAccepted
0004StandardSecondsAtCompletion is frozen at ingestion time, never recomputedAccepted
0005Associate Trend and CoachingFlag on the Scorecard read modelAccepted
0006MeanActualSeconds on TaskTypePerformance, independent of any standardAccepted
0007Per-service analytical data product (the "Labor Performance Report")Accepted
0008Standard metrics convention across the fleetAccepted
0009Model Context Protocol as an inbound adapter, not a new serviceAccepted — auth/scope sections superseded by 0012
0010Transactional outbox for the analytics topicAccepted (amended by 0032)
0011REST identity — fleet-standard static bearer keys with read/read-write scopesSuperseded by 0012
0012Remove the REST/MCP identity layerAccepted
0013Labor performance publishes an integration eventAccepted
0014Measuring idleness and utilizationAccepted
0015Optional travel-time component on a LaborStandardAccepted
0016Transactional Idempotency-Key middleware for POST /standardsAccepted
0017Kafka consumer dead-letter queue and graceful shutdown hardeningAccepted
0018Key-aware Hash balancer on every outbound Kafka writerAccepted
0019Per-workload HorizontalPodAutoscaler and pgxpool MaxConns/statement_timeout tuningAccepted
0020Run golang-migrate against a direct Postgres connection, not PgBouncerAccepted
0021CloudEvents 1.0 as the mandatory event envelopeAccepted
0022Optimistic concurrency and one open standard per task type on labor_standardsAccepted
0023Housekeeping sweeper for idempotency keys and published outbox rowsAccepted
0024labor-mfe: a chart-shipped, disabled-by-default frontend remoteAccepted
0025RFC 7807 Problem Details for every REST errorAccepted
0026arch-go architecture fitness tests, enforced in CIAccepted
0027Boot-time dial retry (bootretry) + Kubernetes startupProbeAccepted
0028Gateway API HTTPRoute, disabled by default, alongside IngressAccepted
0029Kafka writer durability: RequireAll acks + 10ms BatchTimeoutAccepted
0030MCP eval suite and governance gate, run as plain go testAccepted
0031Analytics consumer: atomic claim + apply, commit after success, retry transient failuresAccepted
0032Outbox relay attempt cap (OUTBOX_MAX_ATTEMPTS)Accepted
0033MCP tool invocation and denial counters (governance charter §9)Accepted
0034Postgres and Kafka are the only runtime (no in-memory mode, no log sink, no optional relay or consumer)Accepted
0035Engineered standards per handling unit (EACH, CASE, PALLET), most specific wins, and a declared heavy-case team liftProposed
0036A2A inbound adapter: a read-only Agent2Agent agent (associate_scorecard, task_type_status) over the same read use cases, no write and no outbound clientAccepted
0037Adopt the fleet REST API guideline: noun routes, every POST/PATCH idempotent (global key, 409 idempotency-key-reused, Idempotency-Replayed), no collection GET to paginate, Spectral rest-guideline rulesetAccepted
0038LaborStandardDefined/LaborStandardRevised also published on the integration topic (same payload) for warehouse-planning's local copy; optional site_code scope on a standard; scoring unchangedAccepted
0039Every problem type has an idempotency replay class (FINAL, OUTCOME, RETRYABLE) declared on its catalogue entry; a RETRYABLE refusal (concurrent-modification, standard-conflict, a 404 on a fact not known yet) is not stored and its key is releasedAccepted

The Status column repeats each record's own ## Status section. Four records whose bodies say plain Accepted have since been partly overtaken. The Kafka envelope described in 0003, 0007, 0010 and 0013 was replaced by the CloudEvents 1.0 envelope of 0021. Their other decisions still stand. Separately, 0034 retired the in-memory runtime, the log publisher, the direct (non-outbox) publish path and the localhost broker default that 0001, 0007, 0009, 0010, 0013 and 0016 describe; each of those carries a pointer.

Each of these reconstructs a decision that is actually visible in this repository's history, CLAUDE.md or code — none is a generic placeholder.

Proposing a new one​

  1. Copy the template above into docs/docs/adr/NNNN-short-kebab-title.md, taking the next free number.
  2. Open it with Status: Proposed.
  3. 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.
  4. Fill in Consequences honestly, including the ones you dislike.
  5. Add it to the table above and to sidebars.ts.
  6. Raise it as a pull request; the discussion belongs on the PR, not inside the record.
  7. 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; the bounded-context boundary decision; the integration transport and envelope; 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.