gc hook --claim stamps gc.work_branch from the rig root's checkout, not the claiming session's worktree #31

Open
opened 2026-09-10 16:36:56 +00:00 by forgejo-admin · 0 comments

Summary

When a session claims a bead, gc writes gc.work_branch from 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 carry chore/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 by crew-builder at 2026-09-10T16:27:24Z. Its worktree .gc/worktrees/celilo/crew-builder is detached at origin/main, and its reflog holds one entry (09:17:59 PDT, the creation). The bead carries gc.work_branch: chore/agent-agnostic-config.
  • ce-nt4z, claimed by crew-cli at 16:17:45Z. Its worktree .gc/worktrees/celilo/crew-cli is on design/main-runs-what-the-mac-cannot, per the bead's own text. It carries the same gc.work_branch: chore/agent-agnostic-config.
  • git -C ~/hobby/celilo branch --show-current answers chore/agent-agnostic-config (head 2d00dd6a, 2026-09-09 14:24:59 -0700). That is the celilo rig root.
  • The city root ~/gc-scratch is on main, 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. An rg -uu across ~/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_branch records 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.
  • A test claims from a worktree on branch A while the rig root sits on branch B, and asserts A (or unset for a detached worktree).

Workaround used

None was needed. When crew-builder hands work to the refinery, it sets the branch metadata explicitly and does not rely on gc.work_branch.

  • #7: worktree evidence keys on pool triggers. This may be the same provenance family.
## Summary When a session claims a bead, gc writes `gc.work_branch` from 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 carry `chore/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 by `crew-builder` at 2026-09-10T16:27:24Z. Its worktree `.gc/worktrees/celilo/crew-builder` is detached at `origin/main`, and its reflog holds one entry (09:17:59 PDT, the creation). The bead carries `gc.work_branch: chore/agent-agnostic-config`. - `ce-nt4z`, claimed by `crew-cli` at 16:17:45Z. Its worktree `.gc/worktrees/celilo/crew-cli` is on `design/main-runs-what-the-mac-cannot`, per the bead's own text. It carries the same `gc.work_branch: chore/agent-agnostic-config`. - `git -C ~/hobby/celilo branch --show-current` answers `chore/agent-agnostic-config` (head `2d00dd6a`, 2026-09-09 14:24:59 -0700). That is the celilo rig root. - The city root `~/gc-scratch` is on `main`, 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`. An `rg -uu` across `~/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_branch` records 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. - [ ] A test claims from a worktree on branch A while the rig root sits on branch B, and asserts A (or unset for a detached worktree). ## Workaround used None was needed. When crew-builder hands work to the refinery, it sets the `branch` metadata explicitly and does not rely on `gc.work_branch`. ## Related - #7: worktree evidence keys on pool triggers. This may be the same provenance family.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
celilo/gascity#31
No description provided.