warehouse-systems fleet · executive briefing

shopping-cart

Holds what a shopper wants to buy, with delivery options and an upfront cost estimate
eight capabilitys4 events out · 7 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

Shopping Cart keeps a shopper's intent current, so full cost and delivery choice show before checkout

1

Shoppers see a labelled estimate of prices, delivery charges and tax before they commit.

2

A cart is ready only when every shipment group has a tier and no offer has expired.

3

Agents already read carts through a read-only MCP server and A2A agent, both off by default.

The ask

Harden the delivery-promise outage path, then switch the MCP server and A2A agent on in a deployment.

why it exists

Shoppers should see the full cost before they reach checkout

Shopping Cart holds a shopper's intent between browsing and purchase: cart lines, the destination postal prefix, the delivery quote delivery-promise returned per shipment group, the shopper's tier selection per group, and a labelled, non-binding estimate (effective prices + selected tier charges + tax band) so the total cost is visible up front…

Today

It holds lines, destination, delivery quotes and tier choices, and keeps a labelled estimate fresh from price and tax events.

The catch

Quoting fails if delivery-promise is down, the estimate is non-binding, and a dead-lettered event silently skips an update.

what it does

Lines, delivery and a cost estimate stay current in one cart

Carts per shopper

Create, merge and list carts for each shopper.

Line management

Add, change or remove lines within clear quantity and line limits.

Destination and groups

A postal prefix sets the destination and splits lines into shipment groups.

Delivery quotes

Delivery-promise returns offers per group, with expiry and no capacity held.

Tier selection

Shoppers pick a delivery tier per group; readiness needs every group set.

Upfront estimate

A labelled, non-binding total of prices, delivery charges and tax band.

who it talks to

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

LISTENS TO · 7 EVENT TYPESIS HEARD BY · 0 CONTEXTSpricing4offer-availability2checkout1No downstream consumer yetshopping-cartbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

Shipment groups, quotes and readiness are the words that matter

THE LANGUAGEOF THE DOMAINCartCart LineDestinationDelivery QuoteQuoted OfferShipment GroupDelivery SelectionEstimate
REST11 operations over 9 paths on :8080
MCPRead-only MCP server (cmd/mcp, :8090…
A2ARead-only A2A agent (cmd/a2a, :8093): skills get_cart and…
how it is built

One Cart aggregate, an outbox and inbox, and REST, A2A and MCP doors

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808011 operations over 9 pathsMCP tools :8090Read-only MCP server…Kafka consumer · 7 eventsCatalogItemCreatedCatalogItemDiscontinuedDOMAIN CORECartCart LineDestinationDelivery QuotePostgreSQLPostgreSQLKafka producer · 4 eventscart.CartAbandonedcart.CartCheckedOutTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

7 incoming facts keep it fresh, and 4 cart facts go out

CONSUMED · BY SOURCE · 7PUBLISHED · BY ENTITY · 4pricing 4offer-availability 2checkout 14 cartCatalogItemCreatedCatalogItemDiscontinuedCheckoutCompletedDeliveryChargeScheduleChangedItemPriceChangedItemPriceWithdrawnTaxTableChangedCartAbandonedCartCheckedOutCartDeliveryQuotedCartLineAdded
how we know it is healthy

OpenTelemetry traces, one cart counter and a dead-letter topic watch it

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 85, mutant-coverage 90: below the 99/99 fleet standard)
by the numbers

9 decisions and 17 BDD feature files back the cart

9
Architecture decisions
#34 of 45 in the fleet
1
DB migrations
#32 of 45 in the fleet
17
BDD feature files
#15 of 45 in the fleet
4
Events published
#22 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 harden quoting and turn the agent doors on

NOW1Work the pre-releasechecklist toward RESTspec 1.0.0Work the before-first-releasechecklist and move the 0.1.0REST spec toward a stable 1.0.0NEXT2Harden thedelivery-promise outagepathHarden the delivery-promiseoutage path: a timeout,transport error or 5xx on POST/delivery-quotes answers 503delivery-promise-unavailableand stores nothing; degradequoting instead of failing thecart flowLATER3Raise the mutation gatefrom 85 to the 99standardRaise the mutation gate fromefficacy 85 / mutant-coverage90 to the 99/99 fleet standard(.gremlins.yaml:30-31)LATER4Switch on the MCPserver and A2A agent ina deploymentSwitch the MCP server and A2Aagent on in a deployment: chartmcp.enabled and a2a.enableddefault false (rollout notevidenced in the repo)
what could go wrong · and what we do about it

Our biggest risk is quoting that breaks when a neighbour is down

The estimate can differ from the binding quote

The estimate is non-binding by design; divergence from checkout's binding quote at confirmation is an accepted UX risk

→

The estimate is labelled non-binding; checkout requotes offers when it rejects one.

Quoting depends on delivery-promise being up

Delivery quoting depends synchronously on the delivery-promise Open Host Service…

→

Hardening the outage path so quoting degrades instead of failing the cart flow.

Dead-lettered events silently skip updates

Freshness rides on seven consumed event types; a poison message dead-letters and silently skips an update until reprocessed

→

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

Auth is off by decision; no PII or card data is held

Every REST, A2A and MCP 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

Harden the delivery-promise outage path, then switch the MCP server and A2A agent on in a deployment.

WHAT ISIt holds lines, destination,delivery quotes and tier choices,and keeps a labelled estimate freshfrom price and tax events.THE CATCHQuoting fails if delivery-promise isdown, the estimate is non-binding,and a dead-lettered event silentlyskips an update.WHAT COULD BECarts degrade gracefully whendelivery-promise is down, the RESTspec reaches 1.0.0, and agents readlive carts.
Why it matters

Shopping Cart keeps a shopper's intent current, so full cost and delivery choice show before checkout

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal (ports and adapters) with a Cart aggregate, transactional outbox + inbox (exactly-once effect), saga participant
Layoutcmd/{api (REST :8080, outbox relay, consumers, scheduler), a2a (agent :8093), mcp (server :8090)}; internal/{domain (cart aggregate, estimate, shared), application (usecases, ports)…
StoragePostgreSQL (cart aggregate, transactional outbox, inbox, idempotency keys; golang-migrate) + Kafka (produces retailnetwork.shopping-cart.analytics…
TestingDomain invariant unit tests, use cases over in-memory doubles, httptest adapter tests, godog BDD (17 feature files), testcontainers integration against real Postgres + Kafka…
REST11 operations over 9 paths on :8080: /carts, /carts/{cartId}, /carts/{cartId}/lines, /carts/{cartId}/lines/{catalogItemId}…
Go 1.27chiPostgreSQL + pgx v5KafkaMCP Go SDKa2a-goCloudEvents 1.0OpenTelemetrygodog Cucumber BDDtestcontainers