concurrency-reviewlisted
Install: claude install-skill tmj-90/gaffer
# Concurrency and data-integrity review lens
Race and crash defects pass every sequential test, so they sail through review unless
someone plays the bad schedule on purpose. Live runs shipped exactly this class twice:
concurrent writers sharing one temp-file name (HTTP 500), an unsynchronised
read-modify-write (lost updates), and a time-only stale-lock lease that let a second
process break the lock of a holder that was merely paused — losing a write the first
process had already acknowledged. Every reviewer scored correctness 4/5. This lens exists
so that does not happen again.
A finding here is a **concrete defect only when you can write the schedule**: the
ordered steps (who reads, who writes, who pauses or crashes, when) that end in a wrong,
observable outcome — a lost acknowledged write, a corrupt or partial file, a duplicate
effect, a 500, a deadlock. "Consider adding a lock" without a schedule is a note.
## Steps
1. **Establish the concurrency shape.** Can the changed code run twice at once? An HTTP
handler can (servers serve requests concurrently; Node interleaves at every `await`);
so can workers, cron jobs that overlap, CLI commands a user can start twice, multiple
processes or instances sharing one file or database. Check how the app is deployed
(worker count, cluster mode, replicas) and call `search_lore` for the repo's locking,
transaction and persistence conventions. If there is provably one writer and one
thread, write "single writer — n/a"