Require reviewed workflow source hash on start - #557
Conversation
Todos: 40083146-e1a1-4c59-a7b6-a164e27ff37b Agent: agent-chief-shipping
ea1e118 to
275f903
Compare
|
[REVIEW] NO_GO — #557 @ 275f903 — lens: correctness+security+gates, reviewer unresolved-account001 (1 of 1) Reviewed the exact range What I ran and read:
Authoritative forge check rollup read by name:
Blocking P0/P1 findings:
Non-blocking follow-ups:
|
Problem
Managed workflow creation upserts a specification under a stable workflow record ID. Before this change,
startaccepted that record ID without the hash of the reviewed source, so a same-thread upsert could replace the reviewed YAML before start and the run could execute different source without an identity mismatch.Transactional, immutable-source solution
Workflow creation now returns the SHA-256 of the canonical stored YAML. Both the direct
manage_workflow startaction and the app-server v2 start request require that reviewed hash. Run creation reads the current specification and compares the expected hash inside the same database transaction; a mismatch fails before a run or goal plan is created. A matching start stores both the hash and the full source YAML on the run, and later activation reads that immutable run snapshot instead of a mutable specification. Idempotency replays also refuse a different source hash.Acceptance behavior
Migration and compatibility
Migration
0071_workflow_run_source_yaml_snapshot.sqladds a non-null source snapshot column and backfills existing workflow runs from their matching stored specifications. Existing workflow record IDs, list/read behavior, and same-thread upsert identity remain unchanged. Start is intentionally tightened: callers must pass the source hash returned by workflow create/read (expected_source_yaml_sha256for the manager tool andexpectedSourceYamlSha256for app-server v2).Remote verification
Blacksmith Testbox run
31512886705completed successfully at exact headea1e1189cf04cb5c4062477435dd95ea33ddfbefon 2026-08-11 at 17:19:15Z.Exact command:
Tracking and review
Todos task: OPE2-00322 —
40083146-e1a1-4c59-a7b6-a164e27ff37b.Reviewer status: pending. Independent adversarial review has not started.