← ClaudeAtlas

concurrency-controllisted

Interleaving-first concurrency control for shared durable state. Use when designing, building, auditing, or diagnosing lost updates, double effects from concurrent requests, check-then-act races, duplicate submissions, optimistic vs pessimistic locking, version columns and ETags, unique-constraint arbitration, isolation anomalies like write skew, advisory and distributed locks, fencing tokens, leader election, or singleton work. Route job claim/lease design to durable-background-jobs, PostgreSQL lock contention as a bottleneck to postgres-performance, and constraint modeling to postgres-schema-design.
Dankosik/agent-skills · ★ 0 · AI & Automation · score 70
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