Skip to main content

Edge and supporting components

Besides the six bounded contexts, the storefront has three repos that carry no domain model and therefore no ddd-crew pack. All three are built on develop and registered in warehouse-infra develop (d12d05f, checked 2026-12-02: an entry in terraform/apps.yaml and a helm-values/<app>.yaml each); storefront-bff and payment-provider-simulator are applied to the k3s cluster (checked 2026-12-02: both api pods were Pending on the NotReady node k3s-agent2), and neither has its MCP or A2A component switched on there.

RepoWhat it isdevelopBinariesADRsDeployment
storefront-bffGo backend-for-frontend, the only storefront edge under /api/storefront; MCP server and A2A agent built on develop623d029cmd/api, cmd/mcp, cmd/a2a9released at v0.1.3 (cmd/api only); registered in warehouse-infra and applied to the k3s cluster (api pod Pending, checked 2026-12-02); MCP and A2A registered, switched off
storefront-webReact 19 + React Router 7 framework mode, SSR on Node161efc1Node server (server/), no Go5registered in warehouse-infra (cluster state not checked here)
payment-provider-simulatorGo stand-in for the external payment provider customer-payments calls; MCP server for test agents built on develop4ab9beacmd/api, cmd/mcp7released at v0.1.2 (cmd/api only); registered in warehouse-infra and applied to the k3s cluster (api pod Pending, checked 2026-12-02); MCP registered, switched off

