Andrew Fribush

fig. 2.11.1: two worktrees claim one task: as refs in one git transaction, and as a status line in the file

fig. 2.11.1 · two worktrees claim one task: as refs in one git transaction, and as a status line in the file.
2 REFS, ONE TRANSACTION; B'S CLAIM FAILS BEFORE A LINE IS WRITTENREFS, ONE TRANSACTIONSTATUS LINE IN THE FILEONE BLOCK, ONE PLACE ON DISK, SHOWN AFTER BOTH CLAIMS; ACCENT: A'S CLAIMWORKTREE ABRANCH a/work$ pnpm task claim T-20260814-abcdef01 --agent aclaimed T-20260814-abcdef01 for a (rev 1 @ main, locks: spec-lock).agents/tasks/queued/T-20260814-abcdef01-spec-task.mdUNCHANGED. A CLAIM NEVER EDITS THE TASK FILE.SHARED .gitREAD BY EVERY WORKTREEONE update-ref --stdin TRANSACTIONONE create LINE PER REF ON STDIN; ALL OR NONEcreate refs/swarm/task-claims/T-20260814-abcdef01 54058e90create refs/swarm/task-locks/474cc8e6e4f0452f 54058e90BOTH REFS HOLD ONE CLAIM BLOB. THE LOCK REF IS SHA256("spec-lock"), 16 HEX.WORKTREE BBRANCH b/work$ pnpm task claim T-20260814-abcdef01 --agent bfatal: cannot lock ref 'refs/swarm/task-claims/T-20260814-abcdef01':reference already existsFAIL · exit 1 · NO REF WRITTEN. B PICKS ANOTHER TASK.A WRITES 2 REFSB'S create REFUSED

source: gated-swarm-starter scripts/task-claim.ts lines 32-33, 95, 205-208, 342 and scripts/task-claim.spec.ts lines 15-44 (f4a81c1), outputs measured in a throwaway repo · claimRace.data.ts

View in context: Claiming tasks with git refs → · All figures

Andrew Fribush, software and computer engineer in Austin. I build consequential systems where software meets institutions: finance, healthcare, commerce, government data, and the mechanisms that govern AI agents. Taking new engagements: hello@andrewfribush.com.