Repository navigation
feat(#932): fix(run): manifest fallback ?? "npm" bypasses resolvePackageManager — pnpm worktrees get npm ci (surviving #870 site) - #1000
Merged
admarble merged 14 commits intoSep 8, 2026
Conversation
…tion-verify) Entire-Checkpoint: 5af4df97391f
…irrors Closes remaining #932 scope: the setup skill's manifest template only wrote pmRun, so every plugin-installed project still hit the run.ts fallback path indirectly. Extends the AC-3 gate test to also assert AC-4 (packageManager present + mirrors byte-identical). Entire-Checkpoint: ec929992e989
…parison Entire-Checkpoint: 837e1737ec78
… add CHANGELOG entry Entire-Checkpoint: a4b924ffe21b
…AC-4 gate to the manifest template; restore released CHANGELOG entries (#932) Entire-Checkpoint: 6f74ea3c2bd8
… packageManager literal too Entire-Checkpoint: db4669d6d951
…fest placeholder; drop unused import (#932) Entire-Checkpoint: 46e61cc7042b
…orRun; action-verb CHANGELOG Entire-Checkpoint: de5af4ef28cd
…FILE_PRIORITY; conditional inside the template block Entire-Checkpoint: e65d6a2e8815
…n; CHANGELOG snapshot caveat Entire-Checkpoint: 5cc15ee94055
… in prose (#932) Entire-Checkpoint: f61862075bd2
…le; gate excludes *.spec.ts Entire-Checkpoint: 6e269a2ae05a
…anifest-fallback-npm-bypasses-resolvepack # Conflicts: # CHANGELOG.md
admarble
deleted the
feature/932-fix-run-manifest-fallback-npm-bypasses-resolvepack
branch
September 8, 2026 01:34
This was referenced Sep 8, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Automated PR for issue #932.
Fixes #932
🤖 Generated by
sequant runMutation verification (runner, 2026-09-07)
Mutation-verified: AC-3 — re-added
?? "npm"atsrc/commands/run.ts:102;src/lib/stacks.no-npm-fallback-gate.test.ts(932: no source file falls back to a literal "npm") failed withexpected 'src/commands/run.ts:102: …' to be ''; restored (git checkout -- src/commands/run.ts), gate green again (2/2).A+ pass (runner, 2026-09-07, commit 153ccbb)
Addresses the QA round-1 notes so this PR can reach READY_FOR_MERGE:
?? "npm"bypasses resolvePackageManager — pnpm worktrees getnpm ci(surviving #870 site) #932 test block now asserts the literal install command per lockfile throughresolvePackageManagerConfig(resolved, dir)(pnpm install --frozen-lockfile,yarn install --frozen-lockfilefor a v1 lockfile,bun install --frozen-lockfile).?? "npm",|| 'npm',?? DEFAULT_PM*— via an extended regex assembled at runtime (grep -rnE), so the gate is as broad as AC-3's prose.[Unreleased]→### Fixedentry added.Mutation-verified: AC-3 (widened gate) — re-added
|| "npm"atsrc/commands/run.ts:102;src/lib/stacks.no-npm-fallback-gate.test.tsfailed (932: no source file falls back to a literal "npm"); restored, gate green 2/2.The
?? DEFAULT_PMspelling cannot be exercised through vitest (an undefined identifier fails the global-setup build before the gate runs); the gate's regex was proven against it directly:grep -rnE <pattern> src bin→ 1 hit atrun.ts:102under the mutation, 0 after restore.Acceptance criteria (verbatim from #932)
packageManager+pnpm-lock.yamlresolves topnpm install --frozen-lockfilethrough therunpath — Verify:npx vitest run src/lib/stacks.resolve-package-manager.test.ts -t "932"→ passes; the test builds the orchestrator init the wayrun.tsdoes (no literal fallback) and asserts the resolved install command.yarn.lockandbun.lockbperLOCKFILE_PRIORITY— Verify: same test, two more cases.grep -rn 'packageManager ?? "npm"' src bin | wc -l→0, asserted by a scoped gate test; PR body carriesMutation-verified: AC-3 — re-added ?? "npm" at run.ts:102; <test> failed; restored.packageManagernext topmRunin the manifest template — Verify:grep -c 'packageManager' templates/skills/setup/SKILL.md≥ 1 inside the manifest template block, andmd5 -q templates/skills/setup/SKILL.md .claude/skills/setup/SKILL.md skills/setup/SKILL.md | uniq | wc -l→1.A+ round 2 (runner, 2026-09-07, commit 6b61a7f)
Addresses the QA round-2 adversarial findings:
"npm"(the same short-circuit one layer up): the package-manager block starts withPM="", the no-lockfile branch leaves it empty, and the manifest template says to includepackageManageronly when a lockfile identified it — so an undetected manager stays undeclared andresolvePackageManagerdecides live, exactly asrun.tsnow does. All three skill mirrors updated;check-skill-sync.ts→ 44 synced, 0 diverged.origin/mainand only the[Unreleased]entry re-added by hand — the earlier formatter pass had garbled released entries (the feat(spec/qa): explicit Evidence: clause on ACs — declared verification replaces keyword inference #938 line). No formatter is run onCHANGELOG.mdany more in this PR..sequant-manifest.jsonfenced block (regex over the template, asserting"packageManager"follows"pmRun"), per CLAUDE.md's scoping rule.Mutation-verified: AC-4 — deleted the
"packageManager"line from the manifest template block in all threesetup/SKILL.mdmirrors;src/lib/stacks.no-npm-fallback-gate.test.ts(932: setup skill's manifest template writes packageManager next to pmRun) failed; restored.Note on AC-1/AC-2: their tests mirror
run.ts's init shape (no literal fallback) and assert the resolved install command; AC-3's grep gate is the production-line regression guard.A+ round 3 (runner, 2026-09-07, commit d7f4468)
${SETUP_SKILL_MIRRORS[i]} …); the loop index is used.packageManager: "npm"assignment (alternation??||||:). Test files (*.test.ts,__tests__/) are excluded from the scan because fixtures legitimately declarepackageManager: "npm"as data (six such fixtures exist today); production sources undersrc/andbin/are still scanned in full.Mutation-verified: AC-3 (direct literal) — replaced
run.ts:102withpackageManager: "npm",;src/lib/stacks.no-npm-fallback-gate.test.tsfailed; restored (git checkouton that one clean file), gate green 2/2, resolve suite 15/15.A+ round 4 (runner, 2026-09-07, commit 581d95a)
PM_CONFIGimport removed fromstacks.resolve-package-manager.test.ts.LOCKFILE_PRIORITYinstacks.ts—bun.lockb/bun.lock>yarn.lock>pnpm-lock.yaml>package-lock.json— with a comment naming the source of truth, so a declared value can never outrank what live detection would pick on a multi-lockfile repo. All three mirrors;check-skill-sync.ts44 synced."<detected PM>"again; the omit-when-empty instruction lives in the prose above the block.const pm = manifest.packageManager; … pm ?? "npm"); AC-1/AC-2 tests mirrorrun.ts's init shape rather than invokingrunCommand. Both are noted here as the gate's stated limits.A+ round 5 (runner, 2026-09-07, commit b21c68a)
run.ts's manifest subset is built by a newmanifestForRunhelper (src/commands/run-manifest.ts) andrun.tscalls it;src/commands/run.manifest-init.test.tsasserts an undeclaredpackageManagerreaches the orchestrator init asundefined(key present, no default of any spelling), a declared one passes verbatim, and — through that real init — a pnpm worktree resolves topnpm. A non-literal regression inside the helper now fails this test even though the grep gate cannot see it. (Correction, round 7: the helper is tested but its call site was not — a future edit could bypassmanifestForRunwith an inline literal. Round 7 pins the call site by source inspection; see below.)src/commands/run-manifest.ts(new) andsrc/commands/run.manifest-init.test.ts(new) are not in the node's may-touch list. The helper lives in its own module becauserun.tscarries a stated 200-LOC cap (arch: extract RunOrchestrator — decouple execution engine from CLI wiring #503 AC-2; it is at 197 lines) — folding the helper in would have pushed it to 218.Fix pnpm/yarn/bun worktrees installing with npm ci).A+ round 6 (runner, 2026-09-07, commit 0b85c15)
jsoncfence, comment line directly above"packageManager"), with the prose kept; the template gate accepts thejsoncfence. All three mirrors;check-skill-sync.ts44 synced.--immutable, which Yarn 1 rejects — no berry detection exists #871 class):stacks.no-npm-fallback-gate.test.tsreads the skill's-f "<lockfile>"chain andLOCKFILE_PRIORITY'sfile:entries fromsrc/lib/stacks.tsas text and asserts identical order, per mirror. Neither side is imported, so a reorder on either side fails the test.run.manifest-init.test.tscloses it at the oneRunInitproducer that exists today.Mutation-verified: AC-4 (drift guard) — swapped the
yarn.lockandpnpm-lock.yamlbranches inskills/setup/SKILL.mdonly;src/lib/stacks.no-npm-fallback-gate.test.ts(skills/setup/SKILL.md checks lockfiles in exactly the resolver's order) failed; restored from a backup copy (notgit checkout), mirrors byte-identical again, 5/5 green.A+ round 7 (runner, 2026-09-07, commit c23c96c)
run.manifest-init.test.tsnow also readsrun.tsas text and assertsmanifest: manifestForRun(manifest)is present and no inlinemanifest: { stack: …literal is — the same read-as-text technique as the lockfile drift guard. With the helper tested and its only call site pinned, a two-step alias at the init site is caught by one of the two.packageManageris a setup-time snapshot (likepmRun) that outranks live detection, so a project migrating package managers should update or remove the key.Mutation-verified: AC-3 (call site) — replaced
manifest: manifestForRun(manifest)inrun.tswith an inline{ stack: manifest.stack, packageManager: manifest.packageManager }literal;src/commands/run.manifest-init.test.ts(run.ts builds init.manifest via manifestForRun(manifest)) failed; restored (perl reverse edit,git diffempty), 4/4 green.A+ round 8 (runner, 2026-09-07, commit 85de5aa)
jsonccomment; round 8 correctly pointed out that an agent copying the block verbatim to.sequant-manifest.jsonwould write unparseable JSON. Reverted to a plainjsonfence with the conditional in the prose directly above it ("plain JSON, exactly the shape below … omit that line entirely"). All three mirrors;check-skill-sync.ts44 synced; the AC-4 template gate stays green (5/5).packageManagerat all, given a declared value outranks live detection — is AC-4's explicit requirement in this node; the CHANGELOG discloses the snapshot semantics. Not filed as an issue here (PLAN §5 I-7); recorded for the plan owner.A+ round 9 (runner, 2026-09-07, commit c376760)
docs/features/run-orchestrator.md:45— the public programmatic-API example still taughtpackageManager: manifest.packageManager ?? 'npm'; amended to forward the value verbatim. This was the last copy of the anti-pattern in the repo (docs/and README now have zero). Runner decision under the owner's A+ instruction: a one-line doc fix beats a follow-up issue for a copy-paste example that reintroduces the bug.*.spec.ts.A+ round 10 (runner, 2026-09-07, commit a9d96b0)
LOCKFILE_PRIORITY(bun > yarn > pnpm > npm; it was pnpm > yarn > bun), which changes the recordedpmRun/packageManagerfor multi-lockfile projects.packageManagerat all, given a declared value outranks live detection after a migration?" with the recommendation to decide before node 12 adds another manifest consumer.withActivityHookreadingprocess.env.SEQUANT_ORCHESTRATORmakesbatch-executor.test.tsfail when the suite runs undersequant run(the three pre-existing local failures every round settled against main).