New amendment to an existing bid. Cascade: diff against prior amendment, re-cost changed lines, regenerate affected spec sheets, update bid hub UI, surface deltas, deadline tracker update.
event["email_intake","manual_upload","portal_webhook"]| name | required | type / hint |
|---|---|---|
bid_id | required | — |
amendment_number | required | — |
amendment_doc_r2_key | required | — |
received_at | required | — |
bidbidsSELECT * FROM bids WHERE id=?
prior_linesbid_linesSELECT * FROM bid_lines WHERE bid_id=?
prior_amendmentbid_amendmentsSELECT max(amendment_number) FROM bid_amendments WHERE bid_id=?
| check | rule | severity |
|---|---|---|
bid_active | bid.status IN ('open','pending_submission') | block |
amendment_sequential | amendment_number = prior_amendment + 1 | 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_amendment_arrives (proposal envelope)workflow:bid_amendment_arrives:run_<run_id>update_bid_lines d1_write STUB["UPDATE bid_lines for changed entries","INSERT bid_lines for added entries","UPDATE bid_lines SET deleted_at=now for removed entries"]src/lib/workflow_runner.ts (kind d1_write hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.regen_specs http_call STUB/api/spec/regenerateany spec referenced by changed linessrc/lib/workflow_runner.ts (kind http_call hits the placeholder branch at line ~340 and emits step status 'stub'). Documented intent only.hub_cache_bust kv_invalidate REALhub:nycdoe:bid_?bid_idhub:bids:summary| 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_amendment_arrives, run_id, narrative) | runner automatic (reflexion_enabled=1) |
log_run | INSERT workflow_runs | declared in contract |
reflexion | INSERT reflexion_log with tags=bid_amendment,bid_id:? | declared in contract |
workflow_verify_results (pending — verify cron not yet wired)lines_updatedSELECT COUNT(*) FROM bid_lines WHERE bid_id=? AND updated_at > ?
hub_cache_busted3exponential100030000true| system | table / resource | action | status | source |
|---|---|---|---|---|
| KV (CACHE) | hub:nycdoe:bid_?bid_id | invalidate | REAL | fan-out #3 (hub_cache_bust) |
| KV (CACHE) | hub:bids:summary | invalidate | REAL | fan-out #3 (hub_cache_bust) |
| D1 | workflow_run_log | INSERT (run summary) | REAL | runner automatic |
| D1 | reflexion_log | INSERT (tags=bid_amendment_arrives) | 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 (update_bid_lines) |
| Worker HTTP | POST /api/spec/regenerate | invoke | STUB | fan-out #2 (regen_specs) |