Skip to content

fix(run): manifest fallback ?? "npm" bypasses resolvePackageManager — pnpm worktrees get npm ci (surviving #870 site) #932

Closed

Description

@admarble

Epic: M0 Blocked by: — Tier: mechanical Doc: docs/internal/graph-2026-09/PLAN.md §5 I-4/I-5, §8 Graph node: 02

Symptom

Headless sequant run (2.10.0) on a pnpm project (pnpm-lock.yaml present, no
package-lock.json): every worktree dependency install runs npm ci and fails
with EUSAGE. Non-fatal, so phases proceed on worktrees with no node_modules.

Observed 2026-08-07 on ad-motion (launchd overnight run; log excerpt in
ad-motion experiments/overnight-autonomy/logs/2026-08-07.log).

Root cause

src/commands/run.ts:100-103:

manifest: {
  stack: manifest.stack,
  packageManager: manifest.packageManager ?? "npm",
},

installWorktreeDeps → resolvePackageManager(declared, root) falls back to
live lockfile detection only when the declared value is absent or not a
PM_CONFIG key (src/lib/stacks.ts:284-292). "npm" IS a valid key, so the
substituted literal short-circuits detection and pnpm-lock.yaml is never
consulted.

This is NOT a dup of #847 (shell path, fixed) or #870 (worktree-manager
fallback, fixed): it is a surviving instance of the exact spelling #870's doc
comment warns about (stacks.ts:257-265), introduced by #503's orchestrator
extraction (054434e) and missed by the #870 sweep. The shell path
(new-feature.sh:200) detects pnpm correctly, so the two provisioning paths
disagree today.

Contributing cause: the setup skill's manifest template
(templates/skills/setup/SKILL.md:305-312) writes pmRun but never
packageManager, so every plugin-installed project hits the fallback.

Fix

  1. Drop ?? "npm"; let undefined flow so resolvePackageManager detects from
    the worktree lockfile. Widen RunOrchestratorInit.manifest.packageManager
    to string | undefined (run-orchestrator.ts:215).
  2. Setup skill writes packageManager next to pmRun (all three mirrored
    skill dirs).

Scope (graph plan 2026-09)

  • may touch: src/commands/run.ts, src/lib/workflow/run-orchestrator.ts (only the manifest type at :219 → packageManager?: string), src/lib/stacks.resolve-package-manager.test.ts, one new gate test file, templates/skills/setup/SKILL.md, .claude/skills/setup/SKILL.md, skills/setup/SKILL.md
  • not in scope: resolvePackageManager itself; any other orchestrator line.

Acceptance criteria (graph plan 2026-09)

  • AC-1: manifest without packageManager + pnpm-lock.yaml resolves to pnpm install --frozen-lockfile through the run path — Verify: npx vitest run src/lib/stacks.resolve-package-manager.test.ts -t "932" → passes; the test builds the orchestrator init the way run.ts does (no literal fallback) and asserts the resolved install command.
  • AC-2: same for yarn.lock and bun.lockb per LOCKFILE_PRIORITY — Verify: same test, two more cases.
  • AC-3: gate — no producer reintroduces the literal — Verify: grep -rn 'packageManager ?? "npm"' src bin | wc -l → 0, asserted by a scoped gate test; PR body carries Mutation-verified: AC-3 — re-added ?? "npm" at run.ts:102; <test> failed; restored.
  • AC-4: the setup skill writes packageManager next to pmRun in the manifest template — Verify: grep -c 'packageManager' templates/skills/setup/SKILL.md ≥ 1 inside the manifest template block, and md5 -q templates/skills/setup/SKILL.md .claude/skills/setup/SKILL.md skills/setup/SKILL.md | uniq | wc -l → 1.

Done when (graph plan 2026-09)

A pnpm/yarn/bun worktree provisioned by sequant run installs with its own package manager, and a grep gate keeps the literal fallback out.

