Files
jason.woltje 068d868a99 lead: commit rocko's untracked evidence (4471 files: queue-124 queue-129 queue-171 queue-178 queue-280 queue-31 queue-84 queue-85 queue-94)
Unclaimed files left in the canonical checkout. Inventory: canonical-cleanup-inventory.md (commit-as-evidence groups). detect-secrets scan clean on 2026-11-02: hits are sha256 pins, git object ids, test sentinels already in tracked tests and unit-file lines.
2026-11-02 15:05:15 -06:00

21 lines
805 B
Python

from pathlib import Path
import os, re, sys
own = {os.getpid()}
pid = os.getppid()
while pid > 1 and pid not in own:
own.add(pid)
try: pid = int((Path('/proc') / str(pid) / 'stat').read_text().split(') ', 1)[1].split()[1])
except (OSError, ValueError, IndexError): break
busy = []
for p in Path('/proc').glob('[0-9]*'):
if int(p.name) in own: continue
try:
args = (p / 'cmdline').read_bytes().split(b'\0')
cmd = b' '.join(args).decode(errors='replace')
if any(x in cmd for x in ['shell-snapshots','chrome-devtools-mcp','busy.py','sage-busy-now']): continue
if re.search(r'node --test|gate\.sh|mutants?\.py|scripts/test-[a-z-]+\.sh|docker compose', cmd):
busy.append(int(p.name))
except OSError: pass
print('BUSY pids=' + ','.join(map(str,busy)) if busy else 'CLEAR')
sys.exit(bool(busy))