fix(dev): freeze the worktree setup lockfile #19747
main fromrefs/pull/19747/head·merged by maria-rcks View on GitHubWorktree setup ran an unfrozen vp i -- --yes, so pnpm was free to re-resolve peers and rewrite the tracked pnpm-lock.yaml while bootstrapping. On one host, 36 worktrees differed from HEAD only by a two-line alchemy peer-hash rewrite, which made storage cleanup keep them forever as "has uncommitted changes".
Setup now runs vp i --frozen-lockfile -- --yes. It installs the branch's locked graph and never writes the lockfile. If a branch's manifests don't match its lockfile, setup fails with ERR_PNPM_OUTDATED_LOCKFILE instead of silently resolving a new one. Shell resolution, --yes, closed stdin, env-file links, and cache warming are unchanged. Storage cleanup's dirty-worktree rules are untouched.
Verified in a fresh scratch worktree at 21bedfb175 (global vp 1.2.0 running the pinned pnpm 11.10.0): setup installed dependencies, warmed the web cache, and left git status --porcelain empty. A deliberate manifest mismatch exited 1 and left the lockfile byte-for-byte unchanged. On Blacksmith, vp lint scripts/setup-worktree.ts, the scripts typecheck, vp test run --dir scripts (346 tests), and ProjectSetupScriptRunner.test.ts passed.
Unverified: the alchemy rewrite itself did not reproduce on this host. Lockfile-only installs at eight recent lockfile commits all produced empty diffs, so the trigger on the other host (its environment or an older commit) is still unknown. macOS and Windows shells weren't run. A later CI check could run vp i --lockfile-only --ignore-scripts && git diff --exit-code -- pnpm-lock.yaml to catch lockfiles pnpm would normalize.
Written by gpt-6.1-sol (Codex) in T3 Code on behalf of Maria.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
juliusmarminge added labelsmacroscope-review
Approvability#
Verdict: Approved at
f67e212Macroscope's review found this PR approvable — This small, self-contained development-script change makes worktree setup honor the existing lockfile and fail clearly when it is stale. It does not affect production behavior, product defaults, or static-analysis configuration.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 4.9 KiB 5.0 KiB +23 B (+0.5%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB +23 B (+1.9%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.8 KiB 20.9 KiB +41 B (+0.2%) 29.3 KiB ✅ Codex Live turn messages 1 2 +1 (+100.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 1 1 0 (0.0%) 8 ✅ Baseline:
e536bfd· PR result:f67e212· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
75b594e5-0f1a-4564-b31c-4fe6f09783d4
📥 Commits
-
Reviewing files that changed from the base of the PR and between 504ee13286763f84d33550708d46caa4c71c5c5c and f67e212f8471b8081000bff82351973022ff43e8.
📒 Files selected for processing: 1
-
scripts/setup-worktree.ts
🚧 Files skipped from review as they are similar to previous changes: 1
-
- scripts/setup-worktree.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
📝 Walkthrough
-
Worktree setup now runs the dependency install with
--frozen-lockfile. A stale lockfile causes setup to fail instead of updating dependency resolution.Changes: Worktree setup
Layer / File(s) Summary Frozen dependency installation
scripts/setup-worktree.tsThe install command adds --frozen-lockfileand retains the forwardedpnpm --yesflag.Priority: ⬇️ Low
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Bug fix
### Architecture SummaryMerge Risk: ⚪ Minimal · up to
f67e2-
Worktree setup is intended to fail when its lockfile is stale rather than rewrite it. No actionable merge blocker is identified.
Architecture risk: 🔵 Low · up to
504eeThe change affects 1 system.
Changed systems:
scriptsArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — scripts (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in scripts/setup-worktree.ts: The install command now uses
--frozen-lockfile; previously it ran without that constraint. The added comments state that setup must preserve tracked files and fail on a stale lockfile.
Pre-merge checks:
4-
Passed checks: 4 passed-
Check name Status Explanation Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Title check The title is concise, specific, and accurately describes the change to freeze the worktree setup lockfile. Description check The description clearly explains the problem, implementation, unchanged behavior, verification results, limitations, and a possible follow-up check. It does not use the template headings or explicitly…
-
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
maria-rcks merged thisb8e829d
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed