Skip to content

fix(cli): reject malformed page number options - #244

Open
dirtybits wants to merge 1 commit into
mainfrom
fix/strict-cli-page-number
Open

dirtybits wants to merge 1 commit into
mainfrom
fix/strict-cli-page-number

Conversation

@dirtybits

Copy link
Copy Markdown
Owner

Summary

agentvouch skill list --page previously used parseInt, silently changing malformed user input: 9.5 became page 9 and 3x became page 3. The CLI now accepts only whitespace-padded positive decimal integers that fit in JavaScript's safe integer range; fractional, partially numeric, signed, scientific-notation, and unsafe integer values produce the existing clear validation error.

This is a focused CLI input-boundary fix: two files, no API, protocol, chain, dependency, or configuration changes.

Test plan

  • RED: npm test --workspace @agentvouch/cli -- cli-options.test.ts failed before the implementation because 9.5 was silently accepted as page 9.
  • npm test --workspace @agentvouch/cli -- cli-options.test.ts — 10 tests passed.
  • npm run test --workspace @agentvouch/cli — 13 files / 77 tests passed.
  • npm run typecheck --workspace @agentvouch/cli — passed.
  • npm run build --workspace @agentvouch/cli — passed (tsup ESM + declarations).
  • npm run format:check — passed.
  • npm run lint — passed.
  • git diff --check origin/main...HEAD — passed.

Rollback

Revert this commit to restore the prior permissive parseInt behavior; no data or deployed state requires cleanup.

Not verified

  • No web build, Vercel deploy, browser, wallet, database, or chain smoke: this is a CLI-only parsing change.

This branch was successfully deployed

1 active deployment
Preview — 7a39d209 Deployed Oct 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant