Skip to content

fix(test): tsx-spawning integration tests blow vitest's 5s default — phase-registry should use the prebuilt dist like its five siblings #842

Closed

Description

@admarble

Context

Two integration test files spawn the CLI as TypeScript source under tsx:

src/lib/workflow/phase-registry.integration.test.ts     → node_modules/.bin/tsx bin/cli.ts
src/commands/sync-source-invocation.integration.test.ts → node_modules/.bin/tsx bin/cli.ts

Five sibling integration files already spawn the prebuilt dist/bin/cli.js (cli.integration, run-tui, doctor.integration, locks-cli, mcp/server-extended). vitest.global-setup.ts exists specifically to make that possible — it runs npm run build once so that "integration tests that shell out to node dist/bin/cli.js don't each need their own beforeAll build."

So the fast path is already built, already documented, and already used by the majority. These two files just don't use it.

Problem

Spawning tsx bin/cli.ts compiles the whole TypeScript program on every spawn. Measured on f6aa25c, same command (run 1 --phases deploy --dry-run), same machine:

Condition Wall time
Idle 4.22 s
Under load (full suite running) 7.5 – 17.8 s

vitest.config.ts sets hookTimeout: 60000 and teardownTimeout: 10000 but never sets testTimeout, so every test runs on vitest's default 5000 ms. A 4.2 s idle spawn leaves ~0.8 s of headroom, and the loaded case blows it by 3×.

The result is a flaky failure whose set shifts between runs:

FAIL phase-registry.integration.test.ts > exits non-zero when given an unknown phase
FAIL phase-registry.integration.test.ts > rejects unknown phase even when mixed with valid phases
FAIL phase-registry.integration.test.ts > accepts a list of valid registered phases
FAIL sync-source-invocation.integration.test.ts > installs the core skills, not just the version marker (AC-3)
FAIL sync-source-invocation.integration.test.ts > exits non-zero naming the missing path when the templates root is absent (AC-2)
Error: Test timed out in 5000ms.

The behavior under test is correct. Run manually, the CLI emits exactly what the assertions expect:

$ NO_COLOR=1 ./node_modules/.bin/tsx bin/cli.ts run 1 --phases deploy --dry-run
error: option '--phases <list>' argument 'deploy' is invalid. Unknown phase 'deploy'.
Available: spec, security-review, exec, testgen, test, verify, qa, loop, merger

This is a mis-sized constant, not a defect in the code under test.

Confirmed not a regression

An interleaved A/B against the pre-merge base f8481ab (alternating base/HEAD to cancel load drift, since sequential runs are confounded by the machine warming up):

pair base f8481ab HEAD f6aa25c
1 13.65 s 13.12 s
2 12.61 s 14.27 s
3 17.77 s 10.89 s
4 11.21 s 6.30 s

Base is slower in 3 of 4 pairs. The pre-existing code blows the same budget, so no recent change is implicated.

Secondary bug: an unreachable timeout

phase-registry.integration.test.ts:66-67:

// Short timeout — we only care that the *validator* doesn't reject.
timeout: 30000,

That is a spawnSync child-process timeout, not a vitest test timeout. Vitest kills the test at its own 5000 ms default long before the child's 30 s can apply, so the intended headroom is unreachable — the test is protected by a number that can never take effect. Worth fixing independently of everything else, since it silently misleads the next reader.

Why not just raise the timeout

Widening a tolerance to hide non-determinism is the wrong reflex, and this repo's own convention says so. But the two files are not the same case:

  • phase-registry has no reason to use tsx. It only exercises Commander's --phases validation, which is identical in source and compiled form. Pointing it at dist/bin/cli.js removes the compile from the hot path entirely — that is eliminating the non-determinism, not tolerating it.
  • sync-source-invocation must keep tsx. Its header states the reason: fix(templates): getTemplatesDir resolves one level too high under tsx — source-run sync/init prints "✔ Synced" while installing nothing #822's bug "lived entirely in how import.meta.url resolved at runtime, which an in-process test cannot reproduce." Converting it to dist would delete the regression coverage. Here a right-sized explicit timeout is the correct fix, because the compile is the thing under test.