storefront-bff and payment-provider-simulator adopted the fleet observability standard on 2026-10-29 (ADR 0003 of each repo: OTLP traces and metrics over OTEL_EXPORTER_OTLP_ENDPOINT, with OTEL_SERVICE_NAME, SERVICE_VERSION and ENVIRONMENT; no Tier-2 business counter, an edge and a stand-in have no domain outcome to count), and storefront-web has no OpenTelemetry dependency. The six context services adopted it on 2026-10-26/27 (see each context's Service and operations section).

storefront-bff​

The browser reaches the storefront only through this service. It has no domain model, no database and no Kafka producer or consumer; each route is a thin composition over upstream REST APIs, and upstream answers (including their RFC 9457 problem details) are relayed unchanged. Facts from its apis/openapi.yaml and ADR 0002:

  • State, not authentication. Cart, shopper and last checkout ids live in the sf_state cookie. There is no authentication anywhere.
  • Idempotency. The BFF mints an Idempotency-Key per user action (deterministic per route, subject and payload inside a ten-minute window, or pinned by the page with the Idempotency-Key header) and forwards it to upstream commands.
  • No PII at rest. Saved addresses pass through without being stored or logged; request and response bodies are never logged; only PSP payment-method tokens are accepted, never card data.
  • Time budgets. 2 s for queries, 5 s for commands, 15 s for checkout confirm (BUDGET_QUERY_MS, BUDGET_COMMAND_MS, BUDGET_CONFIRM_MS); an expired budget answers 504 and is never retried.
  • Upstreams (mandatory boot config, internal/config/config.go): PRODUCT_DISCOVERY_URL, PRICING_URL, SHOPPING_CART_URL, CHECKOUT_URL (four storefront contexts) and DELIVERY_PROMISE_URL, CUSTOMER_ORDERING_URL (two retail-network contexts, Open Host Service routes only). The BFF does not call product-content or customer-payments.

Route table​

All routes are under /api/storefront; the generated reference is under API Reference. The upstream column is read from internal/application/usecases/*.go.

BFF routeUpstream call(s)
GET /productsproduct-discovery GET /products (allow-listed search filters only)
GET /products/{id}product-discovery GET /products/{catalogItemId}
POST /products/{id}/delivery-date-quotesdelivery-promise POST /delivery-quotes, joined with pricing GET /delivery-charge-schedules/current (a missing schedule only drops the charge)
POST /cartsshopping-cart POST /carts
GET /cartsshopping-cart GET /carts
GET /carts/{id}shopping-cart GET /carts/{cartId}
POST /carts/{id}/linesshopping-cart POST /carts/{cartId}/lines
PATCH /carts/{id}/lines/{item}shopping-cart PUT /carts/{cartId}/lines/{catalogItemId}
DELETE /carts/{id}/lines/{item}shopping-cart DELETE /carts/{cartId}/lines/{catalogItemId}
PUT /carts/{id}/destinationshopping-cart PUT /carts/{cartId}/destination
POST /carts/{id}/delivery-quotesshopping-cart POST /carts/{cartId}/delivery-quotes
PUT /carts/{id}/delivery-selectionshopping-cart PUT /carts/{cartId}/delivery-selection
POST /checkoutcheckout POST /checkout-sessions
GET /checkout/{id}checkout GET /checkout-sessions/{sessionId}
POST /checkout/{id}/confirmationscheckout POST /checkout-sessions/{sessionId}/confirmations (15 s budget)
GET /orderscustomer-ordering GET /orders?shopperId=
GET /orders/{id}customer-ordering GET /orders/{orderId} plus GET /orders/{orderId}/tracking, and checkout GET /checkout-sessions/{sessionId} for the totals when the cookie's last checkout placed this order
POST /orders/{id}/cancellationscustomer-ordering POST /orders/{orderId}/cancellations
POST /shopperscustomer-ordering POST /shoppers
POST /sessionscustomer-ordering GET /shoppers?email= (sets the cookie's shopper id; not a login)
GET /mecustomer-ordering GET /shoppers/{shopperId}
POST /me/addressescustomer-ordering POST /shoppers/{shopperId}/addresses

Plus GET /healthz and GET /readyz (not in the spec). Every customer-ordering and delivery-promise route above is an Open Host Service route the network model opens to the storefront; none is in-org or restricted.

MCP server and A2A agent​

As built on develop (623d029, checked 2026-12-02) and not in v0.1.3 (v0.1.3:cmd/ lists api only): both surfaces landed on 2026-12-02, the MCP server in ad0f7a0 (ADR 0008, A shopper-shaped MCP surface that hands the purchase to the shopper) and the A2A agent in f3d601e (ADR 0009, An A2A agent with two goal-shaped skills, and a reorder suggestion on the MCP surface), both Accepted 2026-12-02. Neither is deployed: warehouse-infra helm-values/storefront-bff.yaml (develop d12d05f) sets no mcp or a2a block, so both chart components (default off, routes /api/mcp/storefront-bff and /api/a2a/storefront-bff through the Agent Router) stay off. Both are registered in warehouse-infra and switched off. There is no auth on either; the in-cluster boundary is the access control.

Both binaries reuse the REST edge's outbound REST client and composition use cases (the same six upstream URLs, the 2 s / 5 s / 15 s budgets, the per-host circuit breaker, MintKey) and have no database, Kafka, cookie or state. cmd/mcp listens on MCP_ADDR (default :8090, Streamable HTTP at /mcp only) and needs STOREFRONT_WEB_URL, the base of the continue_url; cmd/a2a listens on A2A_ADDR (default :8093, JSON-RPC at / and /a2a, Agent Card at /.well-known/agent-card.json with name storefront-bff, streaming: false and no security schemes) and needs A2A_AGENT_URL and STOREFRONT_WEB_URL. The MCP surface is pinned in internal/adapters/inbound/mcp/testdata/tool_registry.golden.json, nine tools, each carrying _meta com.warehouse/authority:

ToolAuthorityWhat it does
search_catalogL1 informOne page of products by free text, category, stock and price range, with nextCursor when there are more.
get_productL1 informOne product with effective and list price and stock; with a postalCode, an advisory delivery estimate per tier (an estimate, not an offer).
get_cartL1 informA cart by id: state, lines, the coarse destination (a postal prefix), the delivery quote, the chosen offers, the labelled estimate and checkout readiness.
get_order_statusL1 informAn order by id: state, lines, shipment groups with their promised window and tracking numbers, and the binding total when checkoutId names the checkout that placed it.
rank_delivery_optionsL2 recommendRanks a cart's quoted delivery offers per shipment group by code (earliest day, lowest charge, ...); rank 1 is the recommendation; changes nothing.
suggest_reorderL2 recommendSuggests cart lines from a past order (catalogItemId, quantity, availability, price-changed flag); creates no cart.
create_cartL3 act on approvalCreates an empty cart no shopper owns; requires an idempotencyKey.
update_cartL3 act on approvalReplaces the whole cart (lines, destination, delivery selections), requesting a fresh quote when needed; requires an idempotencyKey.
prepare_checkoutL3 act on approvalPrepares a cart for checkout (refreshes the quote) and returns a status, messages and a continueUrl into the web storefront; places no order.
SkillAuthorityWhat it returns
find_products_with_delivery (Find products with their delivery estimate)L1 inform (tag authority:L1)The products matching a query, each with its price, stock and an advisory delivery estimate for a postalCode; fronts search_catalog and get_product.
prepare_checkout (Prepare a cart for the shopper to check out)L3 act on approval (tag authority:L3)The same use case as the MCP tool: a status (requires_escalation, incomplete or not_open), the messages and a continueUrl; the shopper confirms on the web page.

A2A is delegation only: facts still travel as CloudEvents on Kafka, the agent makes no outbound A2A, MCP or REST call to a sibling agent, and no tool or skill places an order or reads a shopper, an address or a payment instrument. Authority levels follow the fleet's Agentic Standard; the surfaces are listed in the agent catalogue and on the A2A agents page.

storefront-web​

The server-side-rendered web experience: home, search and category, product page, cart, account, checkout, confirmation, orders and order detail with tracking (routes in app/routes.ts). Stack: React 19, React Router 7 framework mode with SSR on Node (ADR 0001), Vite, TypeScript strict, vitest, Playwright and Lighthouse CI; Node >= 22.18.

  • One backend. It talks only to storefront-bff through the relative base /api/storefront and never invents ids (ADR 0002). BFF_URL is server-only; npm start proxies /api/storefront to it, and STOREFRONT_STUB=1 serves an in-memory stub BFF for CI and demos (ADR 0005).
  • Strict CSP. Nonce-based Content-Security-Policy on every HTML response, no inline script or style, connect-src 'self' (ADR 0003).
  • Simulated payment fields. The page posts only a scenario token, never a card number (ADR 0004).
  • CI sensors (.github/workflows/ci.yml): web (lint, typecheck, coverage, build), no-network-url-in-bundle (the client bundle holds only /api/storefront URLs), lighthouse-budgets (LCP at most 2.5 s, TBT at most 200 ms, CLS at most 0.1), e2e (Playwright journeys against the stub BFF), guide-lint, docker-build.

payment-provider-simulator​

The external payment provider of customer-payments: its HTTP contract is the one customer-payments documents in ADR 0002, assumption A12, so replacing it with a real provider changes only PAYMENT_PROVIDER_URL in customer-payments. It owns a Postgres database (DATABASE_URL is mandatory; one migration, 0001_provider_schema), and it publishes and consumes no events (ADR 0002 A16): its apis/asyncapi.yaml declares no channels and no operations.

RoutePurpose
POST /tokensissue a scenario token tok_<scenario>_<suffix>
POST /authorizationsplace a hold: 201 with id and expiry, or 402 decline
POST /authorizations/{id}/voidsrelease the remaining hold
POST /authorizations/{id}/reauthorizationsreplace by a new hold (new id and expiry)
POST /authorizations/{id}/reductionslower the remaining hold (partial release)
POST /authorizations/{id}/capturescapture
POST /authorizations/{id}/refundsrefund captured money
GET /authorizations/{id}read a hold (test aid)

Every POST carries an Idempotency-Key. A 4xx decline is final (402 problem+json with a code member); 5xx and 504 are transient.

Test tokens. A token names its scenario, so a test always gets the same outcome. The bare literals tok_approve, tok_decline, tok_timeout and tok_expire-early work too.

ScenarioBehaviour
approveauthorizes; the hold lasts 7 days
declineevery authorization answers 402 payment-declined, code: CARD_DECLINED
timeoutanswers 504 provider-timeout after PROVIDER_TIMEOUT_DELAY (default 1 s, at most 2 s); no hold is created
expire-earlyauthorizes; the hold lasts 5 minutes, so re-authorization before expiry is testable
insufficient-fundsevery authorization answers 402 payment-declined, code: INSUFFICIENT_FUNDS (final, no hold)
authentication-deniedevery authorization answers 402 payment-declined, code: AUTHENTICATION_DENIED (final, no hold)

A string that is not a token is 422; a 13 to 19 digit string is refused as a card number. As built on develop (4ab9bea), POST /tokens also accepts an optional limits member for approve and expire-early tokens (currency, maxAmountMinor, expiresInSeconds), making them delegated test tokens that authorize, reauthorize and capture refuse above the limit with the final decline TOKEN_LIMIT_EXCEEDED (ADR 0007); the two scenarios above were added by the same ADR. Source: the repo's README and ADR 0002.

MCP for test agents​

As built on develop (4ab9bea, checked 2026-12-02) and not in v0.1.2 (v0.1.2:cmd/ lists api only): the MCP server landed on 2026-12-02 in 0277910 (ADR 0006, An MCP surface for test agents, Accepted 2026-12-02), which amends the repo's "No MCP, no A2A" charter for MCP only, so there is no A2A agent. The server is not deployed: warehouse-infra helm-values/payment-provider-simulator.yaml (develop d12d05f) sets no mcp block, so the chart's mcp component (route /api/mcp/payment-provider-simulator through the Agent Router, rewritten to /mcp) stays default off; it is registered in warehouse-infra and switched off. cmd/mcp serves Streamable HTTP on MCP_ADDR (default :8090, /mcp) over the same GetAuthorization and IssueToken use cases as the REST adapter, needs DATABASE_URL like cmd/api, and has no auth: the in-cluster boundary is the access control. The two L1 tools read through a read-only Postgres pool; the L3 tool reaches the unit of work, the idempotency store and the token-limits repository, and nothing else, so it can neither touch a hold nor draw randomness. The surface is pinned in internal/adapters/inbound/mcp/testdata/tool_registry.golden.json:

ToolAuthorityWhat it does
list_scenariosL1 informThe deterministic scenario vocabulary (approve, decline, timeout, expire-early, insufficient-funds, authentication-denied) with outcome, behaviour, an example token, hold validity and decline code; takes no arguments.
explain_paymentL1 informOne authorization: its token's scenario, the held, captured and refunded amounts, what can still be captured and refunded, the delegated-token limits and the ordered timeline (hold, captures, refunds, reauthorization).
mint_test_tokenL3 act on approvalMints a deterministic tok_<scenario>[_<suffix>] token with optional delegated limits (currency, maxAmountMinor, expiresInSeconds); requires an idempotencyKey.

POST /tokens and mint_test_token share one token constructor, so every authorization with a minted token ends the same way. Authority levels follow the fleet's Agentic Standard; the tools are listed in the agent catalogue.