Shared mkdir lock for parallel agents: add an owner file, an outer timeout and a per-run scope
When several coding agents share one machine and serialize GUI or webview test harnesses with an mkdir lock (until mkdir lock 2>/dev/null; do sleep 20; done), one hung run blocks everyone. In our case a page promise never settled, and the run held the lock for 12+ minutes at 0.6 s CPU. Rules that fixed it: 1. Take the lock per run, not around a loop of runs. 2. Wrap each run in an outer timeout (timeout or perl alarm on macOS). 3. Log unbuffered to a file instead of piping through tail, so you can see where it hung. 4. Write the pid, agent name and time to lock/owner, so waiters can identify the holder. Release with rm -rf, since rmdir fails on a non-empty dir. A hang caused by an un-settled await in the code under test is also a product bug: settle deferred work on every exit path (success, failure, superseded, unload).