Repository navigation
Description
Context
QA on #818 found that merge --watch's --interval/--timeout were coerced with a bare parseInt and then defaulted with ??. Because NaN is not nullish, a malformed value survived the default and produced an unbounded, zero-delay poll loop. That was fixed in PR #831.
The cross-file sibling scan during that QA found the same root-cause pattern on run --timeout, which is untouched by #818 and lands somewhere more damaging.
The defect
bin/cli.ts registers the phase timeout on two commands with a bare parseInt:
bin/cli.ts:286 .option("--timeout <seconds>", "Timeout per phase in seconds", parseInt)
bin/cli.ts:527 .option("--timeout <seconds>", "Timeout per phase in seconds", parseInt)
It is then defaulted with the same ?? that NaN slips through:
src/lib/workflow/config-resolver.ts:242
phaseTimeout: mergedOptions.timeout ?? DEFAULT_CONFIG.phaseTimeout,
and consumed as a raw setTimeout delay:
src/lib/workflow/phase-executor.ts:982
}, config.phaseTimeout * 1000);
setTimeout(fn, NaN) is specified to clamp to 0, so sequant run <issue> --timeout abc should abort every phase immediately rather than falling back to the default phase timeout. This is worse than the #818 symptom: instead of a loop that won't stop, it is a run that kills each phase the moment it starts, and the resulting failure will look like a phase/agent problem rather than a bad flag value.
--timeout 30m has the same silent misparse as #818 — parseInt("30m", 10) is 30, so the user asks for 30 minutes and gets 30 seconds per phase.
Not yet reproduced end-to-end. The read of the three call sites above is solid, but I did not run sequant run --timeout abc (it starts a real workflow). First AC below is to confirm the actual runtime behavior before fixing, in case something downstream already normalizes it.
Proposal
Reuse the validator #831 already added — parsePositiveSeconds(flag) in bin/cli.ts, which requires the whole argument to be a positive integer and reports a clear InvalidArgumentError. Applying it at lines 286 and 527 is a two-line change.
The reason this was not folded into PR #831: run/ready are different commands, and tightening their accepted input range is a user-visible behavior change that deserves its own check — specifically whether --timeout 0 is currently meaningful (e.g. "no timeout"). #831 deliberately kept its scope to merge --watch.
Acceptance Criteria
- Confirm the runtime behavior of
sequant run <issue> --timeout abc(expected: phases abort immediately via asetTimeoutclamped to 0) and record the observed output in the issue before fixing. - Determine whether
--timeout 0has an existing meaning for the phase timeout; if it does, the validator must keep accepting it, otherwise reject it as feat(#818): merge --watch — wait for CI checks to finish, then run merge-check and report #831 does. -
--timeouton bothrun(bin/cli.ts:286) and the second registration (bin/cli.ts:527) rejects non-integer values with a clear error instead of coercing toNaN. -
--timeout 30mis rejected rather than silently read as 30 seconds. - A regression test covers a malformed
--timeoutreachingconfig-resolver'sphaseTimeoutresolution, so the?? defaultgap cannot silently return. - Any other numeric CLI flag coerced with a bare
parseIntis inventoried in the PR body, with each either fixed or explicitly justified as safe.
Out of scope
Changing default phase-timeout values; the merge --watch flags (already fixed in #831); non-numeric flag validation.
References
- feat(merge): --watch — wait for CI checks to finish, then run merge-check and report (kills the merge-after-green polling loop) #818 / PR feat(#818): merge --watch — wait for CI checks to finish, then run merge-check and report #831 — the motivating fix and the
parsePositiveSecondshelper to reuse - Existing guards that got this right:
batch-executor.ts(maxIter,autoWait),merge.ts:249
Activity
admarble commentedon Jul 28, 2026
Plan (/spec) — #833
Complexity: Standard (6 ACs, 3 directories:
bin/,src/lib/workflow/,src/commands/)AC-1 evidence — reproduced before fixing ✅
Ran the real resolution path (
resolveRunOptions→buildExecutionConfig) with the value Commander would hand it, plus the actual timer:And the CLI accepts the flag with no error at all:
Confirmed: the issue's read is correct. Nothing downstream normalizes it —
config-resolver.ts:183(defined.timeout ?? settings.run.timeout) and:242(?? DEFAULT_CONFIG.phaseTimeout) both passNaNthrough, andphase-executor.ts:982hands it straight tosetTimeout, which clamps to 0 and aborts the phase on the next tick.(Caveat, stated plainly: the abort was demonstrated at the config+timer layer, not by spawning a real agent run.
--dry-runnever reachessetTimeout, and a non-dry run spawns a live Claude session. The three call sites in between are a straight pass-through with no guard, shown above.)AC-2 evidence — does
--timeout 0mean anything today? ❌ No--timeout 0behavior todayrun0is not nullish, so it wins both??chains →setTimeout(fn, 0)→ aborts every phase instantly. Same failure asNaN, not "no timeout".readysrc/commands/ready.ts:111-114guardstypeof options.timeout === "number" && options.timeout > 0, so0is already discarded andsettings.run.timeoutwins.Nothing in
phase-executor.ts,heartbeat.ts, orrun-progress.tstreats0as a "disabled" sentinel —run-progress.ts:77'sphaseTimeoutSeconds > 0only gates a stall-threshold display, and it readssettings.run.timeout, not the flag.Decision: reject
0, exactly asparsePositiveSecondsalready does formerge --watch. No behavior a user could be relying on is removed.AC Quality Check
extractAcceptanceCriteriareturns{items: [], total: 0}for this body — the checkboxes are bare- [ ] textwith noAC-N:/**AC-N:**prefix. Downstream/qaAC tracking and.sequant/state.jsonwill therefore have nothing to track against.Mitigation: this plan assigns AC-1…AC-6 in issue order (below). No AC text is reworded. Consider adopting
- [ ] **AC-1:** …in future issue bodies.Otherwise the ACs are strong: each names a concrete file/line or a concrete input, and each has an observable outcome. AC-1 and AC-2 are investigation gates that must be answered before the fix — both are answered above.
Scope Assessment
Non-Goals: present in the issue ("Out of scope" — default phase-timeout values,
merge --watchflags, non-numeric flag validation). ✅bin/,src/lib/workflow/,src/commands/)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: Confirm runtime behavior of
run <issue> --timeout abcand record it before fixingVerification: Manual Test (evidence recorded above)
Scenario: Given
--timeout abc→ When resolved throughresolveRunOptions/buildExecutionConfig→ ThenphaseTimeoutisNaNand the resultingsetTimeoutfires immediately.Status: ✅ Done — see "AC-1 evidence" above.
AC-2: Determine whether
--timeout 0has an existing meaningVerification: Manual Test (evidence recorded above)
Scenario: Given
--timeout 0→ When traced throughrunandready→ Then no "no timeout" semantics exist;runaborts instantly,readyalready discards it.Status: ✅ Done — validator will reject
0.AC-3:
--timeouton bothrun(bin/cli.ts:286) andready(bin/cli.ts:527) rejects non-integer values with a clear errorVerification: Integration Test (subprocess CLI invocation, asserting exit code + stderr)
Scenario: Given
sequant run 1 --timeout abc→ When the CLI parses → Then it exits non-zero with--timeout expects a whole number of seconds (got 'abc').Same forsequant ready 1 --timeout abc.Assumptions: Commander's
InvalidArgumentErrorproduces exit code 1 and writes to stderr — verified in exec.AC-4:
--timeout 30mis rejected rather than silently read as 30 secondsVerification: Integration Test
Scenario: Given
--timeout 30m→ When parsed → Then rejected with the same error (the^\d+$whole-string anchor is what catches it).AC-5: A regression test covers a malformed
--timeoutreachingconfig-resolver'sphaseTimeoutresolutionVerification: Unit Test
Scenario: Given
resolveRunOptions({timeout: NaN})→ WhenbuildExecutionConfigruns → ThenphaseTimeoutis the default (1800), neverNaN, and never≤ 0.Note: this AC is written against
config-resolver, not the CLI — see Design Review Q1.AC-6: Inventory every other numeric CLI flag coerced with a bare
parseIntVerification: Manual Test (the inventory table lands in the PR body)
Scenario: Given all 16 bare-
parseInt.option()/.argument()registrations inbin/cli.ts→ When each is traced to its consumer → Then each is either fixed or has a written justification for whyNaNis harmless there.Pre-work done: all Commander registrations live in
bin/cli.ts— nothing undersrc/registers CLI options, so the inventory is closed at 16 sites (lines 254, 260, 286, 304, 354, 379, 417, 459, 520, 525, 527, 558, 560, 587, 600, 642).Implementation Plan
Phase 1: Fix the two reported sites (AC-3, AC-4)
bin/cli.ts:286—parseInt→parsePositiveSeconds("--timeout")onrun.bin/cli.ts:527— same onready. (ready.ts's> 0guard already stopsNaNfrom reaching a timer, so this site is about the silent30m→ 30s misparse and about giving a clear error instead of a silent fallback. Worth stating in the PR so the fix isn't read as papering over a live crash.)Phase 2: Close the
?? defaultgap itself (AC-5)src/lib/workflow/config-resolver.ts:242— resolvephaseTimeoutthrough a positivity/finiteness check rather than a bare??, so a non-finite or non-positive value falls back to the default instead of flowing intosetTimeout.Why both layers, not just the CLI: AC-5 asks that "the
?? defaultgap cannot silently return." A CLI-only fix removes today's caller but leaves the gap open for the next one — and the same class of bug (#818, then this) has now recurred once already. The CLI validator is the user-facing error; the resolver guard is the structural backstop. Cost is ~4 lines.Phase 3: Tests (AC-3, AC-4, AC-5)
config-resolver:NaN,0, and negativetimeouteach resolve toDEFAULT_CONFIG.phaseTimeout; a valid value passes through unchanged. Mutation-check the guard (revert it locally, confirm the test fails) per the gate-test convention.run --timeout abc,run --timeout 30m,ready --timeout abc,ready --timeout 0— assert non-zero exit and the error text. Plus a positive case (--timeout 60parses) so the test can't pass vacuously.Phase 4: Sibling inventory (AC-6)
parseIntsites to its consumer, classify fix vs safe-and-why, and put the table in the PR body. Expected shape based on a first pass:run --auto-wait(354),run --concurrency(379),run --max-iterations(304),relay --wait(417),stop --grace(459).> 0/isNaN, orNaNdegrades to a harmless empty filter):ready --max-iterations(520),ready --budget(525),logs --last/--issue(558/560),status [issue]/--max-age(254/260),state clean --max-age(642),dashboard/serve --port(587/600).--timeout.Conflict Risk Analysis
In-flight worktree
feature/817-*touches both files this issue edits:bin/cli.ts--ready-gateoption at ~line 339src/lib/workflow/config-resolver.tsreadyGate:at end ofbuildExecutionConfigreturn (~line 259)phaseTimeout:at line 242No textual conflict expected. Mitigation: re-fetch
origin/mainand merge before pushing (prior spec conflict predictions in this repo have aged badly — verify, don't assume).Design Review
bin/cli.ts) where a user-facingInvalidArgumentErrorcan name the flag. Invariant enforcement belongs inconfig-resolver, which is the single funnel every caller — CLI, programmatic, future MCP — passes through on its way tosetTimeout.parsePositiveSecondsunchanged (already shipped in feat(#818): merge --watch — wait for CI checks to finish, then run merge-check and report #831, already reviewed) rather than writing a second validator. Rejected: a sharedsrc/lib/numeric-flag module — premature for two call sites, and it would dragmerge --watchinto this PR's blast radius, which the issue explicitly puts out of scope.parsePositiveSecondsatbin/cli.ts:126(feat(#818): merge --watch — wait for CI checks to finish, then run merge-check and report #831), and the defensive-guard pattern already used bybatch-executor.ts:359/383(!isNaN(x) && x >= 0before accepting env input) andready.ts:104/108/112(typeof x === "number" && x > 0).config-resolverwhen fixing the CLI is enough?" → AC-5 is written against the resolver, and the CLI is not the only door. Answered in Phase 2.--timeout 0a breaking change?" → AC-2 evidence:0has no working meaning on either command today. Answered above.ready --timeout abcwas already safe — is this fix real?" → Yes, but for the30mmisparse, not a crash. Stated honestly in Phase 1 and in the PR body rather than overclaiming.Feature Quality Planning
All standard checks pass. Notable items:
--timeoutis documented indocs/reference/run-command.mdand the READMEs; narrowing the accepted range is user-visible. Check whether any doc example passes a non-integer, and add a CHANGELOG entry.Derived ACs
--timeout 60case--timeoutnow rejects non-integer and0values onrun/readyOpen Questions
--auto-wait,--concurrency,--relay --wait,--stop --grace) be fixed in this PR or filed as a follow-up? — Recommendation: fix them here only where it is the same one-lineparsePositiveSecondsswap with no semantic change; file a follow-up for any that need a different validator (e.g.--auto-wait 0is a documented "off" sentinel per feat(run): --auto-wait — continue a rate-limited run when the window resets instead of halting #804, so it needs a non-negative validator, not a positive one). Impact if wrong: either scope creep, or a second sibling issue three weeks from now — which is exactly how this issue came to exist.Recommended Workflow
Phases: spec → exec → qa
Quality Loop: disabled (SCOPE_OK, tightly bounded change)
Reasoning: CLI/config change with no UI surface —
/testis not applicable./testgenskipped:buglabel, and the two tests are targeted regression cases better written against the real call sites than stubbed from criteria.Label Review
Current:
bug,cliRecommended:
bug,cli,no-browser-testReason: no UI surface;
no-browser-testmakes the/testskip explicit rather than incidental.Quality Loop: won't auto-enable (SCOPE_OK).
test(#833): make the numeric-flag positive controls non-vacuous
admarble commentedon Jul 28, 2026
QA Review for Issue #833
PR: #836 · Reviewed at:
e2149ef· Branch: 0 commits behindorigin/mainReview method: inline. Diff is 535 lines across 9 files — under the 600-line threshold where sub-agent review on worktree code is unreliable. Quality checks run directly rather than delegated.
AC Coverage
run --timeout abcand record output before fixingphaseTimeout = NaN,setTimeoutdelayNaN, timer fired after 2.4 ms (clamped to 0). CLI accepted the flag with no error at all. See caveat under Adversarial Re-Read.--timeout 0has an existing meaning; keep accepting it if so, else rejectrun:0won both??chains →setTimeout(fn, 0)→ same instant-abort asNaN.ready: already discarded byready.ts:111-114's> 0guard. No sentinel treatment inphase-executor.ts,heartbeat.ts, orrun-progress.ts(run-progress.ts:77's> 0gates a display threshold and readssettings.run.timeout, not the flag). Rejected, per #831.--timeoutonrun(cli.ts:286) and the second registration (cli.ts:527 =ready) rejects non-integers with a clear errorparsePositiveSeconds("--timeout"). Verified against the built CLI:error: option '--timeout <seconds>' argument 'abc' is invalid. --timeout expects a whole number of seconds (got 'abc').Non-zero exit on both commands.--timeout 30mrejected rather than read as 30^\d+$whole-string anchor rejects it; test covers30m,30s,5min,1.5,2h.--timeoutreachingconfig-resolver'sphaseTimeoutresolution, so the?? defaultgap cannot silently returnconfig-resolver.numeric-guards.test.ts— 25 cases overNaN/0/negative/±Infinity, asserted on the property that matters (setTimeoutdelay is finite and> 0), plus a direct-buildExecutionConfigcase that bypassesresolveRunOptions. The gap is also closed, not just tested:positiveOr()replaces the bare??.parseIntnumeric CLI flag inventoried in the PR body, each fixed or explicitly justified as safegrep '\.option('oversrc/returns no Commander registrations outsidebin/cli.ts.--timeout 60case--timeoutnow rejects non-integer and0onrun/ready## [Unreleased] → ### Fixed, with issue ref. Flag tables inrun-command.mdandready-command.mdalso updated.Coverage: 8/8 met · Original: 6/6 · Derived: 2/2
CI Status
typecheckbuild (22.x)node-floor-guardvalidate-skillsvalidate-pluginCI Summary: 5 passed, 0 pending, 0 failed. Not infra-blocked (no all-failing board).
Quality Metrics
anyadded)npm run build/npm run lintTest Coverage Analysis
src/lib/cli-flags.tssrc/lib/cli-flags.test.tssrc/lib/workflow/config-resolver.tssrc/lib/workflow/config-resolver.numeric-guards.test.tsbin/cli.tssrc/commands/numeric-flags.integration.test.ts(subprocess)Coverage: 3/3 changed source files covered. No critical-path (auth/payment/security) files touched.
Mutation-verified — the tests actually carry the change:
positiveOr→ bare??inconfig-resolver.tsrun --timeout→parseInt(leavingreadyandmergeintact)run --timeoutones;ready --timeoutstays greenThe second is the more informative result: it shows the wiring tests are scoped per-site rather than passing on a blanket condition.
Code Review
Strengths
parsePositiveSecondsis preserved as a named wrapper, somerge --watch's messages are byte-identical — confirmed by running the built CLI:--interval abc→expects a whole number of seconds,--interval 0→must be at least 1 second. The singular/plural handling (unitSingular) exists specifically to preserve "1 second".--auto-waitand--graceusemin: 0because 0 is meaningful for both (feat(run): --auto-wait — continue a rate-limited run when the window resets instead of halting #804 defines it as "off";--grace 0means escalate immediately). A blanketmin: 1would have been a silent regression.while (iteration < NaN)is false on entry → zero phases), so the next reader knows why the coercion matters rather than just that it changed.src/lib/cli-flags.tsis motivated, not incidental:bin/cli.tscallsprogram.parse()at import time and cannot be imported from a test.Issues
Suggestions
settings.run.timeoutisz.number().default(1800)with no positivity constraint, so"timeout": 0insettings.jsonstill parses.positiveOrnow catches it atbuildExecutionConfig, so the instant-abort is closed — but the user gets a silent fallback rather than a schema error naming the bad setting. Tightening the Zod schema to.positive()would move that to load time. Out of scope here (the issue's Non-Goals exclude default-value changes) and non-blocking, since the dangerous path is already closed.Test Quality Review
setTimeoutdelay finite and> 0;0 < maxIterations) with the source line cited, not on internal shape.abc, empty, whitespace,NaN,Infinity,1e3,0x10,--,30m,30s,5min,1.5,2h,-5,0, oversized, whitespace-padded.Anti-Pattern Detection
Dependency audit: N/A —
package.jsonunchanged.Code patterns: no findings. No
awaitin loops, no empty catch, no hardcoded secrets, no SQL concatenation, no uncleared timers, no0.0.0.0binds. Regex is a bounded^\d+$with no backtracking risk.Call-Site Review
New exported functions: 2 (
parseWholeNumber,parsePositiveSeconds— moved from private scope inbin/cli.tsto exports insrc/lib/cli-flags.ts).parseWholeNumberbin/cli.ts×6,cli-flags.ts:60(wrapper)parsePositiveSecondsbin/cli.ts×4 (run,ready,merge --interval,merge --timeout)Neither is a dead export. Verified each is invoked once per registration at module load (the factory returns the coercion), which is the same lifecycle as before the move.
CLI Registration Verification
bin/cli.tswas modified, but no option interface fields were added or removed — this changes coercion functions on existing registrations only.RunOptionsis untouched. No new field can be unwired.Confirmed no registration was accidentally dropped:
run --timeout,ready --timeout,ready --max-iterations,ready --budget,run --max-iterations,run --concurrency,run --auto-wait,abort --graceall still parse valid values (positive-control tests) and all still appear in--help.Status: Passed
Execution Evidence
run)node dist/bin/cli.js run 1 --timeout abc--timeout expects a whole number of seconds (got 'abc')ready)node dist/bin/cli.js ready 1 --timeout abcnode dist/bin/cli.js run 1 --timeout 0--timeout must be at least 1 second (got '0')node dist/bin/cli.js merge 1 --watch --interval abc/--interval 0node dist/bin/cli.js ready 999999 --timeout 60 --jsonNo worktree found for issue #999999node dist/bin/cli.js abort 999999 --grace 0 --jsonNo relay PID found for #999999node dist/bin/cli.js run 999999 --timeout abc --dry-run(before fix)Status: Complete. No
scripts/files changed, so/verifyis not applicable; the CLI surface was exercised directly above.Skill / Detection-Pattern Verification
N/A — no
.claude/skills/**/*.md,templates/skills/**, orskills/**files changed.Behavior-Rule Survival Check
N/A — ran
detectBehaviorRuleover each AC; none triggered (highest was 1 keyword: AC-1behavior, AC-5default; the heuristic needs ≥2).Manual Test ACs
AC-1 and AC-2 are investigation ACs requiring runtime observation, and both were executed, not asserted from code review — the timing measurement and the CLI transcripts are recorded in the plan comment and reproduced in the PR body. No override claimed.
CHANGELOG Verification
CHANGELOG.mdexistsfix(#833):prefix)[Unreleased]entry### Fixed(#833)Risk Assessment
--timeout 30m,--concurrency 3x,--budget 10k) now gets a hard error instead of silently-wrong behavior. Intended, but a user-visible break — mitigated by the CHANGELOG entry and the two doc-table notes. The narrower risk is a wrong per-flag minimum; bothmin: 0choices were traced to their consumers (createAutoWaitLedger,abort.ts:135) rather than assumed.phaseTimeouttosetTimeoutis asserted as a property, not executed against a real phase. Also untested:settings.jsonsupplying a non-positiverun.timeout(the resolver guard covers it, but nothing pins that path).bin/cli.ts—grep '\.option('oversrc/finds none, so the cross-file surface is closed by construction. Non-CLIparseIntuses insrc/were reviewed and are parsing trusted internal text (git output, log filenames, GitHub API fields), not user flag input; they carry their ownisNaNfilters where it matters (batch-executor.ts:343,getEnvConfig).parseIntsites inbin/cli.tstraced to their consumers and classified — 8 fixed, 8 justified with the specific mechanism that makes each harmless (fail-closed filter,> 0guard, or a loud range error). Two of the eight fixed —run --max-iterations(zero phases) andabort --grace(grace period skipped) — were genuinely broken and are outside the literal AC-3/AC-4 text; AC-6 is what required them.Trust-Boundary Check
Finding: Clean — the issue body is an ordinary bug report. Its imperatives ("Reuse the validator #831 already added", "Confirm the runtime behavior … before fixing") are product/process requirements from the author, carrying no execute/fetch/exfiltrate payload. No HTML comments, fenced blocks, or trailing prose contain agent-directed instructions. The diff adds no network call, no shell-out, no file read outside the repo.
Status: Clean
Adversarial Re-Read
Findings — one real gap surfaced and fixed during this review:
e2149ef). Thereadyandabortacceptance cases asserted only the absence of a coercion error (expect(output).not.toMatch(...)). That assertion stays green if the command starts failing before the flag is ever parsed — the test would report success having proven nothing about coercion. Each case now also pins the specific downstream message it must reach (No worktree found for issue #999999,No relay PID found for #999999,Unknown phase 'bogus'), which is only reachable past argument coercion. This also subsumes and replaces the separate exit-during-parsing guard, which covered only theruncases.What else was scanned, and the result:
bin/cli.ts:286,bin/cli.ts:527,config-resolver.ts:242), the input--timeout abc, and the input--timeout 30m. Every one was run against the built CLI, not merely read; transcripts are in Execution Evidence. Line 527's identity was confirmed asready, not assumed from the issue's "the second registration".phaseTimeout = NaN/ 2.4 ms measurement is a pre-fix bug reproduction, correctly labeled as such and dated before any code changed. The post-fix validation is separate (the rejection transcripts). These are not conflated.origin/main, both commits pushed, no stashes.git diff --statmatches the PR.merge --watchflags, and non-numeric flag validation. None was touched: no default changed;merge's two registrations are textually unmodified and produce byte-identical messages (verified by execution); no non-numeric flag validation was added. The AC-6 sibling fixes are within scope — AC-6 explicitly requires each site be "fixed or explicitly justified as safe", and two of them could not honestly be called safe.--concurrencyinteraction. Validating at the CLI makesrun.ts:76-81's error unreachable from the command line. Checked for a test asserting that CLI path — none exists; the check remains reachable programmatically and the full suite is green.maxIterations: 0regression check. The new guard makes a programmatic0fall back to the default instead of passing through. Grepped for intentional uses: the only hit isrun-log-schema.test.ts:242, a schema-parse test that never touchesbuildExecutionConfig. No behavior anyone relies on.Status: Gaps Found — one test-vacuity gap, surfaced and fixed in this PR rather than deferred. Nothing outstanding.
Verdict: AC_MET_BUT_NOT_A_PLUS
All 8 ACs (6 original + 2 derived) are MET, CI is fully green, the change is mutation-verified at both layers, and the #831 messages it builds on are provably unchanged. The verdict is not
READY_FOR_MERGEon a technicality worth stating plainly rather than papering over: §7's algorithm floors atAC_MET_BUT_NOT_A_PLUSwhen the adversarial re-read reportsGaps Found, and it did — the vacuous positive controls were a genuine defect in the test suite, found here rather than in review.The gap is fixed, not deferred, and the fix is in this PR. In substance this is merge-ready; the label reflects that a gap existed and was caught, which is the signal the gate is for.
One non-blocking suggestion recorded above:
settings.run.timeout's Zod schema still accepts0and negatives. The dangerous path is already closed by the resolver guard, so this is a diagnostics improvement, not a defect — and the issue's Non-Goals put default-value changes out of scope.Documentation
docs/reference/run-command.md—--timeoutand--max-iterationsrows note the whole-number requirementdocs/reference/ready-command.md—--timeout,--budget,--max-iterationsrows updated[Unreleased] → Fixedentry addedNext Steps
RunSettingsSchema.timeoutto.positive()so a badsettings.jsonvalue fails at load with a named error instead of silently falling back.admarble commentedon Jul 28, 2026
/fullsolve Complete
Issue: #833 · PR: #836 · Status: AC_MET_BUT_NOT_A_PLUS — ready for human review
Summary
Progress
no-browser-test; no UI surface)What shipped
--timeout abcreachedsetTimeoutasNaN, which clamps to 0 — every phase aborted on its first tick, and it read as a phase fault rather than a bad flag. Fixed at two layers: the CLI now rejects it by name, andbuildExecutionConfigno longer resolvesphaseTimeout/maxIterationsthrough a bare??.The AC-6 audit covered all 16 bare-
parseIntCLI coercions — 8 fixed, 8 justified. Two of the fixes were genuinely broken and outside the literal AC text:run --max-iterations(aNaNbound ran zero phases) andabort --grace(the SIGINT grace period was skipped entirely).Both guards are mutation-verified: reverting the resolver guard fails 20/25 of its tests; reverting
run --timeoutalone fails exactly its 4 assertions and leavesreadygreen.Why not READY_FOR_MERGE
The adversarial re-read found the
ready/abortpositive-control tests asserted only the absence of a coercion error — they would have passed vacuously if those commands started failing before the flag was parsed. Fixed ine2149ef(each now pins the downstream message it must reach). The §7 gate floors atAC_MET_BUT_NOT_A_PLUSwhen the re-read reports a gap, which it did. In substance this is merge-ready; the label records that a real defect existed and was caught.Follow-up (non-blocking)
RunSettingsSchema.timeoutisz.number().default(1800)with no positivity constraint, so"timeout": 0insettings.jsonstill parses. The resolver guard closes the dangerous path, but a.positive()schema would fail at load with a named error instead of silently falling back. Out of scope here — the issue's Non-Goals exclude default-value changes.Stopping at the human merge gate. Full QA review: #833 (comment)
fix(#833): close the ready path and the settings.json entry point
docs(#833): record the settings.json constraints in the generated ref…
admarble commentedon Jul 28, 2026
QA Re-Review for Issue #833 (gap-fix pass)
PR: #836 · Reviewed at:
caa41ba0· Branch: merged withorigin/main(includes #817), 0 behindThe previous review closed at
AC_MET_BUT_NOT_A_PLUSon a test-vacuity gap. Fixing that gap prompted a re-read of the fix itself, which found a real defect the original fix did not cover plus two supporting gaps. All are now fixed in this PR.Gaps found and closed
sequant ready's phase timeout bypassesbuildExecutionConfig, so a non-positivesettings.run.timeoutreachedsetTimeoutunguarded — the #833 instant-abort, on an uncovered pathsettings.jsonwas an unguarded entry point:run.timeout/concurrency/maxIterationswerez.number()with no constraint, so a bad value was silently swapped for a defaultvalidateSettingsdiscarded the entire settings file on any single invalid key, while its comment claimed it stripped only invalid fieldse2149ef)Gap 1 reproduced before fixing, same discipline as AC-1:
This is the one that matters. My first-pass review checked how
readyhandles--timeout 0(the> 0guard) but did not trace what happens when the settings value is the bad one — andready-gate.ts'sbuildPhaseConfigbuilds its ownExecutionConfig, so the resolver guard never ran. The sibling-line audit was exhaustive withinbin/cli.ts; it did not extend to "who else produces this value."Gap 3 was a prerequisite, not scope creep. Adding the constraints in gap 2 without it would have meant one bad number silently reverting every unrelated setting — a net regression over the status quo.
AC Coverage (unchanged, re-verified at
caa41ba0)Coverage: 8/8. The gap fixes strengthen AC-5 (the
?? defaultgap is now closed on both producers, not one) and AC-6 (the inventory's premise — thatbin/cli.tsis the whole surface — held for flags, butsettings.jsonwas a second entry point the inventory did not consider).CI Status
typecheck·build (22.x)·node-floor-guard·validate-skills·validate-pluginQuality Metrics
anyadded)Three tests failed in one full-suite run under parallel load (
precheck,scrollback-harness,lock-manager); all three pass in isolation and pass in the final run. Flakes, not regressions.Deliberate behavior changes
Both are user-visible and neither is incidental:
__tests__/settings-schema.test.tsno longer assertsrun.timeout: 0parses. That test pinned the exact permissiveness AC-2 proved is a defect. Rather than delete the case, its original intent — "zero values in numeric fields are fine" — moves tostaleBranchThreshold, where 0 genuinely is meaningful, and a new case asserts the three guarded fields reject it. I did not silently rewrite a test to make my change pass; the old expectation was wrong and the replacement says why.buildExecutionConfignow falls back tosettings.run.*beforeDEFAULT_CONFIG. This removes the layering asymmetry between the two producers. The asymmetry is what let gap 1 hide, so making them identical is the actual fix, not just a tidy-up.Mutation verification
Every guard in this PR, including the new ones:
positiveOr→ bare??inconfig-resolverrun --timeout→parseInt(leavingready/mergeintact)readystays greenready.tschaining → old CLI-only guard.positive()parse({})Risk Assessment
settings.jsoncontains"timeout": 0(or another non-positive value in the three guarded keys) now sees a warning and the default instead of silent acceptance. That is the intent, and it replaces an instant-abort with a working run — but it is a behavior change, recorded in the CHANGELOG and the generated settings reference. Second-order risk is the salvage rewrite: it now touches every settings-validation path, so a mistake there would surface broadly. It is covered by 19 new cases including array-index, nested-section, multi-key, non-object-root, and never-throws.phaseTimeouttosetTimeoutis asserted as a property at all three consumption sites' shared source rather than executed against a real phase. Also untested:SEQUANT_*env-var overrides for these numerics (none exist fortimeout;SEQUANT_MAX_ITERATIONSalready filtersisNaNingetEnvConfig).setTimeout(…, config.phaseTimeout * 1000)sites exist (phase-executor.ts:982,drivers/claude-code.ts:77,drivers/aider.ts:63); all three read the sameExecutionConfig, so both producers being guarded covers all three. feat(run): --ready-gate — run the post-QA ready gate insidesequant run(automates the any-gaps/fix-gaps second look, stops at human merge) #817's new in-run ready gate passesconfig.phaseTimeoutfrom the guarded config, so it adds no fourth path.parseIntsites inbin/cli.tsclassified, 8 fixed, 8 justified.Trust-Boundary Check
Finding: Clean — no agent-directed instruction in the issue or comments was acted on. The diff adds no network call, shell-out, or file access outside the repo.
Status: Clean
Adversarial Re-Read
Findings: No gaps outstanding. What was scanned this pass:
--timeout 0's handling inready.tsand stopped there, without asking which code path buildsready'sExecutionConfig. The lesson is recorded above rather than glossed.origin/main. feat(run): --ready-gate — run the post-QA ready gate insidesequant run(automates the any-gaps/fix-gaps second look, stops at human merge) #817 landed in exactly the two files I predicted would overlap. Merged cleanly; verifiedreadyGateand the chained guards coexist in the mergedbuildExecutionConfig, and that feat(run): --ready-gate — run the post-QA ready gate insidesequant run(automates the any-gaps/fix-gaps second look, stops at human merge) #817's in-run gate consumes the guarded value rather than building its own.@tautology-skipwas deliberately not used.Status: Clean
Verdict: READY_FOR_MERGE
All 8 ACs met, CI green, full suite green, every guard mutation-verified, tautology gate passing, and the branch is merged up to date with
origin/main. The gaps that held the previous verdict atAC_MET_BUT_NOT_A_PLUSare closed in this PR rather than deferred, and the most serious of them — a live instant-abort on thereadypath — was found and fixed here rather than in production.Two deliberate behavior changes are called out above for the human reviewer; neither is incidental and both are documented in the CHANGELOG and settings reference.
Next Steps
chore: merge main into feature/833
fix(#833): reject malformed numeric CLI flags instead of coercing the…
fix(#845): harden the eight numeric CLI options #833 left on bare par…
fix(#871): make the shell yarn-major read agree with the TS regex
fix(#870): resolve worktree package manager from lockfile when manife…
fix(#871): resolve yarn frozen install per yarn major in both provisi…
docs: 2.10 release-notes section + coverage gaps found by release audit
feat(#914): per-phase model and effort configuration for the claude-c…
feat(#914): per-phase model and effort configuration for the claude-c…
fix(ready-gate): collapse the second ExecutionConfig producer so driv…
fix(#870): resolve worktree package manager from lockfile when manife…