Add atomic task status transitions to prevent race conditions between loops.
Problem: Three independent loops poll and mutate the same task database. A dev loop could promote a task to review while the reviewer is already mid-check, or an integrator could pick up a task that was just rejected.
Implement:
1. Add a task claim <id> <expected-status> <new-status> CLI command that atomically transitions status only if current status matches expected. Returns success/failure.
Example: task claim t-575 open in-progress succeeds only if status is currently open.
2. Use this in run_single_task and select_next_task:
3. If claim fails (status already changed), skip and move to next task. 4. This is a compare-and-swap pattern. Implement in Omni/Task/Core.hs with a SQL WHERE clause on current status.
Files: Omni/Task.hs, Omni/Task/Core.hs, Omni/Ide/dev-review-release.sh
Automation (dev) patchset 0 attempt 2/5 failed for run dev-t-587.5-20260211-182314.
Automation (dev) patchset 0 attempt 3/5 failed for run dev-t-587.5-20260211-182413.
Automation (dev) patchset 0 attempt 4/5 failed for run dev-t-587.5-20260211-183622.
Implemented atomic status claims for loop race protection in commit 8f4313d6. Added task claim command + Core claimTask CAS update, wired dev/review/integrator selection to claim transitions (open->in-progress, review->review-in-progress, approved->integrating), and added failure rollback of claimed review/integrating statuses. Extended status parsing for review-in-progress/integrating.
Automation (review) patchset 1 attempt 1/5 failed for run review-t-587.5-20260211-184416.
Manual review due agent budget exhaustion in review loop. Verified: (1) claim command works with correct exit semantics (success=0, failure=1) via live test task t-592, (2) typecheck.sh Omni/Task.hs passes, (3) bild Omni/Task.hs passes, (4) lint passes for Omni/Task.hs, Omni/Task/Core.hs, Omni/Ide/dev-review-release.sh. Reviewed diff on commit 8f4313d6 for CAS SQL update + loop claim wiring.
Automation (integrator) patchset 1 attempt 1/5 failed for run integrator-t-587.5-20260211-184503.
Integrator loop could not run to completion due provider budget exhaustion (CostExhausted) for run integrator-t-587.5-20260211-184503. Manually integrated commit 8f4313d6 onto live via integrator worktree as commit 24a7fdb4 after successful local verification (typecheck/lint/bild for Omni/Task.hs + claim command runtime test).
Automation (dev) patchset 0 attempt 1/5 failed for run dev-t-587.5-20260211-181719.