Skip to main content

Bounded Context Canvas

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.

Following the ddd-crew Bounded Context Canvas v5. Every message row comes from contexts[node-performance] (inbound, rest, publishes, consumes, sync_calls) or from a neighbour's entry that names this context.

Canvas at a glance​

Two pictures of the sections below: first the inbound collaborators feeding this context (with its purpose, roles and business decisions), then the outbound collaborators it notifies. Arrows follow the message type: solid blue commands (cmd), dotted green queries (qry), thick orange events (evt). Box shapes mark the collaborator kind: blue = sibling bounded context; grey = this context's own scheduler; dashed = a caller or consumer the model does not name. Channel names on the arrows are abbreviated; the tables carry the exact route, topic and CloudEvents type.

Inbound​

Derived from: model.yaml → contexts[node-performance].purpose, .roles, .business_decisions, .inbound, .rest, .consumes, .aggregates[NodeScorecard].throughput_estimate.

Outbound​

Derived from: model.yaml → contexts[node-performance].publishes, .sync_calls (empty).

Both diagrams omit the relationship pattern per message (see the tables), the assumptions, metrics and open questions below, and Postgres and Kafka as infrastructure. There is no outbound command or query arrow because sync_calls is empty: the reply to vendor-connectivity's query is drawn on the inbound side only.

Name​

Node Performance (node-performance, code NP, CloudEvents tier partner).

Purpose​

Measures every node against what it declared and what was asked of it: acknowledgement latency, rejections, on-time handover against requiredShipBy, promise-kept rate and inventory feed freshness, over rolling windows, and grades the node. The scorecard is built from observed facts only. It is published so that delivery-promise can handicap a weak node's promises and order-sourcing can price it, and it is readable by the node's vendor through vendor-connectivity.

Strategic Classification​

AxisVerdict
DomainSupporting. See the Core Domain Chart (complexity 0.34, differentiation 0.45).
Business ModelRisk reducer: promises rest on measured, not just declared, capability.
EvolutionCustom-built.

Domain Roles​

RoleApplies?Evidence in the model
Analysis (scorecard)Yes, primaryNodeScorecard with Metrics{onTimeHandoverRate, lateAckRate, rejectRate, expiryRate, promiseKeptRate, feedFreshnessP95Minutes, observations} and the Grading policy.
AuditYesEvery metric is traceable to counted source events (ErrDuplicateObservation keys on the source event id).
EnforcerNo"This context never suspends a node." The handicap is delivery-promise's.
GatewayNoVendors reach the scorecard only through vendor-connectivity.

Inbound Communication​

CollaboratorMessageTypeChannelRelationship
vendor-connectivityVendorOnboardedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.vendoraccount.VendorOnboardedConformist
vendor-connectivityPurchaseOrderIssuedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.PurchaseOrderIssuedConformist
vendor-connectivityPurchaseOrderAcceptedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.PurchaseOrderAcceptedConformist
vendor-connectivityPurchaseOrderRejectedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.PurchaseOrderRejectedConformist
vendor-connectivityPurchaseOrderExpiredEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.PurchaseOrderExpiredConformist
vendor-connectivityVendorShipmentConfirmedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.VendorShipmentConfirmedConformist
vendor-connectivitySubmissionProcessedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.submission.SubmissionProcessedConformist
vendor-connectivityInboundReceiptSubmittedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.inboundreceipt.InboundReceiptSubmittedConformist
seller-inboundInboundShipmentShippedEventKafka retailnetwork.seller-inbound.events, com.retailnetwork.partner.seller-inbound.inboundshipment.InboundShipmentShippedConformist
vendor-connectivityGetScorecardQueryREST GET /scorecards/{nodeId} (in-org), serving the Vendor API's GET /vendor/nodes/{nodeId}/scorecardCustomer/Supplier (this context is the Supplier)
shipping-and-trackingPackageHandedOverEventKafka retailnetwork.shipping-and-tracking.events, com.retailnetwork.logistics.shipping-and-tracking.journey.PackageHandedOverConformist
delivery-promisePromiseKeptEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseKeptConformist
delivery-promisePromiseBrokenEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseBrokenConformist
offer-availabilityInventoryFeedAppliedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.inventoryfeed.InventoryFeedAppliedConformist
node-topologyNodeRegisteredEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeRegisteredConformist
node-topologyNodeOperationalProfileDeclaredEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeOperationalProfileDeclaredConformist
Own schedulerRecomputeCommandIn-process timer, batched per minute (throughput_estimate)Internal
Not named in the modelList scorecards by grade (the model gives no message name)QueryREST GET /scorecards?grade=Open Host (read-only)

Every consumed event becomes, at most, one RecordObservation command on the node's scorecards. Which events actually produce an observation is in Domain Events.

