Purpose
Enrich the disruption payload with grounded supply context: the ERP/MRP position for the part (on-hand, on-order, safety stock, lead time), the supplier master (single-source flag, approved alternates, substitutes), the BOM/where-used mapping and the open production/sales orders that consume the part, and the supplier's on-time delivery history (to reveal a chronic pattern).
When to use
- After disruption-intake, in every run.
- "Where is this part used and what's our on-hand?" / "has this supplier been late before?".
Inputs
disruption-intake.json(contract inputs from disruption-intake).- ERP inventory/MRP export (CSV): part, on_hand, on_order, safety_stock, lead_time_days.
- Supplier master (CSV): single_source, alternate suppliers + lead times, approved substitutes.
- BOM/where-used (CSV): parent product, component, per-unit qty, line.
- Open orders (CSV): order_id, type (production/sales), product, finished_qty, need_by, customer.
- Supplier on-time history (CSV): prior POs, promised vs actual, days late.
Steps
- Populate
supply{}:on_hand,on_order(the delayed PO qty),safety_stock,lead_time_days,single_source,substitutes[](withapproved+available_qty),alternates[](withlead_time_days+qualified). - Explode the BOM/where-used and join to open orders into
retrieved.open_orders[]: each withorder_type,product,line,finished_qty,per_unit,need_by,customer,high_runner. - Populate
history{}:window_days,late_count,on_time_pct,prior_shipments[], and setchronic_pattern = truewhen the supplier is repeatedly late (a systemic signal). - Attach supplier master + sourcing standards into
retrieved{}, each with a citation.
Output
The contract payload with populated supply{}, retrieved{} and history{} — the input to
shortage-impact-map.
Grounding requirements
Every open order cites its order record; every supply figure cites the ERP/master export; every prior shipment cites its PO row.
Constraints
- Retrieval only — do not map impact or choose a mitigation here (engine/LLM split).
- Do not infer an approved substitute or a qualified alternate the master does not state.
- Do not drop an open order (especially a customer sales order) that a shortage would hit; surfacing it is the point.
Escalation / uncertainty
- If the where-used, open-order or supplier-master data is unavailable, proceed on the PO and
on-hand alone and note it in
escalations[]; do not block the run.