Skip to content

trogonstack/trogonstack-concurrency

v0.1.0MIT

Concurrency skills for finding and fixing time-of-check to time-of-use races in files, databases, caches, authorization, and distributed stores

concurrency-find-toctou

Find, prove, and fix time-of-check to time-of-use (TOCTOU) races: code that checks a condition, then acts as if nothing changed in between. Covers check-then-act in files (exists then open), databases (SELECT then INSERT, find-or-create, read-modify-write), authorization (permission check, later effect), caches (get-or-compute), distributed stores (NATS KV revision, JetStream expected sequence, event-store expected version), and async code (check, await, write). Each finding names the check, the act, the window, who can interleave, the consequence, and the fix. Use when reviewing code for race conditions, duplicate inserts, lost updates, double charges, stale permission checks, flaky tests under parallel load, intermittent 'already exists' errors, when asked 'is this atomic', 'can two requests collide', or 'what if this runs twice', and before adding a mutex, lock, or retry loop. Do not use for: deadlocks or lock ordering, performance tuning, memory-model data races, event model or NATS subject design.

Read SKILL.md at the source

Pinned to revision 411dd5a3eb5d, so it is the text this page describes rather than whatever the author pushed since.

Pre-approved tools experimental

Experimental field. Support varies between clients, so this list is what the author declared, not what your client will enforce.

  • AskUserQuestion
  • Read
  • Write
  • Shell

Files

Every link opens the file at its source, pinned to the revision this page describes.