You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
8 numeric CLI options still use bare parseInt — #833's unit-suffix misparse is unaddressed (--max-age fails open) #845
#833 added parseWholeNumber/parsePositiveSeconds guards to 10 numeric flags. Eight numeric options in bin/cli.ts still use bare parseInt:
status [issue] (:232), status --max-age (:238), prompt --wait (:424), logs --last (:588), logs --issue (:590), dashboard --port (:617), serve --port (:630), state clean --max-age (:672).
PR #836's AC-6 table inventories all eight and justifies each as safe — but every justification reasons only about NaN. The failure #833 is named for is the unit-suffix misparse (30m to 30), which none of them address.
Demonstrated end-to-end against the current build:
sequant logs --last 30m -> renders 30 runs (identical output to --last 30)
sequant logs --issue 817x -> filters to issue 817
sequant status 999999x -> treated as 999999
sequant dashboard --port 3100x -> binds port 3100
sequant serve --port 3199x -> binds port 3199
The PR describes the two port flags as "fails loudly". True for NaN, false for the misparse — it binds the truncated port silently.
--max-age is the one that fails open. The justification relies on state-cleanup.ts:181 (options.maxAgeDays && ...), where NaN is falsy so the age rule is skipped. But --max-age 1w parses to 1, so an intended 7-day retention silently becomes 1 day and cleanup removes more than asked.
Non-Goals: Not stated in the issue. Implied out of scope: adding a max port bound (65535), changing any flag's semantics, or touching the 10 flags #833 already hardened.
Metric
Value
Status
Feature count
1 (harden numeric coercion)
✅
AC items
4
✅
Directory spread
2 (bin/, src/lib/)
✅
Verdict: ✅ SCOPE_OK
Root Cause
All eight sites pass commander the bare parseInt coercion. parseInt("30m",10) === 30: the unit suffix is silently truncated. #833 already built the correct guard — parseWholeNumber (rejects any value that isn't ^\d+$ after trim) and parsePositiveSeconds — and wired it into 10 other flags. This issue simply extends that same guard to the eight that were missed. PR #836's AC-6 table justified leaving them as parseInt by reasoning only about NaN; the misparse (a valid-but-wrong number) was never the NaN case.
--max-age is the sharp edge: state-cleanup.ts:181 gates on options.maxAgeDays && …, so NaN (falsy) safely skips the age rule — but 1w parses to a truthy 1, silently narrowing a 7-day retention to 1 day and deleting more than asked.
Acceptance Criteria
AC-1: All eight options reject a unit-suffixed value with #833's message shape
Verification: Integration Test (spawn CLI) + Unit Test (coercions called directly) Scenario: Given the built CLI → When invoked with logs --last 30m (and the other seven with 30m/1w/3100x) → Then it exits non-zero with <flag> expects a whole number… (got '…').
AC-2: --max-age rejects 1w rather than narrowing retention to 1 day
Verification: Integration Test Scenario: Given status --max-age 1w / state clean --max-age 1w → When run → Then rejected before any cleanup executes (no fail-open).
AC-3: Both port flags reject 3100x instead of binding the truncated port
Verification: Integration Test Scenario: Given dashboard --port 3100x / serve --port 3100x → When run → Then rejected, no server bound.
AC-4: Legitimate boundary values that currently parse continue to parse
Verification: Unit Test Scenario: Given each boundary — --wait 0 (means "don't block", see below), plain positive integers, whitespace-padded (" 60 ") — → When coerced → Then accepted unchanged. Assumptions:--wait 0must stay valid (prompt.ts:259 guards on waitSeconds > 0, so 0 = no-wait). Using parsePositiveSeconds (min 1) here would regress AC-4 — use min: 0 instead.
Implementation Plan
Single phase, mechanical. Import already present (bin/cli.ts:28-29). Replace each parseInt with the mapped coercion:
Then add tests in src/lib/cli-flags.test.ts — a data-driven case asserting each of the 8 configured coercions rejects a suffixed value (AC-1) and preserves its boundary (AC-4), plus a targeted --max-age 1w rejection (AC-2) and --port 3100x rejection (AC-3). The end-to-end reproductions in the issue body are mandatory fixtures.
Design Review
Where does this logic belong? Coercion lives in src/lib/cli-flags.ts (already the home); bin/cli.ts only wires it. No new module.
What's the simplest correct approach? Reuse the existing tested guard. No new helper needed — the only judgment call is per-flag min/unit.
What existing pattern does this follow? The exact #833 pattern applied to the 10 sibling flags. Message shape is inherited verbatim → satisfies AC-1 "same message shape".
What would a senior reviewer challenge? (a) "Why min:0 on --wait but min:1 elsewhere?" — because --wait 0 is a documented no-wait boundary (prompt.ts:259); the others have no meaningful 0. (b) "Should ports also cap at 65535?" — deliberately out of scope (see Open Questions); AC-4 says values that currently parse should keep parsing.
Feature Quality Planning
All standard checks pass. Notable items:
The reproductions must be encoded as tests, not just verified manually — otherwise a future refactor silently reintroduces the misparse.
Mutation-check the --max-age test: revert the coercion and confirm the test fails (AC-2 is the fail-open case that motivated the whole issue).
Open Questions
--last 0 / --issue 0 boundary — min: 1 will reject 0. These aren't meaningful (0 runs / issue #0 doesn't exist), so I recommend min: 1. Impact if wrong: a script passing --last 0 starts erroring. Low risk; confirm during exec.
Port upper bound (65535)? — Recommendation: leave out of scope. AC-3 only requires rejecting the suffix misparse; adding a max is a new behavior and risks AC-4. File as a follow-up only if desired.
Recommended Workflow
Phases: exec → qa Quality Loop: disabled Reasoning: Mechanical fix wiring a pre-tested helper into 8 sites; no new logic. Tests are added inline in exec (cli-flags.test.ts already exists), so a separate testgen phase is optional overhead. QA must verify the 8-site mapping table and the two boundary decisions (--wait 0, ports).
Label Review
Current: (none) Recommended:bug Reason: Correctness fix for a silent misparse (--max-age fails open). No UI, no browser test needed. Quality Loop: Won't auto-enable (SCOPE_OK, small diff).
Purely the #833 pattern applied to the eight missed flags — parseWholeNumber(flag, opts) replaces each bare parseInt, no new module. Per-flag min/unit per the /spec table; --wait gets min: 0 (a documented no-wait boundary), all others min: 1.
End-to-end reproductions (against the built CLI)
logs --last 30m -> error: --last expects a whole number (got '30m').
dashboard --port 3100x -> error: --port expects a whole number (got '3100x').
serve --port 3199x -> error: --port expects a whole number (got '3199x').
status 999999x -> error: issue expects a whole number (got '999999x').
state clean --max-age 1w -> error: --max-age expects a whole number of days (got '1w').
logs --last 30 -> SEQUANT RUN LOGS (boundary preserved)
prompt 999999 test --wait 0 -> No relay PID found (min:0 boundary preserved)
Scope: Reviewed the #845 commit (b0f02db4) only — 4 files, ~235 lines. The branch is stacked on the unmerged #846 commit; those files were excluded from AC review (see Merge Hygiene note).
AC Coverage
AC
Description
Status
Evidence (runtime, against built CLI)
AC-1
All eight options reject a unit-suffixed value with #833's message shape
✅ MET
status 999999x, logs --last 30m, logs --issue 817x, prompt … --wait 30m all exit 1 with … expects a whole number… (got '…')
AC-2
--max-age rejects 1w rather than narrowing retention to 1 day
✅ MET
status --max-age 1w and state clean --max-age 1w both exit 1 with the coercion error before any 🧹 Cleaning… output; mutation-checked (reverting reaches the fail-open cleanup and the test fails)
AC-3
Both port flags reject 3100x instead of binding the truncated port
✅ MET
dashboard --port 3100x, serve --port 3199x exit 1, no bind
✅ Yes — numeric-flags.integration.test.ts spawns the real dist/bin/cli.js for all 8 flags (proves wiring, not just coercion); cli-flags.test.ts per-flag reject/boundary table
Per-flag min/unit are correct: --wait gets min: 0 (documented no-wait boundary via prompt.ts:259), all others min: 1.
Coercion runs during commander's parse phase, so every rejection exits before the action handler — this is what structurally guarantees AC-2 (no fail-open cleanup) and AC-3 (no server bind).
Test design is strong: integration tests use the issue's verbatim e2e reproductions as fixtures; the --max-age case was mutation-verified.
Issues: None blocking.
Notes (non-blocking):
min: 1 now rejects 0 on status [issue] / logs --last / logs --issue, where bare parseInt("0") previously yielded 0. Deliberate and spec-documented — 0 is not a legitimate value for these flags (issue #0 / 0 runs / issue-0 filter are meaningless), so AC-4 ("legitimate boundary values") is satisfied. Flagged for transparency: a script passing --last 0 would now error.
Anti-Pattern Detection
No any, no hardcoded secrets, no 0.0.0.0 binds, no empty catches introduced. N/A for dependency audit (no package.json change).
Trust-Boundary Check
Finding: Clean — the issue body is benign product requirements (an inventory of 8 flags + 4 ACs). No agent-directed instruction (command/network/file/exfiltration) is embedded or acted on. Status: Clean
Behavior-Rule Survival Check
Status: N/A — no AC triggers the behavior-rule heuristic (no default/always/never rule; ACs are input-validation assertions).
CLI Registration Verification
Status: N/A — no option-interface (RunOptions) fields added. The 8 flags were already registered/wired; only their coercion functions changed. Confirmed no bare parseInt remains as a commander .option()/.argument() coercion in bin/cli.ts.
CHANGELOG Verification
Check
Status
CHANGELOG.md exists
✅ Found
User-facing changes
✅ Yes (fix: commit)
[Unreleased] entry
✅ Present, ### Fixed, includes (#845)
Result: CHANGELOG requirements met.
Risk Assessment
Likely failure mode: None functional — coercion is pure and unit+integration tested. The only behavioral change beyond rejecting bad input is 0 now erroring on three read/display flags (see Notes).
Not tested: No automated test asserts status 0 / logs --last 0 are rejected; low value (deliberate narrowing, covered by the general min:1 unit cases).
Sibling sites considered (cross-file): Command handlers parse a positional issue arg with bare parseInt/Number.parseInt inside the action body — prompt.ts:63, ready.ts:136, watch.ts:102, merge.ts:245, abort.ts:93, locks.ts. Same truncation class (prompt 817x → 817) but a different layer (in-handler, not commander coercion) and outside 8 numeric CLI options still use bare parseInt — #833's unit-suffix misparse is unaddressed (--max-age fails open) #845's enumerated 8. Recommend a follow-up issue; not in scope here — do not widen this PR.
Sibling-line audit (intra-file): All 8 commander coercions in bin/cli.ts migrated; zero bare-parseInt coercions remain.
Adversarial Re-Read
Findings: Ran all 4 ACs against the built CLI (exit codes captured); confirmed the evidence is post-fix validation (not a pre-fix repro) with the mutation check supplying the fail-open repro; inspected process state (worktree clean, branch stacked on #846 — noted); cited both cross-file and intra-file siblings explicitly; verified Non-Goals held (no upper port bound / no semantics change added). No gaps affecting #845's scope. Status: Clean
PR #855 is stacked on the unmerged #846 commit (8f40b075), so its diff against main carries worktree-manager.ts too. Land #846 first, or rebase/retarget #855 once #846 merges, so #845 doesn't drag #846's changes in unreviewed-here.
Verdict: READY_FOR_MERGE
All four ACs are MET with independent runtime verification, the change is the exact #833 pattern with no new surface, tests are strong (integration wiring + unit boundaries + a mutation check on the fail-open case), and CI is fully green. The two notes (deliberate 0 narrowing; cross-file in-handler parseInt siblings) are transparency/follow-up items, not blockers.
All eight options reject a unit-suffixed value (30m, 1w, 3100x) with #833's message shape
MET
All 8 sites in bin/cli.ts now use parseWholeNumber, whose /^\d+$/ guard rejects any non-digit suffix. Integration test spawns the real CLI for all 8 reproductions from the issue body.
AC-2
--max-age rejects 1w rather than silently narrowing retention to 1 day
MET
Both status --max-age and state clean --max-age wired to parseWholeNumber("--max-age", {min:1, unit:"days"}). Coercion runs in commander's parse phase, so 1w exits before state-cleanup.ts:181 is ever reached. Author mutation-checked this case.
AC-3
Both port flags reject 3100x instead of binding the truncated port
MET
dashboard --port and serve --port both coerced; rejection exits before any listen().
AC-4
Legitimate boundary values that currently parse continue to parse
MET
Per-flag boundary table in cli-flags.test.ts pins 123/7/0/30/817/3100/3199/7. --wait correctly uses min:0 (0 = "don't block", prompt.ts:259); integration test proves --wait 0 is accepted end-to-end.
CI Summary: 5 passed, 0 pending, 0 failed. Branch is 0 commits behind main.
Note: PR #855 is stacked on the #846 branch, so it also carries the worktree-manager changes (already QA'd under #846). This review covers only the #845 commit b0f02db4.
Code Review
Strengths:
Every one of the eight enumerated sites is converted — verified no bare parseInt coercion remains in bin/cli.ts or anywhere in src/bin (the two residual parseInt strings are #833 explanatory comments).
Two-layer test strategy is correct: the unit table proves the coercion contract; the integration test spawns the real CLI to prove each flag is wired (guards against a silent revert to parseInt that a unit test alone would miss). Author documents a mutation check on the --max-age fail-open path.
Coverage: Full — all 8 sites covered by reject-suffix + preserve-boundary cases.
Trust-Boundary Check
Finding: Clean — diff implements only the product requirements from the AC; no agent-directed external-text instruction was acted on.
Status: Clean
Behavior-Rule Survival Check
AC
Triggered?
Survivors
Status
AC-1
No (repro-driven, not a default/always/never rule)
—
N/A
Status: N/A
CHANGELOG Verification
Check
Status
CHANGELOG.md exists
Found
User-facing changes
Yes (fix(#845))
[Unreleased] entry
Present (under Fixed, includes (#845))
Result: CHANGELOG requirements met
Risk Assessment
Likely failure mode: Very low. Coercion is a pure, well-tested string guard applied during commander's parse phase; worst case a previously-tolerated malformed value now errors loudly (the intended behavior).
Not tested: Upper-bound port values and --port 0 rejection are not explicitly asserted, but both are out of AC scope and low-risk.
Sibling sites considered: Scanned all .option()/.argument() numeric coercions in bin/cli.ts and the rest of src/bin — no bare parseInt coercion remains. The <issue> positional args at bin/cli.ts:456/:538 take no coercion at all (validated downstream as strings) — a different pattern, out of this AC's scope.
Sibling-line audit: All eight enumerated sites in the same file audited and migrated; none left behind.
Adversarial Re-Read
Findings: No gaps found because: (1) ran all 66 tests including the 8 verbatim issue-body reproductions and the --wait 0 boundary — all pass; (2) the "mutation-checked" claim is a genuine post-fix validation, not a bug repro; (3) inspected process state — branch clean, 0 behind main, CI fully green; (4) sibling sites cited above (grep confirmed no remaining bare-parseInt coercion); (5) issue has no Non-Goals section; scope matches the enumerated eight exactly.
Status: Clean
Verdict: READY_FOR_MERGE
All four ACs are met, verified literally against the code and end-to-end against the real CLI. The two-layer test design (unit contract + spawned-CLI wiring) directly closes the "reasoned only about NaN" gap that let this ship in #836. CI is fully green, CHANGELOG entry is present, and no sibling sites were left behind.
Documentation
CHANGELOG entry added ([Unreleased] → Fixed, includes #845)
N/A — no README/docs surface changes (behavior is stricter validation of existing flags)
Activity
admarble commentedon Jul 29, 2026
/spec Plan — #845
Complexity: Standard (4 ACs, 2 directories)
AC Quality Check
30m,1w,3100x) and expected outcome (reject / same message shape). ✅0for--wait, positive integers, whitespace-trimmed values, and existing fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833-style boundaries.Scope Assessment
Non-Goals: Not stated in the issue. Implied out of scope: adding a max port bound (65535), changing any flag's semantics, or touching the 10 flags #833 already hardened.
bin/,src/lib/)Verdict: ✅ SCOPE_OK
Root Cause
All eight sites pass commander the bare
parseIntcoercion.parseInt("30m",10) === 30: the unit suffix is silently truncated.#833already built the correct guard —parseWholeNumber(rejects any value that isn't^\d+$after trim) andparsePositiveSeconds— and wired it into 10 other flags. This issue simply extends that same guard to the eight that were missed. PR #836's AC-6 table justified leaving them asparseIntby reasoning only aboutNaN; the misparse (a valid-but-wrong number) was never theNaNcase.--max-ageis the sharp edge:state-cleanup.ts:181gates onoptions.maxAgeDays && …, soNaN(falsy) safely skips the age rule — but1wparses to a truthy1, silently narrowing a 7-day retention to 1 day and deleting more than asked.Acceptance Criteria
AC-1: All eight options reject a unit-suffixed value with #833's message shape
Verification: Integration Test (spawn CLI) + Unit Test (coercions called directly)
Scenario: Given the built CLI → When invoked with
logs --last 30m(and the other seven with30m/1w/3100x) → Then it exits non-zero with<flag> expects a whole number… (got '…').AC-2:
--max-agerejects1wrather than narrowing retention to 1 dayVerification: Integration Test
Scenario: Given
status --max-age 1w/state clean --max-age 1w→ When run → Then rejected before any cleanup executes (no fail-open).AC-3: Both port flags reject
3100xinstead of binding the truncated portVerification: Integration Test
Scenario: Given
dashboard --port 3100x/serve --port 3100x→ When run → Then rejected, no server bound.AC-4: Legitimate boundary values that currently parse continue to parse
Verification: Unit Test
Scenario: Given each boundary —
--wait 0(means "don't block", see below), plain positive integers, whitespace-padded (" 60 ") — → When coerced → Then accepted unchanged.Assumptions:
--wait 0must stay valid (prompt.ts:259guards onwaitSeconds > 0, so 0 = no-wait). UsingparsePositiveSeconds(min 1) here would regress AC-4 — usemin: 0instead.Implementation Plan
Single phase, mechanical. Import already present (
bin/cli.ts:28-29). Replace eachparseIntwith the mapped coercion:status [issue]parseWholeNumber("issue", { min: 1 })status --max-ageparseWholeNumber("--max-age", { min: 1, unit: "days" })prompt --waitparseWholeNumber("--wait", { min: 0, unit: "seconds", unitSingular: "second" })parsePositiveSecondslogs --lastparseWholeNumber("--last", { min: 1 })logs --issueparseWholeNumber("--issue", { min: 1 })dashboard --portparseWholeNumber("--port", { min: 1 })serve --portparseWholeNumber("--port", { min: 1 })state clean --max-ageparseWholeNumber("--max-age", { min: 1, unit: "days" })Then add tests in
src/lib/cli-flags.test.ts— a data-driven case asserting each of the 8 configured coercions rejects a suffixed value (AC-1) and preserves its boundary (AC-4), plus a targeted--max-age 1wrejection (AC-2) and--port 3100xrejection (AC-3). The end-to-end reproductions in the issue body are mandatory fixtures.Design Review
src/lib/cli-flags.ts(already the home);bin/cli.tsonly wires it. No new module.min/unit.#833pattern applied to the 10 sibling flags. Message shape is inherited verbatim → satisfies AC-1 "same message shape".min:0on--waitbutmin:1elsewhere?" — because--wait 0is a documented no-wait boundary (prompt.ts:259); the others have no meaningful 0. (b) "Should ports also cap at 65535?" — deliberately out of scope (see Open Questions); AC-4 says values that currently parse should keep parsing.Feature Quality Planning
All standard checks pass. Notable items:
--max-agetest: revert the coercion and confirm the test fails (AC-2 is the fail-open case that motivated the whole issue).Open Questions
--last 0/--issue 0boundary —min: 1will reject0. These aren't meaningful (0 runs / issue #0 doesn't exist), so I recommendmin: 1. Impact if wrong: a script passing--last 0starts erroring. Low risk; confirm during exec.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Mechanical fix wiring a pre-tested helper into 8 sites; no new logic. Tests are added inline in exec (
cli-flags.test.tsalready exists), so a separatetestgenphase is optional overhead. QA must verify the 8-site mapping table and the two boundary decisions (--wait 0, ports).Label Review
Current: (none)
Recommended:
bugReason: Correctness fix for a silent misparse (
--max-agefails open). No UI, no browser test needed.Quality Loop: Won't auto-enable (SCOPE_OK, small diff).
admarble commentedon Jul 29, 2026
/exec Progress Update — #845
Status: ✅ Implemented — PR #855 opened.
AC Coverage
bin/cli.ts;numeric-flags.integration.test.ts(spawns real CLI) + per-flag table incli-flags.test.ts--max-agerejects1wrather than narrowing retention to 1 daystatus/state clean --max-agerejected before cleanup; mutation-checked (revert → reaches "🧹 Cleaning up…", test fails)3100xinstead of binding the truncated portdashboard/serve --portintegration cases--wait 0(min:0) accepted e2e; boundaries123/7/30/817/3100/3199pinnedApproach
Purely the #833 pattern applied to the eight missed flags —
parseWholeNumber(flag, opts)replaces each bareparseInt, no new module. Per-flagmin/unitper the /spec table;--waitgetsmin: 0(a documented no-wait boundary), all othersmin: 1.End-to-end reproductions (against the built CLI)
Files changed
bin/cli.ts— 8parseInt→parseWholeNumbercoercionssrc/lib/cli-flags.test.ts— data-driven per-flag reject/boundary tablesrc/commands/numeric-flags.integration.test.ts— 8 e2e reproductions +--wait 0positive controlCHANGELOG.md—### FixedentryQuality Plan Alignment
--max-ageChecks
npm run build✅ ·npm run lint✅ (0 warnings) · targeted tests 66 passedprompt-wait.test.ts(verified on the pristine tree via stash; it callspromptCommand()directly and never touches CLI coercion — asetTimeoutrace, not 8 numeric CLI options still use bare parseInt — #833's unit-suffix misparse is unaddressed (--max-age fails open) #845).PR
admarble commentedon Jul 29, 2026
QA Review for Issue #845
Scope: Reviewed the
#845commit (b0f02db4) only — 4 files, ~235 lines. The branch is stacked on the unmerged#846commit; those files were excluded from AC review (see Merge Hygiene note).AC Coverage
status 999999x,logs --last 30m,logs --issue 817x,prompt … --wait 30mall exit 1 with… expects a whole number… (got '…')--max-agerejects1wrather than narrowing retention to 1 daystatus --max-age 1wandstate clean --max-age 1wboth exit 1 with the coercion error before any🧹 Cleaning…output; mutation-checked (reverting reaches the fail-open cleanup and the test fails)3100xinstead of binding the truncated portdashboard --port 3100x,serve --port 3199xexit 1, no bindprompt … --wait 0passes coercion (reaches liveness check);logs --last 30exit 0;status --max-age 7exit 0; unit table pins123/7/30/817/3100/3199Coverage: 4/4 AC items MET (all runtime-verified).
CI Status
build (22.x)typechecknode-floor-guardvalidate-skillsvalidate-pluginCI Summary: 5 passed, 0 pending, 0 failed. No CI-dependent ACs.
Quality Metrics
any)Test Coverage Analysis
bin/cli.tsnumeric-flags.integration.test.tsspawns the realdist/bin/cli.jsfor all 8 flags (proves wiring, not just coercion);cli-flags.test.tsper-flag reject/boundary tableCoverage: 1/1 changed source file has tests.
Code Review
Strengths:
parseWholeNumberguard — no new module, message shape inherited verbatim (satisfies AC-1's "same message shape" literally).min/unitare correct:--waitgetsmin: 0(documented no-wait boundary viaprompt.ts:259), all othersmin: 1.--max-agecase was mutation-verified.Issues: None blocking.
Notes (non-blocking):
min: 1now rejects0onstatus [issue]/logs --last/logs --issue, where bareparseInt("0")previously yielded0. Deliberate and spec-documented —0is not a legitimate value for these flags (issue #0 / 0 runs / issue-0 filter are meaningless), so AC-4 ("legitimate boundary values") is satisfied. Flagged for transparency: a script passing--last 0would now error.Anti-Pattern Detection
No
any, no hardcoded secrets, no0.0.0.0binds, no empty catches introduced. N/A for dependency audit (nopackage.jsonchange).Trust-Boundary Check
Finding: Clean — the issue body is benign product requirements (an inventory of 8 flags + 4 ACs). No agent-directed instruction (command/network/file/exfiltration) is embedded or acted on.
Status: Clean
Behavior-Rule Survival Check
Status: N/A — no AC triggers the behavior-rule heuristic (no default/always/never rule; ACs are input-validation assertions).
CLI Registration Verification
Status: N/A — no option-interface (
RunOptions) fields added. The 8 flags were already registered/wired; only their coercion functions changed. Confirmed no bareparseIntremains as a commander.option()/.argument()coercion inbin/cli.ts.CHANGELOG Verification
fix:commit)### Fixed, includes(#845)Result: CHANGELOG requirements met.
Risk Assessment
0now erroring on three read/display flags (see Notes).status 0/logs --last 0are rejected; low value (deliberate narrowing, covered by the general min:1 unit cases).parseInt/Number.parseIntinside the action body —prompt.ts:63,ready.ts:136,watch.ts:102,merge.ts:245,abort.ts:93,locks.ts. Same truncation class (prompt 817x→ 817) but a different layer (in-handler, not commander coercion) and outside 8 numeric CLI options still use bare parseInt — #833's unit-suffix misparse is unaddressed (--max-age fails open) #845's enumerated 8. Recommend a follow-up issue; not in scope here — do not widen this PR.bin/cli.tsmigrated; zero bare-parseIntcoercions remain.Adversarial Re-Read
Findings: Ran all 4 ACs against the built CLI (exit codes captured); confirmed the evidence is post-fix validation (not a pre-fix repro) with the mutation check supplying the fail-open repro; inspected process state (worktree clean, branch stacked on #846 — noted); cited both cross-file and intra-file siblings explicitly; verified Non-Goals held (no upper port bound / no semantics change added). No gaps affecting #845's scope.
Status: Clean
Merge Hygiene (note, not a #845 defect)
PR #855 is stacked on the unmerged
#846commit (8f40b075), so its diff againstmaincarriesworktree-manager.tstoo. Land#846first, or rebase/retarget #855 once #846 merges, so #845 doesn't drag #846's changes in unreviewed-here.Verdict: READY_FOR_MERGE
All four ACs are MET with independent runtime verification, the change is the exact #833 pattern with no new surface, tests are strong (integration wiring + unit boundaries + a mutation check on the fail-open case), and CI is fully green. The two notes (deliberate
0narrowing; cross-file in-handlerparseIntsiblings) are transparency/follow-up items, not blockers.Documentation
### Fixed, 8 numeric CLI options still use bare parseInt — #833's unit-suffix misparse is unaddressed (--max-age fails open) #845)Next Steps
parseIntsites (prompt/ready/watch/merge/abort/locks).admarble commentedon Jul 29, 2026
QA Review for Issue #845
AC Coverage
30m,1w,3100x) with #833's message shapebin/cli.tsnow useparseWholeNumber, whose/^\d+$/guard rejects any non-digit suffix. Integration test spawns the real CLI for all 8 reproductions from the issue body.--max-agerejects1wrather than silently narrowing retention to 1 daystatus --max-ageandstate clean --max-agewired toparseWholeNumber("--max-age", {min:1, unit:"days"}). Coercion runs in commander's parse phase, so1wexits beforestate-cleanup.ts:181is ever reached. Author mutation-checked this case.3100xinstead of binding the truncated portdashboard --portandserve --portboth coerced; rejection exits before anylisten().cli-flags.test.tspins 123/7/0/30/817/3100/3199/7.--waitcorrectly usesmin:0(0 = "don't block",prompt.ts:259); integration test proves--wait 0is accepted end-to-end.Coverage: 4/4 AC items fully met
Quality Metrics
any)bin/cli.ts+ 2 test files)CI Status
CI Summary: 5 passed, 0 pending, 0 failed. Branch is 0 commits behind main.
Code Review
Strengths:
parseIntcoercion remains inbin/cli.tsor anywhere insrc/bin(the two residualparseIntstrings are#833explanatory comments).--waitusesmin:0,--max-agecarriesunit:"days", seconds flags carry singular/plural units. Error shape matches fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833.parseIntthat a unit test alone would miss). Author documents a mutation check on the--max-agefail-open path.Issues: None blocking.
Suggestions (non-blocking):
--portnow rejects0(min:1), whichparseInt("0")previously accepted. Port 0 = OS-assigned ephemeral; unlikely intended for a dashboard and consistent with fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833's othermin:1flags — noted only for completeness, not a regression concern.--port(>65535 still passes) — unchanged from prior behavior, out of scope for this fix.Test Coverage Analysis
bin/cli.tscli-flags.test.ts(unit) +numeric-flags.integration.test.ts(e2e)Coverage: Full — all 8 sites covered by reject-suffix + preserve-boundary cases.
Trust-Boundary Check
Finding: Clean — diff implements only the product requirements from the AC; no agent-directed external-text instruction was acted on.
Status: Clean
Behavior-Rule Survival Check
Status: N/A
CHANGELOG Verification
fix(#845))(#845))Result: CHANGELOG requirements met
Risk Assessment
--port 0rejection are not explicitly asserted, but both are out of AC scope and low-risk..option()/.argument()numeric coercions inbin/cli.tsand the rest ofsrc/bin— no bareparseIntcoercion remains. The<issue>positional args atbin/cli.ts:456/:538take no coercion at all (validated downstream as strings) — a different pattern, out of this AC's scope.Adversarial Re-Read
Findings: No gaps found because: (1) ran all 66 tests including the 8 verbatim issue-body reproductions and the
--wait 0boundary — all pass; (2) the "mutation-checked" claim is a genuine post-fix validation, not a bug repro; (3) inspected process state — branch clean, 0 behind main, CI fully green; (4) sibling sites cited above (grep confirmed no remaining bare-parseIntcoercion); (5) issue has no Non-Goals section; scope matches the enumerated eight exactly.Status: Clean
Verdict: READY_FOR_MERGE
All four ACs are met, verified literally against the code and end-to-end against the real CLI. The two-layer test design (unit contract + spawned-CLI wiring) directly closes the "reasoned only about NaN" gap that let this ship in #836. CI is fully green, CHANGELOG entry is present, and no sibling sites were left behind.
Documentation
[Unreleased] → Fixed, includes#845)Next Steps
fix(#845): harden the eight numeric CLI options #833 left on bare par…
docs: 2.10 release-notes section + coverage gaps found by release audit