ADR 0004 — Task ownership via PostgreSQL compare-and-set
Claims use UPDATE tasks … WHERE id=? AND claim_version=? AND (status='open' OR lease expired); exactly one
concurrent claimer gets rowcount=1. Per-agent concurrency limits lock the agent row. Redis is never the source
of truth. Expired leases are claimable immediately and cleaned up by a worker job.