When Mike approves a new bid line price: cascade to NS pricing record, pricing_master, pricing_history, bid_lines, bid artifact regen, hub cache, spec_sheet review flag, customer notification.
hitl_approval"proposed_actions approved with action_type=bid_price_update"| name | required | type / hint |
|---|---|---|
customer_id | required | — |
sku | required | — |
new_price | required | — |
effective_date | required | — |
reasoning_text | required | — |
bid_id | optional | — |
current_pricingpricing_masterSELECT * FROM pricing_master WHERE customer_id=? AND item_code=?
bid_linebid_linesSELECT * FROM bid_lines WHERE bid_id=? AND item_code=?
vendor_costvendor_costsSELECT unit_cost, effective_from FROM vendor_costs WHERE item_code=? ORDER BY effective_from DESC LIMIT 1
| check | rule | severity |
|---|---|---|
vendor_cost_recency | effective_from > datetime('now','-7 days') | warn |
new_price_positive | new_price > 0 | block |
margin_floor | computed_margin_pct >= customer_program.margin_floor | warn |
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_bid_price_update (proposal envelope)workflow:bid_price_update:run_<run_id>write_ns ns_push STUBitempricingNS_PUSH_QUEUEretry_3_then_alertsrc/lib/workflow_runner.ts (kind ns_push hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.write_d1 d1_write STUBwrite_nssrc/lib/workflow_runner.ts (kind d1_write hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.update_bid_lines d1_write STUBbid_id presentsrc/lib/workflow_runner.ts (kind d1_write hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.regen_bid_artifact http_call STUBbid_id AND artifact_r2_keysrc/lib/workflow_runner.ts (kind http_call hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.invalidate_hub_cache kv_invalidate REALbid:{{bid_id}}bid_lines:{{bid_id}}hub:bid:{{bid_id}}pricing:{{item_code}}:*bid_id IN active_hub_bidsspec_sheet_check flag STUBabs(price_change_pct) > 5src/lib/workflow_runner.ts (kind flag hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.customer_notify hitl_email_draft STUBcustomer_has_open_quote AND price_increasesrc/lib/workflow_runner.ts (kind hitl_email_draft 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=bid_price_update, run_id, narrative) | runner automatic (reflexion_enabled=1) |
log_run | INSERT workflow_runs | declared in contract |
reflexion | INSERT reflexion_log | declared in contract |
customer_profile_touch | UPDATE customer_profiles.last_pricing_event | declared in contract |
workflow_verify_results (pending — verify cron not yet wired)ns_reflects_new_pricehub_cache_bustedd1_pricing_master_updated3exponential100030000true| system | table / resource | action | status | source |
|---|---|---|---|---|
| KV (CACHE) | bid:{{bid_id}} | invalidate | REAL | fan-out #5 (invalidate_hub_cache) |
| KV (CACHE) | bid_lines:{{bid_id}} | invalidate | REAL | fan-out #5 (invalidate_hub_cache) |
| KV (CACHE) | hub:bid:{{bid_id}} | invalidate | REAL | fan-out #5 (invalidate_hub_cache) |
| KV (CACHE) | pricing:{{item_code}}:* | invalidate | REAL | fan-out #5 (invalidate_hub_cache) |
| D1 | workflow_run_log | INSERT (run summary) | REAL | runner automatic |
| D1 | reflexion_log | INSERT (tags=bid_price_update) | REAL | runner automatic |
| Event | workflow.completed (or workflow.failed) | fire | REAL | runner automatic |
| D1 | workflow_verify_results | INSERT pending × 3 | REAL | runner verify staging |
| D1 | proposed_actions | INSERT (HITL gate envelope) | REAL | runner HITL gate |
| NetSuite (via NS_PUSH_QUEUE) | itempricing | push | STUB | fan-out #1 (write_ns) |
| D1 | unknown | write | STUB | fan-out #2 (write_d1) |
| D1 | unknown | write | STUB | fan-out #3 (update_bid_lines) |
| Worker HTTP | GET | invoke | STUB | fan-out #4 (regen_bid_artifact) |
| D1 | flags / status field | set = | STUB | fan-out #6 (spec_sheet_check) |
| D1 | proposed_actions | INSERT (email draft via tool) | STUB | fan-out #7 (customer_notify) |