Food-safety compliance use case. A vendor (e.g. Bongards Creameries, Driscoll Foods on USDA cheese, or a co-pack) emails a Certificate of Analysis attached to vendors@ai-globalfoodsolutions.co. The COA template extracts lot_number, item_code, test_date, an array of parameters_tested with results (moisture %, fat %, salt %, microbial), and the overall pass/fail. Output writes to the D1 vendor_coas table (TBD — not yet created; needs its own migration), updates item lot tracking, and fires events.coa.received for compliance subscribers. Failed lots route to a separate HITL action: hold-the-lot + notify warehouse. COAs are NOT on the SO/PO/WO golden path — they sit alongside as food-safety compliance.
| # | strategy | field | pattern | example |
|---|---|---|---|---|
| 1 | regex_after_label | lot_number | /Lot[\s#:]*([A-Z0-9\-]+)/i | LOT-2026053-BNG |
| 2 | regex_after_label | item_code | /Item[\s#:]*([A-Z0-9\-]+)/i | SKU-419 |
| 3 | regex_after_label | test_date | /Test Date[:\s]*([0-9\/\-\.]+)/i | 2026-05-22 |
| 4 | table_with_headers | parameters_tested[] | headers: Parameter / Result / Spec | moisture 36.4% / fat 32.1% / salt 1.7% |
| 5 | formula | pass_fail | all params within spec | pass |
items.lots_json; Option B introduces an item_lots child table.