CLAUDE.md's loop step 8 ('back to main, delete the branch') is impossible as written in a devs/ worktree, and fails silently with stderr suppressed nf-m5t ← Beads

open priority 2 task unassigned

Twinned from https://github.com/cfsh/ninefold/issues/770 by tools/beads/import_github.py's reconcile pass.

Found by nf-dev-gh-upgrade, reported during the #733 design round (design_docs/006, §2.12.2). Filed unclaimed.

The loop's last step cannot be executed on the box the loop runs on

CLAUDE.md's workflow step 8 reads:

> 8. Back to main, pull, delete the branch, drop the number from tracked-prs.txt.

In a devs/ worktree — the layout notes/office.md mandates, and the layout every dev session actually runs in — both halves fail:

nf-dev-gh-upgrade, verbatim:

> "I had 2>/dev/null on it, saw a plausible git log, and briefly believed I was on main. Recovery is git switch --detach origin/main — which appears in no doc I read."

The same collision shows up independently in the gh-pr-edit transcript (git checkout -q main → *"'main' is already used by worktree at '/root/nf/devs/bork'"*), so this is not a one-off.

Why it matters more than a typo

The two docs are individually right and jointly unsatisfiable: notes/office.md prescribes the worktree layout, CLAUDE.md prescribes a step that layout forbids, and nothing compares them. A session that suppresses stderr — reasonable, since the step is described as routine cleanup — ends up believing it is on main when it is not.

wrap_up.py already knows about worktrees; the loop step does not.

Shape of the fix

Either state the worktree-correct form in the step (git switch --detach origin/main, and let the branch be deleted by the merge rather than by hand), or — better, and the direction design_docs/006 argues for — move the step into the tool that already understands the layout, so the instruction stops being something a reader has to get right.

Related: #592, where thirteen documented ./tool.py entry points were not executable and the fix that worked was making presubmit gate the documented invocation form rather than correcting the prose.

Unclaimed and unlabelled — backlog.

Dependencies

None.

Comments

No comments.

Add a comment