Bid Center — Path 2 · direct chat

Mike kicks off in chat → no email intake step → standardized 11-skill review

Mike opens chat (admin-dashboard chat or chat URL) and types something like load bid PDF + run review for ACC Distributors, or drag-drops a PDF into the chat. There's no proposed-action wait: Mike is the loop step, so the worker resolves the customer, picks the SY-version, preloads context, and runs the standardized 11-skill review. The trace thread (customer + SY-version) lights up the same downstream artifacts as Path 1. NS writes are still deferred to Path 3.

D1-mirrored Mike in-the-loop (no separate HITL gate) NS writes deferred to Jul 1 path

Pipeline — chat-initiated review

idle
Bid Center path 2 - Mike opens chat - intent stated - bid PDF attached - customer resolved - SY-version picked - context preloaded - skill chosen - 11-skill dispatcher runs - bid_* writes - .docx regen - STATUS.json refresh - dashboard rerender - events emitted - thread carried through LANE A / Mike kicks off in chat LANE B / Worker resolves customer + SY-version + preloads context LANE C / 11-skill dispatch + D1 writes LANE D / Outputs (.docx, STATUS.json, dashboard, events) WHAT THIS DOES: Mike opens the chat (admin-dashboard chat or direct chat URL). No email step. D1 TABLE: chat_session (INSERT on first message) TECHNICAL DETAILS: MIKE OPENS CHAT SURFACE admin-dashboard.html (chat panel) OR chat.ai-globalfoodsolutions.co STATUS: REAL Mike opens chat admin-dashboard.html / chat URL no email step EXTERNAL · chat UI i WHAT THIS DOES: Mike states the intent: load a bid PDF and run a review for a specific customer. The chat router routes to the bid_center handler. D1 TABLE: chat_message (INSERT) TECHNICAL DETAILS: MIKE TYPES INTENT EXAMPLES "load bid PDF + run review for ACC Distributors" "compare ACC quotes v2.4 vs v2.5" "log this external bid for NYC DOE B5875" ROUTER intent_router -> bid_center handler STATUS: REAL Mike states intent "load bid + run review for <customer>" routes to bid_center handler BACKEND i WHAT THIS DOES: Mike drag-drops a bid PDF (or pastes text). The document_converter normalizes to markdown. D1 TABLE: chat_message attachment; R2 bid-attachments TECHNICAL DETAILS: ATTACH BID PDF HANDLERS drag-drop -> upload to R2 bid-attachments paste -> treat as bid_markdown document_converter PDF/XLSX -> markdown STATUS: REAL attach bid PDF or paste content document_converter -> markdown source -> R2 bid-attachments BACKEND i WHAT THIS DOES: Customer is resolved via name_synonyms. If ambiguous, the chat asks Mike to confirm. Mike is in the loop already so no proposed_action is staged. D1 TABLES: bid_customers (READ), customers (READ) TECHNICAL DETAILS: RESOLVE CUSTOMER (in chat) ALGORITHM exact -> alias -> fuzzy AMBIGUOUS ask Mike inline: "do you mean ACC Distributors or ACC Foods?" STATUS: REAL resolve customer (inline confirm) name_synonyms.json fuzzy match no proposed_action wait DATABASE i WHAT THIS DOES: Pick the customer's SY-version. Mike can bump the version explicitly (v2.5 -> v2.6) or accept the suggestion. D1 TABLE: bid_quote_versions (READ) TECHNICAL DETAILS: PICK SY-VERSION LOGIC latest = SELECT sy_version FROM bid_quote_versions WHERE customer_id=? AND is_latest=1 ask Mike: "bump to next version?" STATUS: REAL pick SY-version (trace thread) latest is_latest=1 OR bump e.g. SY2627-v2.5 -> v2.6 DATABASE i WHAT THIS DOES: The chat session is hydrated with the bid markdown, the customer's customer.json, and the latest bid_quote_versions row. The LLM context now has all the facts needed to run the review. D1 TABLE: chat_message (system role) with preloaded payload TECHNICAL DETAILS: PRELOAD CONTEXT CONTEXT bid_markdown customer.json (region, terms, notes) bid_quote_versions latest row bid_price_snapshots for that version STATUS: REAL preload context (customer.json + bid markdown + latest SY) LLM context fully hydrated no proposed_action - Mike is the loop step CLOUD i WHAT THIS DOES: Mike picks (or LLM suggests) one of 11 skills. Most common from chat: ADD_UPDATE_CUSTOMER_PRICING, COMPARE_CUSTOMER_QUOTES, LOG_EXTERNAL_BID. D1 TABLE: chat_message (router decision) TECHNICAL DETAILS: DECIDE SKILL SKILLS CREATE_NEW_CUSTOMER · ADD_UPDATE_CUSTOMER_PRICING · ADD_UPDATE_ITEM · FILL_REGIONAL_PRICES · REBUILD_REGIONAL_SHEETS · COMPARE_CUSTOMER_QUOTES · LOG_EXTERNAL_BID · BID_PIPELINE · ARCHIVE_CUSTOMER · SYSTEM_HEALTH_CHECK · PREPARE_NEXT_SCHOOL_YEAR STATUS: REAL decide skill (1 of 11) Mike picks OR LLM suggests; common: ADD_UPDATE_CUSTOMER_PRICING BACKEND · skill picker i WHAT THIS DOES: The 11-skill dispatcher runs the chosen skill. Same dispatcher used by Path 1 and Path 3 - one canonical implementation. D1 TABLES: bid_* (UPSERT as appropriate to the skill) TECHNICAL DETAILS: DISPATCHER.RUN CONTRACT inputs: customer_id, sy_version, bid_markdown, extra_args outputs: bid_* writes, .docx render, STATUS.json patch SHARED same code path as Path 1 + Path 3 STATUS: REAL 11-skill dispatcher runs canonical implementation shared with Path 1 + Path 3 BACKEND i WHAT THIS DOES: D1 mirror updates. NS-bound writes are deferred to Path 3 (Jul 1 rollover) - this path NEVER touches NetSuite. D1 TABLES: bid_customers, bid_items, bid_quote_versions (sets is_latest=1), bid_price_snapshots, bid_external_pipeline, bid_reviews, bid_programs, bid_regional_prices TECHNICAL DETAILS: WRITE D1 bid_* INVARIANT no NS push on this path NS write deferred to Jul 1 path STATUS: REAL - migration 136 (Agent M) write D1 bid_* tables NS-bound writes deferred to Path 3 (Jul 1) BACKEND · mirror only i WHAT THIS DOES: Folder side (Customer-Pricing/<customer>/customer.json) is updated to stay parity with D1. FILE: Customer-Pricing/<customer>/customer.json TECHNICAL DETAILS: FOLDER SYNC ACTION patch customer.json with new sy_version + price changes optionally write Customer-Pricing/External_Bids/bids_log.json append (if LOG_EXTERNAL_BID) STATUS: REAL folder parity write (customer.json + bids_log) human-readable source-of-truth stays in sync DATABASE · folder i WHAT THIS DOES: .docx quote regenerates for the new SY-version. FILE: Customer-Pricing/<customer>/quotes/<sy_version>.docx TECHNICAL DETAILS: .docx REGEN TRIGGER bid_quote_versions write STATUS: REAL .docx regen per customer / SY-version CLOUD i WHAT THIS DOES: STATUS.json updated. FILE: Customer-Pricing/STATUS.json TECHNICAL DETAILS: STATUS.json REFRESH STATUS: REAL STATUS.json refresh last_touched_at + sy_version CLOUD i WHAT THIS DOES: Dashboard re-renders. URL: gfs-pricing.pages.dev TECHNICAL DETAILS: DASHBOARD RERENDER STATUS: REAL dashboard rerender gfs-pricing.pages.dev CLOUD i WHAT THIS DOES: Events fire for downstream subscribers. D1 TABLE: events TECHNICAL DETAILS: EVENTS bid.chat_review_completed bid.quote_versioned STATUS: REAL events emitted bid.chat_review_completed · bid.quote_versioned MESSAGEBUS i WHAT THIS DOES: The trace thread (customer + SY-version) carries into every row written by this path: chat_session, bid_quote_versions, bid_price_snapshots. Same thread as Path 1 - they converge. EXAMPLE: ACC Distributors / SY2627-v2.5 TECHNICAL DETAILS: TRACE THREAD CARRIED KEY customer_id + sy_version SHARED WITH Path 1 email + Path 3 rollover STATUS: REAL customer + SY-version threading e.g. ACC Distributors / SY2627-v2.5 FINANCE-KEY · trace thread i "load PDF" markdown ready customer + SY-version context loaded dispatch parity
Glossary
Database / folder JSON
Backend
Cloud (dashboard, .docx)
Messagebus (events)
Trace thread (customer + SY-version)
No HITL gate on intake: Mike is in the loop already
NS writes deferred: only Path 3 (Jul 1) pushes to NS

Tables, endpoints, code paths

kindnamepurpose
Code pathchat-pipeline.htmlchat UI
Code pathsrc/chat_tools/impls.tschat tool routing
R2 bucketbid-attachmentsPDF / XLSX
D1 tablechat_sessionsession identity
D1 tablebid_customerscustomer match
D1 tablebid_quote_versionsSY-version source-of-truth
D1 tablebid_price_snapshotsline-level
Eventbid.chat_review_completeddownstream