Retail network · Supporting domain · EventStorming board
node-performance
Grades each fulfillment node on what it actually did over the last 7 and 30 days, and tells the network when a grade changes.
- events published
- 3
- commands
- 12
- policies
- 17
- read models
- 3
- hot spots
- 5
The story in 3 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventNode
Scorecard Updated - Pivotal eventNode
Threshold Breached - Pivotal eventNode
Tier Eligibility Changed
Listens to (6): contexts whose events this one reacts to
Tells (2): contexts that react to its events
The board, row by row
14 rows, in the order the business story happens: the main path first, then how this context reacts to the others, then the clock. Rows are small stories; read each one left to right.
- Event
- Command
- Actor
- Aggregate
- Policy
- Read model
- External system
- Hot spot
- Opportunity
-
Remember a purchase order's deadlines
When a vendor is sent a purchase order, this context keeps its ship-by and acknowledge-by deadlines. Later facts are judged against them. Nothing is counted yet.
Systemvendor-connectivity EventPurchaseOrder Issued PolicyWhenever a purchase order is issued, keep its ship-by and acknowledge-by deadlinesCommandIntake.PurchaseOrder started by the policyIssued Read model · kept up to datePurchase order deadlinesSource: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/purchaseorder.go
-
Fill in the ship-by deadline
The shipment confirmation repeats the ship-by deadline. It is merged into what is already known, so either message can arrive first. The vendor's own ship time is not used.
Systemvendor-connectivity EventVendorShipment Confirmed PolicyWhenever a vendor confirms a shipment, complete the purchase order's ship-by deadlineCommandIntake.ShipmentConfirmed started by the policyRead model · kept up to datePurchase order deadlinesSource: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/purchaseorder.go
-
Judge an acknowledgement
A vendor accepts or rejects a purchase order. The answer counts as late if it comes in the last tenth of the time allowed. Without the order's deadlines it cannot be judged and is retried.
Systemvendor-connectivity EventPurchaseOrder Accepted PolicyWhenever a purchase order is accepted or rejected, record how timely the answer wasRead modelPurchase order deadlinesCommandIntake.PurchaseOrder started by the policyAcknowledged AggregateNodeScorecard Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/scorecard.go
-
Count an expired order
A purchase order ran out of time without an answer. That counts against the node as a late acknowledgement, always.
Systemvendor-connectivity EventPurchaseOrder Expired PolicyWhenever a purchase order expires, record a late acknowledgementCommandIntake.PurchaseOrder started by the policyExpired AggregateNodeScorecard Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/scorecard.go
-
Judge a handover against the ship-by time
The carrier took a package from the node. It counts as on time if the handover is not after the purchase order's ship-by time; the exact boundary is on time.
Systemshipping-and- tracking EventPackageHanded Over PolicyWhenever a package is handed over, record whether it beat the ship-by timeRead modelPurchase order deadlinesCommandIntake.PackageHanded started by the policyOver AggregateNodeScorecard Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/scorecard.go
-
Count a kept promise
delivery-promise says a delivery promise was kept. That counts in the node's favour.
Systemdelivery-promise EventPromiseKept PolicyWhenever a promise is kept, record it for the nodeCommandIntake.PromiseKept started by the policyAggregateNodeScorecard Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/scorecard.go
-
Count a broken promise, if it is the node's fault
A broken promise only counts against the node when the cause is the node's: late, late handover, vendor refusal or an unanswered order. A lost or returned package is the network's, and is ignored.
Systemdelivery-promise EventPromiseBroken PolicyWhenever a promise is broken, record it only for a cause the node is responsible forCommandIntake.PromiseBroken started by the policyAggregateNodeScorecard Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/scorecard.go
-
Count an inventory feed
offer-availability applied a stock feed from the node. The gaps between feeds show how fresh the node's stock numbers are.
Systemoffer-availability EventInventoryFeed Applied PolicyWhenever a node's inventory feed is applied, record the time of the feedCommandIntake.InventoryFeed started by the policyApplied AggregateNodeScorecard Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/metrics.go
-
Note when an inbound shipment left
A seller's shipment to the node has been shipped. Its ship time is kept, first one wins, to compare with the receipt later. It is shown on reads but never graded.
Systemseller-inbound EventInboundShipment Shipped PolicyWhenever an inbound shipment is shipped, keep its shipped timeCommandIntake.InboundShipment started by the policyShipped Read model · kept up to dateInbound shipmentsSource: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/inbound.go · 0009-inbound-timeliness-and-accuracy-metrics.md
-
Note what an inbound receipt found
The node reports what it received for a shipment. Carton counts are kept, the first report wins, and the receipt is joined to the shipment when both are known. Shown on reads, never graded.
Systemvendor-connectivity EventInboundReceipt Submitted PolicyWhenever an inbound receipt is submitted, keep its carton countsCommandIntake.InboundReceipt started by the policySubmitted Read model · kept up to dateInbound receiptsSource: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/inbound.go · 0009-inbound-timeliness-and-accuracy-metrics.md
-
Note the node's declared profile and do nothing
The node's declared profile arrives and is only logged as seen. A grade comes from observed facts, never from what a vendor declared.
Systemnode-topology EventNodeOperational Profile Declared PolicyWhenever a node declares its profile, record that the message arrived and change nothingCommandIntake.Acknowledgestarted by the policySource: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · 0002-aggregates-and-invariants.md
-
Recompute the grades
A periodic run recomputes every scorecard that has new facts or facts that left the window. A node needs 50 observations to get an A to D grade; below that it stays provisional and nothing is published.
TimeRecompute runPolicyEvery run, recompute the due scorecards and announce a changed grade or metricCommandRecomputestarted by the clockAggregateNodeScorecard EventNodeScorecard Updated Systemdelivery-promise PolicyKeeps the 30-day grade; B pads handling time, C and D skip a pickup optionSystemorder-sourcing PolicyKeeps the 30-day grade and adds a cost penalty for B, C and DSource: application/usecases/recompute.go · domain/scorecard/scorecard.go · domain/scorecard/grade.go
-
Warn when a metric gets worse
When a graded node's metric crosses its bound in the wrong direction between two graded runs, a breach is raised, one per metric. It goes to analytics only, nobody in the network reacts.
Event · earlierNodeScorecard Updated PolicyWhenever a graded scorecard changes, raise a breach for each metric that crossed its boundCommandRecomputestarted by the policyAggregateNodeScorecard EventNodeThreshold analytics stream onlyBreached Source: application/usecases/recompute.go · domain/scorecard/scorecard.go · domain/scorecard/grade.go
-
Suspend or reinstate a node's fast tiers
On the 7-day card, a graded on-time handover rate below 90% suspends the node from same-day and next-day. Three separate days at 95% or better reinstate it. Each flip is announced once per tier.
TimeRecompute runPolicyEvery run, flip a node's fast-tier eligibility when its 7-day on-time rate says soCommandRecomputestarted by the clockAggregateNodeScorecard EventNodeTier Eligibility Changed Systemdelivery-promise PolicyKeeps each node's eligibility per tier and leaves ineligible nodes out of fast-tier offersSource: application/usecases/recompute.go · domain/scorecard/eligibility.go · 0013-fast-tier-eligibility-from-the-7-day-window.md
Hot spots and opportunities
Open questions and known gaps, each taken from a decision record or a document in the repository, never invented. Opportunities are improvements the documentation already names.
- Hot spotA handover or answer that beats its purchase order is retried, then parked in a failure queue. Nothing re-processes that queue.
Source: docs/ddd/eventstorming.md
- Hot spotDeclared profile next to measured behaviour is not modelled: the profile message is received and ignored.
- Hot spotThe broken-promise causes the model names differ from what delivery-promise sends; in practice only LATE counts against a node.
- Hot spotInbound accuracy mixes node and seller causes until they are separated. It is informational and never graded.
- Hot spotAfter a stuck event hits its send-attempt cap, a later event of the same scorecard can reach consumers first.
Opportunities
- OpportunityIf inbound timeliness should count towards a grade, a new decision is needed: the facts would become observations.
- OpportunityA node directory or a declared-versus-measured view could use the profile messages already received.
- OpportunityA compacted counter form is the follow-up if one node's volume grows by orders of magnitude.
This board is a reconstruction from the code and documentation of node-performance at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.