EDI Transaction Health

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.

The exchange being validated

Automotive inbound runs the same document chain with every supplier, in X12 for domestic partners and EDIFACT for cross-border ones:

StepX12EDIFACTDirectionPurpose
Planning schedule830DELFORoutForecast plus firm horizon
Shipping schedule862DELJIToutThe JIT release the supplier ships against
Functional ack997CONTRLinPartner confirms receipt and syntax
Advance ship notice856DESADVinWhat is on the truck, sent before it arrives
Invoice810INVOICinThree-way matched against ASN and PO

The eight rules

RuleThresholdConsequence when it fails
functional_ack997 back within 2hLine risk. No ack means the partner may never have received the schedule and is building to a stale one.
asn_lead_time856 at least 0.5h before the truckReceiving delay. Without an ASN there is no quick-receipt and the dock backs up.
asn_quantity_matchASN quantity equals the 862 release exactlyLine risk. What is coming is not what was scheduled.
asn_label_matchDeclared labels equal container countSupplier chargeback. A receiving scan will fail.
cum_reconciliationCum-shipped within 2% of cum-receivedLine risk. Releases are being computed off a wrong balance.
invoice_three_way_match810 within 0.5% of ASN times PO pricePayment blocked. A supplier on credit hold eventually stops shipping.
partner_connectionAS2 or VAN certificate valid 7+ days outPartner goes dark. The failure nobody notices until a weekend.
segment_syntaxAll required segments presentReceiving delay. The document will not post.

Why line risk is the headline number, not clean percentage

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.

Two counting units, kept explicit

The board carries two numbers that are easy to confuse, so they are named differently and both are shown:

NumberUnitMeans
Rule failures by rule / by consequencerule failuresBoth panels count individual rule failures, so they reconcile to the same total. One exchange breaking three rules contributes three to each.
The grey "ex" figuredistinct exchangesHow 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 exposureconsequence classEvery failure that could stop a line: functional_ack, asn_quantity_match, cum_reconciliation.
Escalated to line riskescalated exchangesA 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.

Scenarios and their signatures

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.

ScenarioModelsDominant rule
Clean dayNormal trading with a few stragglersnone, roughly 74% clean
VAN outageAcknowledgments stop coming backfunctional_ack
ASN driftPartner slowly diverging from usasn_quantity_match, with cum and label failures alongside
Certificates expiringPartners about to go darkpartner_connection
Three-way match failuresInvoices disagree with ASN and POinvoice_three_way_match

Reading an exchange

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.

Reproducing

python -m src.web.app --port=5000     # then open /automotive/edi
python -m pytest automotive_demos/tests/test_edi.py -q