First PO or vendor add. Cascade: NS vendor record, D1 vendors, vendor_costs baseline, items index for which products could use it, sourcing alternative analysis, AR/AP setup.
manual["vendor_intake_form"]| name | required | type / hint |
|---|---|---|
company_name | required | — |
contact_email | required | — |
contact_phone | optional | — |
payment_terms | optional | — |
tax_id | optional | — |
initial_items[] | required | — |
existing_vendorvendorsSELECT id, companyname FROM vendors WHERE LOWER(companyname) = LOWER(?) OR LOWER(email) = LOWER(?)
| check | rule | severity |
|---|---|---|
no_duplicate | existing_vendor IS NULL | block |
Risk level 3 ≥ 3 — runner stages a proposed_actions row before fan-out runs. Mike must approve in proposed-actions.html before any side-effect step executes (real or stub).
workflow_new_ingredient_vendor_onboard (proposal envelope)workflow:new_ingredient_vendor_onboard:run_<run_id>write_d1 d1_write STUB["INSERT vendors","INSERT vendor_items (batch)"]src/lib/workflow_runner.ts (kind d1_write hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.write_ns ns_push STUBvendorNS_PUSH_QUEUEsrc/lib/workflow_runner.ts (kind ns_push hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.| id | action | source |
|---|---|---|
runner_log_run | INSERT into workflow_run_log (run_id, workflow_type, status, started_at, completed_at, summary_json) | runner automatic |
runner_reflexion | INSERT into reflexion_log (tags=new_ingredient_vendor_onboard, run_id, narrative) | runner automatic (reflexion_enabled=1) |
log_run | INSERT workflow_runs | declared in contract |
reflexion | INSERT reflexion_log with tags=new_vendor | declared in contract |
workflow_verify_results (pending — verify cron not yet wired)vendor_persistedSELECT id FROM vendors WHERE companyname=?
ns_vendor_reflects3exponential150030000true| system | table / resource | action | status | source |
|---|---|---|---|---|
| D1 | workflow_run_log | INSERT (run summary) | REAL | runner automatic |
| D1 | reflexion_log | INSERT (tags=new_ingredient_vendor_onboard) | REAL | runner automatic |
| Event | workflow.completed (or workflow.failed) | fire | REAL | runner automatic |
| D1 | workflow_verify_results | INSERT pending × 2 | REAL | runner verify staging |
| D1 | proposed_actions | INSERT (HITL gate envelope) | REAL | runner HITL gate |
| D1 | unknown | write | STUB | fan-out #1 (write_d1) |
| NetSuite (via NS_PUSH_QUEUE) | vendor | push | STUB | fan-out #2 (write_ns) |