Bounded Context Canvas
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.
Following the ddd-crew Bounded Context Canvas v5.
Every message row maps to an entry of contexts[delivery-promise].inbound,
.publishes, .consumes or .rest in the model.
Canvas at a glance
Two pictures of the sections below, laid out like the ddd-crew canvas: first
the inbound collaborators feeding this context (with its purpose, domain roles
and the business decisions it enforces), then the outbound collaborators it
notifies. Arrows follow the message type: solid blue commands (cmd),
dotted green queries (qry), thick orange events (evt); each arrow
names its channel and the messages it carries. Box shapes mark the collaborator
kind: rounded = people, UI or any client; blue = sibling bounded context; grey
= this context's own analytics stream; dashed = published with no consuming
context ("analytics only" in the model). Channel names on the arrows are
abbreviated; the tables below carry the exact route, topic and CloudEvents type
for every message.
Inbound
Outbound
Derived from: model.yaml → contexts[delivery-promise].inbound,
.publishes[*].consumers, .aggregates[DeliveryOffer].notes, .sync_calls
(empty). The diagrams omit assumptions, verification metrics, open questions
and the ubiquitous language (sections below), the relationship pattern per
message (see the tables), the REST read routes with no named caller, and the
replies to the two REST calls. Node* 5 stands for NodeRegistered,
NodeOperationalProfileDeclared, NodeActivated, NodeSuspended,
NodeRetired; Lane* 2 for LaneOpened, LaneClosed; CatalogItem* 2
for CatalogItemCreated, CatalogItemDiscontinued; Listing* 4 for
ListingCreated, ListingAvailabilityChanged, ListingSuppressed,
ListingRestored.
Name
Delivery Promise (delivery-promise, code DP, CloudEvents tier
commerce).
Purpose
To tell a shopper, before and at purchase, the date a package will arrive, and to make that date true by construction:
- a delivery offer is quoted only from a feasible witness path (node cutoff, scheduled departures, delivery wave) that has remaining capacity;
- a promise holds that capacity on the witness node's pickup cutoff until the order is placed or the hold expires;
- when the path breaks, the promise is revised to a later window, never an earlier one;
- every promise is judged kept or broken at delivery.
Strategic Classification
| Axis | Verdict |
|---|---|
| Domain | Core (model classification: Core; chart differentiation 0.92, complexity 0.85). See the core domain chart page. |
| Business Model | Revenue generator (conversion) and cost reducer (no promise the network cannot keep). |
| Evolution | Custom-built. |
Domain Roles
| Role | Applies? | Evidence in the model |
|---|---|---|
| Execution (promising) | Yes, primary | MakePromise, ConfirmPromise, RevisePromise, JudgePromise; the Promise lifecycle. |
| Analysis (feasibility search) | Yes | QuoteDeliveryOffers and PromisePolicy: the earliest feasible witness path over seven read models. |
| Enforcer (capacity holds) | Yes | PromiseBook: provisional + confirmed <= share (ErrPromiseCapacityExhausted); ReleaseExpiredHolds. |
| Gateway / ACL | No | It conforms to every upstream's published language; it translates nothing at its boundary. |
| Specification | No | It publishes promise facts, not capability specifications. |
Inbound Communication
| Collaborator | Message | Type | Channel | Relationship |
|---|---|---|---|---|
| Shopper / storefront | QuoteDeliveryOffers | Query | REST POST /delivery-quotes | Open Host |
customer-ordering | QuoteDeliveryOffers | Query | REST POST /delivery-quotes (in-org) | Customer/Supplier (DP is the Supplier) |
customer-ordering | MakePromise | Command | REST POST /promises (in-org) | Customer/Supplier (DP is the Supplier) |
customer-ordering | CustomerOrderPlaced | Event | Kafka retailnetwork.customer-ordering.events, com.retailnetwork.commerce.customer-ordering.customerorder.CustomerOrderPlaced | Customer/Supplier |
customer-ordering | CustomerOrderCancelled | Event | Kafka retailnetwork.customer-ordering.events, com.retailnetwork.commerce.customer-ordering.customerorder.CustomerOrderCancelled | Customer/Supplier |
order-sourcing | FulfillmentUnsourceable | Event | Kafka retailnetwork.order-sourcing.events, com.retailnetwork.commerce.order-sourcing.assignment.FulfillmentUnsourceable | Customer/Supplier |
order-sourcing | FulfillmentLocked | Event | Kafka retailnetwork.order-sourcing.events, com.retailnetwork.commerce.order-sourcing.assignment.FulfillmentLocked | Customer/Supplier |
shipping-and-tracking | PackageDelivered | Event | Kafka retailnetwork.shipping-and-tracking.events, com.retailnetwork.logistics.shipping-and-tracking.journey.PackageDelivered | Conformist |
shipping-and-tracking | PackageExceptionRaised | Event | Kafka retailnetwork.shipping-and-tracking.events, com.retailnetwork.logistics.shipping-and-tracking.journey.PackageExceptionRaised | Conformist |
linehaul-transportation | DepartureScheduled | Event | Kafka retailnetwork.linehaul-transportation.events, com.retailnetwork.logistics.linehaul-transportation.departure.DepartureScheduled | Conformist |
linehaul-transportation | DepartureCapacityChanged | Event | Kafka retailnetwork.linehaul-transportation.events, com.retailnetwork.logistics.linehaul-transportation.departure.DepartureCapacityChanged | Conformist |
linehaul-transportation | DepartureCancelled | Event | Kafka retailnetwork.linehaul-transportation.events, com.retailnetwork.logistics.linehaul-transportation.departure.DepartureCancelled | Conformist |
last-mile-delivery | DeliveryWaveScheduled | Event | Kafka retailnetwork.last-mile-delivery.events, com.retailnetwork.logistics.last-mile-delivery.wave.DeliveryWaveScheduled | Conformist |
last-mile-delivery | DeliveryWaveCapacityChanged | Event | Kafka retailnetwork.last-mile-delivery.events, com.retailnetwork.logistics.last-mile-delivery.wave.DeliveryWaveCapacityChanged | Conformist |
node-topology | NodeRegistered | Event | Kafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeRegistered | Conformist |
node-topology | NodeOperationalProfileDeclared | Event | Kafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeOperationalProfileDeclared | Conformist |
node-topology | NodeActivated | Event | Kafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeActivated | Conformist |
node-topology | NodeSuspended | Event | Kafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeSuspended | Conformist |
node-topology | NodeRetired | Event | Kafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeRetired | Conformist |
node-topology | LaneOpened | Event | Kafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.lane.LaneOpened | Conformist |
node-topology | LaneClosed | Event | Kafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.lane.LaneClosed | Conformist |
node-topology | ServiceAreaAssigned | Event | Kafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.servicearea.ServiceAreaAssigned | Conformist |
node-topology | RegionDefined | Event | Kafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.region.RegionDefined | Conformist |
offer-availability | CatalogItemCreated | Event | Kafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemCreated | Conformist |
offer-availability | CatalogItemDiscontinued | Event | Kafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemDiscontinued | Conformist |
offer-availability | ListingCreated | Event | Kafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingCreated | Conformist |
offer-availability | ListingAvailabilityChanged | Event | Kafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingAvailabilityChanged | Conformist |
offer-availability | ListingSuppressed | Event | Kafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingSuppressed | Conformist |
offer-availability | ListingRestored | Event | Kafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingRestored | Conformist |
node-performance | NodeScorecardUpdated | Event | Kafka retailnetwork.node-performance.events, com.retailnetwork.partner.node-performance.scorecard.NodeScorecardUpdated | Conformist |
REST read routes with no named caller. The model's rest list also has
GET /delivery-offers/{offerId}, GET /promises/{promiseId},
GET /promises?orderId= and GET /promise-books?nodeId=&date=. No inbound
row names who calls them, so this canvas shows no collaborator for them (see
Open Questions). They are in the
OpenAPI contract.
Outbound Communication
Every event leaves through the transactional outbox on topic
retailnetwork.delivery-promise.events, source /retailnetwork/delivery-promise,
subject and Kafka key = the aggregate root id.
| Collaborator | Message | Type | Channel | Relationship |
|---|---|---|---|---|
| none (analytics only) | PromiseMade | Event | Kafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseMade | Published Language |
| none (analytics only) | PromiseConfirmed | Event | Kafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseConfirmed | Published Language |
customer-ordering | PromiseAtRisk | Event | Kafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseAtRisk | Customer/Supplier (DP is the Supplier) |
customer-ordering, order-sourcing | PromiseRevised | Event | Kafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseRevised | Customer/Supplier |
node-performance, customer-ordering | PromiseKept | Event | Kafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseKept | OHS + PL (node-performance is Conformist); Customer/Supplier with customer-ordering |
node-performance, customer-ordering | PromiseBroken | Event | Kafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseBroken | OHS + PL (node-performance is Conformist); Customer/Supplier with customer-ordering |
| none (analytics only) | PromiseReleased | Event | Kafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseReleased | Published Language |
| none (analytics only) | PromiseCancelled | Event | Kafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseCancelled | Published Language |
order-sourcing | PromiseBookExhausted | Event | Kafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promisebook.PromiseBookExhausted | Customer/Supplier |
| own analytics | DeliveryOfferQuoted | Event (analytics only) | Kafka retailnetwork.delivery-promise.analytics | Internal |
| — | — | Synchronous call | none: sync_calls: []; the promise hot path makes no synchronous call | — |
Full message details: the domain events page. Relationship reasons: the context map page.
Ubiquitous Language
Full glossary: the ubiquitous language page.
Top terms: Delivery Offer, Service Tier, Promise, Ship-By,
Deliver-By Window, Witness Path, Promise Basis (SCHEDULED /
NOMINAL), Promise Book, Capacity Hold, Handicap, Re-promise,
Promise Kept / Broken, Shipment Group.
Business Decisions
- No path, no offer. A delivery offer exists only if at least one feasible
path exists now. Otherwise that tier returns no offer and the constraint that
blocked it (
OfferConstraint). - Fast tiers are never quoted from nominal lane times. Only
STANDARDmay fall back to nominal transit, and the promise records basisNOMINAL(ErrNominalBasisNotAllowedForTier, ADR 0008). - A promise holds capacity. It reserves capacity on the node's pickup
cutoff (
PromiseBook); provisional holds expire if the order is not placed (ReleaseExpiredHolds). - One promise per shipment group. A multi-node order gets one promise per
group (
ShipmentGrouping,ErrGroupSpansNodes). - Handicap, never silent exclusion. A poorly performing node gets a later
ship-by by its scorecard grade (
ScorecardHandicap). - Kept means on time. Delivered on or before
deliverByLatest(JudgeOnDelivery). - Dates only move later. A revision never moves
deliverByLatestearlier (ErrRevisionMovesEarlier). - Peak control by deadline. Per tier and region, a policy-versioned local
order deadline (
TierOrderDeadline) stops new workable demand for that tier.
Assumptions
- Upstream events arrive within seconds. The read models are only as fresh as
the slowest topic; a stale
DepartureViewcan quote a departure that is already full. linehaul-transportationkeeps a 14-day horizon of departures (HorizonRoll), including one pickup departure per declared cutoff of everyACTIVEvendor fulfillment node; without it there is no witness path.last-mile-deliverypublishes waves ahead of time for every delivery station with a service area.- Every postal prefix the storefront sends maps to one delivery station
(
node-topology: one station per prefix per assignment version). - A cancelled departure is announced before its cutoff wherever possible
(
linehaul-transportationbusiness decision), so re-promising has time to act. - Customer-ordering places the order before the hold expires in the normal case; the hold is a guard, not the main path.
Verification Metrics
| Metric | Definition | Source |
|---|---|---|
| Promise-kept rate | PromiseKept / (PromiseKept + PromiseBroken) per tier, per region, per week | own events topic |
| Re-promise rate | PromiseRevised / PromiseConfirmed per tier | own events topic |
| At-risk rate | PromiseAtRisk / PromiseConfirmed | own events topic |
| Hold leakage | PromiseReleased / PromiseMade; a high value means checkout abandons or the hold is too short | own events topic |
| No-offer share by constraint | share of quotes per tier with no offer, split by OfferConstraint | analytics topic (DeliveryOfferQuoted) |
| Quote latency | p99 of POST /delivery-quotes; a target to set before build | HTTP metrics |
| Read-model lag | now - time of the last applied CloudEvent, per consumed topic | inbox (processed_events) |
NOMINAL share | share of STANDARD promises with basis NOMINAL | own events topic |
| Book exhaustion | PromiseBookExhausted per node per day | own events topic |
| Broken by cause | PromiseBroken grouped by cause and nodeId | own events topic |
Open Questions
Each one is a gap or an unstated rule in the model, reported to the model owner, not decided here.
- Offer shape for a multi-line group.
DeliveryOfferis described per (catalogue item, quantity, destination, tier), yet aPromisecovers a multi-lineShipmentGroupandPromiseMadecarries a singleofferId. This pack lets an offer carry the group's lines (one line on a product page). - Basis and policy version on the offer.
PromiseMadeneedsbasisandpolicyVersion;DeliveryOfferstores neither, andWitnessPathdoes not say how aNOMINALpath (no scheduled departures) is written. - What
FulfillmentLockedis for. It is consumed, but no policy or read model says what this context does with it. It is the only consumed event that carriesassignmentIdwithorderIdandgroupNo, which judgement needs (question 4), and it names the node that really ships, which the witness book does not count. - Finding the promise of a delivered package.
PackageDeliveredandPackageExceptionRaisedcarryassignmentIdandorderId, notpromiseIdorgroupNo. For a group shipped in several packages, the model does not say which delivery judges it. - A package that never arrives (resolved).
PackageLostandPackageReturnedare consumed: the promise of every assignment that shares the tracking number is judgedBROKENwith causeLOSTorRETURNED(ADR 0025), so a lost package's promise is judged. - A cancelled delivery wave (resolved).
DeliveryWaveCancelledis consumed: the wave is marked cancelled inDeliveryWaveViewand every active promise whose witness wave it is is flaggedAT_RISKwith reasonWAVE_CANCELLED, thenRepromiseOnRiskruns. - Where a book comes from (resolved, G9). The first
HoldCapacityfor a pickup opens the book (OpenBook, policyLazyBookOpening). Itsshareisceil(min(maxOrders, throughput cap x window) x capacitySharePercent / 100), at least 1 (policyBookShare). A clock job closes the book atcutoffAt(policyCloseBooksAtCutoff), and holds stop from theholdDeadline. - Who owns
TierOrderDeadline. No aggregate, route or event carries the deadlines orpolicyVersion, and noOfferConstraintnames "past the order deadline". - Handicap edge cases.
ScorecardHandicapin the model does not map gradePROVISIONAL(the promise model page reads it as no handicap), and does not say which scorecard window (7-day or 30-day) applies. As built, grades and handicaps read the 30-day window and the 7-day window gates the fast tiers throughNodeTierEligibilityChanged. - A late
CustomerOrderPlaced.customer-orderingnormally confirms synchronously, and the event consumer is the reconciling confirm. If the hold expired first, the consumer skips that group with a warning log (never retried), confirms the other groups of the order, and theReleaseExpiredHoldssweeper releases the lapsedPROVISIONALpromise; the placed order then has aRELEASEDpromise and no event tellscustomer-ordering. - Capacity on revision and cancellation. The model does not say whether
RevisePromisemoves the hold to a new book, or thatCustomerOrderCancelledmaps toCancelPromiseand releases confirmed capacity. This pack assumes both. - The read routes' callers. Four
GETroutes have no named caller. - Transaction boundary of
MakePromise. Consuming the offer, creating the promise and holding capacity touch three aggregates. This pack commits them in one local transaction (see the use cases page). - Vocabularies.
PromiseBroken.cause,PromiseAtRisk.reasonandPromiseReleased.reasonhave no enumerated values;offerTtland the hold TTL have no values.