The bridge between Data Tagger and Bid Center
RFPs and bid invitations arrive at bids@ai-globalfoodsolutions.co. The Data Tagger applies the bid_rfp template, extracts the canonical bid metadata (bid_id, customer / district, items[], decision_date, bid_value), and writes to bid_external_pipeline — a table owned by the Bid Center pillar (migration 136, Agent M). This is the crossing-the-streams moment: the Data Tagger's output becomes the Bid Center's input.
After insert, the bid_pipeline_review workflow fires; the Bid Center dispatcher picks one of 11 skills (typically LOG_EXTERNAL_BID on first arrival, then BID_PIPELINE for status rollup). From there, the bid lives in the Bid Center pillar: pricing work happens there, the .docx quote regenerates there, and if we win the bid the customer joins the 69-customer cohort and eventually rolls up into the Jul 1 named-list flip.
Diagram: ns-data-tagger-path-3-bid-rfp-to-pipeline.html. Downstream: ns-bid-center-master.html.
Trigger conditions
- School district, GPO, or large foodservice buyer emails an RFP / IFB / bid invitation to
bids@. - Document classifier recognizes
doc_type = bid_rfpfrom keywords. - Buyer resolvable from sender domain or fallback to NEW customer prompt.
- A bid template exists for the customer OR a district default template applies via inheritance (e.g.
tpl_nycdoe_bid_v2for NYC schools).
This is the most explicit cross-pillar handoff in the platform. Step 16 of the diagram closes the Data Tagger's involvement. From then on, the bid lives in the Bid Center.
NYC DOE B5875 Food Distribution
NYC Department of Education sends bid B5875 (Food Distribution, due Jun 3 2026, ~246 spec rows, ~$4.2M est) to bids@ai-globalfoodsolutions.co. Pipeline runs: log + R2 + parse. Sender domain resolves to customer_id = NYC DOE. Classifier returns doc_type = bid_rfp. Template lookup finds tpl_nycdoe_bid_v2 (district default).
5 strategies run:
regex_after_labelSolicitation # ->bid_id = "B5875"(0.95)literal_constantcustomer_id = "NYC DOE" (1.00)table_with_headersItem / Description / Qty / Unit -> 246 spec rows (0.89)regex_after_labelDecision Date -> "2026-06-03" (0.94)formulasum(qty * est_unit) -> bid_value = $4.2M est (0.78)
Weighted overall = 0.91. HITL stages "NYC DOE B5875 - approve pipeline insert?" Mike approves. INSERT bid_external_pipeline with status=proposed. bid_pipeline_review workflow fires, dispatches to LOG_EXTERNAL_BID. events.bid.rfp_logged fires; gfs-pricing.pages.dev bid_pipeline tile updates.
From step 16 on, the bid lives in Bid Center pillar. Mike decides whether to bid; if yes, FILL_REGIONAL_PRICES + ADD_UPDATE_CUSTOMER_PRICING work begins.
18 steps from RFP to Bid Center handoff
- 01-02
Intake
bids@ -> log + R2 + parse
- 03-05
Identify
buyer + doc_type + template (with district inheritance)
- 06-10
Apply 5 strategies
bid_id / customer / items[] / decision_date / bid_value
- 11
Confidence
weighted (bid_value lower weight - estimates fuzzy)
- 12
Stage proposed_action
data_tagger_bid_extraction - 13
INSERT bid_external_pipeline
★ cross-pillar write (Bid Center mig 136)
- 14
Trigger bid_pipeline_review workflow
Bid Center dispatcher fires
- 15
events.bid.rfp_logged
dashboard refreshes
- 16
★ BRIDGE to Bid Center pillar
Data Tagger's job is done
- 17-18
Reflexion + subscribers
template metrics + dashboards + notifications
What's different after the cycle
- Bid appears in Bid Center pipeline view (today 44 bids tracked · this would be #45).
- Reviewer (Mike or delegate) can decide go/no-go on bidding.
- If go: Bid Center pricing skills take over.
- If we win: customer enters 69-customer cohort for Jul 1 rollover.
What can go wrong
Buyer not in customers table. System flags customer_id=NEW; Mike resolves in HITL by picking the right customer (or creating a new bid_customers row).
Some RFPs ship as DOCX prose with no item table. table_with_headers fails; fallback to llm_with_schema which is expensive. Per-district template specialization helps.
Bid Center migration 136 (8 bid_* tables) is in flight (Agent M). Until landed, Path 3 stages but doesn't complete the insert; rows sit in data_tagger_extractions.
Adjacent flows + diagrams
Code paths + invariants
| Concern | Where |
|---|---|
| Mailbox | bids@ai-globalfoodsolutions.co |
| Email pipeline | src/email.ts |
| Parser | src/document_converter.ts |
| Template | tpl_nycdoe_bid_v2 in data_tagger_templates |
| Destination | bid_external_pipeline (Bid Center mig 136) |
| Workflow | bid_pipeline_review (Bid Center) |
| Workflow runner | POST /api/workflow/run |
| Event | events.bid.rfp_logged |
| Dashboard | gfs-pricing.pages.dev |
Dated trail
| Date | Round | Change | Touched by |
|---|---|---|---|
2026-05-27 | R598 | Path 3 wiki + diagram shipped. NYC DOE B5875 used as worked example. Pillar bridge documented (5 -> 4). | Mike + Claude |
5 field tags for bid_rfp template
| # | strategy | field | example (B5875) |
|---|---|---|---|
| 1 | regex_after_label | bid_id | B5875 |
| 2 | literal_constant | customer_id | NYC DOE |
| 3 | table_with_headers | items_json | 246 spec rows |
| 4 | regex_after_label | decision_date | 2026-06-03 |
| 5 | formula / llm_with_schema | bid_value | $4.2M est |
Pillar bridge field linkages
| From (Data Tagger) | To (Bid Center) | Field |
|---|---|---|
data_tagger_extractions | bid_external_pipeline | extraction_id -> source_extraction_id |
| extracted customer_id | bid_customers | customer_id |
| extracted bid_id | Bid Center workflow | bid_id |
It broke - what now
Scenario · bid extracted but not visible in Bid Center dashboard
Mike approved but the bid doesn't appear in gfs-pricing.pages.dev pipeline tile.
- Check bid_external_pipeline row:
SELECT * FROM bid_external_pipeline WHERE bid_id='B5875' - If missing: Bid Center mig 136 may not be landed. Check
SELECT name FROM sqlite_master WHERE name='bid_external_pipeline' - Check workflow ran:
SELECT * FROM workflow_run_log WHERE workflow_type='bid_pipeline_review' ORDER BY started_at DESC LIMIT 5 - Force re-render dashboard
Scenario · Unknown buyer; HITL stuck
Sender domain doesn't match; Mike sees customer_id=NEW.
- Add to customers if it's a real new buyer
- Add alias to name_synonyms.json if it's an existing buyer with a new domain
- Re-run extraction: POST
/api/data-tagger/applyagainst the R2 key
Logs to check
data_tagger_extractionsbid_external_pipeline(Bid Center mig 136)workflow_run_log(workflow_type=bid_pipeline_review)events(bid.rfp_logged)proposed_actions(kind=data_tagger_bid_extraction)
Open items for Path 3
- STUBBid Center migration 136
Agent M owns. Until landed, the cross-pillar write doesn't complete.
- DECISIONTemplate inheritance scope
NYC DOE template reused for similar schools? Probably yes via district default; needs explicit rule.
- OPENbid_value estimation strategy
Today
formulawith fallback tollm_with_schema. Estimates inherently fuzzy; consider weighting it 0 unless explicitly stated. - OPENFree-form RFP handling
RFPs without clean tables fall to expensive llm_with_schema. Per-district specialization recommended.