Outbound Communication​

CollaboratorMessageTypeChannelRelationship
delivery-promiseNodeScorecardUpdatedEventKafka retailnetwork.node-performance.events, com.retailnetwork.partner.node-performance.scorecard.NodeScorecardUpdatedConformist (delivery-promise conforms; feeds its ScorecardView and ScorecardHandicap)
order-sourcingNodeScorecardUpdatedEventKafka retailnetwork.node-performance.events, com.retailnetwork.partner.node-performance.scorecard.NodeScorecardUpdatedConformist (order-sourcing conforms; feeds its ScorecardView and AssignmentCost)
Analytics onlyNodeThresholdBreachedEventKafka retailnetwork.node-performance.events, com.retailnetwork.partner.node-performance.scorecard.NodeThresholdBreachedPublished Language, no in-org consumer

No synchronous outbound call: sync_calls is empty. Full payloads: Domain Events. Relationship reasoning: Context Map.

Ubiquitous Language​

Full glossary: Ubiquitous Language. Top terms: Scorecard, Grade (A-D, PROVISIONAL), On-Time Handover Rate, Late Ack Rate, Declared vs Measured, Window (7-day, 30-day).

Business Decisions​

  1. Observed facts only. A scorecard is computed only from observed facts, never from the vendor's declaration.

  2. Provisional below the minimum. A node with fewer than the minimum observations in the window is graded PROVISIONAL, not A (ErrInsufficientObservations guards a grade without enough observations).

  3. Grading thresholds (Grading policy):

    GradeonTimeHandoverRatepromiseKeptRatelateAckRate
    A>= 0.98>= 0.97<= 0.01
    B>= 0.95>= 0.94<= 0.03
    C>= 0.90>= 0.90<= 0.05
    Dotherwiseotherwiseotherwise
  4. Count once. An observation is counted once, idempotent on the source event id (ErrDuplicateObservation).

  5. Report crossings. NodeThresholdBreached is published when a metric crosses its threshold downward (ThresholdAlert).

  6. Never suspend. Grades drive the promise handicap (owned by delivery-promise); this context never suspends a node.

Assumptions​

  • vendor-connectivity, shipping-and-tracking, delivery-promise and offer-availability publish every fact once per occurrence through their outboxes, and a redelivery carries the same CloudEvents id.
  • poNumber joins a handover (PackageHandedOver) to the purchase order's requiredShipBy (from PurchaseOrderIssued or VendorShipmentConfirmed).
  • nodeId is the same identifier in every producer (it is minted by node-topology).
  • A per-minute recompute is fresh enough for the handicap; nothing on the promise hot path waits for it.

Verification Metrics​

  • Freshness: time from a consumed event's CloudEvents time to the NodeScorecardUpdated that includes it; target under two recompute periods.
  • Coverage: share of ACTIVE vendor nodes with a GRADED 30-day scorecard.
  • Duplicates: count of ErrDuplicateObservation per hour (expected non-zero under redelivery, never counted into a metric).
  • Correlation gaps: PackageHandedOver observations whose poNumber has no known requiredShipBy; should trend to zero.
  • Predictive value: promise-kept rate of the following 7 days per grade; a D node should keep fewer promises than an A node, or the thresholds need tuning.
  • Breach rate: NodeThresholdBreached per node per week.

Open Questions​

Each comes from a gap in the model; none is answered on these pages.

  • minObservations (resolved). It is 50 outcomes, not 50 messages (ADR 0002 A5, gap G33); the model names the invariant but no value.
  • What are the literal window values? These pages use 7d and 30d.
  • Which window drives the handicap and the cost? Both windows publish NodeScorecardUpdated; neither consumer says which it reads.
  • How does delivery-promise treat PROVISIONAL? ScorecardHandicap defines A-D and "no scorecard yet", not PROVISIONAL.
  • What are the ThresholdAlert thresholds per metric, and what does "downward" mean for metrics where higher is worse (lateAckRate, rejectRate, expiryRate, feedFreshnessP95Minutes)?
  • Which PromiseBroken causes count against the node? The event carries cause, but no rule attributes a late linehaul to the network rather than the node.
  • How is feed freshness sampled? InventoryFeedApplied carries appliedAt but no asOf.
  • What do VendorOnboarded, SubmissionProcessed, NodeRegistered and NodeOperationalProfileDeclared feed? They are consumed, but no metric reads them, SubmissionProcessed and VendorOnboarded carry no nodeId, and the context declares no read model.
  • Who calls GET /scorecards?grade=? No inbound row names a caller.
  • How is the issue instant of a purchase order known? PurchaseOrderIssued has ackBy but no issuedAt; these pages read the CloudEvents time.