allod change begin: always isolate a branch change in its own worktree #116
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#116
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 beginonly creates a worktree for repos listed inprotected-branches; for every other repo it hands back the shared checkout path, so two agents changing the same repo work in one tree and move HEAD out from under each other without any warning. Make isolation follow the need for a branch instead of the branch's protection status.Part of allod/tools#115.
Primary goals:
begincreates a worktree and anagent/<description>branch for every repo, protected or not, soprotected-branchesgoes back to governing only which branch is protected rather than doubling as the isolation switch.~/changes/<slug>-<description>-XXXXXXso~/workstays exactly the set of checkouts the inventory registry declares.Current state
allod:267-272returns early for any repo whose$HOME-relative path is absent fromprotected-branches:tests/allod-change.sh:255-256pins that passthrough as intended behavior, so both the assertion and the code change together. For protected repos the worktree already lands atmktemp -d "/tmp/allod-change-${slug}-${desc}-XXXXXX"(allod:293), and duplicate descriptions already fail loud through the existing local and remote branch-existence checks (allod:279-284), so neither path naming nor description collision needs new machinery.Why
~/changesrather than a directory under~/workarchitecture.mdprinciple 8 makes the inventory registry the single source of truth for what lives in~/work; a worktree placed there is a second, undeclared source for the same fact, and principle 5 separately says registry-owned and tool-owned material should not share a namespace. Two verified mechanical consequences reinforce it: a worktree under~/workis collected byworkspace_collect_reposas though it were a repo, sopull-allrunsgit pullagainst branches with no upstream and reports errors; and its$HOME-relative path becomes a lookup key that matches nothing inprotected-branches, which is exactly the fail-open shape tracked in allod/tools#112.The current
/tmplocation has its own problem. On a dev VM/tmpis a directory on the root ext4 filesystem with no tmpfiles cleanup rule, so the original design's claim that worktrees "self-clean on reboot" (allod/strategyarchive/dev-plans/allod-change-dev-plan.md:212) does not hold and orphans accumulate indefinitely.~/changesalso keeps agent working directories inside the workspace boundary agents are told to stay within.Why the default-branch flow must stay in place
Git refuses to check out one branch in two worktrees —
fatal: 'master' is already used by worktree at '<path>'— so a worktree cannot isolate two agents that both want to commit tomaster. Attempting to route the memory and planning-doc flow through worktrees would produce a fatal error for the second agent rather than isolation. That flow's collision safety comes from allod/tools#118 instead.Scope
In:
allod change begin, the worktree path scheme,allod change cleanupand a way to reclaim orphans, and the affected assertions intests/allod-change.sh. Out: hook-level enforcement that agents commit only from worktrees, collector visibility of worktrees, andrecord's concurrency guards — each tracked separately under allod/tools#115.