Skip to content

fix(#1231): detectPackageManagerSync detects Python managers; npm-package hints keep a JS-only detector - #1235

Merged
admarble merged 3 commits into
mainfrom
feature/1231-fix-stacks-detectpackagemanagersync-is-js-only-a-u
Sep 30, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/1231-fix-stacks-detectpackagemanagersync-is-js-only-a-u

Conversation

@admarble

@admarble admarble commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

detectPackageManagerSync checked JS lockfiles only and otherwise returned "npm". It's the fallback in resolvePackageManager, so a uv or poetry repo whose manifest declares no packageManager resolved to npm. Worktree provisioning then logged "no manifest found for npm" and installed nothing, and #1217's uv sync --frozen was never reached.

  • AC-1: detectPackageManagerSync(root) now follows the async detectPackageManager's order: JS lockfiles, then package.json → npm, then uv.lock/poetry.lock, then pyproject.toml or a requirements*.txt → pip, and npm last.
  • AC-2: a parity test runs both detectors over the same fixture directories.
  • AC-3: installWorktreeDeps(dir, undefined) on pyproject.toml + uv.lock spawns uv sync --frozen.

Added by the runner, fixing a regression QA flagged: three callers used the sync detector to name the package manager for sequant's own npm packages:

  • bin/cli.ts:167, the "remove local sequant" hint
  • bin/cli.ts:763, the serve missing-@modelcontextprotocol/sdk hint
  • src/lib/version-check.ts:413, the "update sequant" hint

With a Python-aware detector, serve in a Python-only directory would have printed uv add @modelcontextprotocol/sdk. These three now call a new JS-only detectNodePackageManagerSync(), which shares its lockfile loop with the project detector. The stale resolvePackageManager JSDoc ("the JS-only detector") is also updated.

Scope note: bin/cli.ts, src/lib/version-check.ts and src/lib/version-check.yarn-major.test.ts (comments only) are outside the issue's "May touch" list. They're the callers the detector change would otherwise have broken.

AC verification

AC Status Evidence
AC-1 ✅ npx vitest run src/lib/stacks.test.ts, "detectPackageManagerSync (#1231 AC-1)": 11 cases
AC-2 ✅ Same file, "detectPackageManagerSync parity with detectPackageManager (#1231 AC-2)": real temp directories for the sync side, the mocked fileExists for the async side
AC-3 ✅ npx vitest run src/lib/workflow/worktree-manager.frozen-install.test.ts, with spawnSync mocked, asserting uv ["sync", "--frozen"]

Mutation-verified: AC-3 — restored the old JS-only behaviour in detectPackageManagerSync (JS lockfile, else "npm"); src/lib/workflow/worktree-manager.frozen-install.test.ts > manifest-less worktrees detect the package manager (#870) > installWorktreeDeps resolves uv and runs uv sync --frozen on a manifest-less Python worktree (#1231 AC-3) failed, along with 6 AC-1 and 4 AC-2 cases (13 failed / 168 passed); restored.

Mutation-verified: the npm-package hints — made detectNodePackageManagerSync return detectPackageManagerSync(root); src/lib/stacks.test.ts > detectNodePackageManagerSync — sequant's own package manager (#1231) > answers npm in a Python-only directory the project detector reads as uv failed, with the requirements-only case (2 failed / 164 passed); restored.

Runner verification (graph #1203)

  • QA verdict: AC_MET_BUT_NOT_A_PLUS, 3/3. Both gaps were fixed in 5c6053a9 (the regression and the stale JSDoc above).
  • Forced QA re-run on 5c6053a9: NEEDS_VERIFICATION, 3/3. Its two gaps were CI still pending at QA time (now checked by SHA) and the AC-2 parity comment, which sat above the wrong describe. The comment was moved in 898d1e2f.
  • End to end, through the built dist/: a real project with pyproject.toml (depending on six) and uv lock, no manifest, no declared package manager:
  • Suites: stacks, worktree-manager, worktree-manager.frozen-install, version-check, version-check.yarn-major and combined-branch-test all pass (303). tsc --noEmit, npm run lint and prettier are clean.

Closes #1231
Refs #1203

🤖 Generated with Claude Code

…ageManagerSync)

QA risk_gap: with detectPackageManagerSync now Python-aware, bin/cli.ts's serve missing-SDK hint would print 'uv add @modelcontextprotocol/sdk' in a Python-only cwd. cli.ts:167/763 and version-check.ts:413 name sequant's own npm packages, so they use the JS-only detector. Also fixes the stale resolvePackageManager JSDoc.

Entire-Checkpoint: 5bd4127755d3
@admarble admarble changed the title fix(#1231): fix(stacks): detectPackageManagerSync is JS-only — a uv/poetry repo without a declared packageManager resolves to npm and skips its install fix(#1231): detectPackageManagerSync detects Python managers; npm-package hints keep a JS-only detector Sep 30, 2026
@admarble
admarble merged commit 9da8aeb into main Sep 30, 2026
7 checks passed
@admarble
admarble deleted the feature/1231-fix-stacks-detectpackagemanagersync-is-js-only-a-u branch September 30, 2026 14:29
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(stacks): detectPackageManagerSync is JS-only — a uv/poetry repo without a declared packageManager resolves to npm and skips its install

1 participant