Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(dev): freeze the worktree setup lockfile #19747

Mergedmaria-rcksmerged 2 commits intomain fromrefs/pull/19747/headmerged by maria-rcks View on GitHub

maria-rckscommented

Worktree 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

    2. juliusmarminge added labelsmacroscope-review

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at f67e212

      Macroscope'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).
    4. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire4.9 KiB5.0 KiB+23 B (+0.5%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB+23 B (+1.9%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.8 KiB20.9 KiB+41 B (+0.2%)29.3 KiB✅
      CodexLive turn messages12+1 (+100.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages110 (0.0%)8✅

      Baseline: e536bfd · PR result: f67e212 · Source CI: success

      Scenario 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.

    5. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      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.ts
      The install command adds --frozen-lockfile and retains the forwarded pnpm --yes flag.

      Priority: ⬇️ Low

      Estimated code review effort: 1 (Trivial) | ~5 minutes

      Change: Bug fix

      Merge 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 Summary

      Architecture risk: 🔵 Low · up to 504ee

      The change affects 1 system.

      Changed systems: scripts

      Architecture 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: Passed 4
      Passed Passed checks: 4 passed
      Check nameStatusExplanation
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Title checkPassedThe title is concise, specific, and accurately describes the change to freeze the worktree setup lockfile.
      Description checkPassedThe 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
      Comment `@coderabbitai help` to get the list of available commands.
    6. maria-rcks merged thisb8e829d

    7. maria-rcks closed this

Sign in to join this conversation.