change begin: add --resume for an existing agent branch #230
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools!230
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/begin-resume"
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?
allod change begin --resume <description> <repo>picks up anagent/<description>branch that already exists on origin. It creates the same worktree under~/changesthat-ddoes, on a local branch that starts from and tracks the remote one, sorecordandsubmitcontinue the branch instead of starting a new one. It writes the sameallod-change-branchhandoff file-dwrites; note that nothing reads that file yet (allod/tools#118 is the reader), so the continuation rests on the tracking branch, not on the file. It refuses when the branch is missing on origin, when a local branch of that name already exists, or when-dis also given. The-dpath itself is unchanged, and no otherchangesubcommand is touched. The shell suite proves each of those, and the flake'sgo-checkspasses. If it is wrong, revert the one commit; the flag simply disappears.Closes allod/tools#229
What changes
cmd/allod/change.go:beginparses--resume <description>. The start ref becomes a singlestartvariable: the default branch for-d, the agent branch itself for--resume. The existing fetch,worktree add -b <branch> origin/<start>, and handoff-file write are shared; git sets the upstream because the start point is a remote-tracking ref.cmd/allod/main.go: usage line and a paragraph for--resume.README.md: a paragraph and example beside the-dflow.tests/allod-change.sh: 19 new assertions. The resume fixture pushes the agent branch from a throwaway clone so the shared checkout holds no localagent/*ref, matching a branch another session started.Risk
R1. One new flag on a code path that only creates a worktree and a local branch. Every collision case refuses before
worktree addruns, and the worst credible failure after validation is a refusal with the wrong message. Rollback is a straight revert.Validation
nix build .#checks.x86_64-linux.go-checks: passed. That runsgo testfor every package andtests/allod-change.shagainst the built binary.tests/allod-change.shagainst a local build: 217 tests passed, 19 of them new. Covered: resume of an existing remote branch lands under~/changes, checks out the agent branch at the remote commit, tracksorigin/agent/<desc>, writes the handoff file, leaves the shared checkout on master;recordfrom the resumed worktree pushes additively; refusal and no worktree when the branch is missing on origin; refusal and no second worktree when the branch exists locally; refusal of-dwith--resumein either order; refusal of--resumewithout a value.gofmt -landgo vet ./cmd/allod/: clean.