warehouse-systems fleet · executive briefing

exception-management

Turns warehouse problems other teams spot into owned cases with a clock on them
eight capabilitys7 events out · 20 in14 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

Exception management turns scattered anomaly facts into owned cases, each with an owner and a deadline

1

Cases open only from facts other contexts publish, one case per subject and site.

2

Versioned policies set severity, queue and SLA, and can close cases on their own.

3

Agents read cases and the SLA report through read-only MCP tools and an A2A agent.

The ask

Extend metrics past the one case counter: case counts by status and queue, escalations, outbox depth, consumer lag.

why it exists

Warehouse problems get lost when nobody owns them

The warehouse's Problem Solve: it turns the anomaly facts other contexts already publish into owned cases with triage, assignment, an SLA clock, resolution and root cause. It owns the ExceptionCase aggregate and the versioned ExceptionPolicy per source type (severity, queue, SLA, declarative auto-resolve rules)…

Today

It opens one case per anomaly from 20 fact types, then runs triage, assignment, an SLA clock and resolution.

The catch

OTel is wired, but only one business counter exists, so no alert sees backlog or escalations and undeclared types are skipped.

what it does

Every anomaly becomes one owned case with an SLA clock

One case per anomaly

Opens exactly one case per subject and site; repeats touch the open case.

Held-stock cases

Opens a case per held unit and closes it when the hold ends.

Operator workflow

Operators triage, assign and resolve cases, with every step's actor recorded.

Versioned case policies

Sets severity, queue, SLA and auto-resolve rules per source type.

SLA clock and sweeper

Flags breached cases as escalated without blocking work.

Frozen source copies

Stores each source fact as received, so cases stay auditable.

who it talks to

It listens to ten contexts and, so far, nobody listens back

LISTENS TO · 20 EVENT TYPESIS HEARD BY · 0 CONTEXTSinventory-storage5yard-management4fulfillment-execution3network-fulfillment2dock-scheduling1inbound-receiving1+4 more contextsNo downstream consumer yetexceptionmanagementbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

A case, a policy and a frozen fact carry the whole workflow

THE LANGUAGEOF THE DOMAINExceptionCaseExceptionPolicySource factSweeperShared vocabularyRead views for REST/MCP/A2A…Correlation chain
REST11 operations over 10 paths on :8080: GET|POST /exceptions…
MCPMCP server (cmd/mcp, :8090): 4 read-only tools…
A2ARead-only A2A agent (cmd/a2a, :8093, JSON-RPC over HTTP…
how it is built

A pure consumer at the edge, with read-only agent doors

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808011 operations over 10 pathsMCP tools :8090MCP server (cmd/mcp, :8090)…Kafka consumer · 20 eventspackage.PackageDivertedWeightDiscrepancyDetectedDOMAIN COREExceptionCaseExceptionPolicySource factSweeperPostgreSQLPostgres OLTPKafka producer · 7 eventsExceptionAssignedExceptionAutoResolvedTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

20 anomaly types in, seven case facts out

CONSUMED · BY SOURCE · 20PUBLISHED · BY ENTITY · 7inventory-storage 5yard-management 4fulfillment-execution 3network-fulfillment 2dock-scheduling 1inbound-receiving 1order-management 1outbound-shipping 16 exceptioncase1 exceptionpolicy
how we know it is healthy

Traces and one case counter exist, but no alert sees the backlog

Fleet observability standard (ADR 0014): every one of the five binaries pushes traces and metrics over OTLP/gRPC (OTEL_EXPORTER_OTLP_ENDPOINT, lazy and non-blocking) plus Go runtime metrics…

What we watch

  • The SLA report is the one domain-served aggregate: open caseload against its clocks — open_cases, breached, escalated, by_severity/by_queue…
  • Deliberately absent, per its own docs: no auth logs (no auth middleware, fleet decision 2026-09-11), no trace propagation across Kafka…

What stops a bad change

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

14 decisions and 16 BDD features shape problem solve

14
Architecture decisions
#24 of 45 in the fleet
6
DB migrations
#18 of 45 in the fleet
16
BDD feature files
#18 of 45 in the fleet
7
Events published
#17 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-fullvulnapi-lint
what comes next

Next: build the metrics every dashboard is waiting on

NOW1Build the case metricsbeyond one counterExtend the metrics past the oneexception.cases.opened counter— case counts by status/queue,escalation counts, outbox depthand consumer lag are notevidenced (README,observability.md); build thedashboards in warehouse-infraon the names it listsNEXT2Adopt the fleetcontract checkFleet open gap (INCIDENTS.md):a sibling tightening an APIcontract only surfaces in theweekly cross-repo E2E run —adopt the contract-check thatfires when an API contractchangesLATER3Raise the mutation gateto the 99/99 standardRaise the mutation gate(.gremlins.yaml 95% efficacy /95% mutant-coverage, all threedomain packages measured at100%) to the fleet 99/99standardLATER4Wire the two plannedsources once producerspromote themWire the two planned sources,workforce-managementPathUnderstaffed andnetwork-inventory-planningTransferStuckDetected, oncetheir producers promote themoff analytics-only topics (ADR0001: planned, not built)
what could go wrong · and what we do about it

Anomalies can slip past unseen if nobody watches the logs

Metrics stop at one counter and a histogram

Instrumentation stops at the request histogram and one intake counter: no shipped alert or counter sees case backlog…

→

The SLA report and logs carry caseload truth today; extend the metrics to match.

Undeclared fact types are skipped quietly

Intake depends on ten sibling topics and 20 source types — a source type without a declared policy is skipped with a WARN line and a…

→

A WARN log line and a rejected counter name each missing policy.

Traces end at the outbox write

The trace ends at the outbox write: no trace_id crosses Kafka (no headers column, ADR 0014)…

→

The CloudEvents id chain correlates a case across contexts.

No auth on REST, MCP or A2A, by decision

REST, MCP and A2A are unauthenticated BY DECISION (fleet decision 2026-09-11, README study-project disclaimer)

→

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

the decision we need

Extend metrics past the one case counter: case counts by status and queue, escalations, outbox depth, consumer lag.

WHAT ISIt opens one case per anomaly from20 fact types, then runs triage,assignment, an SLA clock andresolution.THE CATCHOTel is wired, but only one businesscounter exists, so no alert seesbacklog or escalations andundeclared types are skipped.WHAT COULD BEDashboards and alerts that see casebacklog and escalations, andcontract breaks caught the momentthey happen.
Why it matters

Exception management turns scattered anomaly facts into owned cases, each with an owner and a deadline

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal / Ports & Adapters; WES-tier Supporting Subdomain (problem solve); inward-only dependencies enforced by arch-go plus fleet fitness tests…
Layoutcmd/{api,mcp,a2a,exceptions-projector,exceptions-reports} — api :8080 (REST, outbox relay, eleven consumers: ten fact + one correlation, SLA sweeper), mcp (read-only), a2a (read-only agent…
StoragePostgres OLTP (6 root migrations: exception_management, idempotency_keys, carton_discrepancy_policies, package_missed_load_policy…
Testingtable-driven -race unit tests; 90% coverage gate on domain+application (CI gate, badge in README); 16 godog BDD feature files over the real HTTP API…
REST11 operations over 10 paths on :8080: GET|POST /exceptions, GET /exceptions/{caseId}…
Go 1.27.4chi v5 routerpgx/v5 + pgxpool Postgresgolang-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 chartweb/ console remote