warehouse-systems fleet · executive briefing

order-management

Owns each customer order and tracks how far along it is in the warehouse
eight capabilitys2 events out · 6 in51 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

Order Management gives every order one validated owner, so stock, promises and release stay in step

1

Before it, an order was an unchecked string passed between services; now it has an owner.

2

It reserves stock, promises a window and picks the fastest path, never the caller.

3

The gaps sit at the edges: unconfirmed release, lingering holds and a softer mutation gate.

The ask

Switch release confirmation on in the cluster and fund a sweeper for orphaned network holds.

why it exists

An order deserves one owner, not a string passed between services

Owns Order and OrderLine as first-class validated aggregates, closing the gap where 'an order' was an unowned unvalidated string threaded through three sibling services. It answers 'what did the customer ask for, and how far along is it' while every other service answers 'what is happening in the warehouse right now'…

Today

One POST takes an order, reserves stock per line, promises a delivery window and hands release to work planning over Kafka.

The catch

Release confirmation exists but is off by default, so release stays fire-and-forget; orphaned holds and mutation efficacy of 97 also linger.

what it does

One call takes an order from intake to release and on to shipped

One-call order intake

A single POST takes the order, allocates stock and releases it as one saga.

Fail-closed allocation

Reserves stock per line and treats only a clear conflict as 'no stock'.

Ship-complete promises

Holds the whole order until backorders clear, and promises a capability-based window.

Smart path routing

Picks the shortest eligible path for each line; callers never choose it.

Cancel and hold

Cancels up to release, frees reservations, and holds network demand to deadline.

Release confirmation

Opt-in loop confirms each released line and flags any that go unconfirmed.

who it talks to

Six contexts feed it, seven build on what it publishes

LISTENS TO · 14 EVENT TYPESIS HEARD BY · 7 CONTEXTSprocess-path-management4warehouse-planning4fulfillment-execution2outbound-shipping2product-master1wes-work-planning1returns-processing2warehouse-planning2e2e-tests1exception-management1network-inventory-planning1slotting-optimization1wes-work-planning1ordermanagementbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

Orders, lines and promises carry the language; status is derived

