warehouse-systems fleet · executive briefing

shipping-and-tracking

Prints shipping labels and tells customers where their package is, start to finish
nine capabilitys13 events out · 19 in17 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

Shipping and Tracking turns scattered handover, load and delivery facts into one timeline a customer can trust

1

Labels are issued only after a deliverability check, with ship-to data encrypted at rest.

2

One journey per tracking number merges handover, load, carrier and pickup facts.

3

A read-only MCP tool and A2A skill expose the journey, but both ship switched off.

The ask

Approve journey search for support desks and the reverse-label route that is accepted but not built.

why it exists

Customers want one answer to 'where is my package?'

Generic subdomain in the logistics tier. It is the only place outside customer-ordering that ever sees a ship-to address, and it owns each package's journey: one customer-visible timeline consolidated from vendor handover, load and delivery facts, ending in delivered, returned or lost…

Today

It issues labels after a deliverability check and merges vendor, linehaul and last-mile facts into one journey per package.

The catch

It holds ship-to addresses, needs customer-ordering up to print labels, and its silence rule can call a late package lost.

what it does

Labels, journeys, carrier handoffs and ETAs all come from one place

Label issuance

Labels print only after the address is checked as deliverable.

Voids and retention

Labels can be voided, and retention rules limit how long ship-to data stays.

One package journey

Handover, linehaul and last-mile facts merge into one timeline.

Silence detection

Packages that go quiet raise one exception, then are marked lost 48 hours later.

Day-of ETA windows

Each journey carries a day-of delivery window.

Delivery-point flags

Last-mile delivery-point flags are relayed downstream by order id.

who it talks to

Five contexts feed it, seven build on what it publishes

LISTENS TO · 14 EVENT TYPESIS HEARD BY · 7 CONTEXTSlast-mile-delivery5node-topology5linehaul-transportation2offer-availability1vendor-connectivity1customer-ordering11delivery-promise6customer-payments2linehaul-transportation2last-mile-delivery1node-performance1order-sourcing1shipping-andtrackingbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

A label and a package journey carry the whole story

THE LANGUAGEOF THE DOMAINShippingLabelPackageJourneytracking numberscanhandoversilenceETA windowdelivery point flag
REST8 operations over 8 paths on :8080
MCPRead-only MCP server (cmd/mcp, :8090…
A2ARead-only A2A agent (cmd/a2a, :8093, ADR 0009): one skill…
how it is built

A hexagonal core with five entry points, an outbox and a reports side

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :80808 operations over 8 pathsMCP tools :8090Read-only MCP server…Kafka consumer · 19 eventsCatalogItemCreatedDeliveryPointFlaggedDOMAIN COREShippingLabelPackageJourneytracking numberscanPostgreSQLPostgreSQLKafka producer · 13 eventsjourney.PackageCollectedjourney.PackageDeliveredTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

13 package and label facts go out; 19 come in to keep one timeline

CONSUMED · BY SOURCE · 19PUBLISHED · BY ENTITY · 13last-mile-delivery 5node-topology 5shipping-and-tracking 5linehaul-transportation 2offer-availability 1vendor-connectivity 111 journey2 label
how we know it is healthy

OpenTelemetry traces, one label counter and dead-letter queues watch it

OpenTelemetry OTLP/gRPC to in-cluster Collector -> Jaeger (traces) + Prometheus (metrics); JSON slog logs on stdout collected by Alloy into Loki (fleet standard, ADR 0008)

What we watch

  • request log with request id per call
  • a2a.skill OTel spans; server spans per chi route and CONSUMER spans per handled message
  • Business counter shipping.labels.issued (outcome issued|rejected, reason slug when rejected); no void or journey instrument
  • traceparent propagated onto published events

What stops a bad change

  • make check (vet + lint + unit + coverage gate 90%)
  • godog BDD suite must pass
  • architecture tests (dependency direction)
  • mutation tests (gremlins) with thresholds efficacy 90, mutant-coverage 90, below the 99/99 fleet standard
  • govulncheck vulnerability scan
by the numbers

17 decisions and 14 BDD feature files back every label

17
Architecture decisions
#16 of 45 in the fleet
6
DB migrations
#18 of 45 in the fleet
14
BDD feature files
#24 of 45 in the fleet
13
Events published
#4 of 45 in the fleet

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

One-command workflows (make)

helpbuildvetfmtfmt-checklinttestcoverageintegrationbddarch-testmutationmutation-fullvuln
what comes next

Next, we build return labels, open journeys to support and measure ETAs

NOW1Build the acceptedreverse-labelrouteBuild the acceptedreverse-label route (ADR0017, POST/return-labels): notevidenced inapis/openapi.yaml orinternal/ (git grepreturn-labels: no match)NEXT2Add journey searchand list forsupport desksBroaden the readsurface: only theget_journey MCP tool andone A2A skill exist; addjourney search/list forsupport desksNEXT3Measure ETA-windowaccuracy on thereports sideAdd ETA-window accuracyanalytics (promisedwindow vs actualdelivery) on theanalytics read sideLATER4Build ship-to keyrotationBuild ship-to keyrotation: CLAUDE.md:43lists it as not built(ADR 0005); retentionexists (30-day purge)but rotation is notevidencedLATER5Raise the mutationgate from 90 tothe 99 standardRaise the mutation gatefrom efficacy 90 /mutant-coverage 90 tothe 99/99 fleet standard(.gremlins.yaml:30-31)
what could go wrong · and what we do about it

Our biggest risk is that we hold customers' addresses

We are the prime target for address data

Custody of PII: it is the only service outside customer-ordering holding ship-to addresses…

→

Ship-to is encrypted at rest and purged 30 days after the journey closes; key rotation is not built.

Labels stop if customer-ordering is down

Label issuance synchronously depends on customer-ordering's GetShipTo; that service's outage halts shipping

→

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

Delayed packages may be called lost

Silence heuristics (NO_SCAN then lost after 48h) can misclassify merely delayed packages as lost…

→

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

Auth is off by decision: scans and carrier events open

Every REST, MCP and A2A endpoint is unauthenticated by decision (fleet-wide auth revert…

→

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

the decision we need

Approve journey search for support desks and the reverse-label route that is accepted but not built.

WHAT ISIt issues labels after adeliverability check and mergesvendor, linehaul and last-mile factsinto one journey per package.THE CATCHIt holds ship-to addresses, needscustomer-ordering up to printlabels, and its silence rule cancall a late package lost.WHAT COULD BESupport desks search journeys,returns get their own labels, ETAaccuracy is measured, and ship-tokeys rotate.
Why it matters

Shipping and Tracking turns scattered handover, load and delivery facts into one timeline a customer can trust

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal (ports & adapters), event-driven DDD, transactional outbox
Layoutcmd/{api,mcp,a2a,st-projector,st-reports} composition roots; internal/domain {label, journey, shared}; internal/application {ports, usecases, repository, views, shipto, outbox}…
StoragePostgreSQL (pgx v5): labels, journeys, processed_events inbox, transactional outbox, global idempotency keys, 6 schema migrations incl…
TestingUnit + 90% coverage gate; integration on real PostgreSQL and Kafka via testcontainers (incl. a real-wiring test of cmd/api)…
REST8 operations over 8 paths on :8080: /labels, /labels/{labelRef}/voids, /journeys/{trackingNumber}, /journeys/{trackingNumber}/scans, /carrier-events…
Go 1.27.4PostgreSQL via pgx v5Kafka via segmentio/kafka-goCloudEvents 1.0 envelopeOpenTelemetrychi HTTP routerMCP go-sdka2a-go v2React/Vite MFE consoleHelm/Kubernetes