An EDI failure is not an IT ticket. It is a line stop, a supplier chargeback, a receiving delay, or blocked payment. This demo validates the release-to-payment exchange with every trading partner and maps each failure to the consequence it actually causes.
Automotive inbound runs the same document chain with every supplier, in X12 for domestic partners and EDIFACT for cross-border ones:
| Step | X12 | EDIFACT | Direction | Purpose |
|---|---|---|---|---|
| Planning schedule | 830 | DELFOR | out | Forecast plus firm horizon |
| Shipping schedule | 862 | DELJIT | out | The JIT release the supplier ships against |
| Functional ack | 997 | CONTRL | in | Partner confirms receipt and syntax |
| Advance ship notice | 856 | DESADV | in | What is on the truck, sent before it arrives |
| Invoice | 810 | INVOIC | in | Three-way matched against ASN and PO |
| Rule | Threshold | Consequence when it fails |
|---|---|---|
functional_ack | 997 back within 2h | Line risk. No ack means the partner may never have received the schedule and is building to a stale one. |
asn_lead_time | 856 at least 0.5h before the truck | Receiving delay. Without an ASN there is no quick-receipt and the dock backs up. |
asn_quantity_match | ASN quantity equals the 862 release exactly | Line risk. What is coming is not what was scheduled. |
asn_label_match | Declared labels equal container count | Supplier chargeback. A receiving scan will fail. |
cum_reconciliation | Cum-shipped within 2% of cum-received | Line risk. Releases are being computed off a wrong balance. |
invoice_three_way_match | 810 within 0.5% of ASN times PO price | Payment blocked. A supplier on credit hold eventually stops shipping. |
partner_connection | AS2 or VAN certificate valid 7+ days out | Partner goes dark. The failure nobody notices until a weekend. |
segment_syntax | All required segments present | Receiving delay. The document will not post. |
A hundred cosmetic failures matter less than one failure on a part with three hours of cover. So every exchange is scored against the same clock the Line-Down demo uses. An exchange is escalated to line risk only when both conditions hold: it broke a rule whose consequence is line risk, and the affected part stops the line inside 24 hours.
This is why the demo has two scenario selectors. The EDI scenario decides what breaks. The inventory scenario decides whether it matters. Running the same VAN outage against normal inventory and against a launch ramp produces the same fault mix and very different business impact. EDI health read on its own is not actionable.
The board carries two numbers that are easy to confuse, so they are named differently and both are shown:
| Number | Unit | Means |
|---|---|---|
| Rule failures by rule / by consequence | rule failures | Both panels count individual rule failures, so they reconcile to the same total. One exchange breaking three rules contributes three to each. |
| The grey "ex" figure | distinct exchanges | How many exchanges are touched by that consequence class. Lower than the failure count wherever one exchange breaks several rules of the same class. |
| Line stop exposure | consequence class | Every failure that could stop a line: functional_ack, asn_quantity_match, cum_reconciliation. |
| Escalated to line risk | escalated exchanges | A strict subset: the affected part also stops inside 24 hours. This is the number to act on. |
Only line_risk (three rules) and receiving_delay (two rules) can diverge
between the two units. The single-rule classes, chargeback, payment blocked and partner outage, always
report the same figure in both, and the tests assert exactly that.
On the ASN drift scenario the gap is wide on purpose: 55 line-stop-exposure failures across 42 exchanges, of which 7 escalate to line risk. Reading the 55 as an emergency would be wrong, and reading the 7 as the whole problem would also be wrong. The distance between them is the triage.
Each scenario is tuned so the failure mix names the root cause, which is how a real morning gets triaged. The tests assert these signatures so they cannot silently drift.
| Scenario | Models | Dominant rule |
|---|---|---|
| Clean day | Normal trading with a few stragglers | none, roughly 74% clean |
| VAN outage | Acknowledgments stop coming back | functional_ack |
| ASN drift | Partner slowly diverging from us | asn_quantity_match, with cum and label failures alongside |
| Certificates expiring | Partners about to go dark | partner_connection |
| Three-way match failures | Invoices disagree with ASN and PO | invoice_three_way_match |
Click any row to expand it. The document flow shows the chain with each step marked, and the full eight rule trace lists every rule with its measured value and its limit, pass or fail. As with the inbound constraint engine, the complete trace is the product rather than a red or green light.
862 out 60u → 997 missing → 856 48u at 7.2h → truck 14.0h → 810 $28,800
× functional_ack no 997/CONTRL for 300012 sent at 2.1h; partner may be
building to a stale schedule
× asn_quantity_match ASN 48 units against a 60 unit release, -12 units
✓ asn_lead_time ASN landed 6.80h ahead of the truck
Synthetic, seeded data with failure rates tuned per scenario so each mode has a visible signature. The transaction sets, segment names and thresholds are realistic, but no real trading partner data, routing, or certificate is represented here. The demo validates a modelled exchange; it does not parse raw X12 or EDIFACT envelopes.
python -m src.web.app --port=5000 # then open /automotive/edi
python -m pytest automotive_demos/tests/test_edi.py -q