warehouse-systems fleet · executive briefing

dock-scheduling

Keeps every dock door's calendar so trucks never collide at the same door
eight capabilitys14 events out · 10 in13 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

Dock scheduling is the one door calendar per site, so no two trucks get booked into the same window

1

One calendar per site enforces no double-booking, opening hours and closures at every door.

2

Gate, ASN, layout and CPT facts drive check-ins and cancellations without a single sibling call.

3

Late ETAs and no-shows become published facts, so the yard can act without asking.

The ask

Switch on the built-but-disabled MCP, projector, reports, relay and no-show sweep in warehouse-infra.

why it exists

A double-booked dock door stalls trucks, crews and the whole yard

Owns the door calendar of every site: every booked time window on every dock door, inbound and outbound, from booking through arrival to door release, enforcing no-double-booking, door opening hours and closures, ETA-driven risk and terminal no-shows…

Today

It books, moves and cancels carrier windows per door, flags late ETAs, and folds yard and receiving facts into its calendar.

The catch

Only the API runs on the cluster: MCP, reports, projector, relay and no-show sweep are off, and OTel is not wired.

what it does

It owns every booked window on every door, inbound and outbound

Door calendar per site

Sets opening hours, closures and slot size for every site's doors.

Appointment lifecycle

Books, reschedules and cancels carrier windows with no double-booking.

ETA risk flags

Flags appointments at risk from late ETAs; nothing reschedules on its own.

Carrier registry

Registers, suspends and reinstates carriers by their SCAC code.

Door availability search

Shows free and busy windows per door over up to 14 days.

Fact-driven policies

Checks in, releases doors and cancels bookings from yard and ASN facts.

who it talks to

Four contexts feed it, five build on what it publishes

LISTENS TO · 10 EVENT TYPESIS HEARD BY · 5 CONTEXTSyard-management4facility-layout3inbound-receiving2process-path-management1yard-management9inbound-receiving4exception-management1outbound-shipping1warehouse-planning1dockschedulingbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

Appointments, door calendars and carriers carry the whole story

