Repository navigation
fix(cli): reject non-decimal source-map decode deadlines - #9168
Plastic-time wants to merge 1 commit into
Conversation
Codex Review Summary: ❌ FailedThis 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. |
[Low impact] The PR appears safe to merge; no blocking issue was found. Summary
Reviews (2) · Last reviewed commit: "fix(cli): reject non-decimal source-map ..." · Reviewed by Greptile |
Summary
trace-web-source-locationalready reads its script index, line and column withcliIntegerArgument. Its--decode-timeout-msoption was still the shareddecode_timeout_msnumber, which Incur reads throughNumber(). So--decode-timeout-ms 0x1ran the owned source-map codec with a 1 ms deadline, and2e4meant 20 seconds. This change reads that option withcliDecimalField, as #8919 did for other numeric options.No issue is linked. I found this while checking which numeric CLI options still go through
Number().Problem and expected behavior
On main
bacc1e384, with thewebSourceLocationFixture()manifest, script and map written to a temporary directory:rea trace-web-source-location <manifest> 0 <map> <url> 1 0 --decode-timeout-ms=0x1 --jsonexits 1 withcode: "provider_timeout".--decode-timeout-ms=020000exits 0 and maps the position.Expected:
--decode-timeout-mstakes decimal text only, like the positionals of the same command. A non-decimal spelling is refused during argument parsing and names the field. Decimal values keep the shared 1 to 2147483647 bounds. Omitting the option still means 20000.Change and scope
src/cli/webSourceLocationCommands.ts:decodeTimeoutMsusescliDecimalField(webSourceLocationInputSchema.shape.decode_timeout_ms). The field is optional, so an omitted deadline stays absent.trace_web_source_locationis unchanged.Scope decision: not applicable. This is an ordinary fix within the existing CLI boundary.
Contract and boundary impact
webSourceLocationInputSchemaowns the bounds and the description. CLI argument parsing now admits only decimal text before it.<number>to<value>, as for the other decimal options. MCP is unchanged.docs/public/product-catalog.json), package, or installation impact: none committed.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 added or updated: "admits only a decimal source-map decode deadline" at the end of
tests/acceptance/webSourceLocationCli.test.ts. It writes the existing fixture and runs the real CLI twice.--decode-timeout-ms=0x1must giveVALIDATION_ERRORondecodeTimeoutMs.--decode-timeout-ms=020000must exit 0 withgenerated_offset: 0.Base reproduction: with main's
webSourceLocationCommands.ts(rebuilt bytest:focused), the file gives 1 failed, 4 passed. The new test receives"code": "provider_timeout"for0x1. With this change: 5 passed.User-visible CLI output for
--decode-timeout-ms=0x1:Before: exit 1,
"code":"provider_timeout".After:
{"code":"VALIDATION_ERROR","message":"REA could not read the command arguments. Check the named argument and its expected type, then try again.","fieldErrors":[{"code":"invalid_format","missing":false,"path":"decodeTimeoutMs","expected":"","received":"","message":"Expected a decimal integer"}]}Remaining proof gaps: Linux CI has not run yet. The test runs the Node codec runtime; Bun was not tried.
Boundary regressions: input admission at the CLI argument boundary, through the compiled CLI and the owned codec. Lifecycle regressions: not applicable.
For evidence-bearing changes:
Not an evidence-bearing change.
Validation performed
Windows 11, Node.js 24.22.1, base
bacc1e384.npm run test:focused -- tests/acceptance/webSourceLocationCli.test.ts: 5 passed. With main'swebSourceLocationCommands.ts: 1 failed, 4 passed.npm run typecheckandnpm run check:fast: passed.npx oxfmton the two changed files.git merge-treewith fix(artifacts): explain ASAR PE signed-after-packing mismatches #9024 and fix(application): surface web resource cleanup errors via tagged error algebra #3492, which touch these files: no new conflicts. Both already conflict with main in the same files.Compatibility, safety, and release
0x1or2e4is now refused. The deadline is documented in milliseconds, so this follows fix(cli): reject non-decimal byte-entropy window options #8919 without a breaking marker.Author readiness
Human owner: @Plastic-time
Before merge
type(scope): outcome.