Skip to content

feat(core): parse bounded WebDriver BiDi response envelopes - #186

Draft
seonghobae wants to merge 40 commits into
feat/webdriver-bidi-response-document-budgetfrom
feat/webdriver-bidi-response-envelope-parser
Draft

feat(core): parse bounded WebDriver BiDi response envelopes#186
seonghobae wants to merge 40 commits into
feat/webdriver-bidi-response-document-budgetfrom
feat/webdriver-bidi-response-envelope-parser

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Stacked on exact PR #185 head afe81c45b5d5be09f980bbd1dd153874b628fef1.

Buyer/security gap

#185 bounds the raw WebDriver BiDi response document before parsing. This branch first added complete fail-closed response-envelope parsing and then closed the next local integration gap: one consuming boundary takes that exact bounded document through complete parsing and the existing exact in-flight locateNodes command correlation contract, without allowing caller-selected kind/id metadata to bypass document parsing.

A current-spec audit also found one concrete interoperability defect on this canonical parser branch: the reviewed WebDriver BiDi Editor’s Draft ErrorCode vocabulary includes no such client window, but OriginWeave’s closed error-code admission set omitted it. Unknown protocol text must still fail closed, so the repair adds only the reviewed code rather than broadening parsing.

Test-first / repair lineage

  1. Earlier test-first heads established complete-document parsing, decoded top-level field uniqueness, exact success/error payload requirements, explicit JSON depth/top-level-field budgets, preservation of exact admitted wire text, and bounded-document → parse → exact-id correlation. The integration RED at e9d90dfa73552a8d0dd4e1d022478864b3300167 was observed in CI run 32106400534; the smallest production repair reused the existing parser and correlation implementations rather than duplicating either authority boundary.
  2. The current-spec ErrorCode defect was proven RED at exact test-only head f5e087d58f5540993946c5f4057bef3f1623def9. CI run 32114308435, Rust contracts job 95640284991, checked out that exact head and failed specifically because parser_accepts_current_webdriver_bidi_error_code_vocabulary rejected no such client window.
  3. Production head 4077a79a49d77cb929a3818371b33c6e90cc7f56 added exactly no such client window to the closed reviewed ErrorCode set. Unknown values remain rejected; no fallback, retry, catch-all, or success conversion was introduced.
  4. That head exposed a separate strict-test-contract failure: CI run 32114516094, Rust contracts job 95640912016, rejected the new unknown-code regression for use of expect_err() under repository -D clippy::expect-used. Head b7e5ba55090f22fefefd89bab638858ca42610d1 replaced that panic-prone assertion with an explicit match while preserving the exact fail-closed parser-error check.
  5. Current head 9d39c5907c8d983d8c446f6f1df9654990576c60 records the reviewed current BiDi ErrorCode contract and authority consequences in docs/doctoring/browser-agent-protocols.md. The existing Unreleased changelog already describes the bounded response parser/correlation boundary and remains accurate.

No predecessor-head check or review evidence transfers to the resulting exact head.

Implemented contract

Current exact head 9d39c5907c8d983d8c446f6f1df9654990576c60:

  • admits only an already-bounded WebDriver BiDi response document from feat(core): bound raw WebDriver BiDi response documents #185;
  • parses the complete response object and retains the existing typed success/error kind plus protocol-range response id contract;
  • rejects duplicate decoded top-level fields, malformed/over-budget JSON, invalid success/error payload shapes, and invalid ids through the existing parser boundary;
  • admits the reviewed current WebDriver BiDi ErrorCode vocabulary, including no such client window, while rejecting unknown error-code text fail closed;
  • consumes the WebDriverBiDiLocateNodesCommand and feeds only parsed response kind/id into the existing exact command-correlation boundary;
  • rejects a mismatched response id, a success response without a usable id, and an error response with id: null as uncorrelatable;
  • preserves parser versus correlation failure classes in WebDriverBiDiLocateNodesResponseDocumentError and preserves nested causal errors via std::error::Error::source();
  • does not broadly catch, retry, suppress, or convert protocol/integrity failures into success; and
  • grants no browser, adapter, session/context/origin, destination, TLS/transport, node, policy, secret, typed-action, execution, or post-condition authority.

Exact-current GREEN evidence

On unchanged exact head 9d39c5907c8d983d8c446f6f1df9654990576c60 against unchanged exact prerequisite afe81c45b5d5be09f980bbd1dd153874b628fef1:

  • CI run 32115080633: success;
  • Rust contracts job 95642656079: repository contracts, canonical formatting, locked workspace/all-target check, full tests, strict Clippy, and rustdoc success;
  • Production coverage job 95642656053: exact owned-production function, line, region, and branch measurement and enforcement success;
  • Manifest V3 Compatibility run 32115080487: success;
  • both current ErrorCode regressions pass: the reviewed current vocabulary is admitted and unknown error-code text remains rejected;
  • formal reviews returned by the fresh exact-head refetch: none;
  • inline review threads returned by the fresh exact-head refetch: none; and
  • GitHub reports this Draft mergeable against its exact live prerequisite.

Protected-main-only security/central review workflows absent for this stacked Draft are absent, not passing. No predecessor-head, prerequisite-head, queued, skipped, cancelled, stale, synthetic, status-only, or model-only evidence is promoted as current proof.

Standards / truth boundary

The latest published W3C technical-report baseline reviewed by this branch remains the 1 June 2026 Working Draft; the current Editor’s Draft reviewed on 18 August 2026 identifies itself as the 20 July 2026 draft. docs/doctoring/browser-agent-protocols.md records those APA 7 primary-source references and the closed current ErrorCode vocabulary consequence. OriginWeave’s JSON size/depth/field budgets are product safety limits rather than protocol maxima, and protocol compatibility never substitutes for authenticated transport or OriginWeave authority.

This slice still does not authenticate Chromium, ChromeDriver, or WebSocket/TLS transport provenance; validate locateNodes node payload semantics beyond the separately owned admission boundary; mint OriginWeave node authority; authorize an Agent action; execute browser input; or prove a post-condition. Those remain later trusted-runtime boundaries.

Keep Draft while #185 and its prerequisite stack remain active. Passing automation is not independent approval. This scheduled actor does not merge, self-approve, alter workflows, add secrets, weaken checks, tag, or publish.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c7a5e8d1-7652-4eec-8b5f-183367ddec8a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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