Repository navigation
fix(cli): reject non-decimal byte-entropy window options - #8598
Closed
Plastic-time wants to merge 3 commits into
Closed
Plastic-time wants to merge 3 commits into
Plastic-time wants to merge 3 commits into
Conversation
Parse --offset, --length and --block-size as decimal tokens, so an empty --length= no longer becomes a zero-byte window and hex or exponent tokens no longer select a different window. The advertised option schema is unchanged. Fixes morluto#7376
12 of 19 tasks
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. |
Contributor
[Low impact] The reviewed changes appear safe to merge; no actionable issue remains. SummaryMakes
Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
Pipe each decimal byte-entropy token into its inspect_byte_entropy schema field, so the CLI copies no block-size bounds or defaults and rejects a non-power-of-two block size at argument validation. Keep one option on the full malformed-spelling list and one representative case for the others.
…py-decimal-window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #7877, which was closed without review. This is the same change rebased onto
d3ab0faf5. Greptile's earlier review (5/5) is on #7877. After Greptile's review here,40f40d199takes bounds and defaults from the canonical schema fields and trims the spelling matrix.Problem and outcome
Fixes #7376.
inspect-byte-entropycoerced CLI tokens before validation:--length=selected an empty window,--offset=0x10selected offset 16, and--offset=1e2selected offset 100. These invocations returned successful inspection results despite the documented decimal-byte-count contract.Parse
--offset,--lengthand--block-sizethrough a newcliDecimalFieldhelper. It checks the decimal token, then validates the number with the matchinginspectByteEntropyInputSchemafield. Empty and non-decimal tokens now returnVALIDATION_ERRORnaming the option. Omitted defaults, leading-zero decimal tokens and explicit--length=0remain supported. A decimal block size that is not a power of two, such as384, is still refused during argument validation, as onmain.Evidence and validation
Updated with upstream
9bea563e3on 2026-11-02 (merge commit77a6bf61c). Windows, Node 24.22.1, npm 11.19.1:npm run test:focused -- tests/boundary/cli/cliIntegerArguments.test.ts71/71 passed;npm run check:fastandnpm run docs:checkpassed. The upstream update includes00c4f44a1, which repairs the old formatting/verifier failures. Earlier evidence below is historical; see the checks on the current head for hosted CI status.Local environment: Windows 11 x64 (10.0.26200), Node 24.22.1, npm 11.19.1, head
40f40d199ond3ab0faf5(main, 2026-11-01).npm run test:focused -- tests/boundary/cli/cliIntegerArguments.test.ts: 71/71 passed.src/cli/binaryDiagnosticsCommands.tsandsrc/cli/options.tsreset tod3ab0faf5: 12 failed / 59 passed. The defect still reproduces on currentmain.3af8e795d: 1 failed / 70 passed. The failing case is--block-size=384, which the copied bounds passed on to the service.--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.rea inspect-byte-entropy --schema --format json: byte-identical tomain.cliIntegerArguments,cliInputSchemaRequired, bothreferenceSourceSummarytests,binaryDiagnosticsMcp,analysisSummaryDetailMcp,markdownMissingSelectionWindow,localPathAdmissionCli,byteEntropy.test.ts,ByteEntropyService.test.ts): 156 passed, 4 skipped, 1 failed. The failure isByteEntropyService.test.ts > reports a changed artifact when its parent directory moves during streaming. It fails the same way on cleanmain, because it renames a parent directory while a file is open, which Windows refuses ([Bug] Windows: five artifact tests fail because they rename a parent directory while its admitted file is open #7846).npm run check:fastpassed (typecheck and lint), as didnpm run docs:checkandnpx oxfmt --checkon the changed files.Earlier hosted CI (before the 2026-11-02 upstream merge):
Static checks, one test shard andPortable testsfail the same way on maintainer PRs opened ond3ab0faf5(#8602, #8605). The causes areformat:checkon files onmain,providerVerifierCleanupandjavascriptRuntimeObservationMcp.Remaining limits: local validation was on Windows with synthetic input.
Contract and boundary impact
The change is owned by CLI argument admission.
cliDecimalFielduses the canonical field's inner number schema and its default or optionality, so the CLI copies no limits.cliIntegerArgumentis unchanged. MCP numeric inputs, provider behavior, dependencies and execution authority are unchanged. Ordinary correction within existing scope; no separate maintainer scope decision is required.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Prepared with AI assistance.
Author readiness
Human owner: @Plastic-time
Before merge
type(scope): outcome.