From 680d1df16e2ff1ac237bba34864ed8ad16f4ef1f Mon Sep 17 00:00:00 2001 From: Sebastian Gieseler Date: Mon, 2 Nov 2026 11:32:22 +0100 Subject: [PATCH] docs: stop a lane with links before git worktree remove The devstack skill and the plan said `git worktree remove` works while a lane runs. With `prepare.link` it does not on Windows: Git 2.43 follows the junction and empties the lane's copy (measured again), a newer Git leaves the worktree behind with the junction in it (ADR-0044). Both now say what docs/stack-file.md already said. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 9 +++++++++ docs/plan.md | 6 ++++-- skills/devstack/SKILL.md | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de3bfdec..712a38f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,15 @@ no longer blocks every start. it: every lane starts its own containers; a profile's `skip` leaves out what a lane can do without. +### Fixed + +- **The `devstack` skill and the plan no longer say `git worktree remove` + works while a lane runs.** With `prepare.link` it does not on Windows: Git + 2.43 follows the junction and empties the lane's copy (measured again), + a newer Git leaves the worktree behind with the junction in it (ADR-0044). + Both now say what `docs/stack-file.md` already said: stop the lane first + when it links directories; without `link` the remove works while it runs. + ### Added - **`/v1/lanes/main/v1/...`** answers as the main working tree's `/v1/...` diff --git a/docs/plan.md b/docs/plan.md index afb6e7f8..3d838073 100644 --- a/docs/plan.md +++ b/docs/plan.md @@ -669,8 +669,10 @@ sends a `lanes` event, and the dashboard shows each lane under its stack, named by its branch, the ones not started folded away. A lane's dev servers, tools and hot-reload mode run from its snapshot, which follows the worktree within 150 ms; `prepare` installs what the snapshot lacks (`npm ci`), so -`git worktree remove` works while the lane runs. `devstack lane stop` stops a -lane. `promote --lane` moves the ports +`git worktree remove` works while the lane runs, unless the lane links +directories into its worktree (`prepare.link`, ADR-0044): then +`devstack lane stop` comes first, which removes the links. `devstack lane stop` +stops a lane. `promote --lane` moves the ports first and the main slot only when all of them moved; `--lane main` restarts only what the main tree ran before; a dev server listening on `::1` only is reached through the forward. Pruning keeps every build a started lane runs or diff --git a/skills/devstack/SKILL.md b/skills/devstack/SKILL.md index 8110cdf6..4a34f100 100644 --- a/skills/devstack/SKILL.md +++ b/skills/devstack/SKILL.md @@ -57,7 +57,7 @@ Run from the repository root (devstack looks for `{{devstack:stack_file}}` there | `devstack hot-reload on\|off` | for a debugging session: the toolchain's watcher (e.g. `dotnet watch`) from the source tree instead of builds and candidates; needs `hot_reload` in the stack file. Switch it off again afterwards | | `devstack up` refuses: "the stack `` … runs on " | another repository's stack on this machine runs on the same ports. Nothing started. Ask the user, then `devstack up --shift auto` (MCP `up` with `shift: "auto"`): this stack runs on its ports + 1000 (2000, ...) on this machine, services, containers and links alike, its data unchanged, and keeps the shift until `devstack up --shift none`. Ports written into app config outside devstack's placeholders do not move. A stopped stack on the same ports only warns. `devstack status` shows `shifted +1000` | | `devstack up` in a `git worktree` | starts that worktree's **lane** (every worktree is one) in the main tree's daemon: its own builds, ports moved by +100 (+200, ...), its own containers (a Compose project per lane, ports moved alike; the deprecated `shared` services come from the main tree), no background workers (`--workers` turns them on; `--force` skips the memory check). Every command in the worktree then acts on the lane (`devstack lane list` shows all) | -| `git worktree add -b ` | a new worktree is a lane at once, not started (devstack never creates or removes worktrees; use git or your tool); tell the user its dashboard page (`devstack ui --link` in it). A lane runs from a copy of its worktree, so `git worktree remove` works while it runs and stops it. `devstack lane stop ` stops a lane and keeps the worktree | +| `git worktree add -b ` | a new worktree is a lane at once, not started (devstack never creates or removes worktrees; use git or your tool); tell the user its dashboard page (`devstack ui --link` in it). A lane runs from a copy of its worktree, so removing the worktree stops the lane and takes its state along. `devstack lane stop ` stops a lane and keeps the worktree. **When the lane links directories into its worktree** (`devstack lane list`: `linked`, from `prepare.link`), run `devstack lane stop ` before `git worktree remove`: on Windows Git follows the junction and empties the lane's copy, or leaves the worktree behind with the junction in it; the stop removes the links. Without links the remove works while the lane runs | | a directory in a worktree that `prepare` links (`node_modules`, see `devstack lane list`: `linked`) | it is **the lane's copy**, not the worktree's own: on Windows a junction, which looks like a folder. Do not reinstall, delete or clean it there (`npm ci`, `rm -rf`, `git clean -x`, an IDE's "delete node_modules"): that empties what the lane runs from (for a lane on a node, its copy from the store), and a running dev server then fails. To install your own, ask the user, then stop the lane (`devstack lane stop ` removes the link) or remove only the link (`cmd /c rmdir ` on Windows, without `/s`; `rm ` elsewhere, no trailing slash), then install. devstack prepares a copy emptied this way again (a notice says so), but the lane's dev server fails until then | | `devstack lane start [--on ]` | start a lane from the main tree (or anywhere in the repository), as `devstack up` in its worktree does; `status` in the main tree lists the lanes in one line. **To run another branch or commit beside the main stack** (an end-to-end run against a given commit, a review): `git worktree add `, `devstack lane start ` (its ports are the main ports plus its offset, `devstack lane list`), test against those, `devstack lane stop `, `git worktree remove `. A commit without a stack file of its own runs with the main tree's. **For an acceptance run** use the stack file's profile if it has one (`status` lists none; `[profiles]` in the file): `devstack lane start --profile

--run` starts the lane as the profile says (a build instead of a dev server, workers, fresh data, the suite's env) and runs its suite command. A worktree another tool or script created is a lane too: starting it gives its own ports, containers and database without building a separate environment | | `devstack lane reset ` / `devstack lane prune [--older-than 7d] [--dry-run]` | throw a stopped lane's data away (it starts fresh, seeded again); remove what lanes whose worktree is gone left behind, here and on the pool's nodes. A lane on a node keeps its data there between starts. Ask the user before either: data goes |