Repository navigation
Description
Summary
sequant merge --check's combined-branch test runs npm test and npm run build on the merged combined state without reinstalling dependencies first. When any merged branch changed the lockfile / added a dependency, the repo-root node_modules is stale, so both commands fail — producing a false BLOCKED verdict that can scare a user away from a perfectly healthy merge.
Real-world evidence
A length-4 chain (sequant run 109 111 112 113 --chain -Q, ad-motion M6 audio) produced 4 stacked PRs. sequant merge --check reported:
## Combined Branch Test
**Status:** ❌ Issues found (14s)
- ❌ npm test failed on combined state:
- ❌ npm run build failed on combined state:
Batch Verdict: ❌ BLOCKED
Note the empty error strings. But the actual combined state was fine:
- The full-stack tip worktree (
feature/113…, which contains all 4 issues' commits) built clean (npm run build— all 4 workspaces) and passed the whole suite (npm test— 929 passed, 1 skipped, 0 failed). - Both PRs' GitHub CI (which does a clean
npm cifirst) were fully green.
The chain's own run log had printed Reinstalling dependencies (lockfile changed)… before creating the PRs — i.e. the branches genuinely changed the lockfile, and the merge-check never re-ran install, so it tested against stale node_modules.
Root cause
src/lib/merge-check/combined-branch-test.ts (lines ~177-207): after merging the branches into the combined state, it goes straight to:
const testResult = npm(["test"], repoRoot); // ~178
// ...
const buildResult2 = npm(["run", "build"], repoRoot); // ~194There is no npm install (or pnpm/yarn equivalent) between the merge and the test/build. A combined state that changed package.json/lockfile therefore runs against outdated dependencies.
Secondary defect: the failure message is ${testResult.stderr.slice(0, 500)} — when the failure writes to stdout (or exits without stderr, as here), the report shows an empty reason, making the false-BLOCKED impossible to diagnose from the report alone.
Acceptance Criteria
- AC-1: After assembling the combined state and before running test/build,
combined-branch-test.tsreinstalls dependencies when the lockfile changed (compare lockfile vs the base, or install unconditionally). Use the detected package manager (this repo is pnpm; don't hardcodenpm install). - AC-2: With deps reinstalled, a combined state whose branches only changed the lockfile (added a dep) reports
npm test/npm run buildpassed — reproduce the fix: /qa should detect templates/scripts changes for verification #109-113-class scenario in a test/fixture and assert no false BLOCKED. - AC-3: When test/build genuinely fails, the finding message includes a non-empty reason: fall back to a stdout tail when stderr is empty (both truncated). No more
failed on combined state:with nothing after it. - AC-4: Install failures themselves are surfaced distinctly (a bad merged lockfile → clear "dependency install failed" finding, not a downstream mystery test failure).
- AC-5: Regression test covering: (a) lockfile-changed combined state passes after reinstall, (b) empty-stderr failure still yields a diagnosable message.
Notes
- Mirrors what GitHub CI already does correctly (
npm cibefore test), which is why every individual PR was green while the local merge-check was red. - Impact: a false BLOCKED on a good stack is high-friction — it directly contradicts green PR CI and a clean worktree, and (empty errors) gives the user nothing to act on. Found while merging a real chain; had to override the verdict by hand after verifying build+test in the worktree.
Activity
admarble commentedon Jul 25, 2026
Plan (
/spec) — #803Complexity: Standard (5 ACs, 3 directories)
AC Quality Check
All 5 ACs pass the linter (no vague/unmeasurable/open-ended patterns). Two notes:
1. AC markers were not parseable — issue body normalized. The ACs were written as
- [ ] **AC-1** After …(bold ID, no colon).src/lib/ac-parser.tsrequires the colon inside or immediately after the bold marker, so all four parser patterns missed and 0 ACs were extracted — state tracking and/qawould have had nothing to check against. I edited the issue body to- [ ] **AC-1:** …(formatting only, AC text untouched); all 5 now parse. Flagged as a follow-up candidate under Open Questions.2. AC-1's parenthetical is factually wrong for this repo. It says "(this repo is pnpm; don't hardcode
npm install)". Sequant haspackage-lock.jsonand nopnpm-lock.yaml— it is an npm repo. The requirement (use the detected package manager rather than a hardcoded one) is still correct and worth implementing, becausesequant merge --checkruns in consumer projects that may be pnpm/yarn/bun. Implementing the requirement, ignoring the incorrect premise.Scope Assessment
Non-Goals:⚠️ Non-Goals section not found. Consider adding scope boundaries.
Verdict: ❌ SCOPE_SPLIT_RECOMMENDED — overridden, do not split.
Reasoning: The red comes solely from the feature-count heuristic scoring three nouns (reinstall / error message / install-failure surfacing). All three are facets of one defect in one ~230-line file, and splitting would mean shipping the reinstall without the diagnostics that made the original failure unreadable. Directory spread is 1, AC count is green. Proceeding as a single change; quality loop left disabled.
Acceptance Criteria
AC-1: Reinstall deps after assembling the combined state, using the detected package manager
Verification: Unit Test
Scenario: Given a combined state whose merge changed a lockfile → When
runCombinedBranchTestruns → Then a frozen install for the detected package manager is spawned before the first test/build spawn.Assumptions:
detectPackageManagerSync()currently resolves lockfiles relative toprocess.cwd(), not torepoRoot— needs an optionalrootparam (backward compatible).PM_CONFIGhas no CI/frozen-install command yet — needs aciInstallfield.AC-2: Lockfile-only combined state no longer reports a false BLOCKED
Verification: Unit Test
Scenario: Given branches that only added a dependency (lockfile + package.json changed), and test/build that succeed once deps are installed → When merge-check runs → Then both findings are
info("passed") andresult.passed === true.Assumptions: The #109–113 scenario is reproduced at the spawn-sequence level (mocked
spawnSync), which is the layer the defect lives at — the missing install call. A live npm-install fixture would add minutes of wall-clock for no extra signal.AC-3: Failure findings always carry a non-empty reason
Verification: Unit Test
Scenario: Given a test/build failure with empty
stderrand diagnostics onstdout→ When the finding is built → Then the message contains a stdout tail, not a trailing empty string. Given both streams empty (e.g. timeout / signal kill) → Then the message states the exit code or signal.Assumptions:
spawnSynctimeouts producestatus: null+ emptystderr— the exact empty-message symptom — so the fallback chain must terminate in an exit-code/signal string, never"".AC-4: Install failures are surfaced distinctly
Verification: Unit Test
Scenario: Given the merged lockfile is inconsistent with
package.json(frozen install fails) → When merge-check runs → Then a singleerrorfinding names dependency installation as the cause, and test/build are skipped (no downstream mystery failure).AC-5: Regression tests
Verification: Unit Test
Scenario: New
src/lib/merge-check/combined-branch-test.test.tscovering (a) lockfile-changed state passes after reinstall, (b) empty-stderr failure yields a diagnosable message. TodayrunCombinedBranchTesthas zero direct test coverage — onlybuildResultis tested.Implementation Plan
Phase 1: Shared package-manager plumbing (
src/lib/stacks.ts)ciInstalltoPackageManagerConfigand to all 7PM_CONFIGentries —npm ci,pnpm install --frozen-lockfile,yarn install --immutable,bun install --frozen-lockfile; Python entries reuse their existing quiet install. Frozen install is chosen deliberately: it mirrors what green PR CI does (the issue's own diagnosis), it does not rewrite the lockfile (a mutatingnpm installwould dirty the temp branch and make thegit checkout <original>in thefinallyblock fail), and a bad merged lockfile fails it loudly — which is exactly AC-4's signal.detectPackageManagerSync(root = process.cwd())an optional root so merge-check can detect againstrepoRootrather than the process cwd. Existing caller (version-check.ts:371) is unaffected.Phase 2: Fix
combined-branch-test.tsnpm()helper intorunPm(command, cwd, timeoutMs)that takes a resolved command string fromPM_CONFIGand a per-step timeout (install gets a longer budget than test/build).resolveFailureReason(result)— first non-empty of:stderrhead-500 →stdouttail-500 → spawnerror.message→killed by signal X/exited with code N. Guaranteed non-empty. (AC-3)lockfileChanged(repoRoot, baseRef)—git diff --name-only <base> HEAD -- <lockfiles>, reusing the same lockfile listworktree-manager.tsalready uses.ciInstall. On failure → push oneerrorfinding naming dependency installation, includeresolveFailureReason, and return early without running test/build. (AC-1, AC-4)runcommand instead of hardcodednpm, and embed the actual command in every finding message. (Consistency with AC-1; keeps AC-3'sfailed on combined state:phrasing.)try/finallyso cleanup findings can be appended: todayreturn buildResult(...)insidetryfreezespassedbeforefinallyruns, so anything pushed during cleanup would silently not affect the verdict. Compute findings in thetry, build the result after thefinally.node_modules(derived — see below): if we installed, re-run the non-frozen install after the original branch is restored, so the user isn't left with the combined state's dependency tree. Best-effort; emits awarningfinding with a manual-fix hint if it fails.Phase 3: Tests + docs
src/lib/merge-check/combined-branch-test.test.tswith a mockedspawnSync(the patternmerge-check-extended.test.tsalready uses): AC-2 happy path asserting install-before-test ordering, AC-3 empty-stderr and empty-both cases, AC-4 install-failure short-circuit, plus a no-lockfile-change case asserting install is skipped.docs/reference/merge-command.md:159-160sample output for the new finding wording, and extendstacks.test.tsforciInstall.Design Review
src/lib/stacks.ts(already the single source of truth —worktree-manager.ts,update.tsboth consumePM_CONFIG). The merge/install/test sequencing belongs incombined-branch-test.ts. No new module.reinstallIfLockfileChanged()inworktree-manager.ts:1127— same "diff the lockfile against a ref, reinstall if changed" shape, sameLOCKFILESlist, samePM_CONFIGlookup. Deliberately not extracted into a shared util yet: that function is rebase-specific (ORIG_HEAD, chalk console output, boolean return) while this one must emitCheckFindings and short-circuit. Noted as a future consolidation, not done here.npm ciinstead ofnpm install?" — becausenpm installrewrites the lockfile, dirtying the temp branch and breaking thefinallycheckout. Answered inline in the code comment.node_modules." — yes; step 9 restores it. Called out as a derived AC so it can be argued down.spawnSyncisn't a real reproduction of fix: /qa should detect templates/scripts changes for verification #109–113." — the defect is a missing call in a command sequence; the mock asserts on that sequence. Stated in AC-2's assumptions.Feature Quality Planning
Notable items:
spawnSync(..., {timeout: 120_000})returnsstatus: nullwith emptystderrwhen it fires — a second, independent path to the same "empty reason, false BLOCKED" symptom this issue reports. A 929-test suite plus a 4-workspace build can plausibly exceed 2 minutes on a cold cache. AC-3's fallback chain makes it diagnosable; raising the budget makes it not happen.node_modulesside effect (Phase 2 step 9) — without it, this fix leaves the user's repo installed against the combined lockfile after the check restores their original branch. Ironic failure mode given the issue.stderronly" pattern has exactly one other instance inmerge-check/(report.ts:320, agh pr commentfailure) —ghreliably writes to stderr there, so no value in changing it. Below the ≥3-instance bar; no scope expansion recommended.Derived ACs
node_modulesis restored to that branch's state (or the user is explicitly told it wasn't)Open Questions
- [ ] **AC-1** Desc(bold ID, no colon)? — Recommendation: file a separate follow-up againstsrc/lib/ac-parser.ts; it's a different module and out of scope here. Impact if not fixed: every issue written in that (very common) style silently yields zero ACs, and/qahas nothing to verify — a silent failure, not a loud one. Normalized fix(merge-check): combined-branch-test runs npm test/build without reinstalling deps after a lockfile change → false BLOCKED #803's body in the meantime.node_modulesafter the check, or just warn? — Recommendation: restore (AC-7), best-effort with a warning finding on failure. Impact if wrong: one extra incremental install per merge-check that hit a lockfile change; harmless but slower.npm testis incoherent. Impact: finding-message wording changes, sodocs/reference/merge-command.mdneeds a matching update (included in the plan).Rule Touchpoints
None — the behavior-rule detector short-circuits on all 5 ACs (0 keyword hits). Section omitted.
Conflict Risk Analysis
Two other worktrees exist (
feature/782-*,feature/795-*), both sitting atorigin/mainwith zero commits — no file overlap, no conflict risk. NoDepends on/Blocked bymarkers in the issue body.Recommended Workflow
Phases: spec → exec → qa
Quality Loop: disabled
Reasoning: Single-file bugfix with precise, mostly unit-testable ACs. No UI surface → no
/testphase. Skippingtestgen: AC-5 already specifies the exact test cases, so generating stubs first adds a round-trip without adding information.Label Review
Current: (none)
Recommended:
bug,no-browser-testReason: It's a defect fix, not an enhancement;
no-browser-testis the explicit opt-out that keeps/fullsolvefrom probing for a UI surface that doesn't exist.Quality Loop: Won't auto-enable — the SCOPE_SPLIT_RECOMMENDED verdict is an overridden false positive (single file, 1 directory), so the yellow/red auto-enable is not honored here.
fix(#803): use a frozen install for the node_modules restore too
refactor(#803): rename runCommand to runPackageManagerCommand
admarble commentedon Jul 25, 2026
QA Review for Issue #803
PR: #806 · Branch:
feature/803-fix-merge-check-combined-branch-test-runs-npm-· HEAD:7d4a54eSize Gate
Deviation, stated: the review below was done inline, not via
sequant-qa-checkersub-agents. Reason: the substantive change is one 430-line file plus its new test file, and QA sub-agents have a track record of hallucinating about worktree contents. The mechanical checks the agents would have run (type-safety, deleted-tests, scope, security grep) were executed directly and are reported verbatim below.AC Coverage
combined-branch-test.ts:355-380.lockfileChanged(repoRoot, "origin/main")gates it;detectPackageManagerSync(repoRoot)picks the manager;pmConfig.ciInstallis the command. Literal check on "before running test/build": the test asserts spawn-index ordering, not just presence —installIdx < testIdxandinstallIdx < buildIdx. Not hardcodednpm installanywhere.result.passed === true, zeroerrorfindings, and the three expectedinfomessages. The #109-113 shape (branches touchedpackage.json+package-lock.json) is the fixture'sfilesModified.resolveFailureReason()at:119-141. Literal check on each clause: stdout tail (truncateTail,:150-154) ✅; stderr truncated (truncateHead,:144-148) ✅; never empty — terminal branch returnsexited with code N✅. Two end-to-end tests assertnot.toMatch(/failed on combined state:\s*$/), which is the exact symptom string from the issue.:365-372pushes oneerrorfinding naming dependency installation and returns early. The test asserts both halves: the finding text, and thatnpm run test/npm run buildwere never spawned and no test-related finding exists. The "not a downstream mystery" clause is what the early return buys.combined-branch-test.test.ts, 17 cases. (a) and (b) both present. Regression value measured, not assumed — see Adversarial Re-Read.INSTALL_TIMEOUT_MS = 300_000,TEST_BUILD_TIMEOUT_MS = 600_000(was a flat 120_000).resolveFailureReasonhas a dedicated signal branch; test "names the signal when the command was killed (timeout)".node_modulesrestored after the check, or the user is told:214-238. Restores with a frozen install after the branch checkout; on failure emits awarningfinding with the exact remediation command. Two tests: ordering (one install either side ofgit checkout main) and the warning path.Coverage: 7/7 AC items fully met
Original ACs: 5/5 met · Derived ACs: 2/2 met
Note on AC-1's premise: AC-1 parenthesizes "(this repo is pnpm; don't hardcode
npm install)". Sequant haspackage-lock.jsonand nopnpm-lock.yaml— it is an npm repo. The requirement is implemented as written (detect, don't hardcode), becausemerge --checkruns in consumer projects that may be pnpm/yarn/bun; only the parenthetical is factually wrong. Flagged rather than silently followed.Quality Plan Verification
PM_CONFIG/LOCKFILESrather than new detection)Derived ACs: 2/2 addressed
Quality Plan Status: Complete
CI Status
typecheckbuild (22.x)node-floor-guardvalidate-skillsvalidate-pluginCI Summary: 5 passed, 0 pending, 0 failed (run 30145981343, on final commit
7d4a54e)CI-related AC items: none — no AC references CI.
Quality Metrics
any/as anyon added lines)Build Verification
N/A —
npm run buildpasses on the feature branch (tsc, clean).Test Coverage Analysis
src/lib/merge-check/combined-branch-test.tssrc/lib/merge-check/combined-branch-test.test.tssrc/lib/stacks.tssrc/lib/stacks.test.ts(extended forciInstall)Coverage: 2/2 changed source files have corresponding tests
Critical paths without tests: None. Before this PR
runCombinedBranchTesthad zero direct coverage — onlybuildResultwas tested.Local results:
npx vitest run src/lib/merge-check/→ 68 passed. Fullnpm test→ 4056 passed, 2 failed; both failures (lock-manager.integration,phase-registry.integration) are pre-existing worktree-environment flakes — they pass onmain, and running them in this worktree with the changes stashed produced 3 failures, i.e. more without the PR than with it. Both are subprocess-spawn tests hitting a 5s timeout under worktree cold-start. CI (which runs on a clean checkout) is fully green.Code Review
Strengths:
npm installwould rewrite the lockfile, dirty the temp branch, and break thegit checkout <original>during cleanup — a failure mode that would have been maddening to diagnose.PM_CONFIGand mirrorsworktree-manager.ts's existingLOCKFILESlist rather than inventing a second detection path.try/finallyrestructure is a real correctness fix, not cosmetics: the originalreturn buildResult(...)insidetryevaluatedpassedbeforefinallyran, so any finding pushed during cleanup would have appeared in the array but silently failed to affect the verdict. Findings are now collected in thetryand the result is built after cleanup.detectPackageManagerSync(root = process.cwd())is genuinely backward compatible — all three existing callers (version-check.ts:371,bin/cli.ts:145,bin/cli.ts:538) call it with no arguments.Issues found and fixed during this review (both committed, both re-verified):
pmConfig.installSilent(npm install --silent), which normalizes and rewritespackage-lock.json— so the restore step could leave the user's own branch with a dirty tree, the exact hazard the forward install was made frozen to avoid. Not theoretical: this worktree's ownnew-feature.shnpm installstrippedlibcfields frompackage-lock.jsonearlier in this session. Fixed inaf0494a; two tests now assert the mutating variant is never spawned.runCommandname collision.src/commands/run.tsalready exportsrunCommand(the CLIrunentry point). A second unrelatedrunCommandmade grepping for either ambiguous — it cost time during this very review. Renamed torunPackageManagerCommandin7d4a54e.Suggestions (non-blocking, not filed):
reinstallIfLockfileChanged()inworktree-manager.ts:1127now shares the "diff lockfiles against a ref, reinstall" shape withlockfileChanged()here. Deliberately not extracted: that one is rebase-specific (ORIG_HEAD, chalk output, boolean return) while this one emitsCheckFindings and short-circuits. Worth revisiting if a third caller appears.spawnSync("npm", …)withoutshell: truedoes not resolvenpm.cmdon Windows. Pre-existing — the originalnpm()helper had the identical problem — so not a regression from this PR, and the whole merge-check path is Unix-oriented today.Test Quality Review
child_process), the established pattern inmerge-check-extended.test.ts.mockSpawnSync.mockReset()inbeforeEach.detectPackageManagerSync("/repo")finds no lockfile and deterministically falls back tonpm.Issues Found: None.
Anti-Pattern Detection
Dependency Audit: N/A —
package.jsonunchanged.Code Patterns: No
awaitin loop, no empty catch, no hardcoded secrets, no SQL concatenation, no0.0.0.0bind, no uncleared timer.spawnSynctimeouts are bounded and now diagnosable.Critical Issues: 0 · Warnings: 0
Call-Site Review
New exported symbols: 4 (
CommandResult,runPackageManagerCommand,resolveFailureReason,lockfileChanged) + 1 signature change (detectPackageManagerSync)runPackageManagerCommand:223(restore),:356(install),:383(test),:400(build)installedCombinedDeps; install gated onlockfileChangedresolveFailureReason:232,:369,:394,:415lockfileChanged:355if (lockfileChanged(repoRoot, BASE_REF))detectPackageManagerSync(root?):189(new, passesrepoRoot); pre-existing:version-check.ts:371,bin/cli.ts:145,bin/cli.ts:538process.cwd()CommandResultFindings: No mismatches. Every new export is reachable; no dead exports.
installedCombinedDepsis deliberately set totruebefore the install's success is checked, because a failednpm cimay already have wipednode_modules— so restore must still run. Confirmed correct by reading:358-373.Execution Evidence
npx tsx bin/cli.ts merge --helpnpm run buildnpm run lint(--max-warnings 0)npx vitest run src/lib/merge-check/Evidence status: Complete
Note on scope:
scripts/was not modified — the change is insrc/lib/, reached viasequant merge --check. A live end-to-endmerge --checkrun against a real multi-branch lockfile-changing batch was not executed; it requires a purpose-built 2+ branch stack and would run a realnpm ciplus the full suite. The spawn-sequence tests cover the defect exactly (the missing call), and the smoke test confirms the command surface is intact. Recorded here as the honest boundary of what was executed.Skill Command Verification
N/A — no
.claude/skills/**/*.mdfiles changed.Detection Pattern Verification
N/A — no skill markdown changed, so the §6c hard precondition is false.
CLI Registration Verification
N/A — no
RunOptionsor other CLI option-interface fields added.bin/cli.tsunchanged.Behavior-Rule Survival Check
N/A — the behavior-rule detector was run against all 5 ACs during
/spec; zero triggered (0 keyword hits each).Manual Test ACs
N/A — the spec plan assigns Unit Test verification to all 5 original ACs and both derived ACs. No Manual Test ACs detected.
Smoke Test
npx tsx bin/cli.ts merge --helpgit diff --name-only origin/main HEAD -- <5 lockfile paths>with 4 of 5 absentlockfileChangeddoesn't error on pathspecs matching nothingSmoke Test Status: Complete
CHANGELOG Verification
fix(#803):commits)[Unreleased]entry### Fixed(#803), correct sectionResult: CHANGELOG requirements met
Risk Assessment
npm cithat fails for an environmental reason unrelated to the merge (registry outage, disk full, corrupted cache) now produces anerrorfinding and skips test/build — turning a transient infra problem into aBLOCKEDverdict. This trades one false BLOCKED for a narrower one, but the new message names dependency installation and quotes the real reason, so it's diagnosable in seconds rather than being an empty string. Second-order:npm cideletes and rebuildsnode_modules, so a merge-check on a lockfile-changing batch is now materially slower (two full frozen installs) — correctness bought with wall-clock.merge --checkagainst a real multi-branch stack that actually changes a lockfile (see Execution Evidence). The mocked spawn sequence proves the ordering; it does not provenpm cibehaves as expected inside a temp-branch checkout on every platform. Windowsnpm.cmdresolution remains untested (pre-existing).src/lib/merge-check/for the same "reportstderronly" root cause found exactly one other instance —report.ts:320, agh pr commentfailure, whereghreliably writes to stderr. Below the ≥3-instance bar and low value; no scope expansion, no follow-up filed. The related "reinstall on lockfile change" logic inworktree-manager.ts:1127was checked and is correct there (it already reinstalls).combined-branch-test.ts(:232restore,:369install,:394test,:415build) share the root-cause pattern and all four route throughresolveFailureReason. Verified by grep, not assumed: the only otherstderrinterpolation left in the file is:250(Failed to create temp branch), wheregit checkout -breliably populates stderr.Adversarial Re-Read
Findings:
resolveFailureReasonreduced tostderr.slice(0, 500)): 13 of 16 failed. The 3 that passed are the ones that should be behavior-independent (skip-install-when-unchanged, prefer-stderr, truncate-stderr-head). This rules out the tautological-test class.runCommandcollision (both detailed under Code Review). Neither was caught by the structured pipeline; both came from re-reading the diff against its own stated rationale ("we chose frozen so we don't dirty the tree" — then the cleanup path used a mutating install).git statusclean; branch 0 commits behindorigin/main; 3 commits ahead, all pushed; no stashes left (the two diagnostic stashes were popped and verified). One trap caught:new-feature.sh'snpm installhad silently modifiedpackage-lock.json(strippinglibcfields) — reverted before the first commit, so no unrelated lockfile churn is in the PR./spec). Two things went beyond AC-1's literal text and are called out rather than smuggled: routing test/build through the detected manager (AC-1 mandates only the install), and raising the timeouts. Both are stated in the PR body and the CHANGELOG.sed -i '' 's/\brunCommand\b/…/'rename silently did nothing (BSDsedhas no\b). It was caught because the follow-upgrep -creturned 0 andgit diff --statwas empty — not because anything failed loudly. Had I trusted the exit code, the rename commit would have been empty.Status: Gaps Found — two defects were surfaced and fixed within this PR; no AC is left unmet, and no fixture went unrun.
Verdict: AC_MET_BUT_NOT_A_PLUS
All 7 ACs (5 original + 2 derived) are MET, CI is fully green on the final commit, and the new tests demonstrably fail against the old behavior. The verdict is one notch below
READY_FOR_MERGEfor one reason, per the §7 algorithm: the adversarial re-read reached Gaps Found, having surfaced two genuine defects (a mutating restore install that could dirty the user's tree, and an export-name collision) that the structured checks did not catch. Both are fixed and verified in this PR — but the honest record is that a second pass was required to reach this state, and "no live end-to-endmerge --checkrun" remains a stated coverage boundary.This is merge-ready. The distinction from A+ is that the first pass shipped a defect of the same family as the bug being fixed.
Documentation
docs/reference/merge-command.mdupdated — both the check-description table row and the sample report output[Unreleased]entry added under### FixedNext Steps
gh pr merge 806 --squash), then clean up the worktree.src/lib/ac-parser.tsdoes not match- [ ] **AC-1** Desc(bold ID, no colon) — all four patterns require the colon. This issue's ACs originally parsed as zero items; the body was normalized during/specto unblock state tracking. It is a silent failure mode (/qawould have had nothing to verify) affecting a very common authoring style, and is worth its own issue against the parser.admarble commentedon Jul 25, 2026
/fullsolve Complete
Issue: #803 · PR: #806 · Verdict: AC_MET_BUT_NOT_A_PLUS
Summary
no-browser-test, no UI surface)7d4a54esrc/lib/merge-check/; new suite has 17 cases, 13 of which fail against the pre-fix behaviorKey changes
src/lib/merge-check/combined-branch-test.ts— diff lockfiles vsorigin/main, run a frozen install for the detected package manager before test/build; install failures become their own finding and skip test/build;resolveFailureReason()guarantees a non-empty reason; timeouts raised and named;node_modulesrestored after the branch restoresrc/lib/stacks.ts— addedciInstalltoPM_CONFIG;detectPackageManagerSync(root?)now targets a given repo rootsrc/lib/merge-check/combined-branch-test.test.ts— new (previously zero direct coverage forrunCombinedBranchTest)CHANGELOG.md,docs/reference/merge-command.mdupdatedWhy not READY_FOR_MERGE
The adversarial re-read reached Gaps Found: it surfaced two real defects that the structured checks missed — a mutating restore install that could dirty the user's own branch (the same hazard the forward install was made frozen to avoid), and a
runCommandexport-name collision withsrc/commands/run.ts. Both are fixed and verified in this PR. The verdict reflects that a second pass was needed, not an outstanding gap.Stated coverage boundary: no live end-to-end
merge --checkwas run against a real multi-branch lockfile-changing stack; the defect is covered at the spawn-sequence level.Next steps
src/lib/ac-parser.tssilently returns zero ACs for- [ ] **AC-1** Desc(bold ID, no colon). This issue's ACs hit exactly that; the body was normalized during/specto unblock state tracking.fix(#803): close the gaps QA flagged as coverage boundaries
admarble commentedon Jul 25, 2026
QA gaps closed
Every gap the QA review recorded as a stated limitation is now fixed. Verdict moves to READY_FOR_MERGE.
combined-branch-test.integration.test.ts— 8 cases on real git; 5 fail against pre-fix behavior1356c24npm.cmdunresolvable (pre-existing)shell: trueon win32 only1356c24node_modulesrestore lost ifrunChecksthrowsInstallState; flag set before the install runs1356c24report.ts:320reports stderr only — sibling of this bugcommand-result.ts; both call sites routed through it1356c24ac-parser.tssilently returns zero ACs for bold-no-colonOn gap 1
The integration test uses a real bare
origin, a real clone, real feature branches, a realgit mergeinto a real temp branch, and the realgit diffthat decides whether the lockfile moved. Only the package manager is stubbed — a shell script namednpm, first onPATH, logging its argv and exiting with a configurable code.Building it surfaced a fixture bug worth recording: my first attempt had both branches write the same
package-lock.jsonobject, so real git conflicted and the check early-returned before ever reaching the install. The fixture now reserves one padded, non-adjacent lockfile slot per branch so git auto-merges — which is what actually reproduces the #109-113 shape. A mocked test could not have caught that; the merge was fake there.Verification
npm run build✅ ·npm run lint✅ (0 warnings) ·npx vitest run src/lib/merge-check/→ 76 passednpm test: 191 files, 4048 passed, 0 failuresRevised verdict: READY_FOR_MERGE
The earlier
AC_MET_BUT_NOT_A_PLUSwas driven by the adversarial re-read reaching Gaps Found. Those gaps are closed, the sibling site is fixed rather than argued down, and the coverage boundary that justified the downgrade no longer exists.Merge order: #809 (parser, independent) and #806 (merge-check) touch disjoint files — either order works.
fix(#808): parse bold AC markers that have no colon (#809)
fix(#803): reinstall deps in merge-check's combined-branch test (#806)
fix(worktree): frozen installs so provisioning cannot dirty the lockf…
fix: close three pre-2.10.0 gaps found by release verification (#851)
fix(#871): close the remaining yarn classic/berry hybrids and QA cove…
fix(#871): resolve yarn frozen install per yarn major in both provisi…
fix(#803): reinstall deps in merge-check's combined-branch test
fix(#803): use a frozen install for the node_modules restore too
refactor(#803): rename runCommand to runPackageManagerCommand
fix(#803): close the gaps QA flagged as coverage boundaries