THE LANGUAGEOF THE DOMAINDockAppointmentDoorCalendarCarrier aggregateDoorArrivalFromGate policyStandard vocabulary on…Local copies
REST22 operations over 19 paths on :8080
MCP14 tools on Streamable HTTP :8090 — 7 L1 reads (list/get…
Events14 produced, 10 consumed on Kafka (CloudEvents 1.0):…
how it is built

Six binaries share one image, but only the API is switched on

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808022 operations over 19 pathsMCP tools :809014 toolsKafka consumer · 10 eventsCPTScheduleChangedLocationSlotDecommissionedDOMAIN COREDockAppointmentDoorCalendarCarrier aggregateDoorPostgreSQLPostgres OLTPKafka producer · 14 eventscarrier.CarrierRegisteredcarrier.CarrierReinstatedTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

Ten facts in, fourteen out, all through a reliable outbox

CONSUMED · BY SOURCE · 10PUBLISHED · BY ENTITY · 14yard-management 4facility-layout 3inbound-receiving 2process-path-management 18 dockappointment3 carrier3 dockcalendarCPTScheduleChangedLocationSlotDecommissionedLocationSlotRegisteredZoneRegisteredASNCancelledASNRegisteredTrailerDockedTrailerUndockedVisitCheckedInCarrierRegisteredCarrierReinstatedCarrierSuspendedDockAppointmentBookedDockAppointmentCancelledDockAppointmentDoorReassignedDockAppointmentNoShow
how we know it is healthy

Metrics exist, but alerts watch the gateway, not the calendar

Private Prometheus registry at GET /metrics on api (:8080), mcp (:8090) and reports (:8092): http_requests_total and duration histogram by chi route, ignored_facts_total by reason, implicit_arrivals_total…

What we watch

  • ignored_facts_total turns silent policy skips into a signal: steady already_applied is normal redelivery…
  • Transactional outbox with relay attempt cap (OUTBOX_MAX_ATTEMPTS default 20) before a row is excluded; consumer dead-letters with headers…

What stops a bad change

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

13 recorded decisions and 12 BDD features pin the rules

13
Architecture decisions
#27 of 45 in the fleet
4
DB migrations
#22 of 45 in the fleet
12
BDD feature files
#29 of 45 in the fleet
14
Events published
#3 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-fullvulncheck
what comes next

Next: turn on what is built, wire OTel and close the contract gap

NOW1Turn on MCP,projector,reports, relay andTurn thebuilt-but-disabledcomponents on inwarehouse-infra: MCP,projector, reports, thededicated relay and theno-show sweep CronJobare all switched off — …NEXT2Confirmwarehouse-planningconsumes thewarehouse-planning isnamed as a consumer ofDockAppointmentBooked/Rescheduled/Cancelled/NoShow(apis/asyncapi.yaml,docs/docs/ecosystem/integration.md)— its consumption is notevidenced in thisrepository's filesNEXT3Add a contractcheck on every APIchangeFleet open gap(INCIDENTS.md): asibling tightening anAPI contract onlysurfaces in the weeklycross-repo E2E run — thefleet needs a contractcheck that fires …LATER4Raise the mutationgate to the 99/99standardRaise the mutation gate(.gremlins.yaml 95%efficacy / 95%mutant-coverage) to thefleet 99/99 standardLATER5Wire the OTel SDKor stop renderingits variablesResolve the OTelcontradiction: chartsvalues.yaml says an otelSDK readsOTEL_EXPORTER_OTLP_ENDPOINT,observability.md andgo.mod show no SDK —either wire the SDK …
what could go wrong · and what we do about it

Our biggest risk is that half the signals are never seen

OTel is half-wired: variables rendered, no SDK

Observability is half-wired: no OTel SDK (the chart renders OTEL_* into pods that nothing reads) and the dashboard's OTel-style…

→

A private Prometheus registry still exposes request, ignored-fact and arrival metrics.

No alert fires on ignored facts, backlog or lag

All six alert rules read Kong and kube-state metrics — nothing fires on ignored facts, outbox backlog or consumer lag…

→

The ignored-facts counter turns silent skips into a signal; backlog is read from the outbox table.

No auth on REST or agent write tools, by decision

REST and the L3 MCP write tools (book/reschedule/cancel appointment, carrier suspend) are unauthenticated BY DECISION (fleet-wide…

→

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

the decision we need

Switch on the built-but-disabled MCP, projector, reports, relay and no-show sweep in warehouse-infra.

WHAT ISIt books, moves and cancels carrierwindows per door, flags late ETAs,and folds yard and receiving factsinto its calendar.THE CATCHOnly the API runs on the cluster:MCP, reports, projector, relay andno-show sweep are off, and OTel isnot wired.WHAT COULD BEA fully running door calendar:agents can book, no-shows sweepthemselves, and schedule-adherencereports go live.
Why it matters

Dock scheduling is the one door calendar per site, so no two trucks get booked into the same window

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal / Ports & Adapters; WMS-tier Supporting bounded context of the yard domain (the yard instance of warehouse-docs holds the single-source model)…
Layoutcmd/{api,mcp,projector,reports,relay,sweep} — six binaries in one image: api :8080 (REST, in-process outbox relay, Kafka consumers), mcp :8090, projector (sole analytics writer)…
StoragePostgres OLTP (4 root migrations: dock_scheduling, idempotency_keys, carriers, door_gln) + separate analytical Postgres (1 migration: schedule…
Testingtable-driven -race unit tests with 90% coverage gate on domain+application (check-all); 12 godog BDD feature files; testcontainers Postgres+Kafka integration (-tags=integration)…
REST22 operations over 19 paths on :8080: /appointments (+/{appointmentId}, /{id}/eta-reports, /{id}/reschedules, /{id}/cancellations)…
Go 1.27.4chi v5 routerpgx/v5 + pgxpool Postgresgolang-migratesegmentio/kafka-goCloudEvents sdk-go v2official MCP Go SDK v1.8.0prometheus/client_golangOTel API for MCP tool spanstestcontainers-goHelm chart