feat(worktree): symlink the repo's node_modules into the coder worktree (v0.24.0)#58
Merged
Merged
Conversation
…ee (v0.24.0) A fresh `git worktree` is a bare checkout with NO node_modules, so an npm/pnpm pre-PR gate (local_gate_cmd) — or the coder running a build — couldn't resolve deps, and the gate failed in the worktree even though it passes in the main repo. (Surfaced dispatching a DS fix to a pnpm monorepo: `pnpm -C packages/ui build` had no deps in the worktree.) create_worktree now symlinks every node_modules dir from the main repo into the worktree at the same relative path (root + each monorepo workspace package), so the worktree shares the repo's installed deps without a slow/offline per-worktree install. Best-effort: a non-node repo is a no-op; symlink failures are skipped. Build output (dist/) still lands in the worktree — only the deps are shared. Worktree removal unlinks the symlink, never the target (safe). +3 tests (root + monorepo package symlinks; non-node no-op; no descent into node_modules). 196 pass; ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow. |
There was a problem hiding this comment.
QA Audit — PR #58 | feat(worktree): symlink the repo's node_modules into the coder worktree (v0.24.0)
VERDICT: WARN (CI test still queued — formal PASS/FAIL deferred)
CI Status
- test: queued
- No unresolved CodeRabbit threads
Diff Review
- Version bumps 0.23.0→0.24.0 in
protoagent.plugin.yaml+pyproject.toml— clean create_worktree(worktree.py:113): callslink_node_modulesviaasyncio.to_threadafter worktree add — correct, won't block the event looplink_node_modules(worktree.py:117-140): walks repo, symlinks eachnode_modulesat matching relative path; prunes descent intonode_modules/.git/.worktrees; doubleOSError: passfor best-effort semantics — design matches specos.path.lexistsguard (worktree.py:131) prevents clobbering existing paths; minor TOCTOU window if two worktrees race on same path, but practical risk is negligible- Removal safety:
git worktree remove+rmdo not recurse through symlinks — targetnode_modulesin main repo is safe - +3 tests cover root+workspace symlinks, non-node no-op, and nested-node_modules pruning — 196 pass, ruff clean per PR description
Observations
- LOW: clawpatch structural review unavailable (repo not in project registry) — reviewed from diff alone
- LOW: CI
teststill queued at review time — formal PASS/FAIL will land when checks are terminal - No correctness, security, or design concerns identified
— Quinn, QA Engineer
|
Submitted COMMENT review on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A fresh
git worktreeis a bare checkout with nonode_modules, so an npm/pnpm pre-PR gate (local_gate_cmd) — or the coder running a build — can't resolve deps, and the gate fails in the worktree even though it passes in the main repo. (Surfaced dispatching a DS fix to a pnpm monorepo:pnpm -C packages/ui buildhad no deps in the worktree.)create_worktreenow symlinks everynode_modulesdir from the main repo into the worktree at the same relative path (root + each monorepo workspace package), so the worktree shares the repo's installed deps without a slow/offline per-worktree install.dist/) still lands in the worktree — only deps are shared.rm/git worktree removedon't recurse through symlinks).Tests
+3 (root + monorepo-package symlinks; non-node no-op; no descent into nested
node_modules). 196 pass; ruff clean.🤖 Generated with Claude Code