feat(dev): lab — per-instance worktrees + unified identity [worktrees 1/3] #134
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos#134
Loading…
Add table
Add a link
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?
Parent
Cloonar/nixos#133 (superseded by this slice + siblings — the full settled design lives there).
What to build
Make every manual
labinstance run in its owngit worktree, and unify session identity on<project>~<label>(slots removed). Today all manual instances share the project's main checkout (handleStartpassesdir = projectDir(project)); only AFK runs are isolated.End-to-end:
<project>~<label>, where<label>=afk-<N>(AFK) |<userlabel>-<timestamp>(manual labelled) |<timestamp>(manual unlabelled). Everything derives from<label>: kind (parseAFKLabel), branch (afk/<N>orlab/<label>), worktree dir (<project>-<N>for AFK [unchanged],<project>-<label>for manual).parseSessionName→ split on the first~. DeleteallocateSlot/takenSlots/theSlotfield (and AFK's "reserve slot 1" rule). Rows render: AFK →AFK #N; manual →label · 15:30(time-only when unlabelled); the old slot-1mainrendering is gone.<timestamp>e.g.20260608-1530, existence-check-and-bump on a same-second collision.git fetch origin→ baseorigin/<default>→git worktree add -b lab/<label>-<ts> <wt> origin/<default>→SeedTrust(<wt>)→ spawn in<wt>. Any failure (noorigin, fetch fails, ref unresolvable, add fails) aborts Start with the git cause in the banner and rolls back a partial worktree (mirror AFK'steardownClaim). Add a timeout so a network stall fails loudly. No fallback base.origin/<default>else keep. (AFK Stop is unchanged in this slice; reaper unification is the next slice.)docs/adr/00NN-lab-per-instance-worktrees.md(full design) and update CONTEXT.md's Instance entry (drop "only AFK runs are isolated…").Reuse AFK's existing
git.goworktree methods (AddWorktree/RemoveWorktree) where possible.Acceptance criteria
<project>~<label>;allocateSlot/takenSlots/Slotare gone;parseSessionNamesplits on the first~.label · 15:30(time-only when unlabelled); AFK rows still renderAFK #N.origin(or a failing fetch) shows a clear Start error and leaves nothing behind.go test ./...passes (run locally — the eval-only pre-commit does not build/run Go).Blocked by
None — can start immediately.