Original acceptance criteria (superseded by the graph-plan ACs above; kept for history)
  • Manifest without packageManager + pnpm-lock.yaml in the tree resolves
    to pnpm install --frozen-lockfile (regression test, mutation-verified)
  • Same for yarn.lock / bun.lockb per LOCKFILE_PRIORITY
  • Setup skill template writes packageManager; drift-guard covers the new
    call site so the next extraction can't resurrect the fallback

Activity

  1. added
    graph-2026-09
    on Sep 7, 2026
  2. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    Runner context (graph-run, 2026-09-06): the plan for this graph is on PR #998 (branch docs/graph-plan-2026-09), not yet on main. Read it from the branch, not the working tree:

    git show origin/docs/graph-plan-2026-09:docs/internal/graph-2026-09/PLAN.md
    git show origin/docs/graph-plan-2026-09:docs/internal/graph-2026-09/issues/NODE-FILE.md
    

    PLAN §5 invariants are binding here: I-4 (hook/skill copies byte-identical: md5 -q a b c | uniq | wc -l → 1), I-5 (gate tests ship a Mutation-verified: record in the PR body), I-6 (stop at PR — never gh pr merge, never close the issue), I-9 (run the Verify commands verbatim; never reason an AC done). Base is main 20e2a867 (v2.13.1); no code drift from the plan base c3c1b0a8 beyond the version bump. Stay inside the may touch list in the node file.

    Node file: issues/02-932-pnpm-manifest-fallback.md.

  3. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (4 ACs, ~3 code paths + 3 mirrored template dirs)

    Read the graph plan from origin/docs/graph-plan-2026-09 per the runner-context comment above (PLAN §5 I-4/I-5/I-6/I-9 binding; node file issues/02-932-pnpm-manifest-fallback.md). This plan follows that node file's AC verbatim — no divergence.

    AC Quality Check

    All 4 AC pass lintAcceptanceCriteria clean (0 flagged). They already follow the graph plan's house format (AC-n: <claim> — Verify: <verbatim command> → <expected>), which is stricter than the constitution's own Evidence: convention — one gap worth flagging: extractAcceptanceCriteria looks for a literal Evidence: clause (#938), not Verify:, so all 4 AC resolve to verificationMethod: "manual" in .sequant/state.json even though AC-1–AC-3 are plainly vitest unit tests. This doesn't block anything here (I'm classifying by reading the AC text, not the parser field) but it means downstream tooling keyed on verificationMethod (e.g. testgen auto-detection) can't see this issue's real test shape. Not in scope for #932 — noting for awareness only.


    Scope Assessment

    Non-Goals: No literal "Non-Goals" heading, but the issue's ## Scope section (may touch / not in scope lists) serves the identical function and is explicit and tight.

    Metric Value Status
    Feature count 1 ✅
    AC items 4 ✅
    Directory spread 3 ⚠️

    Tool verdict: ⚠️ SCOPE_WARNING (directory spread)

    Judgment call — treating as false positive, not auto-enabling quality loop. The tool's directory list is ["src", "test", "bin"], extracted by keyword-matching path-like tokens inside the AC prose (AC-3's grep ... src bin command, AC-2's "same test") — not from an actual diff or file list. The issue's own may touch enumeration is the ground truth: src/commands/run.ts, src/lib/workflow/run-orchestrator.ts (one type, one line), src/lib/stacks.resolve-package-manager.test.ts, one new gate test file, and 3 byte-identical mirrors of one skill doc. That's a single localized code fix plus a mirrored-doc edit already governed by I-4 — real spread is low. Recommending quality loop disabled.


    Acceptance Criteria

    AC-1: pnpm resolves through the run path with no manifest declared

    Verification: Unit Test
    Scenario: Given a tmp worktree with pnpm-lock.yaml and no declared packageManager (built the way run.ts constructs RunInit.manifest post-fix, not via a direct resolvePackageManager(undefined, dir) call — that path is already covered by the existing #870 test suite) → When resolved → Then pmConfig.ciInstall is pnpm install --frozen-lockfile.
    Assumptions: None — LOCKFILE_PRIORITY and PM_CONFIG already exist and are correct (out of scope per the issue).

    AC-2: same for yarn.lock and bun.lockb

    Verification: Unit Test
    Scenario: Same harness as AC-1, two more fixtures (yarn.lock → yarn install --immutable; bun.lockb → bun install --frozen-lockfile).
    Assumptions: Test name must contain "932" so -t "932" selects all three cases (issue's literal Verify command).

    AC-3: gate — literal fallback never reintroduced

    Verification: Unit Test (gate)
    Scenario: Given src/ and bin/, a new test greps for the literal packageManager ?? "npm" and asserts 0 matches.
    Assumptions: Mutation-verify required before PR: temporarily restore ?? "npm" at run.ts:102, confirm the gate test fails, revert, record Mutation-verified: AC-3 — re-added ?? "npm" at run.ts:102; <test> failed; restored. in the PR body per CLAUDE.md.

    AC-4: setup skill writes packageManager next to pmRun

    Verification: Integration Test (scripted, no app logic — grep + md5 check)
    Scenario: Given the manifest template block in all 3 skill mirrors → When grepped → Then packageManager appears ≥1 time in the template, and all 3 files stay byte-identical (I-4).
    Assumptions: Current 3 mirrors are already byte-identical (verified: single md5 548b1adb...).


    Implementation Plan

    Phase 1: Core fix

    1. src/commands/run.ts:102 — drop ?? "npm"; let manifest.packageManager flow through as undefined when absent, matching the already-correct call in src/commands/update.ts:94.
    2. src/lib/workflow/run-orchestrator.ts:219 — widen RunInit.manifest.packageManager from string to string | undefined. Region-owned edit only — this one type, no other orchestrator restructuring (PLAN §8: node 02 owns :219 only; nodes 05/09/08 own the other regions in this file).

    Phase 2: Tests

    1. Extend src/lib/stacks.resolve-package-manager.test.ts with a test (name containing "932") that constructs the init object the way run.ts builds it post-fix — not a direct resolvePackageManager() call, which the existing suite already covers — and asserts the resolved ciInstall command for pnpm/yarn/bun (AC-1, AC-2).
    2. New gate test file (e.g. src/lib/stacks.no-npm-fallback-gate.test.ts) asserting grep -rn 'packageManager ?? "npm"' src bin returns 0 matches (AC-3). Mutation-verify per above before opening the PR.

    Phase 3: Setup skill manifest template (3 mirrors, same PR)

    1. templates/skills/setup/SKILL.md step 5 (Detect Package Manager): add a bare PM variable alongside the existing PM_RUN in each branch (e.g. PM="pnpm" next to PM_RUN="pnpm run") — PM_RUN is a command ("pnpm run"), not a PM_CONFIG key, so reusing it for the manifest's packageManager field would fail resolvePackageManager's hasOwnProperty check and silently re-fall-through to detection, masking this exact bug.
    2. Step 7's .sequant-manifest.json template: add "packageManager": "<detected PM>" next to "pmRun": "<detected PM_RUN>".
    3. Apply the identical edit to .claude/skills/setup/SKILL.md and skills/setup/SKILL.md. Verify: md5 -q templates/skills/setup/SKILL.md .claude/skills/setup/SKILL.md skills/setup/SKILL.md | uniq | wc -l → 1.

    Design Review

    1. Where does this logic belong? Entirely in src/commands/run.ts, the single call site building RunInit. resolvePackageManager/PM_CONFIG in stacks.ts already own fallback+command resolution and stay untouched (explicitly out of scope).
    2. What's the simplest correct approach? Delete the literal, widen the one type it breaks. Rejected: a second resolution call inside run.ts — would duplicate stacks.ts logic and reintroduce the dual-producer drift worktree-manager's bare || "npm" fallback disagrees with the PM-aware shell path on manifest-less projects #870 already fixed.
    3. What existing pattern does this follow? src/commands/update.ts:94 already calls resolvePackageManager(manifest.packageManager, process.cwd()) with no literal fallback — the correct instance of this exact call, right next to the buggy one.
    4. What would a senior reviewer challenge? "Why a new gate-test file instead of extending an existing drift guard?" — AC-3 wants a source grep in src/bin, which is a different mechanism from the TS↔shell mirror drift guard (that one compares literal strings across languages, not absence of a pattern).

    Open Questions

    1. Should AC-4's grep+md5 check get a CI-enforced vitest wrapper, or stay a manual PR-time check per the issue's literal Verify command? Recommendation: fold it into the same gate-test file as AC-3 (cheap, and I-4 is exactly the kind of thing that silently drifts on the next unrelated SKILL.md edit). Impact if skipped: a future single-file SKILL.md edit breaks the mirror invariant until someone runs the command by hand.
    2. Where exactly does the new bare PM variable get set in the setup skill's step 5 shell block? Recommendation: alongside PM_RUN in each existing if/elif branch, verbatim (PM="pnpm"), not derived from PM_RUN by string-splitting. Impact if wrong: an indirection for a value already known verbatim at detection time.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Mechanical tier per graph plan; SCOPE_WARNING judged a false positive (see Scope Assessment); AC's Verify commands are already fully verbatim-specified, so testgen would just restate them — exec can write both test files directly. No security/UI surface.


    Label Review

    Current: graph-2026-09
    Recommended: no change
    Reason: Phase routing for this graph is driven by .sequant/settings.json run.phases tiering (PLAN §8), not issue labels; the issue is already correctly tiered mechanical in the node file.
    Quality Loop: Won't auto-enable — see Scope Assessment override above.

  4. added
    planned
    on Sep 7, 2026
  5. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/2 met

    Gaps:

    • The fix(run): manifest fallback ?? "npm" bypasses resolvePackageManager — pnpm worktrees get npm ci (surviving #870 site) #932 test block's second assertion compares a value to itself, presenting as install-command coverage while providing none
    • AC-3's mutation-verification record is unrecorded even though the mutation was executed and verified in-session
    • User-facing bug fix has no CHANGELOG [Unreleased] entry
    • The AC-3 gate pins one exact spelling and would not catch an equivalent reintroduction such as || "npm" or ?? DEFAULT_PM
    • stacks.resolve-package-manager.test.ts:125 — expect(PM_CONFIG[resolved].ciInstall).toBe(PM_CONFIG[pm].ciInstall) is vacuous: line 124 already asserts resolved === pm, so this compares a value to itself and would pass even if PM_CONFIG.pnpm.ciInstall were changed to something wrong. It reads as install-command coverage but provides none. (Real command coverage does exist — at frozen-install.test.ts:177/196/208 — so this is redundancy that misrepresents itself, not a coverage hole.)
    • The #932 describe block hand-builds const init = { manifest: { stack: "node", packageManager: undefined } } rather than exercising run.ts's actual init. The comment is honest about this ("Mirrors run.ts's init"), and AC-3's gate test covers the drift risk, but the block's title ("run path resolves through the lockfile") claims more than the body does.

    Suggestions:

    • Replace line 125 with a literal: expect(resolvePackageManagerConfig(resolved, dir).ciInstall).toBe(expectedCommand) per case — that would make the block assert what its name and AC-1 both claim, and would route through the same resolver the production path uses (relevant for yarn, where PM_CONFIG.yarn.ciInstall is the berry spelling but the real path emits classic).
  6. added a commit that references this issue on Sep 7, 2026
  7. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    Runner verification — node 02 (PR #1000, QA verdict AC_MET_BUT_NOT_A_PLUS)

    Verify commands from issues/02-932-pnpm-manifest-fallback.md, run verbatim in the worktree at 3623d8e7 (then 8c7d770f):

    AC Command Result
    AC-1/AC-2 npx vitest run src/lib/stacks.resolve-package-manager.test.ts -t "932" 3 passed (pnpm, yarn, bun)
    AC-3 grep -rn 'packageManager ?? "npm"' src bin | wc -l 0; gate test src/lib/stacks.no-npm-fallback-gate.test.ts present
    AC-3 mutation re-added ?? "npm" at run.ts:102 → gate test failed (expected 'src/commands/run.ts:102: …' to be '') → restored → green 2/2 recorded in the PR body (SEQUANT_MUTATION marker) — it was missing
    AC-4 grep -c packageManager templates/skills/setup/SKILL.md → 1 (inside the manifest template block, line 316); md5 -q … | uniq | wc -l → 1 met

    Fixed beyond the agent's work: the QA's vacuous-assertion finding — expect(PM_CONFIG[resolved].ciInstall).toBe(PM_CONFIG[pm].ciInstall) compared a value to itself, so AC-1's "asserts the resolved install command" was not literally true. Replaced with a per-case literal through resolvePackageManagerConfig(resolved, dir) (yarn classic → yarn install --frozen-lockfile); 15/15 pass. Commit 8c7d770f, pushed to PR #1000.

    Not done (A+ polish, per stop-at-PR): CHANGELOG [Unreleased] entry; the gate's single-spelling pattern (|| "npm" / ?? DEFAULT_PM would evade it). Owner's call whether to require either before merge.

    Merge decision is yours — I will not merge.

  8. added a commit that references this issue on Sep 7, 2026
  9. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/5 met

    Gaps:

    Suggestions:

    • The AC-1/AC-2 test constructs const init = { manifest: { stack: "node", packageManager: undefined } } as a local literal and then reads it straight back. It asserts a real install command now (the round-1 fix landed), but the init object is inert: if run.ts:102 regressed tomorrow, this test would still pass. AC-1's own text prescribes this shape ("builds the orchestrator init the way run.ts does"), so it is AC-compliant — but the actual regression guard for the production line is the AC-3 grep gate, not this test. Worth saying plainly in the PR body so the next reader doesn't over-trust it.
  10. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/4 met

    Gaps:

    • The new gate test's failure messages lost their mirror-path interpolation, so a failure across the three setup/SKILL.md mirrors cannot name which mirror broke, and is left unused
    • A direct assignment would pass the grep gate and both resolve tests, reintroducing the bug in a spelling the gate does not cover
    • AC-1/AC-2 tests mirror run.ts's init shape rather than executing the run path (as the AC's Verify clause prescribed), so the production line is guarded by the grep gate alone
    • A project that migrates package managers after setup keeps a stale declared snapshot that wins over live lockfile detection — the documented declared-wins contract, and what the issue's Fix item 2 requested, but the residual edge of this design
    • src/lib/stacks.no-npm-fallback-gate.test.ts:57,65,69 — for (const [i, text] of contents.entries()) binds i but never uses it, and both assertion messages begin with a stray leading space (" should have a .sequant-manifest.json template block"), which is the residue of a removed ${SETUP_SKILL_MIRRORS[i]} interpolation. When the gate fires across three mirrors, the failure message cannot say which mirror is broken — a real diagnostic loss in the very test this PR exists to add. ESLint does not flag it (array-destructuring unused bindings are not caught by the current config).

    Suggestions:

    • Restore the interpolation: `${SETUP_SKILL_MIRRORS[i]} should have a .sequant-manifest.json template block` (and likewise for the pmRun/packageManager assertion). One-line fix, makes i used again.
    • Consider extending the banned-pattern regex to the non-coalescing spelling (packageManager:\s*"npm") — see Risk Assessment.
  11. added a commit that references this issue on Sep 7, 2026
  12. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/4 met

    Gaps:

    • On a repo with multiple lockfiles the setup skill declares a different package manager than the resolver's own detector would pick, a newly-activated instance of the two-producer drift class this issue targets.
    • The diff adds an unused PM_CONFIG import that no lint or typecheck gate catches.
    • Instruction-inside-a-JSON-value placeholder is LLM-hostile formatting in a prompt meant to be followed literally, though both misread modes degrade safely to live detection.
    • No test drives the run path end-to-end, and the grep gate has a blind spot for an aliased two-step reintroduction of the literal fallback.
    • src/lib/stacks.resolve-package-manager.test.ts:20 — PM_CONFIG was added to the import list but is never used in code. Its only post-import occurrences are a test-name string (:34) and comments (:42, :60, :76, :100). It passes eslint --max-warnings 0 and tsc (no noUnusedLocals), so nothing catches it. Dead code added by this diff.
    • The setup skill's lockfile precedence is pnpm > yarn > bun > npm (SKILL.md:207-224), while LOCKFILE_PRIORITY in stacks.ts:178-184 is bun > yarn > pnpm > npm. That elif order is pre-existing, but this diff newly activates the divergence: before, the skill recorded nothing and detection always decided; now the skill records a declared value that wins over detection (resolvePackageManager returns the declared value on a hasOwnProperty hit). On a repo carrying both pnpm-lock.yaml and bun.lockb, setup declares pnpm where the resolver's own detector would say bun — a narrow instance of the same two-paths-disagree class this issue is about.
    • "packageManager": "<detected PM — omit this key when PM is empty>" embeds an instruction inside a JSON value, unlike its sibling "pmRun": "<detected PM_RUN>". This degrades safely — I checked both misread modes: an emitted "" is falsy so detection runs, and the literal placeholder text is not a PM_CONFIG key so hasOwnProperty fails and detection runs — but it is still LLM-hostile formatting in a prompt whose whole job is to be followed literally.

    Suggestions:

    • Drop the unused PM_CONFIG import.
    • Either reorder the setup skill's elif chain to match LOCKFILE_PRIORITY, or file a follow-up; a one-line comment noting the deliberate difference would also close it.
    • Move the "omit when empty" instruction out of the JSON value into the prose already directly above the block.
  13. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/5 met

    Gaps:

    • No test exercises run.ts's actual init construction, so a non-literal npm-default regression at run.ts:102 would keep both the AC-1/AC-2 tests and the grep gate green
    • The AC-3 grep gate is blind to a two-step alias (const pm = manifest.packageManager; pm ?? "npm"), which is the recurrence shape an extraction refactor produces and an extraction (arch: extract RunOrchestrator — decouple execution engine from CLI wiring #503) introduced this bug
    • CHANGELOG entry does not follow the section 10a format guidance to start with an action verb (Add, Fix, Update, Remove, Improve)
    • No test exercises runCommand's init construction. run.test.ts contains no manifest / resolveConfig / packageManager assertions, and AC-1/AC-2 reconstruct the init shape in the test rather than invoking the real one. If run.ts:102 regressed to a non-literal npm default (e.g. manifest.packageManager ?? someDefault()), both the AC-1/2 tests and the grep gate stay green. The PR body discloses this as a stated limit.
    • The gate's documented blind spot — a two-step alias (const pm = manifest.packageManager; … pm ?? "npm") — is not hypothetical for this defect class. This bug was introduced by arch: extract RunOrchestrator — decouple execution engine from CLI wiring #503's orchestrator extraction, and an extraction refactor is exactly what produces an aliased intermediate. The gate is strictly better than main, but the most likely recurrence shape is the one it cannot see.
    • CHANGELOG entry does not lead with an action verb (§10a format guidance: "Starts with action verb — Add, Fix, Update, Remove, Improve"). It opens **pnpm/yarn/bun worktrees no longer install with npm ci.**. Issue number and ### Fixed section are correct.

    Suggestions:

    • File a follow-up to add one assertion that calls the real run.ts init path (or extract the init literal into an exported helper the test can call), closing both bullets above at once.
    • Reword the CHANGELOG entry to open with Fix ….
  14. 1 remaining item

  15. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/2 met

    Gaps:

    • The manifest template's include-conditional lives in prose rather than the JSON block an executing agent copies; degraded values resolve safely only because of the hasOwnProperty guard in stacks.ts
    • The setup skill's newly-introduced lockfile precedence has no drift guard against its source of truth, repeating the PM_CONFIG.yarn.ciInstall uses Yarn 2+ --immutable, which Yarn 1 rejects — no berry detection exists #871 TS-to-markdown mirror drift class
    • The grep gate cannot see non-literal re-defaulting; that is closed at the run.ts init site by run.manifest-init.test.ts but a future second RunInit producer would be covered by neither guard

    Suggestions:

    • Move the "omit when PM is empty" conditional into the JSON block (see §Adversarial Re-Read finding 1).
    • Consider a drift guard for the setup skill's lockfile precedence vs. LOCKFILE_PRIORITY (finding 2).
  16. added a commit that references this issue on Sep 7, 2026
  17. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/6 met

    Gaps:

    • No test asserts that run.ts still calls manifestForRun, so a two-step-alias regression at the init site evades both the grep gate and the helper test, contrary to the PR body's 'closed by construction' claim
    • Plugin-installed projects that previously never declared packageManager now get a setup-time snapshot that outranks live detection if the project later migrates package managers
    • The PR body's round-5 claim that "the alias blind spot noted in round 4 is closed by construction" overstates coverage. See §6d.

    Suggestions:

    • Add a one-line source-inspection assertion that run.ts still calls manifestForRun (the same technique the drift guard already uses), which would genuinely close the init-site blind spot.
  18. added a commit that references this issue on Sep 7, 2026
  19. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/6 met

    Gaps:

    • The setup skill's manifest template puts an instruction comment inside the fenced block an agent copies to a plain-JSON file, so a literal copy yields unparseable JSON and getManifest throws on every later command.
    • Writing packageManager at setup gives every plugin-installed project a setup-time snapshot that outranks live lockfile detection, a milder form of the same override class fix(run): manifest fallback ?? "npm" bypasses resolvePackageManager — pnpm worktrees get npm ci (surviving #870 site) #932 fixed; mandated by AC-4 and disclosed in the CHANGELOG.
    • A future second RunInit producer could re-introduce a default via a two-step alias, which the same-line grep gate cannot see and the run.ts-only source pin does not cover.
    • templates/skills/setup/SKILL.md:317 introduces the only ```jsonc fence in the entire skill tree (44 skill files), containing a // comment inside a block the agent is instructed to write to disk as .sequant-manifest.json. A literal copy yields unparseable JSON and getManifest throws on every subsequent command. Mitigated — the comment itself says "the file you write must be plain JSON: no comments", and the prose above repeats the conditional — but round 4 had this safely as prose-only and round 6 moved it inside the fence voluntarily (the AC-4 gate asserts only "pmRun" … "packageManager", not the comment). Every other // in the skill tree sits in pseudo-code blocks, never in a copy-to-file template.

    Suggestions:

    • Revert the in-fence comment to round 4's prose-only form (or use a non-comment marker) so the template block stays copy-safe plain JSON. The AC-4 gate stays green either way.
    • The gate regex excludes *.test.ts / __tests__/ but not *.spec.ts; harmless today (no .spec.ts under src/bin), worth aligning if the convention ever changes.
  20. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/2 met

    Gaps:

    • The documented public programmatic-API example still teaches the literal npm fallback this PR removed, so a downstream integrator following the docs reintroduces fix(run): manifest fallback ?? "npm" bypasses resolvePackageManager — pnpm worktrees get npm ci (surviving #870 site) #932 in their own caller.
    • The gate's test-file exclusion list omits the *.spec.ts convention; harmless today since no .spec.ts exists under src or bin.
    • docs/features/run-orchestrator.md:45 still shows packageManager: manifest.packageManager ?? 'npm' in the public copy-paste RunOrchestrator.run() example. Detail under Risk Assessment / Adversarial Re-Read.

    Suggestions:

    • The gate excludes *.test.ts and __tests__/ but not *.spec.ts. Harmless today (no .spec.ts under src/bin), worth aligning if the convention changes.
  21. added a commit that references this issue on Sep 7, 2026
  22. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/5 met

    Gaps:

    • The setup skill's lockfile precedence reorder changes the recorded pmRun for multi-lockfile projects and is undocumented in the CHANGELOG
    • AC-4's manifest packageManager write reintroduces the short-circuit class on package-manager migration; disclosed but untracked
    • The setup skill's lockfile precedence reorder is an undocumented user-visible behavior change. templates/skills/setup/SKILL.md:214-231 changed the order from pnpm > yarn > bun > npm to bun > yarn > pnpm > npm. This is the correct order (it now mirrors LOCKFILE_PRIORITY), but it also changes the pmRun written to .sequant/settings.json for any project with more than one lockfile — a repo with both yarn.lock and pnpm-lock.yaml now gets yarn where it previously got pnpm run. The CHANGELOG [Unreleased] entry covers the packageManager write and the run-path fix but says nothing about the precedence change.
    • The snapshot-staleness consequence of AC-4 remains open and unfiled. Writing packageManager into .sequant-manifest.json creates a declared value that, by resolvePackageManager's own contract, outranks live lockfile detection — the same short-circuit shape as the bug, one layer up. A project that later migrates pnpm → bun gets pnpm worktrees until someone hand-edits the manifest. This is AC-4's explicit requirement and it is disclosed (CHANGELOG, and PR "A+ round 8" defers it to the plan owner under PLAN §5 I-7), but no follow-up issue exists to track it.

    Suggestions:

    • Add a line to the [Unreleased] entry noting the setup skill's lockfile precedence now mirrors LOCKFILE_PRIORITY.
    • File the snapshot-staleness follow-up rather than leaving it only in a PR round note, so it survives the PR being merged.
  23. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    QA Verdict: READY_FOR_MERGE

    AC coverage: 0/4 met

    Gaps:

    • The positive half of the call-site pin is not scoped to the init block, so a comment containing the matched text could satisfy it; the paired negative assertion is what catches the realistic regression and is mutation-proven

    Suggestions:

    • run.manifest-init.test.ts:51 — expect(src).toMatch(/manifest:\s*manifestForRun\(manifest\)/) reads the whole of run.ts, so a comment containing that text could satisfy the positive half. CLAUDE.md's scoping rule targets exactly this shape. In practice the paired negative (not.toMatch(/manifest:\s*\{\s*stack:/)) is what catches the realistic regression, and round 7's mutation record shows the pair fires — so this is a latent hazard needing a contrived decoy comment to exploit, not an active hole. Anchoring both to the const init = { block would close it.
  24. admarble commented on Sep 7, 2026

    @admarble
    ContributorAuthor

    Runner verification — node 02, final (PR #1000 at a9d96b0e, QA verdict READY_FOR_MERGE, round 11)

    Verify commands from issues/02-932-pnpm-manifest-fallback.md, re-run verbatim at the final commit:

    AC Result
    AC-1/AC-2 npx vitest run src/lib/stacks.resolve-package-manager.test.ts -t "932" → Tests 3 passed
    AC-3 grep -rn 'packageManager ?? "npm"' src bin | wc -l → 0; gate + real-init-path tests → Tests 9 passed (9); mutation markers on the PR: 6 classification":"valid";
    AC-4 grep -c packageManager templates/skills/setup/SKILL.md → 3 (inside the manifest template block, asserted by the scoped gate); three mirrors md5 … | uniq | wc -l → 1

    What the A+ pass changed beyond the original agent work (11 QA rounds, commits 8c7d770 → a9d96b0, all on PR #1000): real install-command assertions; the grep gate widened to every spelling (??/||/direct :, 'npm', DEFAULT_PM*) with test files excluded; run.ts's manifest init extracted to manifestForRun (new src/commands/run-manifest.ts, disclosed off-list, keeps run.ts under its #503 cap) and tested on the real path with its call site pinned by source inspection; the setup skill no longer records a guessed "npm", its lockfile order mirrors LOCKFILE_PRIORITY with a source-inspection drift guard, and the manifest template stays plain JSON; the docs API example no longer teaches the fallback; CHANGELOG restored from main and rewritten with the snapshot and precedence caveats. Six mutation records, all parser-valid. The one open design question (should setup record packageManager at all) is PLAN §9 OQ-20 on PR #998, not a new issue.

    Merge decision is yours — I will not merge.

  25. added 2 commits that reference this issue on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    graph-2026-09planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions