Skip to main content

Architecture decision records

Every ADR of product-master, in number order. The Status column is copied from each ADR's own ## Status section (one exception, ADR 0011, explained under Status notes); the ADR bodies are immutable, so a change of decision is recorded in a new ADR that supersedes the old one.

NumberTitleStatus
0001product-master as the owner of SKU-level product master dataAccepted (2026-10-06)
0002Physical profile, declared versus measuredAccepted (2026-10-06)
0003Migrating classification ownership from inventory-storageAccepted (2026-10-06); companion decisions: inventory-storage ADR 0034 (hand-over) and one ADR in each of order-management, wes-work-planning and fulfillment-execution (local copy instead of live lookup)
0004CloudEvents envelope and type catalogueAccepted (2026-10-06); per-key ordering amended by 0007
0005MCP server adoption (read-only, unauthenticated, additive)Accepted (2026-10-07)
0006Analytics read side: an analytics stream, a projector and a master data quality report over a separate analytical databaseAccepted (2026-10-07); additive
0007Outbox relay attempt cap (OUTBOX_MAX_ATTEMPTS)Accepted (2026-10-13)
0008The analytics projector sets up telemetry; every backend Deployment sets ENVIRONMENTAccepted (2026-10-13); additive
0009The W3C trace context crosses the outbox to KafkaAccepted (2026-10-13); additive
0010Postgres and Kafka are the only runtime (no in-memory mode, no log sink, real /readyz)Accepted (2026-10-19)
0011Packaging hierarchy with GS1 GTIN; eaches are the ledger unitAccepted - implemented (the Status line was flipped from "Proposed (2026-10-23)" on 2026-11-14; see Status notes); amends 0005 (two MCP write tools)
0012A2A inbound adapter (third driving adapter): product_profile (read) and declare_pack_level (write), delegation onlyAccepted (2026-10-29); additive
0013Adopt the fleet REST API guideline: noun route for retirement, Idempotency-Key on the one POST (409 reuse, Idempotency-Replayed), keyset-paged collectionsAccepted (2026-11-01); breaking
0014Agent authority levels and complete MCP surface: every tool/skill declares L1 or L3, the handler is stateless (2026-07-28), one resource + one promptAccepted (2026-11-02); additive
0015Every problem type has a replay class; a RETRYABLE refusal is not stored (amends 0013 item 2)Accepted (2026-11-20); additive

Where each decision lives in the code​

ADRMain code
0001internal/domain/product (the Product aggregate), apis/openapi.yaml, apis/asyncapi.yaml
0002internal/domain/product/physical.go (declared, measured, effective, 10% discrepancy)
0003importer removed at stage E (2026-10-17); internal/adapters/inbound/kafka/kafka.go
0004internal/adapters/kafka/cloudevents/cloudevents.go, internal/adapters/outbound/kafka/encoder.go
0005cmd/mcp, internal/adapters/inbound/mcp
0006cmd/product-projector, cmd/product-reports, internal/analytics/report, internal/adapters/outbound/analyticsstore, analytics/migrations
0007internal/adapters/outbound/outbox/relay.go (WithMaxAttempts), internal/adapters/outbound/postgres/outbox_repository.go (claim), cmd/api/config.go (outboxMaxAttempts)
0008cmd/product-projector/main.go (setupTelemetry), charts/product-master/templates/{projector,reports}-deployment.yaml
0009internal/adapters/outbound/postgres/outbox_repository.go (Insert, traceHeaders), internal/adapters/outbound/kafka/relay_sink.go
0010cmd/api/{config,adapters,relay,main}.go, cmd/mcp/main.go, cmd/product-projector/main.go, internal/adapters/inbound/http/readiness.go, internal/adapters/outbound/kafka/health.go, internal/architecture/runtime_no_memory_fitness_test.go, charts/product-master/templates/_helpers.tpl
0011internal/domain/product/packaging.go (PackagingHierarchy), internal/adapters/outbound/postgres/migrations/0002_product_pack_levels.up.sql, apis/openapi.yaml, apis/asyncapi.yaml, web/src/screens/PackagingScreen.tsx
0012cmd/a2a, internal/adapters/inbound/a2a, charts/product-master/templates/a2a-*.yaml
0013internal/adapters/inbound/http/{idempotency,paging,server}.go, internal/adapters/inbound/http/page, internal/adapters/outbound/postgres/idempotency_store.go, internal/adapters/outbound/postgres/migrations/0003_idempotency_keys.up.sql, .spectral.yaml
0014internal/adapters/inbound/mcp/{authority.go,resources.go,prompts.go,server.go,tools.go}, internal/adapters/inbound/a2a/server.go, internal/adapters/inbound/mcp/testdata/tool_registry.golden.json, internal/architecture/mcp_authority_fitness_test.go
0015internal/adapters/inbound/http/{errors,idempotency,response,export_test}.go, internal/adapters/inbound/http/idempotency_classes_test.go, internal/adapters/inbound/http/idempotency_replay_classes_integration_test.go, internal/adapters/inbound/http/idempotency_replay_classes_wiring_integration_test.go, internal/adapters/inbound/http/retryable_replay_integration_test.go

Status notes​

ADR 0011's Status line was never updated after it was built. It was flipped to Accepted on 2026-11-14; this note keeps the history.

  • 0011 (the body read "Proposed (2026-10-23). Nothing in this ADR is built" until 2026-11-14): Accepted - implemented, checked against origin/develop on 2026-11-13.
    • Design merged in PR #60 (2026-10-24); implementation merged in PR #61 "feat(packaging): pack levels with GS1 GTINs (ADR 0011)" (2026-10-24, commit 70d8eac).
    • Schema: internal/adapters/outbound/postgres/migrations/0002_product_pack_levels.up.sql.
    • REST (apis/openapi.yaml): GET /products/{sku}/pack-levels (listPackLevels), PUT /products/{sku}/pack-levels/{level} (declarePackLevel), POST /products/{sku}/pack-levels/{level}/retirements (retirePackLevel), PUT /products/{sku}/pack-levels/{level}/measured (recordPackLevelMeasurement), GET /gtins/{gtin} (resolveGtin).
    • MCP write tools declare_pack_level and retire_pack_level (internal/adapters/inbound/mcp/tools.go), which amend ADR 0005 as the ADR said.
    • A2A skill declare_pack_level (internal/adapters/inbound/a2a/skills.go, see ADR 0012).
    • Web Packaging screen: web/src/screens/PackagingScreen.tsx.

Back to the documentation.