Skip to content

fix(#1196): worktree provisioning, pip install, merge-check skip non-Node repos - #1212

Merged
admarble merged 4 commits into
mainfrom
feature/1196-fix-worktree-ts-provisioning-runs-npm-ci-pip-insta
Sep 29, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/1196-fix-worktree-ts-provisioning-runs-npm-ci-pip-insta

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • installWorktreeDeps skips (and logs why) when no manifest exists for the resolved package manager, instead of always attempting npm ci. Root cause: a non-Node worktree has no node_modules, so ensureWorktree's guard was always true, and resolvePackageManager's fallback (detectPackageManagerSync) is JS-lockfile-only.
  • resolvePackageManagerConfig names pip's requirements*.txt file (pip install -q -r <file>) or resolves to a skip sentinel — never the bare, failing no-op pip install -q. reinstallIfLockfileChanged gets the same skip-sentinel check, defensively (currently unreachable in practice — its lockfile list is JS-only).
  • combined-branch-test's test/build steps now skip with an info finding, not a severity: error BLOCKED, when the repo defines no such script (hasScript reads package.json).

Pre-PR AC Verification

AC Description Status Evidence
AC-1 Worktree provisioning skips install (and logs why) when no manifest exists for the resolved PM ✅ Implemented hasManifestForPackageManager (src/lib/stacks.ts), gated in installWorktreeDeps (src/lib/workflow/worktree-manager.ts)
AC-2 A pip stack's install command names its requirements file, or is skipped — never a bare pip install -q ✅ Implemented resolvePackageManagerConfig's pip branch + CI_INSTALL_SKIP sentinel (src/lib/stacks.ts)
AC-3 merge-check skips (not errors) the test/build step when the repo defines no such script ✅ Implemented hasScript gating in src/lib/merge-check/combined-branch-test.ts

Test plan

  • npx vitest run src/lib/stacks.test.ts — 136 passed (AC-1, AC-2 evidence)
  • npx vitest run src/lib/workflow/worktree-manager.test.ts — 7 passed (AC-1 evidence, includes new fix(worktree): TS provisioning runs npm ci / pip install -q in repos with no manifest to install from — the shell path guards, TS doesn't #1196 tests)
  • npx vitest run src/lib/workflow/worktree-manager.frozen-install.test.ts — 14 passed (updated fixtures for the new manifest gate)
  • npx vitest run src/lib/merge-check/combined-branch-test.test.ts — 28 passed (AC-3 evidence)
  • npx vitest run src/lib/merge-check/combined-branch-test.integration.test.ts — 8 passed (real-git integration; fixture manifest updated with test/build scripts)
  • npx vitest run src/commands/run.test.ts — 143 passed
  • npx tsc --noEmit -p .
  • npm run lint
  • npm run build

Mutation records

Notes

  • Non-goals confirmed from /spec: no new stack/PM types, no change to new-feature.sh (already guards on package.json per new-feature.sh hardcodes npm ci while the TS path is package-manager aware — pnpm/yarn/bun provisioning fails misleadingly #847), no change to non-Python stacks.
  • reinstallIfLockfileChanged's pip guard is cheap insurance, not exercised by a dedicated test — its LOCKFILES list is JS-only, so it can never resolve pip through detection; called out per /spec's design notes rather than claimed as covered.
  • Fixed a pre-existing integration test gap: combined-branch-test.integration.test.ts's baseline manifest fixture had no scripts.test/scripts.build, so AC-3's fix (correctly) would have skipped those steps there. Added the scripts to the fixture.

Closes #1196

🤖 Generated with Claude Code

Entire-Checkpoint: 895a5b2c3645
…Node repos

- installWorktreeDeps skips (and logs why) when no manifest exists for the
  resolved package manager, instead of always attempting npm ci
- resolvePackageManagerConfig names pip's requirements*.txt file, or skips,
  instead of running the bare failing no-op pip install -q
- combined-branch-test's test/build steps skip with an info finding, not a
  severity:error BLOCKED, when the repo defines no such script
- reinstallIfLockfileChanged gets the same pip skip-sentinel guard, defensively
- fixed the integration fixture manifest that lacked test/build scripts

Entire-Checkpoint: 9332d54d9a01
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.

fix(worktree): TS provisioning runs npm ci / pip install -q in repos with no manifest to install from — the shell path guards, TS doesn't

1 participant