THE LANGUAGEOF THE DOMAINOrder aggregate with…PromisePolicyprocesspath definitions…ReleaseConfirmationPlannedCapacityWindow…Ports
REST8 operations over 7 paths on :8080
MCPMCP server (cmd/mcp, :8090, Streamable HTTP…
A2AA2A agent (cmd/a2a, :8093): 2 read-only skills…
how it is built

A hexagonal core with five binaries keeps orders apart from reports

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :80808 operations over 7 pathsMCP tools :8090MCP server (cmd/mcp, :8090…Kafka consumer · 6 eventsCPTScheduleChangedWorkUnitCreatedDOMAIN COREOrder aggregate with…PromisePolicyprocesspath definitions…ReleaseConfirmationPostgreSQLPostgres 16 via pgxpool with…Kafka producer · 2 eventsorder-management.eventsorder-management.analyticsTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

Fifteen events come in and fifteen go out; four are integration events

CONSUMED · BY SOURCE · 14PUBLISHED · BY ENTITY · 2process-path-management 4warehouse-planning 4fulfillment-execution 2outbound-shipping 2product-master 1wes-work-planning 12 order-management
how we know it is healthy

OpenTelemetry in every binary and a 90% gate keep it honest

OpenTelemetry push-only over OTLP/gRPC (no /metrics scrape route), telemetry.Setup in all five binaries; Go runtime metrics; slog structured JSON logs…

What we watch

  • Circuit breakers per dependency, read-only retry, Kafka DLQ, graceful shutdown with /readyz flip and drain delay (ADR 0025)
  • Standard metrics convention per ADR 0009; promise KPIs exposed via MCP get_promise_health
  • Eventually-consistent analytics to a freshness SLA (p95 event-to-report lag < 30s) instead of real-time views

What stops a bad change

  • make check / check-all: fmt-check + vet + build + lint + test -race + coverage 90% gate
  • CI sensors: lint, guide-lint, complexity, file-length, test+coverage, bdd, contract (Schemathesis), pinned-contracts, evals-tests (MCP)…
  • lefthook pre-commit (fmt/vet/lint) and pre-push (make check); harness hooks block pushes to develop/main
by the numbers

Fifty-one decisions and 21 feature files show a mature context

51
Architecture decisions
#3 of 45 in the fleet
14
DB migrations
#4 of 45 in the fleet
21
BDD feature files
#5 of 45 in the fleet
2
Events published
#30 of 45 in the fleet

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

One-command workflows (make)

checkcheck-allcheck-fastbddcontractintegrationmutation-fastmutationcoveragearch-testchart-testvuln
competitive position

Against the market leaders, we cover part of the ground

PartialOrder Management vs Manhattan (ActiveOrder / Active Omni), Blue Yonder, Körber

Where we match or lead

  • Allocation-then-release saga with fail-closed semantics
  • Capability-derived CPT-window promising with lead-time fallback
  • Attribute-driven multi-path routing by shortest eligible cycle time
  • Cancellation up to the release boundary with reservation revocation

Gaps to close

  • High No returns / reverse-logistics flow
  • Medium Release is fire-and-forget: no confirmation from wes-work-planning (ADR 0005 deferral)
  • Medium No multi-node sourcing by proximity or cost; promising ignores future inventory
  • Medium Known sweeper gaps: orphaned holds and released-work claw-back can leave reservations lingering

Leader capabilities are vendor-published; gaps reflect repo docs reviewed in November 2026.

what comes next

Next, turn on release confirmation and sweep up orphaned holds

NOW1Ratchet mutationefficacy from 97 toward99/99Ratchet .gremlins.yaml efficacyfrom 97 toward the fleet's99/99 standard (mutant-coverageis already 99); the orderpackage has documentedsurvivors in path_selection.goand promise.go(.gremlins.yaml:63-65)NEXT2Turn releaseconfirmation on bydefaultTurn release confirmation on:RELEASE_CONFIRMATION_MODEdefaults to off and the chartvalue mode is empty(values.yaml:244-246); plannedcapacity and demand projectionare also empty-by-defaultLATER3Sweep orphaned holdsthat are never releasedAdd an orphaned-hold sweeperfor orders held withreleaseOnAllocation=false: ADR0020 deliberately leaves itunbuilt becausenetwork-fulfillment owns theacknowledgement clock(ADR-0020:428-432)LATER4Rework claw-back ofalready-released workRework cancellation claw-backof already-released work,documented as a known gap inADR 0004 (ADR-0004:74)
what could go wrong · and what we do about it

Our biggest risk is releasing work and never hearing back

Unauthenticated endpoints, by fleet decision

Every REST, MCP and A2A endpoint is unauthenticated by decision (ADR 0012 removed the bearer layer)…

→

A decision, not a gap: relies on cluster-internal reachability.

Release is fire-and-forget unless confirmation is on

Release is fire-and-forget unless RELEASE_CONFIRMATION_MODE=kafka (default off): the service otherwise never learns whether…

→

Turn on the confirmation loop; the mode defaults to off today.

Mutation efficacy of 97 is below the 99/99 standard

Mutation gate efficacy 97 sits below the fleet 99/99 standard while promise-boundary survivors are documented

→

Mutant coverage is already 99; the survivors are documented in the promise code.

Orphaned holds and released work can pin stock

Orphaned network holds and released-work cancellation gaps mean inventory reservations can linger (ADR 0020, ADR 0004)

→

Add a sweeper for orphaned holds and rework claw-back of released work.

the decision we need

Switch release confirmation on in the cluster and fund a sweeper for orphaned network holds.

WHAT ISOne POST takes an order, reservesstock per line, promises a deliverywindow and hands release to workplanning over Kafka.THE CATCHRelease confirmation exists but isoff by default, so release staysfire-and-forget; orphaned holds andmutation efficacy of 97 also linger.WHAT COULD BEEvery released order is confirmed,no hold lingers on stock, andmutation efficacy reaches thefleet's 99/99 bar.
Why it matters

Order Management gives every order one validated owner, so stock, promises and release stay in step

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal (ports & adapters) with strict inward-only dependency rule; DDD bounded context, pure HTTP consumer of suppliers plus Kafka choreography…
Layoutcmd/order (OLTP), cmd/mcp (read-only MCP), cmd/a2a (read-only A2A), cmd/order-projector (analytics writer), cmd/order-reports (read-only reader)…
StoragePostgres 16 via pgxpool with golang-migrate run on boot (14 OLTP *.up.sql migrations, direct non-PgBouncer DSN, ADR 0029)…
Testinggodog/Gherkin BDD (20 *.feature) driving the real REST API; httptest per endpoint; -race; 90% coverage gate on domain+application; MCP evals/governance tests; Schemathesis contract…
REST8 operations over 7 paths on :8080: /healthz, /readyz, /orders, /orders/{id}, /orders/{id}/releases, /orders/{id}/allocation-retries…
Gochipgxpool / Postgres 16golang-migratesegmentio/kafka-goCloudEvents 1.0OpenTelemetryslog JSONmodelcontextprotocol/go-sdkA2A agentgodog BDDarch-go fitness tests