Proposal

  1. Convert phase-registry.integration.test.ts to spawn dist/bin/cli.js, matching its five siblings and the stated purpose of vitest.global-setup.ts.
  2. Give sync-source-invocation.integration.test.ts an explicit per-test testTimeout sized from measurement (observed worst case 17.8 s ⇒ 60 s), with a comment stating that tsx is load-bearing for fix(templates): getTemplatesDir resolves one level too high under tsx — source-run sync/init prints "✔ Synced" while installing nothing #822 and why the number is what it is.
  3. Fix the spawnSync-vs-vitest timeout confusion at phase-registry.integration.test.ts:67.
  4. Consider a testTimeout for the integration project in vitest.config.ts so subprocess-spawning tests don't silently inherit the 5 s default intended for unit tests.

Acceptance Criteria

  • AC-1: phase-registry.integration.test.ts spawns dist/bin/cli.js; no tsx invocation remains in that file, and its assertions are unchanged.
  • AC-2: sync-source-invocation.integration.test.ts still spawns via tsx (so fix(templates): getTemplatesDir resolves one level too high under tsx — source-run sync/init prints "✔ Synced" while installing nothing #822's import.meta.url regression stays covered) and carries an explicit testTimeout with a comment justifying both the tsx requirement and the chosen value.
  • AC-3: No spawnSync timeout: option remains where a vitest testTimeout was intended; where a child timeout is genuinely wanted it is paired with a testTimeout strictly greater than it.
  • AC-4: Both files pass 3 consecutive full-suite runs (npx vitest run src/lib/workflow src/commands) with no timeout failures.
  • AC-5: If a testTimeout is added to the integration project in vitest.config.ts, it is justified in a comment and does not change the unit project's default.
  • AC-6: If any file skips when dist is absent, that skip is not silent — a converted validation gate must not vanish when someone runs vitest without a build. (globalSetup builds, so this is a guard against the describe.skipIf(!distExists) pattern hiding a gate.)

Out of scope

Converting sync-source-invocation to dist (deletes #822 coverage). A general subprocess-test harness or shared CLI fixture — two files do not justify it. Any change to the CLI behavior these tests assert. Re-litigating fileParallelism: false, which is already correct for the integration project.

References

Activity

  1. added
    bug
    no-browser-test
    on Jul 29, 2026
  2. admarble commented on Jul 29, 2026

    @admarble
    ContributorAuthor

    Plan (/spec)

    Complexity: Standard (6 ACs, 3 directories)

    AC Quality Check

    All six ACs are measurable and reference concrete files/lines. Two notes:

    • AC-3, AC-5, AC-6 are conditionals (No … remains where …, If a testTimeout is added …, If any file skips …). Each is satisfiable vacuously. Per feedback_qa_ac_literal, they are treated as obligations to check and report, not as license to skip — each gets an explicit finding below.
    • AC-3 is the sharpest one and it constrains AC-2's number: sync-source-invocation already carries a spawnSync child timeout: 120_000 (line 74). The issue proposes a 60 s testTimeout, but 60 s < 120 s would recreate the exact unreachable-timeout bug AC-3 exists to kill. The chosen values below resolve that.

    Scope Assessment

    Non-Goals: present in the issue (Out of scope section) — converting sync-source-invocation to dist, a shared CLI fixture, any CLI behavior change, re-litigating fileParallelism.

    Metric Value Status
    Feature count 1 (test-timing correctness) ✅
    AC items 6 ✅
    Directory spread 3 (src/lib/workflow, src/commands, repo root) ✅

    Verdict: ✅ SCOPE_OK


    Measurements (this machine, 0abdc95)

    Re-measured before planning rather than inheriting the issue's numbers. Same command (run 1 --phases deploy --dry-run):

    Condition Wall time
    tsx bin/cli.ts, warm tsx cache, idle 0.69 s
    tsx bin/cli.ts, cold cache, idle (issue's figure) 4.22 s
    tsx bin/cli.ts, under full-suite load (issue's figure) 7.5 – 17.8 s
    node dist/bin/cli.js, idle 0.22 s

    The warm-cache number explains why this flake is intermittent rather than constant: the 5 s budget is comfortable on a warm cache and impossible on a cold one under load. Sizing is therefore driven by the 17.8 s worst case, not the idle figure.

    Also confirmed: run 999999999 --phases spec,exec,qa --dry-run short-circuits inside --dry-run and makes no GitHub calls (0.78 s end to end). The third phase-registry test is safe to convert — it was never doing network work, which is why its 30 s child timeout was speculative in the first place.


    Acceptance Criteria

    AC-1: phase-registry.integration.test.ts spawns dist/bin/cli.js; no tsx remains; assertions unchanged.
    Verification: Integration Test
    Scenario: Given the file converted → When npx vitest run src/lib/workflow/phase-registry.integration.test.ts → Then 3/3 pass and grep -c tsx on the file returns 0.
    Assumptions: Commander's --phases validation is byte-identical in source and compiled form (confirmed — both emit Unknown phase 'deploy' with the same available-phase list).

    AC-2: sync-source-invocation.integration.test.ts keeps tsx and carries an explicit testTimeout with a justifying comment.
    Verification: Integration Test + manual read
    Scenario: Given the file → When read → Then tsxBin still present, and a testTimeout is set with a comment covering both why tsx is load-bearing (#822 import.meta.url) and how the number was derived.
    Assumptions: none.

    AC-3: No spawnSync timeout: remains where a vitest testTimeout was intended; a genuine child timeout is paired with a strictly greater testTimeout.
    Verification: Integration Test + repo-wide grep
    Scenario: Given a grep for timeout: inside spawnSync option objects across src/ and scripts/ → When each hit is inspected → Then each is either removed or has an enclosing vitest timeout strictly greater than it.
    Sibling scan result (see below): the two named files are the only violations.

    AC-4: Both files pass 3 consecutive npx vitest run src/lib/workflow src/commands with no timeout failures.
    Verification: Integration Test (3× repetition)

    AC-5: Any integration-project testTimeout is justified in a comment and leaves the unit project's default alone.
    Verification: Manual read + unit-project run
    Scenario: Given vitest.config.ts → When the unit project block is read → Then it has no testTimeout key and still inherits vitest's 5000 ms.

    AC-6: A dist-absent skip must not be silent.
    Verification: Integration Test
    Scenario: Given dist/ removed → When the converted file runs → Then it fails loudly naming the missing path, rather than reporting green with skipped tests.


    Sibling-site Scan

    The issue names two files. I scanned every test that spawns tsx or sets a spawnSync timeout:, because AC-3 is phrased repo-wide ("No spawnSync timeout: option remains…") rather than scoped to the two files:

    File Spawns Child timeout Vitest timeout Verdict
    src/lib/workflow/phase-registry.integration.test.ts tsx 30_000 (line 67) none → 5000 default ❌ violates AC-3 — child > test, unreachable
    src/commands/sync-source-invocation.integration.test.ts tsx 120_000 (line 74) none → 5000 default ❌ violates AC-3 — child ≫ test, unreachable
    src/lib/workflow/state-update-cli.test.ts tsx 30_000 (line 31) 60_000 (line 49) ✅ already correct — this is the precedent
    src/lib/locks/lock-manager.integration.test.ts tsx none 20_000 per test ✅ compliant

    state-update-cli.test.ts is the useful find: it already implements exactly the child-below-test pairing AC-3 asks for, which is why it has never flaked. It is the pattern to copy, not a site to change — no edit proposed. Its existence also settles the AC-2 sizing question in favour of "child timeout below test timeout" rather than "raise the test timeout above the existing 120 s child".

    No scope expansion proposed. The two violations are exactly the two files the issue names.


    Implementation Plan

    Phase 1 — Convert phase-registry to the prebuilt CLI (AC-1, AC-3, AC-6)

    1. Replace tsxBin + cliSource with const cliPath = resolve(projectRoot, "dist/bin/cli.js"), and every spawnSync(tsxBin, [cliSource, …]) with spawnSync("node", [cliPath, …]). Assertions untouched. This mirrors src/commands/numeric-flags.integration.test.ts, the closest analogue in the repo — also a Commander parse-time validation test, also dist-based, also relying on globalSetup for the build.
    2. Delete the timeout: 30000 at line 67 rather than re-pairing it (AC-3). Its comment states the intent was headroom for the test, not a child-process kill; with dist the whole invocation is 0.78 s, so no child timeout is genuinely wanted. AC-3's pairing clause therefore does not apply.
    3. Add the beforeAll hard guard from locks-cli.integration.test.ts — throw naming the missing path and telling the reader to run npm run build. Deliberately not describe.skipIf(!distExists), which is the exact silent-vanish pattern AC-6 names.

    Phase 2 — Right-size sync-source-invocation (AC-2, AC-3)

    1. Keep tsx. Reduce the child timeout 120_000 → 60_000 and add testTimeout: 90_000 on the describe.

      Why child below test, not above: whichever fires first determines the error message. With the child at 60 s, a hang is killed by spawnSync and surfaces as result.signal === "SIGTERM" with captured stdout/stderr — diagnosable. With vitest firing first, you get the opaque Test timed out in 5000ms that produced this issue. The 30 s/60 s pairing in state-update-cli.test.ts is the same ordering.

      Why these numbers: 17.8 s worst observed under load → 60 s child kill is 3.4× headroom; 90 s test ceiling sits strictly above the child so the child always wins. Both stated in the comment alongside the fix(templates): getTemplatesDir resolves one level too high under tsx — source-run sync/init prints "✔ Synced" while installing nothing #822 tsx justification.

    Phase 3 — Config-level floor (AC-5)

    1. Add testTimeout: 30_000 to the integration project only, with a comment: subprocess-spawning tests should not silently inherit a 5 s default meant for in-process unit tests. The unit block is not touched. sync-source-invocation's explicit 90 s overrides this floor for the one file that needs more.

    Phase 4 — Verify (AC-4, AC-6)

    1. Run npx vitest run src/lib/workflow src/commands three consecutive times; all green, zero timeout failures.
    2. Verify AC-6 directly: rm -rf dist and confirm the converted file fails loudly rather than skipping. (Note that globalSetup rebuilds, so this needs the guard to be checked against a genuinely absent dist.)

    Design Review

    1. Where does this logic belong? Test configuration, at two altitudes. The per-file timeout belongs on the file that has a file-specific reason (sync-source needs tsx); the floor belongs in vitest.config.ts because "subprocess tests need more than 5 s" is a property of the whole integration project, not of one file.
    2. What's the simplest correct approach? Point the test at the artifact globalSetup already builds. No new harness, no new fixture, no new abstraction — the issue's Out-of-scope section explicitly rejects those, and two files don't justify one.
    3. What existing pattern does this follow? numeric-flags.integration.test.ts for the dist spawn shape; locks-cli.integration.test.ts for the loud beforeAll guard; state-update-cli.test.ts for the child-below-test timeout pairing. All three are in-repo, all three predate this change.
    4. What would a senior reviewer challenge?

    Feature Quality Planning

    All standard checks pass. Notable items:

    No derived ACs.


    Open Questions

    1. Child-timeout ordering for sync-source (60 s child / 90 s test) vs. the issue's suggested flat 60 s testTimeout. — Recommendation: the 60/90 pairing above. The issue's 60 s would sit below the existing 120 s child timeout, silently recreating the unreachable-timeout bug that AC-3 was written to eliminate. Impact if wrong: none to correctness; a hang would report vitest's less informative message instead of spawnSync's.
    2. integration floor value of 30 s. — Recommendation: 30 s. Above every observed subprocess test, below the point where a hung test wastes real time. Impact if wrong: only the latency of a failing run.

    Recommended Workflow

    Phases: spec → exec → qa
    Quality Loop: disabled (SCOPE_OK, focused change)
    Reasoning: bug + no-browser-test labels, so /test is skipped by explicit opt-out. testgen is skipped — this modifies existing tests rather than adding coverage for new behavior, and stubs would be noise.


    Label Review

    Current: bug, no-browser-test
    Recommended: unchanged
    Reason: correctly labeled. no-browser-test properly suppresses the /test phase for a test-infrastructure change.
    Quality Loop: won't auto-enable — scope is green.

  3. added
    planned
    on Jul 29, 2026
  4. admarble commented on Jul 29, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #842

    PR: #843

    AC Coverage

    AC Description Status Notes
    AC-1 phase-registry spawns dist/bin/cli.js; no tsx remains; assertions unchanged MET grep tsx on the file returns only 2 hits, both header prose explaining the change — no invocation. spawnSync("node", [cliPath, …]) throughout. All 6 assertions byte-identical to before.
    AC-2 sync-source-invocation keeps tsx + explicit testTimeout with justifying comment MET tsxBin still used. describe(…, { timeout: TEST_TIMEOUT_MS }) where TEST_TIMEOUT_MS = 90_000. Header comment covers both required justifications: why tsx is load-bearing (#822 import.meta.url) and how 60 s/90 s were derived from the 17.8 s worst case.
    AC-3 No spawnSync timeout: where a vitest testTimeout was intended; genuine child timeouts paired strictly greater MET Audited repo-wide, not just the two named files — see table below.
    AC-4 Both files pass 3 consecutive npx vitest run src/lib/workflow src/commands, no timeout failures MET 3/3 runs green: 87 files, 1713 passed, 2 skipped. Durations 36.7 s / 71.6 s / 56.6 s — a ~2x spread with zero timeouts, which is the load variance that used to break this.
    AC-5 Any integration testTimeout justified in a comment; unit default unchanged MET 8-line comment on the integration block. unit block has no testTimeout key and still inherits vitest's 5000 ms.
    AC-6 A dist-absent skip must not be silent MET Verified by execution, not inspection — see Adversarial Re-Read below.

    Coverage: 6/6 met. Derived ACs: none (no Derived ACs table in the spec plan).


    AC-3 Repo-Wide Audit

    AC-3 is phrased repo-wide ("No spawnSync timeout: option remains…"), so I audited every execSync/spawnSync child timeout rather than only the two named files. The spec's sibling scan was incomplete — it grepped for tsx-binary spawners and therefore missed execSync-based ones. Two further live violations:

    File Child timeout Vitest ceiling Verdict
    src/lib/workflow/phase-registry.integration.test.ts 30 s removed integration floor 30 s Fixed — --dry-run short-circuits, sub-second, no child timeout wanted
    src/commands/sync-source-invocation.integration.test.ts 120 s → 60 s none → 90 s Fixed — strictly ordered
    scripts/qa/precheck.test.ts 30 s + 60 s 5 s (no .integration. infix ⇒ unit project) Was a live flake — shells out to npx tsx twice under a 5 s budget. Fixed: own 90 s ceiling
    scripts/qa/tautology-detector-cli.test.ts 30 s 30 s after this PR's floor — equal, not greater Fixed: own 60 s ceiling
    src/lib/workflow/state-update-cli.test.ts 30 s 60 s Already correct — untouched. The precedent the rest now follow
    src/lib/locks/lock-manager.integration.test.ts none 20 s per test Compliant

    Note this PR's own integration floor changed tautology-detector-cli's compliance status (5 s → 30 s made it equal to its child timeout). Caught and fixed in the same change.


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 6 (5 + CHANGELOG) OK
    Lines added / deleted +185 / −119 OK
    Substantive (-w) +104 / −39 ~150 added lines are prettier re-indent from wrapping a describe body

    Build: pass. Lint: pass (--max-warnings 0). Full suite: 219 files, 4575 passed, 1 expected fail, 2 skipped, 0 failures.


    Test Coverage Analysis

    All changed files are tests or test config, so the usual "does this file have a test?" question inverts: the right question is whether each change was executed. All were.

    Changed file Tier Executed
    phase-registry.integration.test.ts Standard 3/3 pass, ~250 ms each (was ~700 ms–4 s)
    sync-source-invocation.integration.test.ts Standard 3/3 pass
    scripts/qa/precheck.test.ts Standard pass (35 tests across both scripts files)
    scripts/qa/tautology-detector-cli.test.ts Standard pass
    vitest.config.ts Config exercised by all 219 files
    CHANGELOG.md Docs n/a

    Critical paths without tests: none — no auth/payment/security/middleware/admin paths touched.


    Test Quality Review

    Category Status Notes
    Behavior vs implementation OK Assertions unchanged; only the spawn mechanism moved
    Coverage depth OK #822 regression coverage explicitly preserved rather than traded away for speed
    Mock hygiene OK No mocks added or removed; these are real subprocess spawns
    Test reliability Improved This is the point of the change — variance removed at the source for phase-registry, right-sized where the compile is load-bearing

    The one judgment call worth naming: the child timeout is deliberately below the test timeout, not above. Whichever fires first decides the error message, and the child kill gives the better one (SIGTERM + captured stdout/stderr, vs. vitest's opaque Test timed out in 5000ms that produced this issue).


    Anti-Pattern Detection

    No any, no hardcoded secrets, no SQL concatenation, no empty catch, no uncleared timers. No package.json change ⇒ dependency audit N/A.

    Execution Evidence

    scripts/ files were modified, so §11 applies.

    Test Command Result
    Scripts suite npx vitest run scripts/qa/precheck.test.ts scripts/qa/tautology-detector-cli.test.ts 2 files, 35 passed
    Target files npx vitest run …phase-registry… …sync-source-invocation… 2 files, 6 passed
    AC-4 gate npx vitest run src/lib/workflow src/commands ×3 87 files, 1713 passed, ×3

    Evidence status: Complete.

    Sections not applicable

    Skill Command Verification, Detection Pattern Verification (§6c precondition false — no skill markdown changed), CLI Registration Verification (no option interface touched), Call-Site Review (no new exported functions), Behavior-Rule Survival (§6e — detector run on all 6 ACs, none triggered; AC-5 and AC-6 hit one keyword each, below the ≥2 threshold), Manual Test ACs (none), Browser testing (no-browser-test label).

    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists Yes
    User-facing per §10a Yes — fix(#842): matches the conventional-commit regex
    [Unreleased] entry Added under ### Fixed

    Test-infrastructure changes are arguably not user-facing, but the repo documents comparable contributor-facing infrastructure fixes (#803, #720), so an entry matches convention.


    Risk Assessment

    • Likely failure mode: The integration project's 30 s floor raises failure latency — a genuinely hung integration test now takes 30 s to fail instead of 5 s. That is the deliberate cost of not producing false failures on a legitimate 17.8 s run. The unit project, where a slow test is a real signal, is untouched.
    • Not tested: The 60 s/90 s pairing in sync-source-invocation has never been observed firing — no run has come close to 60 s. It is sized off measurement (17.8 s worst case), not off an observed timeout, so the specific numbers are a judgment call rather than an empirical floor. The AC-6 guard, by contrast, was observed firing.
    • Sibling sites considered: Cross-file scan found scripts/qa/precheck.test.ts and scripts/qa/tautology-detector-cli.test.ts — both had the same unreachable-timeout root cause, both fixed here. state-update-cli.test.ts and lock-manager.integration.test.ts were already compliant and left alone.
    • Sibling-line audit: phase-registry had 3 separate spawnSync call sites with duplicated option objects — all 3 converted via one shared local runCli helper, so none was left on tsx. sync-source-invocation's 3 tests all route through a single runCli, so the child-timeout change covers all of them.

    Adversarial Re-Read

    Findings:

    1. Verbatim motivating-example fixture — run, not assumed. The issue body quotes the exact command and its expected stderr. I ran it under both tsx and node dist/bin/cli.js and confirmed byte-identical validator output (Unknown phase 'deploy'. Available: spec, security-review, exec, testgen, test, verify, qa, loop, merger). This is the load-bearing premise of AC-1 — that source and compiled forms validate identically — and it is now evidence rather than reasoning.
    2. AC-6 verified by mutation, not inspection. globalSetup rebuilds dist, so simply deleting dist proves nothing. I ran the converted file against a throwaway config without globalSetup and with dist genuinely absent: the suite failed (Error: dist/bin/cli.js not found at … Run 'npm run build' first., 1 failed / 3 skipped, non-zero exit) rather than reporting green. A describe.skipIf would have reported green — that is precisely the failure mode AC-6 names.
    3. Evidence-claim audit. Every number here is a post-fix validation. The pre-fix measurements (4.2 s, 0.69 s warm) are labeled as baseline, not as proof the fix works.
    4. Process state. The re-measured idle tsx spawn was 0.69 s, not the issue's 4.2 s — the difference is a warm vs. cold tsx cache. Worth recording because it explains why this flake was intermittent rather than constant, and why sizing had to come from the 17.8 s loaded worst case rather than any idle figure.
    5. Non-Goals checked. sync-source-invocation was not converted to dist (would delete fix(templates): getTemplatesDir resolves one level too high under tsx — source-run sync/init prints "✔ Synced" while installing nothing #822 coverage). No shared/general subprocess harness was introduced — the runCli helper is file-local, mirroring what numeric-flags.integration.test.ts and locks-cli.integration.test.ts each already do independently. No CLI behavior these tests assert was changed. fileParallelism: false untouched.

    Gap surfaced: The commits on PR #843 are unsigned. gpg-agent could not launch pinentry in the non-interactive session, and disabling your signing config silently was not an acceptable substitute. Every other commit on main is signed, so this needs a human decision before merge.

    Status: Gaps Found


    Verdict: AC_MET_BUT_NOT_A_PLUS

    All 6 ACs are met with executed evidence, and the change is strictly better than the issue asked for — the repo-wide AC-3 audit caught two live violations the issue didn't name, including one (precheck.test.ts under a 5 s budget) that was an undiagnosed flake of exactly this class.

    The verdict is not READY_FOR_MERGE for one reason: the commits are unsigned, which deviates from this repo's signed history and is a call only you can make. Re-sign the branch and this is a merge.

    Next Steps

    1. Re-sign the two commits on feature/842-… if you want the branch to match repo convention, then merge fix(#842): tsx-spawning integration tests blow vitest's 5s default — phase-registry now uses the prebuilt dist #843.
    2. Review with git diff -w — ~150 of the added lines are prettier re-indent from wrapping a describe body.
  5. added
    needs-improvement
    on Jul 29, 2026
  6. added a commit that references this issue on Jul 29, 2026
  7. admarble commented on Jul 29, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #842 — Round 2 (gap fixes)

    A second adversarial pass found that the first review's own verdict was inconsistent: it applied AC-3 repo-wide but AC-6 only to the converted file. Under a consistent reading, AC-6 was PARTIALLY_MET at the time of the first review. Commit 14b0e692 closes that and two adjacent gaps.

    Gaps fixed

    1. AC-6 applied repo-wide (was: two surviving silent-skip sites).
    cli.integration.test.ts:139 had a describe.skipIf(!distExists) block whose only test asserted expect(distExists).toBe(true) — skipped in exactly the case it would have failed, i.e. a test that could not fail under any condition. run-tui.integration.test.ts:29,40 silently dropped both flag-wiring assertions on an unbuilt tree. Both files now use the throwing-beforeAll guard. Verified against a genuinely absent dist (throwaway config without globalSetup): both fail loudly naming the path — Test Files 2 failed, not green-with-skips.

    2. Precheck fixed at the cause, not the symptom.
    The first-round fix gave precheck.test.ts's CLI block a 90 s ceiling but left it in the unit project (no .integration. infix), where fileParallelism is ON — its two npx tsx spawns race every other unit file for CPU, the exact contention fileParallelism: false exists to prevent. The CLI block now lives in scripts/qa/precheck-cli.integration.test.ts (integration project by name: serialized, 30 s floor, 90 s ceiling kept strictly above the 60 s child timeout per AC-3). The 28 in-process precheck tests stay in the parallel unit project. Confirmed via npx vitest list: the new file runs in project [1] (integration).

    3. The convention is now enforced, not documented.
    Three files had independently reached for the silent-skip pattern, so scripts/qa/dist-skip-guard.test.ts walks every test file under src/ and scripts/ and fails naming the offender on any dist-conditioned skipIf. Comments are stripped before matching (the fixed files quote the forbidden pattern in their own explanatory comments — the guard's first run caught exactly those, which is how the stripping requirement was discovered). Mutation-verified: planting a real describe.skipIf(!distExists) in a scratch test file fails the guard with the planted file's path; removing it goes green.

    Deleted test disclosure

    The "dist/ directory exists" test is deleted — it was the tautology in gap 1. Its job (fail when dist is missing) is now done by guards that actually execute in that case.

    Updated AC coverage

    AC Status Change
    AC-1, AC-2, AC-4, AC-5 MET unchanged
    AC-3 MET unchanged; the precheck move preserves the 60 s < 90 s ordering
    AC-6 MET (was PARTIALLY_MET under the consistent reading) repo-wide now, and regression-guarded

    Full suite after fixes: 221 files, 4576 passed, 1 expected fail, 2 skipped, 0 failures. Build + lint clean.

    Verdict: AC_MET_BUT_NOT_A_PLUS

    Sole remaining reason unchanged: the three commits on PR #843 are unsigned (gpg-agent has no pinentry in this non-interactive session). Everything code-side is now A+ by this review's own standards. Re-sign and merge.

  8. admarble commented on Jul 29, 2026

    @admarble
    ContributorAuthor

    /fullsolve Complete

    PR #843 merged as 31f8b3e4, squash-signed by GitHub's web-flow key (B5690EEEBB952194) — same provenance as every commit on main, which resolves the unsigned-branch-commits caveat from the QA reviews: main's history never contains locally-signed commits, so the squash merge itself produced the signed commit.

    • AC: 6/6 met (round 2 closed the AC-6 repo-wide gap)
    • CI: 5/5 green on the final commit
    • Post-merge: main builds clean, sequant doctor passes, worktree + local/remote branches cleaned up
    • Iterations: exec 1, QA 2 (second pass self-caught the narrow AC-6 reading, the precheck symptom-vs-cause fix, and added the dist-skip convention guard)
  9. added 3 commits that reference this issue on Jul 29, 2026
  10. added 3 commits that reference this issue on Aug 10, 2026
  11. added 2 commits that reference this issue on Sep 9, 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

    bugneeds-improvementno-browser-testplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions