Purpose
Deterministically compute deviation status, statistics and certificate cross-checks for every characteristic in the lot.
When to use
After spec-ingest, in every lot review.
Inputs
characteristics.json + measurements.csv + coc.json from spec-ingest (contract mfg.quality-inspection.v1 inputs).
Steps
- Validate inputs against the contract.
- Run scripts/tolerance_check.py --spec characteristics.json --measurements measurements.csv --coc coc.json --out deviations.json
- Quote the engine output verbatim - statuses, statistics, band consumption, incidence. Never restate or recompute a number in prose.
- If any characteristic carries doc_conflict=true, lead with it: the certificate says one thing, the measurements say another, and measurements govern (disposition-rules.md #4.3).
Output
deviations.json - the {deviations} hop: characteristics[] with stats, status, doc_conflict, confidence, source=engine:tolerance_check, citations.
Grounding requirements
Every characteristic row carries the drawing citation forwarded from spec-ingest; conflicts cite the certificate ID and the rule.
Constraints
- All math happens in the engine.
- No severity or disposition talk here - that is defect-grade's job.
- A certificate claim never suppresses a measured nonconformance.
Escalation / uncertainty
Engine escalations (missing tolerance #4.4, doc conflict #4.3) pass through verbatim to the payload and the eventual NCR.