Routing Engine
Every allocation, fully explainable
Deterministic scoring — never Math.random()
Given an order line item and a pool of eligible suppliers, the routing engine returns a ranked (possibly split) allocation. It's a stateless, pure function — no side effects — so it's trivial to test and to scale horizontally.
Two-stage decision
Hard constraints first, then scoring
- 1
Filter by hard constraints
Compliance-region eligibility and certification requirements remove ineligible suppliers before scoring even starts — a compliance gap is never just a low score.
- 2
Score the remaining pool
A weighted multi-factor model ranks what's left. Ties break deterministically — by supplier tier, then supplier ID — so routing decisions are reproducible for audit and dispute resolution.
Default weighting
What moves the score
// RoutingDecision — the explainability log
chosenSupplierId: "meridian-supply-co"
score: 0.87
factorBreakdown: { price: 0.91, quality: 0.96, reliability: 0.98, leadTime: 0.6 }
requiresManualReview: false