Repository navigation
fix(cli): reject non-decimal byte-entropy window options - #8919
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no actionable defects or new security issues were found in the changed paths. SummaryAdds
Reviews (3) · Last reviewed commit: "Merge branch 'main' into rrfz/decimal-by..." · Reviewed by Greptile |
Keyed-archive offset and limit, asset-catalog paging, and interface-builder budgets use the same decimal token check as byte-entropy windows. Defaulted fields stay numbers.
Summary
Fixes #7376.
inspect-byte-entropycoerces CLI tokens before validation. These calls all return a successful inspection:--length=selects an empty window.--offset=0x10selects offset 16.--offset=1e2selects offset 100.The options are documented as decimal byte counts.
Problem and expected behavior
--offset,--lengthand--block-sizeshould accept decimal tokens only. Empty and non-decimal tokens should fail argument validation and name the option.Change and scope
cliDecimalFieldhelper insrc/cli/options.tschecks the decimal token first.inspectByteEntropyInputSchemafield and keeps that field's default or optionality, so the CLI copies no limits.VALIDATION_ERRORnaming the option.--length=0still work. A decimal block size that is not a power of two, such as384, is still refused during argument validation.cliIntegerArgumentis unchanged. MCP inputs and provider behavior are unchanged.#8386 also adds a decimal helper to
src/cli/options.tsfor other commands. It does not touchinspect-byte-entropy. Whichever lands second resolves a small conflict in that file.Follow the contribution scope. Ordinary fix within existing boundaries; maintainer scope decision not applicable.
Contract and boundary impact
inspect-byte-entropy.rea inspect-byte-entropy --schema --format jsonis unchanged. MCP is unchanged.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
tests/boundary/cli/cliIntegerArguments.test.ts.--offsetruns every malformed spelling (empty, whitespace, newline, hexadecimal, binary, exponent, signed, fractional, unsafe,-0).--lengthand--block-sizeshare the parser and run one representative token each, plus--block-size=384.src/cli/binaryDiagnosticsCommands.tsandsrc/cli/options.tsreset tomain(89317a3), the file gives 12 failed / 59 passed. On this branch, 71/71 passed.--offset=0x10now fails withVALIDATION_ERRORonoffsetinstead of inspecting offset 16.For evidence-bearing changes:
Validation performed
Windows 11 x64 (10.0.26200), Node 24.22.1, base
main89317a3.npm run test:focused -- tests/boundary/cli/cliIntegerArguments.test.ts— 71/71 passed. With the two source files reset tomain: 12 failed / 59 passed.npm run check:fast(typecheck and lint) — passed.Compatibility, safety, and release
Prepared with AI assistance.
Author readiness
Human owner: @Plastic-time
Before merge
type(scope): outcome.