Skip to content

#146 fix: worktrees get their own venv, not the main checkout's - #148

Open
gregoryfoster wants to merge 5 commits into
mainfrom
146-worktree-venv-none
Open

gregoryfoster wants to merge 5 commits into
mainfrom
146-worktree-venv-none

Conversation

@gregoryfoster

@gregoryfoster gregoryfoster commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Closes #146.

Cause [reproduced 2026-11-27T19:31Z]: worktree-create.sh symlinked the main checkout's .venv into every worktree, because .skills/worktree_venv was absent and so defaulted to link. A worktree's uv sync then reinstalled the editable project into that shared venv (+ co-status==0.1.0 (from file:///…/.worktrees/146-repro-link)), which re-pointed the main checkout's _editable_impl_co_status.pth at the worktree.

Fix:

  • .skills/worktree_venv = none, committed.
  • tests/ci/test_worktree_venv_knob.py pins the file, read with the script's grammar, and runs the vendored worktree-create.sh against a scratch repo carrying the knob: no .venv. A link control has to produce the symlink. The vendored tests skip in CI. The knob test fails with link.
  • One AGENTS.md sentence. It also covers worktrees the harness makes, where using-git-worktrees tells the agent to ln -s the main checkout's .venv by hand and the knob never applies.

Proof [measured 2026-11-27T19:32Z]: with the knob in the main checkout, worktree-create.sh --new 146-worktree-venv-none printed NOTE: .skills/worktree_venv=none — no .venv linked. uv sync --locked there built the worktree's own .venv, whose .pth reads the worktree path. The main checkout's .pth read /home/exedev/status both before and after.

No deploy: this touches only .skills/, tests/ and *.md.

CR (--fix): 4 findings, one commit each (debe6e0, ef5e99e, ed9c2b1, da4b09e). The gate passed on da4b09e: 2006 passed, 13 skipped.

🤖 Generated with Claude Code

gregoryfoster and others added 5 commits November 27, 2026 19:33
worktree-create.sh symlinked the main checkout's .venv into every
worktree (.skills/worktree_venv defaulted to link), so a worktree's
uv sync re-pointed the main checkout's editable install at the
worktree; once removed, the operator scripts lost src. Set the knob
to none, pinned by tests/ci/test_worktree_venv_knob.py (the file,
and the vendored script run against it), and say so in AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
using-git-worktrees tells an agent to ln -s the main .venv into a
worktree the harness made; the knob never reaches that path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Main checkout's venv can be re-pointed at a worktree's editable install, breaking the operator scripts

1 participant