Skip to main content

Delivery Promise

As built

Derived from network/model/model.yaml. This context's service is built; the model carries its as-built contracts, and identifiers (Err... names, routes, CloudEvents types) are the names the service uses. It also has an analytics read side (delivery-promise ADR 0018): cmd/dp-projector projects this context's own topics into a separate analytical database, and cmd/dp-reports serves the read-only /reports/... routes on :8092. Wave 1 added four promise-quality capabilities (ADR 0020 to ADR 0023): a calibrated quote buffer with an optional confidence, a sweep that flags a promise AT_RISK with reason PREDICTED_LATE, a fast-tier candidate filter fed by NodeTierEligibilityChanged, and an optional capacityBand on offers. The pages below predate them; the model and the contract copies are authoritative.

Core

Delivery Promise (delivery-promise, code DP, tier commerce) tells a shopper, before and at purchase, the date a package will arrive, and makes that date true by construction. A delivery offer is quoted only when a feasible witness path exists now: an ACTIVE fulfillment node with the item, a pickup cutoff the node can still make, scheduled departures with room, and a delivery wave at the destination's delivery station. A promise holds capacity on the node's pickup cutoff (the PromiseBook) until the order is placed or the hold expires. When the path breaks, the context re-promises to a later window, never an earlier one. At delivery it judges every promise kept or broken, including every promise that shares the delivered package's tracking number. Besides the four classic tiers it can quote the opt-in CONSOLIDATED tier for a delivery day the shopper chooses. It owns three aggregates (DeliveryOffer, Promise, PromiseBook), its event-fed read models (plus one local read model fed by its own judgements) and its policies. It makes no synchronous call to any other context: every input of the promise hot path is a local read model fed by events.

This context's pages​

PageWhat it holdsddd-crew tool it follows
Business ContextThe business problem, actors, decisions, the real fulfillment networks and what is out of scope— (narrative)
Ubiquitous LanguageEvery term of this context and the neighbour terms it usesBounded Context Canvas (UL section, expanded)
Core Domain ChartWhy this is the Core domainCore Domain Charts
Bounded Context CanvasPurpose, classification, roles, inbound and outbound messages, decisions, metrics, open questionsBounded Context Canvas v5
Context MapEvery upstream and downstream neighbour, with pattern and channelContext Mapping
Aggregate Design CanvasDeliveryOffer, Promise, PromiseBook and the read modelsAggregate Design Canvas v1.1
Domain EventsThe published and consumed events, with a full CloudEvents envelope— (CloudEvents catalogue)
Domain Message FlowQuote, checkout, re-promise and judgement scenariosDomain Message Flow Modelling
EventStormingProcess-level boards with hotspotsEventStorming glossary & cheat sheet
Use CasesOne section per command use case, with errors and idempotency— (application layer)
Class DiagramThe proposed domain model and the hexagonal ports and adapters— (UML)
Entity RelationshipThe proposed Postgres schema— (UML / ER)
Sequence DiagramsAdapter → use case → aggregate → outbox for every command— (UML)

Service and operations​

  • Service: IQVO/delivery-promise on develop (806d835, 2026-10-26): binaries cmd/api (REST) and cmd/mcp (read-only MCP), and the console remote in web/.
  • Deployment: wired in warehouse-infra develop: a terraform/apps.yaml entry (database: true, frontend_remote: delivery_promise_mfe) and helm-values/delivery-promise.yaml (MCP enabled, gateway path /api/mcp/delivery-promise). The cluster itself was not checked in this refresh.
  • Observability: service ADR 0009, Adopt the fleet observability standard, Accepted 2026-10-26. Logs, metrics and traces leave over OTLP to the otel-collector (OTEL_EXPORTER_OTLP_ENDPOINT, chart default otel-collector.observability.svc.cluster.local:4317; OTEL_SERVICE_NAME). The Tier-2 business counter is promising.promises.made (unit {promise}, in internal/adapters/outbound/telemetry/promise_metrics.go), with attribute outcome = made or refused and reason on the outcomes that are not a success. The dashboard queries it as promising_promises_made_total in warehouse-infra's terraform/dashboards/contexts/delivery-promise.json, by outcome.

Elsewhere​

  • Read-only MCP server (service ADR 0007): cmd/mcp, a second binary serving Streamable HTTP on :8090 with no auth; it sources this context's own reads and nothing that writes. Five tools: get_current_policy, get_delivery_offer, get_promise, list_promise_books, list_promises_by_order. The gateway (Kong) exposes it at /api/mcp/delivery-promise, rewritten to the server's /mcp mount.
  • Console remote (service ADR 0008): web/, a Vite + React Module Federation remote — federation container delivery_promise_mfe, gateway mount /mfes/delivery-promise/, dev/preview port 4013 — read-only screens over the existing REST reads, calling only this context's API.
  • The worked promise example (one cart, one destination, every step of the search with numbers) lives in the promise model. This pack links to it rather than repeating it.
  • Decisions this context rests on: ADR 0002: promise and assignment are separate, ADR 0003: declared and measured capability, ADR 0008: capacity held at promise time, ADR 0007: CloudEvents namespace.
  • The REST contract (as built, from the service repository): apis/delivery-promise/openapi.yaml, rendered under the API reference.
  • Where this context sits among the twelve: the domain context map and the core domain chart.