Repository navigation
Description
Epic: field-2026-09-28 follow-up (downstream non-Node adoption) Tier: mechanical Graph: tracker #1203 (not in the DAG)
Problem. There are two package-manager detectors, and they disagree on Python repos:
detectPackageManager()(async,src/lib/stacks.ts:209) checks JS lockfiles, thenpackage.json→ npm, then Python lockfiles (uv.lock→ uv,poetry.lock→ poetry), thenpyproject.toml/requirements.txt→ pip.sequant initandinit --manifest-onlyuse it, so their manifests recordpackageManager: "uv"correctly.detectPackageManagerSync(root)(src/lib/stacks.ts:249) checks JS lockfiles only and otherwise returns"npm". It's the fallback inresolvePackageManager(:291-299) when the manifest declares nopackageManager. Worktree provisioning (installWorktreeDeps), the dependency reinstall and merge-check's combined-branch test (combined-branch-test.ts:171) all rely on that fallback.
So a uv or poetry repo whose manifest has no packageManager resolves to npm. installWorktreeDeps then logs "Skipping dependency install — no manifest found for npm" and installs nothing. #1217's uv sync --frozen is never reached, and neither is poetry's or pip's install. It's the same two-producer drift as #833/#870.
Evidence (2026-09-30, main @ 4797ac8c, built dist/). A real project with pyproject.toml (depending on six) and uv lock:
installWorktreeDeps(dir, undefined)resolvedpm=npm,ciInstall="npm ci", printed "Skipping dependency install — no manifest found for npm", and created no.venv.- The same directory after
sequant init --manifest-only(manifestpackageManager: "uv"):installWorktreeDeps(dir, "uv")ranuv sync --frozen, andsiximported from the project's.venv.
Who's affected: manifests written by hand (a minimal {version, stack, installedAt, files: {}} was the documented workaround before #1209), and manifests created before the repo gained a Python lockfile.
AC
- AC-1:
detectPackageManagerSync(root)followsdetectPackageManager's order. JS lockfiles come first, thenpackage.json→ npm, thenuv.lock→ uv,poetry.lock→ poetry, thenpyproject.tomlor arequirements*.txt→ pip, andnpmlast when none of these exist. Evidence:npx vitest run src/lib/stacks.test.ts - AC-2: A parity test runs both detectors over the same fixture directories (JS lockfiles,
package.jsononly,uv.lock,poetry.lock,pyproject.tomlonly,requirements.txtonly, a JS+Python mix, empty). Wherever the async detector returns non-null, the sync detector returns the same value. Evidence:npx vitest run src/lib/stacks.test.ts - AC-3:
installWorktreeDeps(dir, undefined)on a directory withpyproject.tomlanduv.lock(no declared package manager) resolves uv and spawnsuvwith["sync", "--frozen"], not the npm "no manifest found" skip. Evidence:npx vitest run src/lib/workflow/worktree-manager.frozen-install.test.ts
Non-goals.
templates/scripts/new-feature.sh'sdetect_package_manageris JS-only too, but its install is gated onpackage.json, so Python repos never reach it. Leave it alone.version-check.ts:413also calls the sync detector. It only runs for a localnode_modulesinstall, and JS-first ordering keeps its answer unchanged for any repo with apackage.json.
Graph metadata
- No dependency edges. Found while verifying fix(stacks): uv ciInstall is a bare
uv pip install -q— useuv sync --frozenwith uv.lock, else requirements or skip #1217 (PR fix(#1217): uv ciInstall uses uv sync --frozen with uv.lock, else requirements or skip #1224).
May touch
src/lib/stacks.tssrc/lib/stacks.test.tssrc/lib/workflow/worktree-manager.frozen-install.test.ts(it mocksspawnSync;worktree-manager.test.tsdeliberately leaveschild_processreal)
Activity
admarble commentedon Sep 30, 2026
Context for the run (re-checked against
main@2aec2459, 2026-09-30)Line refs (all still hold):
src/lib/stacks.ts:196:PYTHON_LOCKFILE_PRIORITY.src/lib/stacks.ts:209: the asyncdetectPackageManager(). It reads the cwd, has norootparameter, and usesfileExistsfrom./fs.js.src/lib/stacks.ts:249:detectPackageManagerSync(root). It's JS-only, with"npm"as the fallback.src/lib/stacks.ts:291:resolvePackageManager.src/lib/stacks.ts:322: the privatefindRequirementsFile(root). Reuse it for the pip fallback sorequirements-dev.txtand similar files count, the same wayhasManifestForPackageManagercounts them.Shape of the fix
detectPackageManagerSync:LOCKFILE_PRIORITY(JS)package.json→ npmPYTHON_LOCKFILE_PRIORITYpyproject.tomlorfindRequirementsFile(root)→ pip"npm"PackageManager, not nullable. That final"npm"is what the callers rely on.Tests
src/lib/stacks.test.ts). That filevi.mocks./fs.js(sofileExistsis mocked for the async detector), while the sync detector uses realexistsSync. For the parity test, build real temp directories for the sync side and drive the async side'smockFileExistsfrom the same file list for each fixture. Don'tchdir, and don't spy onprocess.cwd.src/lib/workflow/worktree-manager.frozen-install.test.ts). That file already hoists aspawnSyncmock. Assert thatinstallWorktreeDeps(dir, undefined, false)onpyproject.toml+uv.lockcallsspawnSync("uv", ["sync", "--frozen"], …). Don't add it toworktree-manager.test.ts, which deliberately leaveschild_processreal.worktree-manager.test.ts"skips … no package.json, no lockfile" case must still pass. An empty directory still resolves to npm and gets skipped.Standard block
npm testin exec or in qa. This applies to the qa phase as well as exec. Run targeted suites in the foreground with a timeout:timeout 600 npx vitest run src/lib/stacks.test.ts src/lib/workflow/worktree-manager.frozen-install.test.ts src/lib/workflow/worktree-manager.test.ts. Global setup runsnpm run buildfirst.failedTeststarts with the test file path.Closes #1231. UseRefsonly for the tracker, tracker(graph): field report 2026-09-28 — downstream non-Node adoption gaps (10 nodes) #1203..sequant/settings.jsonmust handle JSONC (not expected to apply here).### Fixedentry under[Unreleased].admarble commentedon Sep 30, 2026
@/tmp/existing_comment.md
admarble commentedon Sep 30, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 3/3 met
Gaps:
fix(#1231): npm-package hints keep a JS-only detector (detectNodePack…
admarble commentedon Sep 30, 2026
QA Verdict: NEEDS_VERIFICATION
AC coverage: 3/3 met
Gaps:
test(#1231): parity comment sits above the parity describe