Node Performance
node-performance is a Supporting bounded context of the retail network (partner
tier, CloudEvents segment partner). The network does not run its fulfillment nodes: vendors do,
and every promise the network makes rests on what a vendor declared about a node. This
context answers one question in a repeatable way: how has this node actually behaved over the
last 7 and 30 days? It answers from observed facts only, never from the declaration (the
model's principle of Declared vs Measured), and publishes the result as a grade.
It consumes what the network observed (purchase orders issued, accepted, rejected and expired,
packages handed over against requiredShipBy, promises kept or broken, inventory feeds
applied, inbound shipments and receipts), keeps two NodeScorecard aggregates per node (a 7-day
and a 30-day one), computes six graded metrics, grades the node A to D from 50 observations
(PROVISIONAL below), raises NodeThresholdBreached when a metric crosses its bound, publishes
NodeScorecardUpdated for the contexts that act on the grade, and publishes NodeTierEligibilityChanged
when the 7d scorecard suspends or reinstates a node for the SAME_DAY and NEXT_DAY tiers.
:::info What runs on develop
Three binaries: cmd/api (a chi REST adapter with two read routes, six Kafka consumers, a
recompute scheduler and an always-on transactional-outbox relay, all in one process), a read-only
MCP server (cmd/mcp, ADR 0007) and a read-only A2A agent
(cmd/a2a, ADR 0011). It runs on real Postgres and real
Kafka only: there is no in-memory mode, and DATABASE_URL, KAFKA_BROKERS and the six consumer
group ids are mandatory (ADR 0006). Also
packaged: a Helm chart (charts/node-performance) and a console remote (web/, the
node_performance_mfe Module Federation remote, ADR 0008).
:::
What the context owns
| Concept | Where it lives | Rule in one line |
|---|---|---|
NodeScorecard (two per node, 7d and 30d) | internal/domain/scorecard | State PROVISIONAL or GRADED, grade A to D, metrics, observations; saved with a version guard (ADR 0002). |
| Observation | internal/domain/scorecard/observation.go | One measured fact keyed by the CloudEvents id of its source event; kinds ACK_ACCEPTED, ACK_REJECTED, ACK_EXPIRED, HANDOVER, PROMISE_KEPT, PROMISE_BROKEN, FEED_APPLIED. A source id counts once. |
| Grading policy | internal/domain/scorecard/grade.go | A: on-time ≥ 0.98, promise-kept ≥ 0.97, late-ack ≤ 0.01; B: 0.95 / 0.94 / 0.03; C: 0.90 / 0.90 / 0.05; otherwise D. Never below 50 observations. |
| Fast-tier eligibility | internal/domain/scorecard/eligibility.go | The 7d scorecard suspends a node from SAME_DAY and NEXT_DAY below 0.90 on-time handover and reinstates it at 0.95 on three distinct UTC days; published as NodeTierEligibilityChanged (ADR 0013). |
| Threshold alert | same file | Six bounds (on-time ≥ 0.90, promise-kept ≥ 0.90, late-ack ≤ 0.05, reject ≤ 0.10, expiry ≤ 0.05, feed freshness p95 ≤ 240 min); a downward crossing between two graded states raises NodeThresholdBreached. |
| PurchaseOrderFacts | purchase_order_facts table | Local copy of issuedAt, ackBy and requiredShipBy per purchase order, needed to judge acknowledgements and handovers (ADR 0003). Not aggregate state. |
| Inbound shipments and receipts | inbound_shipments, inbound_receipts | Joined by shipmentId into two informational metrics, inboundTimelinessP95Minutes and inboundAccuracyRate, shown on reads and never graded (ADR 0009). |
What it does not own
- Orders, promises, inventory, topology, shipments. They belong to
order-sourcing,delivery-promise,offer-availability,node-topologyandshipping-and-tracking; here they are only observed facts that arrive as events. Facts are never fetched from a sibling: the service calls no other context over REST, MCP or A2A. - The promise handicap and the choice of a node.
delivery-promiseandorder-sourcingread the grade fromNodeScorecardUpdated; this context publishes a grade and stops. - Suspending or blocking a node. That is a
node-topologydecision made by people. - The vendor's declaration. A low on-time rate does not rewrite the operational profile.
- Penalties and invoicing, and metrics for network-operated nodes (sortation centres, delivery stations), which receive no purchase orders and send no feeds.
- Authentication. REST, MCP and A2A are unauthenticated fleet-wide; the in-cluster ClusterIP boundary is the access control.
Classification and area
- Supporting subdomain. The grading rule is a replaceable policy over facts the network already produces; the competitive core of the network is elsewhere (Subdomain classification).
- Area: Network (retail-network), partner tier: event types look like
com.retailnetwork.partner.node-performance.scorecard.<EventName>. This service belongs to the retail network, not to the warehouse-systems fleet; the fleet reaches the network only through thevendor-connectivityVendor API. - The repository is a domain-driven-design study, not associated with any company.
Main capabilities
- Consume 15 event types from six producers on six topics, deduplicated on the CloudEvents
idwith dead-lettering (Integration). - Record observations on both windows of the node; the first observation creates the scorecards.
- Recompute the due scorecards every minute: drop observations that left the window, recompute six metrics, grade, and detect threshold crossings (Use cases).
- Publish
NodeScorecardUpdatedandNodeTierEligibilityChanged(topicretailnetwork.node-performance.events) andNodeThresholdBreached(topicretailnetwork.node-performance.analytics) through a transactional outbox with an attempt cap (Event catalogue). - Serve the scorecards read-only over REST (
GET /scorecards/{nodeId},GET /scorecards?grade=), MCP (get_scorecard,list_scorecards_by_grade) and A2A (skillsnode_performance,nodes_by_grade) (API overview).
Where to go next
| You want to | Read |
|---|---|
| See the layers, binaries, diagram and fitness rules | Architecture, Runtime |
| Run it and make the first calls | Quickstart |
| Know every setting | Configuration |
| Deploy and operate it | Runbook, Observability, Before first release |
| Fix something that broke | Troubleshooting |
| Know what tests and CI gates exist | Testing |
| See who talks to whom | Integration, MCP tools |
| Read the design | Ubiquitous language, Use cases, DDD artifacts |
| Read the contracts | API overview, Event catalogue |
| Read the decisions | ADR index |
Published at https://iqvo.github.io/node-performance/.
This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic.