warehouse-systems fleet · executive briefing

inventory-storage

Knows exactly where every item sits and how much we can safely promise
ten capabilitys2 events out · 5 in52 recorded decisions

This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic. · November 2026

the short version · read this if nothing else

Inventory storage is the stock truth: every item has one known bin or is flagged lost, never in between

1

Two scans per stow mean every item has one known bin or is openly flagged unlocated.

2

Reservations can be revoked, so a failed pick or delivery never strands an order.

3

Usable stock is on-hand minus holds and lost items, so promises match the shelf.

The ask

Check stow against facility-layout's slot catalogue, not just the local bin list, and add placement policy.

why it exists

With no fixed bins, software must know where every item is

Owns the 'storing them under chaotic storage' clause of the platform vision and the stock truth everything downstream depends on. Under chaotic (random) stow there is no fixed product location, so the software must answer authoritatively where each SKU is (which bin, how many) and how much of it can actually be promised…

Today

Goods are stowed wherever there is room; a two-scan rule records each bin, and orders hold revocable reservations on usable stock.

The catch

Postgres and Kafka are hard requirements, and 19 event types are consumed elsewhere, so payload changes ripple.

what it does

Six capabilities keep stock findable and promises honest

Chaotic-storage stow

Stowing needs an item scan and a bin scan, and a full bin says no.

Revocable reservations

Orders hold stock against a named pick bin and can release it cleanly.

Usable stock view

Each SKU shows what can really be promised: on hand minus holds and lost items.

Cycle counting

Counts that come up short flag stock as unlocated instead of hiding the gap.

Relocation and replenishment

Moves stock between bins within a site and publishes where it went.

Containers and sealed cases

Tracks pallets and cases, breaks cases, and keeps owners' stock apart.

who it talks to

Four contexts feed it, five build on what it publishes

LISTENS TO · 7 EVENT TYPESIS HEARD BY · 5 CONTEXTSfacility-layout3product-master2network-inventory-planning1returns-processing1exception-management5pick-face-replenishment2inbound-receiving1network-inventory-planning1slotting-optimization1inventorystoragebadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

Stock units, bins, reservations and containers are the core words

