State Ownership
Which process owns each state transition and which database guard prevents conflicting writers.
Notes
- The create command owns input validation and the first durable
creatingtransaction; other CLI commands cancel and read eligible state. - Coordinators own expired run-creation recovery, expired chunk lease recovery, run dispatch, run finalization, and outbox publishing.
- Workers own chunk leases, attempt leases, execution attempt allocation, retry scheduling, and execution/attempt terminal transitions. Chunk-local worker state is addressed by
run_id + run_shard + chunk_id. - DB guards are the authority boundary: creation and coordinator leases, idempotent seed checks, shared run-state locks, chunk and attempt leases, conflict keys, current-attempt checks, worker ownership checks, and outbox delivery claim tokens prevent stale writes.