Spec sheets are the contract document for every item we sell. This pipeline takes raw product input (manual paste, inbound email, vendor attachment, or NetSuite item sync) and produces an approved, dated PDF on R2 plus a structured row in spec_items. Workers AI does the heavy parse; Mike approves every diff before publish; Browser Rendering produces the PDF.
cost-ingestion.html — admin paste form · highest fidelitypricerequest@ai-globalfoodsolutions.co — CF Email Routing → src/email.tssrc/document_converter.ts → Markdownitems table; trigger on new item_idallergens · nutritionals · claims · pack_size · brand · GTIN · case_dimsPOST /api/specs/ingestconfidence_score ∈ [0,1]PUB (Melt Mates / Power Up) · RS (Right Start Foods) · PU · AIS · BR · TT · GFS · Harvest Promise~/Desktop/GFS-NetSuite-Cloudflare/source-documents/Specification-Sheet/spec_items (136 rows current)proposed_actions. Mike sees the diff against the prior spec_version and decides.proposed_actions · status='pending'confidence_score < 0.7/proposed-actions.html · X-Edit-Token required to approveUPDATE...RETURNING claim → one winner per rowBROWSER · Puppeteer-compatible APIPOST /api/specs/renderR2://specs/<item_code>/<version>.pdfenv.STORAGEspec_items with the new version number.spec_items (current) · spec_versions (history) · item_annotations (flags/notes)spec_status='approved' · spec_version++ · approved_at · approved_byGET /api/specs/<item_code> → latest + signed R2 URLbid_lines.item_code to spec_itemsget_spec_sheet({ item_code }) → spec data + signed R2 PDF URLlist_items_by_claim({ claim }) → items matching nutritional/allergen/marketing claim0 8 * * SUN — Sunday 08:00 UTCWHERE julianday('now') - julianday(rendered_at) > 90spec_version unless field diff detected| kind | name | purpose |
|---|---|---|
| table | spec_items | current spec per item_code · 136 rows · PK item_code |
| table | spec_versions | append-only history of every approved spec version |
| table | item_annotations | per-item flags, custom notes, manual overrides |
| endpoint | POST /api/specs/ingest | raw input → AI extract → stage proposed_action |
| endpoint | POST /api/specs/render | approved spec → PDF via Browser Rendering → R2 |
| endpoint | GET /api/specs/<item_code> | latest spec JSON + signed R2 PDF URL |
| chat tool | get_spec_sheet | retrieve current spec for one item by code or name |
| chat tool | list_items_by_claim | filter spec catalog by claim (kosher, gluten-free, halal, etc.) |
POST /api/specs/ingest not yet enabled.ns_pending_pushes staging.