warehouse-systems fleet · executive briefing

linehaul-transportation

Schedules the trucks and flights between nodes and books packages onto them
seven capabilitys10 events out · 13 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

Linehaul runs the middle mile: scheduled departures with live capacity, so every package rides a real seat

1

Departures come from lane schedules and vendor cutoffs, so the middle mile is planned ahead.

2

Each departure tracks remaining seats, and a full one moves or fails bookings in the open.

3

It reads siblings' events and calls no one, so it never waits on their uptime.

The ask

Add alerts for dispatch outcomes, outbox backlog, consumer lag and dead letters the dashboards already show.

why it exists

The middle mile needs a seat for every package between nodes

Runs the middle mile of the retail network: it turns lanes into scheduled departures — including a pickup departure at every cutoff of an ACTIVE vendor fulfillment center — keeps each departure's remaining capacity, builds loads of packages onto departures, and reports when loads depart and arrive…

Today

Lane schedules roll into a 14-day horizon of departures; locked orders book pickup seats, and loads report departing and arriving.

The catch

Nothing alerts on the business metric, outbox backlog, consumer lag or dead letters, and the analytics stream has no consumer here.

what it does

Lanes become scheduled departures with honest, live capacity

Lane schedules

Planners set each lane's weekly slots: cutoff, departure, arrival and capacity.

Departure horizon

A rolling 14-day horizon of truck, air and vendor pickup departures, ready to book.

Capacity accounting

Every departure knows how many packages are booked and how many seats remain.

Package bookings

A locked order gets a pickup seat, or moves to the next pickup when one is full.

Load tracking

Loads open, fill, close, dispatch and arrive, recording real trip times.

Local read models

Node, lane, order and label facts are copied locally, so it never calls a service.

who it talks to

Three contexts feed it, four build on what it publishes

LISTENS TO · 13 EVENT TYPESIS HEARD BY · 4 CONTEXTSnode-topology7order-sourcing4shipping-and-tracking2delivery-promise7order-sourcing5shipping-and-tracking2last-mile-delivery1linehaultransportationbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

Departures, lane schedules, loads and bookings carry the story

THE LANGUAGEOF THE DOMAINDepartureLaneScheduleLoadBookingHorizon rollNodeProfileView / LaneViewLabel read model from…Shared vocabulary in…
REST11 operations over 11 paths on :8080 (HTTP_ADDR): POST…
MCPRead-only MCP server on Streamable HTTP :8090 with two…
A2ARead-only A2A agent on :8093 (ADR 0011): Agent Card at…
how it is built

Three binaries, one hexagon, and no calls out to anyone

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808011 operations over 11 pathsMCP tools :8090Read-only MCP serverKafka consumer · 13 eventsFulfillmentCancelledassignment.FulfillmentLockedDOMAIN COREDepartureLaneScheduleLoadBookingPostgreSQLSingle Postgres instanceKafka producer · 10 eventsdeparture.BookingFaileddeparture.BookingMovedTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

13 facts come in and ten go out, each with a stable id

CONSUMED · BY SOURCE · 13PUBLISHED · BY ENTITY · 10node-topology 7order-sourcing 4shipping-and-tracking 27 departure3 loadFulfillmentCancelledFulfillmentLockedFulfillmentReassignedFulfillmentReleasedToNodeLaneClosedLaneOpenedNodeActivatedNodeOperationalProfileDeclaredNodeRegisteredBookingFailedBookingMovedDepartureCancelledDepartureCapacityChangedDepartureScheduledLoadArrivedLoadDepartedDepartureArrivedDepartureDepartedLoadClosed
how we know it is healthy

Dashboards show its health, but nothing alerts on it yet

Follows the fleet observability standard (ADR 0010): all three binaries push OTLP/gRPC metrics and traces to the OpenTelemetry Collector (Jaeger, Prometheus), logs are JSON shipped by Alloy to Loki…

