PR #800 follow-ups: a third pasteable command still sets a chunk branch upstream to origin/main nf-kga ← Beads

open priority 2 task unassigned

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

Suggestions from ninefold-reviewer's review of #800.

#800 fixes two commands that handed back the origin/main upstream #794 removed: spawn_dev.py's detached-worktree refusal line and session_start.py's cut_new advice. Both fixes are right and the PR is CONVERGED. Three residuals, none of them a defect in that diff.

1. tools/office/spawn_dev.py:909 — the standing-slot kickoff, and it is the most-travelled of the three.

```python "This worktree is DETACHED at origin/main on purpose — a standing " "slot has no chunk yet, so it has no branch name yet. When you are " "handed work, cut the branch first: " f"git checkout -b {names.branch} origin/main." ```

checkout -b <new> <remote-ref> sets tracking by the branch.autoSetupMerge default — the identical parse #794 removed from worktree_add_argv and #800 removed from the refusal line one function down. This one is not a recovery path: it is the instruction handed to every standing-slot dev at spawn, at the moment it cuts its chunk branch, so it recreates the defect on the normal path rather than a rare one. tools/tests/test_spawn_dev.py:1049 pins the spelling without the flag (assertIn("checkout -b feat/widget", text)), so the suite is currently holding it in place.

The fix is the same shape as the other two, flag before -b:

``` git checkout --no-track -b <branch> origin/main ```

If #800 is still open when you read this, this is one line plus that assertion in a file it already touches — fold it in, update the body's "Two other commands still handed the same upstream back by hand", and close this. #797 does not cover it; closing #797 on #800 leaves this with no home otherwise.

2. tools/pr/session_start.py:97 — the module docstring still advertises the advice #800 replaced.

> ⚠ The advice off main is git switch -c <name> origin/main, never git switch main

400 lines above the code that now prints git switch --no-track -c feat/<name> origin/main. Same drift class as #797 item 3 — a docstring falsified by a code change, DEV_PRINCIPLES C6 — in the same file, and it is the last place in the repo that spells the full form with a remote start point. CLAUDE.md:184 and design_docs/006-the-coders-front-door.md:388 both give git switch -c feat/<name> with no start ref, where git sets no upstream, so those are correct as written and want no change.

3. Optional, DEV_PRINCIPLES B7 — the --no-track rule still has two hand-written spellings in spawn_dev.py.

worktree_add_argv's docstring says "ONE definition of them"; create_worktree's refusal message spells the same fresh-vs-adoption asymmetry a second time by hand, and item 1 above is a third. That divergence is what produced the broken checkout -B --no-track flag order caught mid-#800 — the second spelling was wrong from the moment it was written, and nothing structural stopped it. Rendering the message (and the kickoff line) from one helper closes the category instead of this instance of it. #797 item 1 offered this as the alternative; #800 took the other option, which is fine and shipped.

Unclaimed and unlabelled.

Dependencies

None.

Comments

No comments.

Add a comment