fix(cli): refuse an empty numeric flag value instead of reading it as 0
Summary
The CLI parser converts int and number flag values with Number(value). Number('') and Number(' ') return 0, so an empty or blank value passes the finite check and becomes 0. For flags whose minimum is 0, the command runs with that value and gives no error: --retries=, --hold-ms "", --delay-ms=, --pause-ms=, --interval-ms=, --duration-ms=, --jitter-px=, and --settle-quiet=. This happens, for example, when a script passes --retries="$RETRIES" and the variable is unset. For flags with a minimum of 1 or more, the user sees Invalid <flag>: with an empty value instead of the real cause.
This change refuses an empty or blank numeric value with the existing Flag <name> requires a value. error. booleanOrString flags already refuse an empty inline value. String and enum flags do not change.
- Files touched: 2 (
src/cli/parser/args.ts,src/cli/parser/__tests__/args-validation.test.ts). - No scope expansion.
- Linked issue: #3792
Validation
- Base
4a8abed, headca41e6a. pnpm exec vitest run src/cli/parser/__tests__/args-validation.test.ts: base, 1 failed and 23 passed (the new test); head, 24 passed.pnpm check:affected --run --head bc44accc68fa4e1006f693841fea6282cd0700ce(the same change before a rebase onto4a8abed, which touches none of these files): format, lint, typecheck, layering, fallow, build, and vitest-related (60 files, 657 tests) passed.exactCommit=true.- The device lanes are GitHub-authoritative and were not run locally. The change is in CLI argument parsing only. It does not change dispatch, capture, or interaction.