warehouse-systems fleet · executive briefing

checkout

Takes a shopper from cart review to a placed, paid-for order in one safe step
eight capabilitys7 events out · 0 in9 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

Checkout runs each purchase as one saga, so no order lands without its payment held and its price confirmed

1

Payment is authorized before the order is placed, and voided if the purchase falls through.

2

An unknown place-order outcome is locked, never retried blindly, until a resolver settles it.

3

Status is readable over REST, MCP and A2A, and seven outcome events say how each purchase ended.

The ask

Load-test the in-doubt lock and resolver under broker and provider latency before the first release.

why it exists

A purchase touches price, payment and promise, and must not half-happen

Checkout owns the purchase saga from review to placed order: one transaction across price, payment and the network's promise confirmation. It authorizes payment before placing the order (compensatable: void), places the order as the pivot step, and drives retriable steps through clock-run policies…

Today

Checkout authorizes payment, places the order as the point of no return, then settles outcomes through clock-driven policies.

The catch

It reads every sibling synchronously and consumes no events, so an outage in ordering, payments, cart or pricing stalls buying.

what it does

Checkout authorizes, places and cleans up after every purchase attempt

Open a session

Starts checkout from a ready cart with a binding price quote.

Run the purchase saga

Authorizes payment, places the order, then settles the outcome.

Undo on failure

Voids the authorization when payment is declined or the price must change.

Resolve unknown outcomes

Locks an uncertain placement and settles it under a 15-second policy.

Clock-driven cleanup

Retries owed voids, frees stuck authorizations and expires stale sessions.

Publish outcomes

Sends seven outcome events through a reliable outbox.

who it talks to

It starts the flow: two build on what it publishes

LISTENS TO · 0 EVENT TYPESIS HEARD BY · 2 CONTEXTSNo upstream events: it starts the flowcustomer-payments1shopping-cart1checkoutbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

One session, one saga, and a lock for the moment we cannot know

THE LANGUAGEOF THE DOMAINCheckout SessionSagaPlace-Order StepAuthorizationIn-Doubt PlacementSemantic LockRequoteAllocation
REST3 operations over 3 paths on :8080
MCPRead-only MCP server (cmd/mcp, :8090…
A2ARead-only A2A agent (cmd/a2a, :8093): 1 skill…
how it is built

A hexagonal core with three front doors: REST, MCP and A2A

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :80803 operations over 3 pathsMCP tools :8090Read-only MCP server…DOMAIN CORECheckout SessionSagaPlace-Order StepAuthorizationPostgreSQLPostgreSQLKafka producer · 7 eventsCheckoutCompletedCheckoutDeclinedTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

Seven saga outcomes go out, and nothing comes in

CONSUMED · BY SOURCE · 0PUBLISHED · BY ENTITY · 77 checkoutsessionCheckoutCompletedCheckoutDeclinedCheckoutFailedCheckoutOpenedCheckoutPlacementInDoubtCheckoutRequoteRequiredCheckoutSessionExpiredConsumes nothing: it is a source
how we know it is healthy

Coverage, mutation and architecture gates guard every change

OpenTelemetry SDK -> OTLP/gRPC -> in-cluster Collector -> Jaeger (traces) and Prometheus (metrics); stdout JSON logs shipped by Alloy to Loki (fleet observability standard ADR)

What we watch

  • /healthz (liveness) and /readyz (readiness dials Postgres and Kafka) probes per binary
  • OTLP/gRPC trace + metric export that never blocks the request path (collector outage costs telemetry, not traffic)
  • stdout JSON structured logs collected via Alloy to Loki
  • inbound requestlog adapter records every API request

What stops a bad change

  • make check / check-all (fmt + vet + golangci-lint + unit + coverage)
  • coverage gate >= 90% on domain + application packages
  • make arch-test (arch-go hexagonal fitness functions)
  • make mutation / mutation-full (gremlins gate, thresholds efficacy 95, mutant-coverage 90: below the 99/99 fleet standard)
by the numbers

Nine recorded decisions and ten feature files pin the behaviour down

9
Architecture decisions
#34 of 45 in the fleet
2
DB migrations
#30 of 45 in the fleet
10
BDD feature files
#33 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)

helpbuildvetfmtfmt-checklinttestcoverageintegrationbddarch-testmutationmutation-fullvuln
what comes next

Four moves stand between checkout and its first release

NOW1Promote the REST specto 1.0.0Move the 0.1.0 REST spec to1.0.0 via thebefore-first-release checklistNEXT2Load-test the in-doubtlock and resolverLoad-test the PLACINGsemantic-lock and in-doubtresolver paths under broker andprovider latency before firstreleaseLATER3Declare agent authorityand pin a tool registryDeclare agent authority onget_checkout_session(com.warehouse/authority) andpin a tool-registry golden fileas its siblings do: neither isevidenced ininternal/adapters/inbound/mcpLATER4Raise the mutation gateto the 99/99 standardRaise the mutation gate fromefficacy 95 / mutant-coverage90 to the 99/99 fleet standard(.gremlins.yaml:30-31)
what could go wrong · and what we do about it

In-doubt orders hold money, and sibling outages stall the purchase

In-doubt placements keep shopper money on hold

In-doubt placements hold money: until the resolver settles an unknown place-order outcome…

→

Load-test the lock and the in-doubt resolver under broker and provider latency before first release.

Sibling outages stall checkout

Zero consumed events - all sibling facts are read synchronously, so availability is coupled to customer-ordering, customer-payments…

→

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

Schema drift could break byte-for-byte replay

Replay depends on byte-stable PII-free placement requests; a payload schema drift breaks byte-for-byte replay

→

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

No authentication on any endpoint, by decision

Every REST, MCP and A2A endpoint is unauthenticated by decision (fleet-wide auth revert 2026-09-11, TestNoAuthMiddlewareReintroduced)

→

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

the decision we need

Load-test the in-doubt lock and resolver under broker and provider latency before the first release.

WHAT ISCheckout authorizes payment, placesthe order as the point of no return,then settles outcomes throughclock-driven policies.THE CATCHIt reads every sibling synchronouslyand consumes no events, so an outagein ordering, payments, cart orpricing stalls buying.WHAT COULD BEA release-ready checkout: a 1.0.0spec, a proven in-doubt path, andagent tools that declare theirauthority.
Why it matters

Checkout runs each purchase as one saga, so no order lands without its payment held and its price confirmed

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal (ports and adapters) orchestrating a saga with a semantic lock; synchronous Anti-Corruption Layer to siblings, transactional outbox, zero consumed topics
Layoutcmd/{api (REST :8080, outbox relay, 5 saga policies), mcp (read-only MCP :8090), a2a (agent :8093)}; internal/{domain (checkoutsession aggregate, shared), application (usecases, ports…
StoragePostgreSQL (checkout_session aggregate, transactional outbox, global Idempotency-Key store…
TestingUnit tests over domain/use cases/httptest adapters, 90% coverage gate, godog BDD (10 feature files), repository-contract suite…
REST3 operations over 3 paths on :8080: /checkout-sessions, /checkout-sessions/{sessionId}, /checkout-sessions/{sessionId}/confirmations
Go 1.27chiPostgreSQL + pgx v5KafkaCloudEvents 1.0MCP go-sdka2a-goOpenTelemetrygodog Cucumber BDDtestcontainers