THE LANGUAGEOF THE DOMAINStockUnitBin aggregateReservationContainer aggregateProductClassificationShared value objects
REST25 operations over 23 paths on :8080
MCPMCP server (cmd/mcp, :8090, Streamable HTTP): 6 tools…
A2AA2A agent (cmd/a2a, :8093, JSON-RPC over HTTP…
how it is built

A pure domain core with ports for every outside dependency

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808025 operations over 23 pathsMCP tools :8090MCP server (cmd/mcp, :8090…Kafka consumer · 5 eventsfacility.eventsevents: ProductClassified…DOMAIN COREStockUnitBin aggregateReservationContainer aggregatePostgreSQLPostgres OLTP via pgxpool…Kafka producer · 2 eventsinventory.eventsinventory.analyticsTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

14 facts come in, and 23 stock and analytics facts go out

CONSUMED · BY SOURCE · 8PUBLISHED · BY ENTITY · 2facility-layout 3product-master 2network-inventory-plann… 1returns-processing 1unattributed 12 inventory
how we know it is healthy

Traces follow a reservation across services without leaking SKUs

OpenTelemetry traces and metrics over OTLP/gRPC to a Collector (no /metrics endpoint; Collector owns Prometheus exposition), wired in all five binaries via telemetry.Setup…

What we watch

  • Server spans named by chi route pattern; mcp.tool <name> spans; otelpgx spans with normalized SQL so SKUs/bin codes never leave the process as span…
  • kafka.publish spans with W3C traceparent injected into message headers (outbox keeps the originating request's trace) so the reserve -> release path…

What stops a bad change

  • make check / check-fast / check-all / mutation / integration mirroring CI locally; lefthook pre-commit and pre-push hooks
  • CI: golangci-lint, complexity and file-length gates, >=90% domain+application coverage, live Postgres/Kafka integration via testcontainers…
by the numbers

52 decisions and 20 migrations shape the stock truth

52
Architecture decisions
#2 of 45 in the fleet
20
DB migrations
#2 of 45 in the fleet
28
BDD feature files
#2 of 45 in the fleet
2
Events published
#30 of 45 in the fleet

Ranked against all 45 briefed repositories (dot = one repository, highest on the left).

One-command workflows (make)

check-fastcheckcheck-allcoverageintegrationbddcontractarch-testmutationmutation-fullvuln
competitive position

Against the market leaders, we cover part of the ground

PartialInventory & Storage vs Manhattan, Blue Yonder, SAP EWM, Körber, SSI Schäfer

Where we match or lead

  • Chaotic-storage stow with item-scan + location-scan invariant and bin-capacity enforcement
  • Revocable reservations with allocations naming the pick bin
  • Cycle counting that marks shortfalls Unlocated and emits DiscrepancyDetected
  • DOT hazard-class matrix for hazmat/temperature placement

Gaps to close

  • High No lot/batch, serial or expiry (FEFO) traceability in the documented model
  • Medium No directed putaway: leaders assign bins by size and access frequency
  • Medium Cycle-count overage reconciliation deferred to a separate, unbuilt process
  • Medium No ERP/physical-inventory reconciliation connector

Leader capabilities are vendor-published; gaps reflect repo docs reviewed in November 2026.

what comes next

Next: tighten stow checks, reconcile overages, add a DLQ replay tool

NOW1Check stow againstthefacility-layoutStowStock only checksthat the bin exists inthe local LocationRepo,not againstfacility-layout's slotcatalogue; placementpolicy forOversized/HighValue/Fra…NEXT2Decide FEFO andcommingling byGTIN forContainer scope leavesFEFO (lot and expirycarried only) andcommingling by GTIN outof scope (ADR-0045)NEXT3Reconcilecycle-countoverages properlyCycle-count overagehandling is deliberatelysimple:DiscrepancyDetected +CycleCountCompleted(discrepancy=true)await a separatereceiving/audit processto reconcileLATER4Add a DLQ replaytool for poisonoutbox rowsOutbox relay poison rows(OUTBOX_MAX_ATTEMPTS,default 20) are onlylogged at ERROR; amanual DLQ replay toolwas left out of scope(ADR-0020, ADR-0038)LATER5Turn on MCP, A2Aand reports in thechartLOCATION_LOOKUP_MODE=httpis retained as therollback path for thekafka facilitycache(ADR-0013); chartdefaults keep mcp, a2aand the reports workloadoff …
what could go wrong · and what we do about it

Our biggest risk is hard dependence on Postgres and Kafka at boot

No auth on REST, MCP or A2A, writes included, by decision

Every REST, MCP and A2A endpoint is unauthenticated by decision (ADR-0015, guarded by an arch-test)…

→

No mitigation on the roadmap yet: this one needs an owner.

Postgres and Kafka are the only runtime

Postgres and Kafka are the only runtime (ADR-0042): no in-memory mode, relay and all consumers always on…

→

/readyz checks both, and there is no in-memory mode to hide a broken setup.

Kafka layout replay blocks startup in kafka mode

Kafka facilitycache replay blocks startup until complete, coupling boot readiness to broker availability when…

→

The http lookup mode stays as the rollback path.

19 event types are consumed: breaking changes need .v2

warehouse.inventory.events now carries 19 event types consumed by other contexts…

→

A breaking payload change ships as a new .v2 type with its own dataschema.

the decision we need

Check stow against facility-layout's slot catalogue, not just the local bin list, and add placement policy.

WHAT ISGoods are stowed wherever there isroom; a two-scan rule records eachbin, and orders hold revocablereservations on usable stock.THE CATCHPostgres and Kafka are hardrequirements, and 19 event types areconsumed elsewhere, so payloadchanges ripple.WHAT COULD BEStow checked against the real map,placement rules for oversized andfragile items, and a replay path forpoison outbox rows.
Why it matters

Inventory storage is the stock truth: every item has one known bin or is flagged lost, never in between

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal / ports and adapters with strict dependency rule (domain pure Go, no SQL types; application depends only on ports) enforced by arch-go and extra fitness tests…
Layoutcmd/{inventory,inventory-projector,inventory-reports,mcp,a2a}; internal/{domain (location,stock,reservation,product,container,packaging,relocation,transfer,allocation,shared)…
StoragePostgres OLTP via pgxpool with golang-migrate (20 OLTP *.up.sql migrations + 1 analytics) + idempotency_keys + transactional outbox and relay…
TestingUnit tests with a named failing-path test per invariant (bin-capacity rejection, stow requires item+location, reservation <= usable, revoke returns to usable)…
REST25 operations over 23 paths on :8080: /healthz, /readyz, /stock-receipts, /stowages, /reservations, /reservations/{id}…
Gochi routerpgx/v5 + pgxpoolgolang-migratesegmentio/kafka-goCloudEvents sdk-go v2OpenTelemetrymodelcontextprotocol/go-sdkA2A agentgodog BDDarch-go fitness testsgremlins mutation testing