warehouse-systems fleet · executive briefing

inbound-receiving

Gets supplier trucks counted and checked before goods become stock
nine capabilitys11 events out · 11 in25 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

Inbound receiving turns an announced truck into counted, checked stock without calling any other team live

1

It owns the dock story from ship notice to counted receipt, up to but not including stock placement.

2

Discrepancies surface when a receipt closes, so only good units ever become stock.

3

Events and local copies keep it decoupled, with no live calls in either direction.

The ask

Retire the frozen appointment surface now that dock-scheduling owns door bookings.

why it exists

It closes the gap between a truck announced and stock staged

Owns the inbound dock workflow up to, but not including, stock placement: the supplier's advance ship notice (ASN), a read-only copy of the carrier's booked dock door window (the DockAppointment moved to dock-scheduling, ADR 0019) and the counted physical receipt whose close raises coded discrepancies and a receiving advice…

Today

Suppliers send ship notices, dock teams count cartons, and good units hand over to storage by event.

The catch

Postgres and Kafka are hard requirements with no fallback, and the old appointment API is retired but still lingers read-only.

what it does

Six jobs take a truck from announcement to clean stock

ASN registration

Suppliers announce what is coming, carton by carton, before the truck arrives.

Read-only appointment copy

Keeps a local copy of door bookings from dock-scheduling; booking moved away.

Carton-aware receiving

Teams scan whole cases and print carton labels instead of counting every unit.

Discrepancy management

Short, over and damaged goods surface, with coded findings, at scan and close.

Receiving advice

Tells the supplier what arrived and flags advice that runs past its SLA.

Handover to storage

Only good units become stock; damaged ones are recorded but never booked.

who it talks to

Five contexts feed it, four build on what it publishes

LISTENS TO · 11 EVENT TYPESIS HEARD BY · 4 CONTEXTSdock-scheduling4product-master3facility-layout2inventory-storage1yard-management1yard-management4dock-scheduling2network-fulfillment2exception-management1inboundreceivingbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

Ship notices, receipts and local copies carry the whole story

