race_prescan report — 5 file(s), 11 finding(s)

MEDIUM RC-EXISTS-USE       Worker.java:7  check-then-act on 'f' — exists here then open at line 8; the resource can change between test and use (fix = try/except, atomic ops, or lock)
       | if (f.exists()) {
MEDIUM RC-SYMLINK-USE      Worker.java:15  symlink check then delete of the same path (line 16) — target can be swapped between test and use; fix with O_NOFOLLOW / NOFOLLOW_LINKS / fd-relative ops
       | if (Files.isSymbolicLink(p)) {
MEDIUM RC-EXISTS-USE       app.py:11  check-then-act on 'path' — exists here then open at line 12; the resource can change between test and use (fix = try/except, atomic ops, or lock)
       | if os.path.exists(path):
MEDIUM RC-LOCKFILE-RACE    app.py:19  exists-check then create/write of lock/pid file 'lockfile' (line 20) — two starters can both take the lock; use O_EXCL create / mkdir / flock
       | if not os.path.exists(lockfile):
MEDIUM RC-LOCKFILE-RACE    daemon.sh:4  exists-check then create/write of lock/pid file 'PIDFILE' (line 8) — two starters can both take the lock; use O_EXCL create / mkdir / flock
       | if [ -f "$PIDFILE" ]; then
MEDIUM RC-EXISTS-USE       server.js:5  check-then-act on 'f' — exists here then delete at line 6; the resource can change between test and use (fix = try/except, atomic ops, or lock)
       | if (fs.existsSync(f)) {
MEDIUM RC-EXISTS-USE       server.js:12  check-then-act on 'f' — exists here then read at line 13; the resource can change between test and use (fix = try/except, atomic ops, or lock)
       | fs.access(f, () => {
LOW    RC-DIR-CREATE-RACE  app.py:28  existence check then non-atomic mkdir of 'd' (line 29) — usually benign but one edit from a real race; prefer exist_ok=True / recursive:true / catch EEXIST
       | if not os.path.isdir(d):
LOW    RC-EXISTS-USE       app.py:35  check-then-act on 'path' — exists here then open at line 36; the resource can change between test and use (fix = try/except, atomic ops, or lock) [lock context nearby — downgraded]
       | if os.path.exists(path):
LOW    RC-DIR-CREATE-RACE  server.js:19  existence check then non-atomic mkdir of 'd' (line 20) — usually benign but one edit from a real race; prefer exist_ok=True / recursive:true / catch EEXIST
       | if (!fs.existsSync(d)) {
LOW    RC-DB-CHECK-WRITE   users.py:11  check-then-write on 'cur' — the row gate at line 10 and this write are not atomic; two writers can both pass (fix = unique constraint + upsert / transaction)
       | cur.execute("INSERT INTO users VALUES (?, ?)", (uid, name))

scope: deterministic pre-scan — flags check-then-act shapes for review; not an audit, clean != race-free
