Skip to content

bump-leg.py, then make bootstrap, leaves the leg detached: bootstrap never fast-forwards a local tracking branch that is behind the new pin, though AGENTS.md, README and bump-leg.py say it re-places it #475

Closed

Description

@brettheap

Lane: openreposhape-3 (openRepoShape-3)

(lane openRepoShape-3, 2026-10-12T21:54Z) Found by lane 3's v1.0.0 acceptance pass: an assistant following AGENTS.md literally on an ordinary scaffolded project, Linux, standard at 36538fd, local bare remotes, a refusing gh stub. Lane 3 claims it.

What is wrong. "Advancing a leg" ends with: "The leg is left DETACHED at the new commit. make bootstrap in the root re-places it on its tracking branch AT the new pin; say so when you relay the result" (AGENTS.md:344-346). README.md:994-995, the line bump-leg.py itself prints (scripts/bump-leg.py:1492-1493) and every project's AGENTS-shape.md make the same promise. It does not happen on any project that has been bootstrapped once, which is every project setup.sh makes.

Reproduction (Atlas on main; the same with --tracking-branch trunk):

  1. Scaffold, clone and bootstrap. The spec leg is on main at the pin.
  2. Push a new commit to the spec leg's remote.
  3. In the root: git switch -c bump/spec, then bump-leg.py --root . --leg spec --to <new commit>. Exit 0; one commit; the leg is detached at the new commit.
  4. make bootstrap. Exit 0, and it prints:
    [spec] spec: PIN 6867f6748379 != branch main tip 7085133d1f65
            not moving an existing branch. The checkout stays at the pin; ...
    
    The leg stays detached. A commit the person makes there is on no branch.

Cause. templates/assembly-root/scripts/bootstrap.py (around :136-149 at 36538fd) creates the tracking branch at the pin only when no local branch exists. When one exists, it never moves it, even when the move is a pure fast-forward: the local branch's tip is an ancestor of the pin, so moving it loses nothing.

Why the suite misses it. tests/test_bump_leg.py:204 (…bootstrap_re_places_it) never runs bootstrap after the bump. Its fixture clone is never bootstrapped first, so its legs have no local branch to lag.

Proposed fix. When the local tracking branch's tip is an ancestor of the pin, fast-forward it to the pin and check it out. Keep refusing to move a branch that holds commits the pin does not contain (ahead or diverged), and keep that message. Test it the way a person meets it: scaffold, bootstrap, bump, bootstrap, then assert the leg is on its branch at the new pin. Also test the ahead/diverged case still refuses. This changes a pinned template, so the digest every project pins moves. That is cheaper before the tag than after.

Why v1.0.0. "Advancing a leg" is one of AGENTS.md's core procedures, and it does not end where its documentation says, for an ordinary repository on every OS. Proposed P1: a detached leg loses the next commit made in it.

Parent: #458 (update-shape and bump-leg).

Activity

  1. added this to the v1.0.0 milestone on Oct 12, 2026
  2. brettheap commented on Oct 12, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session 20b4ae33-927d-4b5d-a856-e7e467ea11b2@Eagle, 2026-10-12T22:00:54Z, for #475

    Logged in lanes/log/openRepoShape-3.md at 761e9ae3bac06ad786e1294952638b02b55ef427.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#475:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#475"`, kept where the row or its body names `#475`:
       none
    3. `git ls-remote --heads git@github.com:opensoft/openRepoShape` branches naming `475` as a whole token:
       none
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions