Worktree lanes — human chat, implementers, and reviewers¶
How this factory keeps coding, review, and your interactive chats from
colliding on the same working tree. No new product: same git repo, same
main, different directories.
The three seats¶
| Seat | Directory | What happens here |
|---|---|---|
| Primary (orchestration) | The folder git calls the main worktree — today an internal repository | Housekeep, merge, gald3r worktree create/remove, review-result commits, board verbs (gald3r task / bug). Prefer this tree clean while a wave is in flight. |
| Implementer lane | A gald3r-owned worktree under the sibling <repo>_worktrees/ |
Code, tests, CHANGELOG for one task/bug. Commit on that branch. Do not hand-edit the live board here — use gald3r … --dir <primary>. |
| Reviewer lane | A review-swarm worktree |
Reads a SHA, writes a verdict. Does not need your chat dirt. |
| Human / interactive chat | A long-lived human worktree or Throne / gald3r project-agent / Valkyrie |
Your questions and WIP. If Cursor is pointed at primary, every overlay edit is mixed-dirty for the next housekeep. |
The project agent is the intended human seat: you talk to the project; it uses board verbs on primary; coding agents stay in lanes.
What "clean primary" actually means¶
A reviewer already looks at a commit (the worktree SHA). The whole
machine does not need to be clean. Primary must be clean enough for
housekeep, spawn, and merge. Human or chat dirt on primary is the
mixed-dirty stop.
Implementer dirt inside a lane worktree is allowed.
Daily pattern¶
- Leave primary for orchestration. Do not park overlay WIP there while reviewers run.
- Do factory coding in a lane (
gald3r worktree create --task-id N --role agent). - Land lane work by committing in the lane, then merge to primary when housekeep is idle — same as an agent bucket.
- When you must touch primary (board verbs, cut, merge fight): do that,
housekeep if you dirtied
.gald3r/, and stop. Do not leave.cursor/.claudeWIP sitting there. - Talk to the project with
gald3r project-agent/@g-project-agentor Throne, not by treating primary as a scratch tree.
Check a lane's declared scope¶
Run scope checks against the primary repository that owns the lane. The explicit binding is portable from the primary, a linked lane, or a nested source directory:
gald3r worktree scope-check `
--repo-path G:/gald3r_labs/gald3r_core_exp `
--task-id --role code-swarm --owner claude-sonnet
--repo-path names the coordination owner; it does not change where source,
board, or ordinary project commands operate. Current worktree resolution also
recognizes a linked lane when the flag is omitted, but use the explicit primary
path in bootstrap and handoff instructions so the owner is visible and the
same command can be replayed from any directory.
For a code-swarm lane, reserve a newly planned repository-relative path
before editing it:
gald3r worktree scope-check `
--repo-path G:/gald3r_labs/gald3r_core_exp `
--task-id --role code-swarm --owner claude-sonnet `
--expand gald3r_project/board/statedb/new_file.go
Expansion changes only the invoking lane's existing lock manifest. It refuses
the entire request if another live lane already holds a requested path; do not
edit lock manifests by hand or proceed after that refusal. A normal scope check
reports a SCOPE_ESCAPE for a changed path outside the lane's declared scope.
Preserve a nonzero command result when a shell transcript formats both output streams. In PowerShell, capture the exit code immediately after the native command, print the captured output, then return that code:
$scopeOutput = & gald3r worktree scope-check --repo-path G:/gald3r_labs/gald3r_core_exp --task-id --role code-swarm --owner claude-sonnet 2>&1
$scopeExit = $LASTEXITCODE
$scopeOutput | Write-Output
if ($scopeExit -ne 0) { exit $scopeExit }
's two observed incidents are acceptance evidence for this binding:
and each first failed from an owned Core lane, then returned the
expected owner, base, branch, and bucket after the explicit primary
--repo-path; also expanded two planned statedb files before editing.
The resolver now supports the lane invocation too, while the explicit form
remains the canonical bootstrap command.
Why .gald3r/ still shows up in lanes¶
Git worktrees check out tracked files. gald3r.db is already gitignored.
Lane sparse-checkout hides tasks/ and bugs/ so a stale
board snapshot cannot be rescue-committed onto main. Other .gald3r/
files may still materialize. Lanes read/write the board only via
--dir <primary>.
Gitignoring the live board is correct for a consumer SDLC project
(local DB, or later world_tree). This factory / any WPAC controller still
commits .gald3r/ until world_tree is the shared store. That is
unfinished conversion, not a second design.
What not to revive¶
Environment branches named dev / test / live model promotion,
not working-directory contention. They do not fix mixed-dirty and they
re-open 3-way merges on the board and overlays.
Related¶
- project agent (user seat); realtime
.gald3r/sync design:docs/design/project-agent-realtime-sync.md(implements) - Throne / Longship / Cartograph skill+command parity
- / worktree hide and Windows remove-retry
g-rl-33housekeep / mixed-dirty gates (factory playbooks)