Files
PaperClipAI/packages
Priya RamanandPaperclip 7779193a05 fix(runner): close the ACPX stale-gate recovery replacement race
Stale-gate recovery read a gate file, proved its holder dead, then
unlinked the gate by pathname. Another admission could replace the
gate at that same path in the gap between the read and the unlink,
so recovery could delete a live replacement gate instead of the dead
one it inspected.

Recovery now records the exact bytes of the gate it inspected and
re-checks the path immediately before removing it, unlinking only
when the bytes still match. A device-and-inode check cannot do this:
this filesystem reuses a just-freed inode number for a file created
right after at the same path, so a replacement gate can carry the
same identity as the one it replaced. The gate's own content gets a
random per-acquisition token for this purpose.

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-09-03 09:34:57 +00:00
..