Repository navigation
fix(capture): report an out-of-range record ordinal as a selection fault - #7067
Conversation
inspect_web_network_capture reported a record_ordinals entry past the capture's records as an invalid_format issue on record_ordinals, with no bounds. It is now an out_of_range issue on that entry (record_ordinals[i]) with minimum 0 and maximum total_records - 1, or invalid_value when the capture has no records.
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. |
[Medium impact] The PR appears safe to merge. SummaryThe PR reports missing selected records as selection errors rather than malformed captures.
No actionable defects or new security issues were found. Tests were inspected, not executed. Supersession could not be checked because GitHub access required authentication. Adolanium explicitly acknowledged the missing dedicated test: “Remaining proof gaps: the empty-capture branch ( Reviews (1) · Last reviewed commit: "fix(capture): report an out-of-range rec..." · Reviewed by Greptile |
Summary
Fixes #7068.
inspect_web_network_capturereports arecord_ordinalsentry past the end of a valid capture as aninvalid_formatissue onrecord_ordinals, with no bounds. The request is well formed; the caller selected an ordinal the capture does not have. The issue is nowout_of_rangeon that entry, with the valid bounds, as #6979 did forscript_index.Problem and expected behavior
WebNetworkCaptureService.#projectCapturereturned{ path: ["record_ordinals"], reason: "invalid_format" }whensafeValue.records[ordinal]was missing.docs/web-network-captures.mddescribes out-of-range selections as input errors, andAnalysisInputIssuedefinesout_of_rangewithminimum/maximumso a client can correct the request. Withinvalid_format, a client is told the request is malformed and gets no range.Expected:
{ path: ["record_ordinals", i], reason: "out_of_range", minimum: 0, maximum: total_records - 1 }for the first out-of-range entryi, andinvalid_valuewhen the capture has no records.Change and scope
src/application/WebNetworkCaptureService.ts: the out-of-range branch reports the entry's index in the path and the bounds fromtotal_records, which the service already checks equalsrecords.length. The message is unchanged.Not included: the duplicate-ordinal and protobuf-without-ordinals checks keep their current issues.
Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contribution scope: not applicable. This is a fix inside the existing web network capture inspection.
Contract and boundary impact
WebNetworkCaptureService.#projectCapture, where the selected ordinals are resolved.invalid_request; the issue reason, path and bounds change as described.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): 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
src/application/WebNetworkCaptureService.test.ts, "reports an ordinal past the capture's records as an out-of-range selection": withrecord_ordinals: [0, 5]on the fixture capture, the projected error isinvalid_requestwithdetails.issues[{ path: ["record_ordinals", 1], reason: "out_of_range", minimum: 0, maximum: total_records - 1 }]. The existing "rejects invalid caller selection" cases still pass.WebNetworkCaptureService.tsfrom upstream/main 8e6a957 and the new test, the test fails.invalid_requestdetails for an out-of-rangerecord_ordinalsentry (CLI--record).invalid_value) has no dedicated test.For evidence-bearing changes:
Validation performed
On Linux (WSL Ubuntu, Node 24.22.1) at 9513da7 (on upstream/main 8e6a957), after
npm ciandnpm run build:cached:npx tsc -p . --noEmitpassed.npx oxfmt --checkon the changed files: clean.node scripts/ci/static-check-report.mjs lint: 0 errors.npx vitest run src/application/WebNetworkCaptureService.test.ts tests/acceptance/tools/harBoundaryFacts.test.tsand the HAR boundary tests: 51 passed, in two runs.Compatibility, safety, and release
Author readiness
Human owner: @Adolanium
Before merge
type(scope): outcome.