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 WRITTEN REFS, ONE TRANSACTION STATUS LINE IN THE FILE ONE BLOCK, ONE PLACE ON DISK, SHOWN AFTER BOTH CLAIMS; ACCENT: A'S CLAIM WORKTREE A BRANCH a/work $ pnpm task claim T-20260814-abcdef01 --agent a claimed T-20260814-abcdef01 for a (rev 1 @ main, locks: spec-lock) .agents/tasks/queued/T-20260814-abcdef01-spec-task.md UNCHANGED. A CLAIM NEVER EDITS THE TASK FILE. SHARED .git READ BY EVERY WORKTREE ONE update-ref --stdin TRANSACTION ONE create LINE PER REF ON STDIN; ALL OR NONE create refs/swarm/task-claims/T-20260814-abcdef01 54058e90 create refs/swarm/task-locks/474cc8e6e4f0452f 54058e90 BOTH REFS HOLD ONE CLAIM BLOB. THE LOCK REF IS SHA256("spec-lock"), 16 HEX. WORKTREE B BRANCH b/work $ pnpm task claim T-20260814-abcdef01 --agent b fatal: cannot lock ref 'refs/swarm/task-claims/T-20260814-abcdef01': reference already exists FAIL · exit 1 · NO REF WRITTEN. B PICKS ANOTHER TASK. A WRITES 2 REFS B'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 .