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 | A new bounded context, not an extension of workforce-management or fulfillment-execution | Accepted |
| 0003 | Kafka choreography consumer of fulfillment-execution, no REST dependency | Accepted |
| 0004 | StandardSecondsAtCompletion is frozen at ingestion time, never recomputed | Accepted |
| 0005 | Associate Trend and CoachingFlag on the Scorecard read model | Accepted |
| 0006 | MeanActualSeconds on TaskTypePerformance, independent of any standard | Accepted |
| 0007 | Per-service analytical data product (the "Labor Performance Report") | Accepted |
| 0008 | Standard metrics convention across the fleet | Accepted |
| 0009 | Model Context Protocol as an inbound adapter, not a new service | Accepted — auth/scope sections superseded by 0012 |
| 0010 | Transactional outbox for the analytics topic | Accepted (amended by 0032) |
| 0011 | REST identity — fleet-standard static bearer keys with read/read-write scopes | Superseded by 0012 |
| 0012 | Remove the REST/MCP identity layer | Accepted |
| 0013 | Labor performance publishes an integration event | Accepted |
| 0014 | Measuring idleness and utilization | Accepted |
| 0015 | Optional travel-time component on a LaborStandard | Accepted |
| 0016 | Transactional Idempotency-Key middleware for POST /standards | Accepted |
| 0017 | Kafka consumer dead-letter queue and graceful shutdown hardening | Accepted |
| 0018 | Key-aware Hash balancer on every outbound Kafka writer | Accepted |
| 0019 | Per-workload HorizontalPodAutoscaler and pgxpool MaxConns/statement_timeout tuning | Accepted |
| 0020 | Run golang-migrate against a direct Postgres connection, not PgBouncer | Accepted |
| 0021 | CloudEvents 1.0 as the mandatory event envelope | Accepted |
| 0022 | Optimistic concurrency and one open standard per task type on labor_standards | Accepted |
| 0023 | Housekeeping sweeper for idempotency keys and published outbox rows | Accepted |
| 0024 | labor-mfe: a chart-shipped, disabled-by-default frontend remote | Accepted |
| 0025 | RFC 7807 Problem Details for every REST error | Accepted |
| 0026 | arch-go architecture fitness tests, enforced in CI | Accepted |
| 0027 | Boot-time dial retry (bootretry) + Kubernetes startupProbe | Accepted |
| 0028 | Gateway API HTTPRoute, disabled by default, alongside Ingress | Accepted |
| 0029 | Kafka writer durability: RequireAll acks + 10ms BatchTimeout | Accepted |
| 0030 | MCP eval suite and governance gate, run as plain go test | Accepted |
| 0031 | Analytics consumer: atomic claim + apply, commit after success, retry transient failures | Accepted |
| 0032 | Outbox relay attempt cap (OUTBOX_MAX_ATTEMPTS) | Accepted |
| 0033 | MCP tool invocation and denial counters (governance charter §9) | Accepted |
| 0034 | Postgres and Kafka are the only runtime (no in-memory mode, no log sink, no optional relay or consumer) | Accepted |
| 0035 | Engineered standards per handling unit (EACH, CASE, PALLET), most specific wins, and a declared heavy-case team lift | Proposed |
| 0036 | A2A inbound adapter: a read-only Agent2Agent agent (associate_scorecard, task_type_status) over the same read use cases, no write and no outbound client | Accepted |
| 0037 | Adopt 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 ruleset | Accepted |
| 0038 | LaborStandardDefined/LaborStandardRevised also published on the integration topic (same payload) for warehouse-planning's local copy; optional site_code scope on a standard; scoring unchanged | Accepted |
| 0039 | Every 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 released | Accepted |
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
- 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; 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.