Skip to main content

Bounded context canvas

Following the ddd-crew Bounded Context Canvas v5, filled in from the code of develop.

1. Name​

Node Performance (node-performance, module github.com/claudioed/node-performance).

2. Purpose​

Measure every node of the retail network against what was asked of it, over rolling 7-day and 30-day windows, from observed facts only, and publish a grade. It keeps the network honest about what a vendor declared: the declaration is what the vendor says, the scorecard is what the network observes (Declared vs Measured).

3. Strategic classification​

DimensionValue
DomainSupporting (Performance Management), see Core domain chart
Business modelRisk reducer
EvolutionCustom-built
Tier / areapartner, retail network

4. Domain roles​

  • Execution context: it computes the grades itself (recompute) and analysis context for the other contexts, which read the result. Vendors see their own scorecard only through vendor-connectivity.
  • It is not a decision context for promises or sourcing: it grades, and delivery-promise, order-sourcing and people decide. The one decision it takes itself is the fast-tier eligibility flag of a node (FastTierEligibility, ADR 0013), which delivery-promise then applies.

5. Inbound communication​

MessageKindFromCollaboration pattern
PurchaseOrderIssued, PurchaseOrderAccepted, PurchaseOrderRejected, PurchaseOrderExpired, VendorShipmentConfirmed, InboundReceiptSubmitted, VendorOnboarded, SubmissionProcessedeventsvendor-connectivityConformist
PackageHandedOvereventshipping-and-trackingConformist
PromiseKept, PromiseBrokeneventsdelivery-promiseConformist
InventoryFeedAppliedeventoffer-availabilityConformist
NodeRegistered, NodeOperationalProfileDeclaredevents (no effect)node-topologyConformist
InboundShipmentShippedeventseller-inboundConformist
GetScorecard (GET /scorecards/{nodeId})queryvendor-connectivityCustomer/Supplier, this context is the Supplier
get_scorecard, list_scorecards_by_gradeMCP queriesagentsOpen host, read-only
node_performance, nodes_by_gradeA2A skillsagentsOpen host, read-only

6. Outbound communication​

MessageKindToChannel
NodeScorecardUpdatedeventdelivery-promise, order-sourcingKafka retailnetwork.node-performance.events
NodeTierEligibilityChangedevent (two per flip, one per tier)delivery-promiseKafka retailnetwork.node-performance.events
NodeThresholdBreachedeventanalytics (no in-organization consumer)Kafka retailnetwork.node-performance.analytics

No command and no query leaves the context: it calls no sibling.

7. Ubiquitous language​

Scorecard, Window, Observation, Grade, On-time handover rate, Late ack rate, Provisional, Threshold breach, Fast-tier eligibility, Reinstatement streak, Declared vs Measured; see Ubiquitous language.

8. Business decisions​

  1. A scorecard is computed only from observed facts, never from the vendor's declaration.
  2. A node with fewer than 50 observations in the window is PROVISIONAL, not A.
  3. Grades are A to D by the grading bars over on-time handover, promise-kept and late-ack rates.
  4. A metric that crosses its bound downward between two graded states raises NodeThresholdBreached.
  5. Only node-attributable broken promises (LATE, LATE_HANDOVER, VENDOR_REJECT, ACK_EXPIRED) count against the node; LOST and RETURNED do not.
  6. An acknowledgement in the last tenth of its ack window is late; an expired order is always late.
  7. A GRADED 7d scorecard with an on-time handover rate below 0.90 suspends the node from the SAME_DAY and NEXT_DAY tiers; 0.95 or more on three consecutive distinct UTC days of recompute reinstates it (FastTierEligibility, ADR 0013). A flip is published as NodeTierEligibilityChanged, one event per tier. A PROVISIONAL result changes nothing.
  8. This context never changes a node's status in node-topology and never changes a promise: it publishes the flag, and delivery-promise drops an ineligible node from the candidates of future quotes and estimates only (its apis/asyncapi.yaml).

9. Assumptions​

The numbered assumptions A1 to A23 live in ADR 0002 and ADR 0003; the ones that shape behaviour: the first observation creates both scorecards (A1), a metric with an empty denominator reports its best value (A5), the instant of a fact is the fact's own timestamp, not the envelope's (A3), the boundary instant of requiredShipBy is on time, and the read routes take no Idempotency-Key (A21).

10. Verification metrics​

MetricWhere
nodeperformance.scorecards.recomputed by outcome and reasonObservability
Unpublished outbox rows, attempts, consumer lag, DLQ trafficSQL and Kafka tooling, see the Runbook
Dashboard warehouse-node-performance and the Kong SLO alertswarehouse-infra
Coverage 90%, mutation efficacy 95 (measured 100)Testing

11. Open questions and discrepancies​

  • VendorOnboarded, SubmissionProcessed, NodeRegistered and NodeOperationalProfileDeclared are consumed with no effect (inbox row only). The declared profile never enters a metric, so there is no "declared next to measured" read model.
  • The informational inbound metrics are on REST reads but not on MCP, A2A or the event.
  • Inbound accuracy mixes node and seller causes until they are separated (model gap G52).