concurrency-controllisted
Install: claude install-skill Dankosik/agent-skills
# Interleaving-First Concurrency Control
Judge every mechanism against a concrete **interleaving**:
`shared state -> writers -> breaking schedule -> weakest mechanism -> conflict path -> failure windows -> prove`
A race is not "two things at once"; it is a specific schedule of reads and writes that violates a named invariant. Design against that schedule, prefer the weakest mechanism that closes it, and assume every "exclusive" holder can stall and resume after losing exclusivity.
## Choose the branch
Run only the branch the request needs. Record missing evidence as a gap instead of broadening the task.
- **Audit or diagnose:** enumerate every writer of the corrupted state, construct the breaking schedule that reproduces the observed damage, and propose the smallest closing mechanism plus a forced-interleaving proof. Keep code and production unchanged.
- **Design or plan:** map state, writers, and schedules, choose mechanisms and conflict dispositions to the fidelity requested; label artifacts proposed.
- **Build or fix:** apply the smallest mechanism change and a proof that fails on the old code under the forced schedule.
- **Operate:** releasing stuck locks, forcing leadership changes, or repairing raced state in production requires explicit authorization for the exact action and targets. Preflight, execute only that action, verify with fresh readback.
Hand work-queue claim and lease design to `durable-background-jobs`; PostgreSQL lock waits as a load or latency bott