THE LANGUAGEOF THE DOMAINAsnReceiptAppointmentshared value typesRead models fed by Kafka…
REST23 operations over 20 paths on :8080
MCPMCP server (cmd/mcp, :8090, Streamable HTTP…
A2ARead-only A2A agent (cmd/a2a, :8093…
how it is built

Five binaries share one strict hexagon around the dock rules

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808023 operations over 20 pathsMCP tools :8090MCP server (cmd/mcp, :8090…Kafka consumer · 11 eventsproduct.ProductRegisteredProductPackLevelDeclaredDOMAIN COREAsnReceiptAppointmentshared value typesPostgreSQLPostgres OLTPKafka producer · 11 eventsasn.ASNRegisteredasn.ASNCancelledTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

11 dock facts go out, each with an analytics twin, and 11 come in

CONSUMED · BY SOURCE · 11PUBLISHED · BY ENTITY · 11dock-scheduling 4product-master 3facility-layout 2inventory-storage 1yard-management 18 receipt3 asn
how we know it is healthy

Traces and business counters exist, but logs do not carry trace ids

OpenTelemetry OTLP/gRPC traces + metrics from all four long-running binaries (api, mcp, reports, projector — projector without spans) to the Collector (periodic reader 30 s, lazy and non-blocking)…

What we watch

  • Telemetry is an outbound adapter — domain and application never import it (ADR 0008)…
  • Business counters inbound_receiving.receipts.units_received (ReceiveLine), inbound_receiving.advice.issued (CloseReceipt…
  • Transactional outbox with relay and attempt cap OUTBOX_MAX_ATTEMPTS=20 before a row is excluded (ADR 0007)…

What stops a bad change

  • make check / check-all (fmt-check, vet, build, golangci-lint, test; check-all adds coverage >= 90% domain+application, arch-test, bdd)…
  • CI jobs: lint, guide-lint, complexity, file-length, test, bdd, integration, mutation-fast, api-lint, vuln, helm-lint, chart-tests, docs-api-drift…
by the numbers

25 decisions and 19 BDD features, with mutation at the 99/99 standard

25
Architecture decisions
#12 of 45 in the fleet
9
DB migrations
#10 of 45 in the fleet
19
BDD feature files
#12 of 45 in the fleet
11
Events published
#8 of 45 in the fleet

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

One-command workflows (make)

buildvetfmtfmt-checklinttestcoverageintegrationbddarch-testmutationmutation-full
what comes next

Next: retire old appointments, link logs to traces, catch API breaks

NOW1Retire thefrozenappointmentRetire the frozenappointment surfaceonce dock-schedulingreads suffice: GET/appointments andMCPget_appointment/list_appointmentsstill read the…NEXT2Link logs totraces and spanthe consumersCorrelate slog lineswith trace ids andgive the consumers,relay and projectortheir own spans orextraction: theobservability pagesays logs are not …NEXT3Move floorclient and e2etests to newADR 0017 cutoveraftermath:warehouse-floor-clientand e2e-tests mustmigrate to the nounroutes, keyed POSTs,409 key reuse andkeyset paging…LATER4Add a contractcheck on everyAPI changeClose theINCIDENTS.md opengap: a siblingtightening a RESTcontract currentlyonly surfaces in theweekly cross-repoE2E run — needs a …LATER5Design aquarantine flowfor damagedQuarantine flow forDamaged units isexplicitly deferred(ADR 0001 out ofscope: recorded onthe receipt, neverbooked as stock — alater ADR)LATER6Verify the Kongroute and infrawiringVerifywarehouse-infrawiring (Kong route,local.services) — anADR 0001 consequencedeferred to a laterwave; the chartalready ships Kong …
what could go wrong · and what we do about it

Our biggest risk is hard dependence on Postgres, Kafka and event copies

No auth on REST, MCP, A2A or reports, by decision

REST, MCP, A2A and the reports are unauthenticated BY DECISION (fleet-wide revert 2026-09-11, README disclaimer)

→

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

No fallback when Postgres or Kafka is down

Hard runtime coupling by design (ADR 0011): Postgres and Kafka are the only runtime…

→

Readiness checks both, and the Helm chart refuses to render setups that would crash-loop.

Six event-fed copies can go stale

Six event-fed local copies: a missed or late dock-scheduling, yard-management or inventory-storage event leaves the appointment copy…

→

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

Breaking REST cutover with no aliases

ADR 0017 was a breaking REST cutover with no legacy aliases, and ADR 0019 retired three POSTs with 410: any caller not yet migrated…

→

Floor client and e2e tests must move to the new routes; the in-repo web remote already has.

the decision we need

Retire the frozen appointment surface now that dock-scheduling owns door bookings.

WHAT ISSuppliers send ship notices, dockteams count cartons, and good unitshand over to storage by event.THE CATCHPostgres and Kafka are hardrequirements with no fallback, andthe old appointment API is retiredbut still lingers read-only.WHAT COULD BEOne clear owner for dock bookings,API breaks caught the day theyhappen, and logs that line up withtraces.
Why it matters

Inbound receiving turns an announced truck into counted, checked stock without calling any other team live

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal / Ports & Adapters (WMS-tier Supporting bounded context); strict inward dependency rule CI-enforced by arch-go fitness tests
Layoutcmd/{api,mcp,a2a,inbound-projector,inbound-reports} — 5 binaries in one image (api default entrypoint :8080 with the outbox relay and six Kafka consumers…
StoragePostgres OLTP (9 golang-migrate migrations: inbound_receiving schema, housekeeping indexes, cartons_and_packaging, receipt_carton_discrepancies…
Testingtable-driven unit tests with -race; 90% coverage gate on domain+application; godog BDD (19 feature files); testcontainers Postgres+Kafka integration (mandatory, no env-based skips)…
REST23 operations over 20 paths on :8080: /asns (+/{asnNumber}, /{asnNumber}/cartons, /{asnNumber}/cancellations), /appointments (+/{appointmentId}…
Go 1.27.4chi HTTP router + go-chi/corspgx/v5 + pgxpool Postgrespgtx UnitOfWorkgolang-migratesegmentio/kafka-gocloudevents/sdk-go v2official MCP Go SDK v1.8.0official A2A Go SDK a2a-go/v2…OpenTelemetry Go SDK v1.47.0testcontainers-goHelm chart