gc hook --claim stamps gc.work_branch from the rig root's checkout, not the claiming session's worktree #31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When a session claims a bead, gc writes
gc.work_branchfrom the branch the rig's ROOT checkout happens to be on, not from the claiming session's own worktree. Two crew beads claimed on 2026-09-10 both carrychore/agent-agnostic-config. Neither worktree has ever been on that branch. Anyone who reads the field to find the work will look at the wrong branch, and nothing about the value looks wrong.Evidence
ce-42q4, claimed bycrew-builderat 2026-09-10T16:27:24Z. Its worktree.gc/worktrees/celilo/crew-builderis detached atorigin/main, and its reflog holds one entry (09:17:59 PDT, the creation). The bead carriesgc.work_branch: chore/agent-agnostic-config.ce-nt4z, claimed bycrew-cliat 16:17:45Z. Its worktree.gc/worktrees/celilo/crew-cliis ondesign/main-runs-what-the-mac-cannot, per the bead's own text. It carries the samegc.work_branch: chore/agent-agnostic-config.git -C ~/hobby/celilo branch --show-currentanswerschore/agent-agnostic-config(head2d00dd6a, 2026-09-09 14:24:59 -0700). That is the celilo rig root.~/gc-scratchis onmain, so the value does not come from there.Consequence, and what was not checked
Nothing in the city's prompts, formulas or scripts reads
gc.work_branch. Anrg -uuacross~/gc-scratch, excluding worktrees, finds it only in the bead JSONL archives and.gc/events.jsonl. So today the cost is a field that misleads a person or an agent reading the bead.I did not check whether gc itself reads the field, for example as worktree evidence on a pool trigger (see #7, which is about the companion provenance keys). The city's rule is that no agent works in
~/dev/gascity, so the source was not read. If the stamp turns out to come from the pinned pack rather than the binary, move this to celilo/gascity-packs.Acceptance
gc.work_branchrecords the branch of the claiming session's work directory, or is left unset when that worktree is detached. It never records the rig root's branch.Workaround used
None was needed. When crew-builder hands work to the refinery, it sets the
branchmetadata explicitly and does not rely ongc.work_branch.Related