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.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

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.

  1. Pivotal eventNodeScorecardUpdated
  2. Pivotal eventNodeThresholdBreached
  3. Pivotal eventNodeTierEligibilityChanged

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
  1. 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
    EventPurchaseOrderIssued
    PolicyWhenever a purchase order is issued, keep its ship-by and acknowledge-by deadlines
    CommandIntake.PurchaseOrderIssuedstarted by the policy
    Read model · kept up to datePurchase order deadlines

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/purchaseorder.go

  2. 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
    EventVendorShipmentConfirmed
    PolicyWhenever a vendor confirms a shipment, complete the purchase order's ship-by deadline
    CommandIntake.ShipmentConfirmedstarted by the policy
    Read model · kept up to datePurchase order deadlines

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/purchaseorder.go

  3. 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
    EventPurchaseOrderAccepted
    PolicyWhenever a purchase order is accepted or rejected, record how timely the answer was
    Read modelPurchase order deadlines
    CommandIntake.PurchaseOrderAcknowledgedstarted by the policy
    AggregateNodeScorecard

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/scorecard.go

  4. 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
    EventPurchaseOrderExpired
    PolicyWhenever a purchase order expires, record a late acknowledgement
    CommandIntake.PurchaseOrderExpiredstarted by the policy
    AggregateNodeScorecard

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/scorecard.go

  5. 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
    EventPackageHandedOver
    PolicyWhenever a package is handed over, record whether it beat the ship-by time
    Read modelPurchase order deadlines
    CommandIntake.PackageHandedOverstarted by the policy
    AggregateNodeScorecard

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/scorecard.go

  6. 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 node
    CommandIntake.PromiseKeptstarted by the policy
    AggregateNodeScorecard

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/scorecard.go

  7. 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 for
    CommandIntake.PromiseBrokenstarted by the policy
    AggregateNodeScorecard

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/scorecard.go

  8. 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
    EventInventoryFeedApplied
    PolicyWhenever a node's inventory feed is applied, record the time of the feed
    CommandIntake.InventoryFeedAppliedstarted by the policy
    AggregateNodeScorecard

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/observation.go · domain/scorecard/metrics.go

  9. 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
    EventInboundShipmentShipped
    PolicyWhenever an inbound shipment is shipped, keep its shipped time
    CommandIntake.InboundShipmentShippedstarted by the policy
    Read model · kept up to dateInbound shipments

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/inbound.go · 0009-inbound-timeliness-and-accuracy-metrics.md

  10. 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
    EventInboundReceiptSubmitted
    PolicyWhenever an inbound receipt is submitted, keep its carton counts
    CommandIntake.InboundReceiptSubmittedstarted by the policy
    Read model · kept up to dateInbound receipts

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · domain/scorecard/inbound.go · 0009-inbound-timeliness-and-accuracy-metrics.md

  11. 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
    EventNodeOperationalProfileDeclared
    PolicyWhenever a node declares its profile, record that the message arrived and change nothing
    CommandIntake.Acknowledgestarted by the policy

    Source: adapters/inbound/kafka/handlers.go · application/usecases/intake.go · 0002-aggregates-and-invariants.md

  12. 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 run
    PolicyEvery run, recompute the due scorecards and announce a changed grade or metric
    CommandRecomputestarted by the clock
    AggregateNodeScorecard
    EventNodeScorecardUpdated
    Systemdelivery-promise
    PolicyKeeps the 30-day grade; B pads handling time, C and D skip a pickup option
    Systemorder-sourcing
    PolicyKeeps the 30-day grade and adds a cost penalty for B, C and D

    Source: application/usecases/recompute.go · domain/scorecard/scorecard.go · domain/scorecard/grade.go

  13. 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 · earlierNodeScorecardUpdated
    PolicyWhenever a graded scorecard changes, raise a breach for each metric that crossed its bound
    CommandRecomputestarted by the policy
    AggregateNodeScorecard
    EventNodeThresholdBreachedanalytics stream only

    Source: application/usecases/recompute.go · domain/scorecard/scorecard.go · domain/scorecard/grade.go

  14. 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 run
    PolicyEvery run, flip a node's fast-tier eligibility when its 7-day on-time rate says so
    CommandRecomputestarted by the clock
    AggregateNodeScorecard
    EventNodeTierEligibilityChanged
    Systemdelivery-promise
    PolicyKeeps each node's eligibility per tier and leaves ineligible nodes out of fast-tier offers

    Source: 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.

Opportunities

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.