What we watch

  • Trace context crosses the service boundary: the outbox row stores traceparent (and tracestate/baggage) and the consumer parents its span to it…
  • No metric for the outbox backlog, consumer lag or the horizon roll by design — read Postgres (outbox_events) and the logs ('horizon roll'…

What stops a bad change

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

13 decisions and 11 BDD features over a two-migration schema

13
Architecture decisions
#27 of 45 in the fleet
2
DB migrations
#30 of 45 in the fleet
11
BDD feature files
#31 of 45 in the fleet
10
Events published
#11 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 dashboards into alerts, close tracing gaps, declare authority

NOW1Turn dashboardsignals intoalertsAdd alerts on what thedashboards already show:linehaul_loads_dispatched_totaloutcome shifts, outboxbacklog, consumer lagand dead-letter topics —all explicitly listed asnot presentNEXT2Add spans aroundPostgres and relaypublishClose the tracing gapsnamed in ADR 0010's ownpages: no spans aroundPostgres calls or therelay publishNEXT3Find a consumerfor the analyticsstreamGive the analyticsstream a consumer:DepartureDeparted,DepartureArrived andLoadClosed are publishedtoretailnetwork.linehaul-transportation.analyticswith no consumer in…LATER4Raise the mutationgate to the 99/99standardRaise the mutation gatefrom efficacy 90 /mutant-coverage 90 tothe 99/99 fleet standard(.gremlins.yaml:33-34)LATER5Declare authorityon the MCP toolsand A2A skillsDeclare agent authoritylevels on the two MCPtools and the A2Askills: thetool-registry goldencarries nocom.warehouse/authority_meta and no authority…
what could go wrong · and what we do about it

Our biggest risk is a silent backlog nobody gets paged for

Bookings can move or fail when pickups fill

The booking model is consumer-sensitive: a full pickup departure moves locked bookings (BookingMoved) or fails them (BookingFailed)…

→

Moves and failures are published events, so downstream capacity views can follow them.

Nothing alerts on backlog, lag or dead letters

Nothing alerts on the business metric, outbox backlog, consumer lag or DLQ topics…

→

Add alerts on dispatch outcomes, outbox backlog, consumer lag and dead-letter topics.

Hard runtime coupling, no degraded mode

Hard runtime coupling on a single-broker platform: DATABASE_URL and KAFKA_BROKERS are mandatory with no degraded mode (CLAUDE.md:21)…

→

Readiness names the failing dependency; the README marks it study-only.

No auth on REST, MCP or A2A, by decision

Every REST, MCP and A2A endpoint is unauthenticated by decision (fleet-wide auth revert; CLAUDE.md:23,43)

→

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

the decision we need

Add alerts for dispatch outcomes, outbox backlog, consumer lag and dead letters the dashboards already show.

WHAT ISLane schedules roll into a 14-dayhorizon of departures; locked ordersbook pickup seats, and loads reportdeparting and arriving.THE CATCHNothing alerts on the businessmetric, outbox backlog, consumer lagor dead letters, and the analyticsstream has no consumer here.WHAT COULD BEProblems that page someone beforethey surface downstream, full tracesthrough Postgres, and an analyticsstream someone consumes.
Why it matters

Linehaul runs the middle mile: scheduled departures with live capacity, so every package rides a real seat

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal / Ports & Adapters; Supporting subdomain, logistics tier of the retail network (network-level design lives in warehouse-docs' retail-network pages)…
Layoutcmd/{api,mcp,a2a} — three binaries: api :8080 (REST composition root: HTTP, the three Kafka consumers — node-topology, order-sourcing, shipping-and-tracking…
StorageSingle Postgres instance (2 embedded golang-migrate migrations: linehaul_schema, idempotency_global_key) applied at boot…
Testingtable-driven -race unit tests; 90% coverage gate on internal/domain + internal/application; 11 godog BDD feature files over the real HTTP API…
REST11 operations over 11 paths on :8080 (HTTP_ADDR): POST /lane-schedules, POST /lane-schedules/{laneId}/retirements, GET /departures…
Go 1.27.4chi v5 + otelchipgx/v5 Postgresgolang-migratesegmentio/kafka-goCloudEvents sdk-go v2official MCP Go SDK v1.8.0official A2A Go SDK a2a-go/v2…OpenTelemetry SDK with OTLP/gRPC…testcontainers-goHelm chartweb/ linehaul_mfe console remote