Skip to content

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

Merged
seonghobae merged 129 commits into
cursor/bc-76ee265e-c335-4e79-9ce1-985ad0d8ea71-aa6bfrom
feat/webdriver-bidi-response-envelope-parser
Aug 26, 2026
Merged

feat(core): parse bounded WebDriver BiDi response envelopes#186
seonghobae merged 129 commits into
cursor/bc-76ee265e-c335-4e79-9ce1-985ad0d8ea71-aa6bfrom
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 raw WebDriver BiDi response documents before parsing. This branch completes the bounded response-envelope/result path: exact success/error parsing, response-id correlation, typed protocol-error preservation, wire-derived result.nodes admission, and direct binding of admitted wire nodes to current OriginWeave session/context/origin/document-epoch authority without allowing a caller-selected intermediate result to replace wire evidence.

It also admits raw response bytes only under the same 65,536-byte product safety budget before UTF-8 validation. The reviewed current WebDriver BiDi error vocabulary is retained as WebDriverBiDiErrorCode; unknown protocol text remains fail closed.

Current implemented boundary

Current exact head a11b838823b185829267ea0c3cccbcaeb0793f2c:

  • checks raw byte length before UTF-8 decoding and returns typed DocumentTooLarge / InvalidUtf8 outcomes;
  • parses the complete response object with bounded JSON depth/top-level-field handling and decoded duplicate-field rejection;
  • requires exact success/error envelope shapes and protocol-range response IDs;
  • retains the reviewed WebDriver BiDi protocol error as a typed value and rejects unknown error-code text;
  • correlates a non-null exact response ID to the consumed WebDriverBiDiLocateNodesCommand while preserving nullable error responses as explicitly uncorrelatable;
  • derives result.nodes from the same validated wire document and preserves the exact command maxNodeCount budget;
  • rejects malformed, duplicate, non-node, missing-metadata, and over-budget node batches fail closed;
  • composes wire-derived admission directly into current session/context/origin/document-epoch node binding through bind_response_document_nodes; and
  • grants no Chromium/ChromeDriver/WebSocket/TLS/adapter authenticity, policy authorization, typed action execution, or post-condition evidence merely from protocol compatibility.

GitHub reports the Draft mergeable against the exact live prerequisite. Keep Draft while #185 and its prerequisite stack remain active.

Test-first / repair lineage

Earlier RED→GREEN cycles established complete-envelope parsing, exact correlation, hostile JSON/resource bounds, raw-byte admission, wire-derived node admission, and current-authority binding.

The compatible contributor delta after b0c29ac48b66f81c0e59ce4abc625c04d1ddfd2f added typed WebDriver BiDi protocol-error preservation through the complete wire admission path and removed an unreachable success-conversion edge. Exact current tests additionally prove that a correlated wire error remains typed and that an error response with id: null remains uncorrelatable before protocol-error admission.

No catch-all exception handling, retry loop, silent fallback, transport authority, parser-budget increase, or gate weakening was introduced.

Exact-current GREEN evidence

On unchanged exact head a11b838823b185829267ea0c3cccbcaeb0793f2c against unchanged exact prerequisite afe81c45b5d5be09f980bbd1dd153874b628fef1:

  • CI run 32211029081: success;
  • Rust contracts job 95943581967: checkout explicitly used exact SHA a11b838823b185829267ea0c3cccbcaeb0793f2c; repository contracts, canonical formatting, locked workspace/all-target check, full tests, strict Clippy, and rustdoc all success under Rust 1.97.1;
  • Production coverage job 95943581926: exact owned-production function/line/region/branch measurement and enforcement success;
  • Manifest V3 Compatibility run 32211029060: success;
  • formal reviews currently returned: none;
  • inline review threads currently returned: none; and
  • GitHub reports this Draft mergeable against its exact live prerequisite.

Security/SAST/central review workflows absent for this stacked feature-base head 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

docs/doctoring/browser-agent-protocols.md records the reviewed primary WebDriver BiDi sources and compatibility consequences. OriginWeave's JSON/document/node/raw-byte limits are product safety budgets rather than protocol maxima, and protocol compatibility never substitutes for authenticated transport or OriginWeave authority.

This slice still does not authenticate Chromium, ChromeDriver, WebSocket/TLS provenance, or an adapter process; authorize a typed Agent action; execute browser I/O; or prove a post-condition. Those remain later trusted-runtime boundaries. Child Draft #188 begins the next bounded transport-endpoint admission step without claiming those authorities.

Passing automation is not independent approval. Protected-main AGENTS.md forbids this scheduled actor from merging, self-approving, altering workflows, adding secrets, weakening checks, tagging, or publishing.


Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: 8de535c7-3785-40fc-85bd-3f1fdd5335c5

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.

…websocket-handshake-request

feat(network): serialize bounded BiDi WebSocket opening request
…socket-peer-verification

feat(core): verify exact BiDi socket peer identity
…websocket-session-correlation

feat(core): correlate BiDi WebSocket endpoint with exact session
…explicit-connect-target

feat(core): derive explicit BiDi loopback connect targets
@seonghobae
seonghobae marked this pull request as ready for review August 26, 2026 20:55
…websocket-endpoint

feat(core): admit bounded WebDriver BiDi WebSocket endpoints
…loopback-tcp-connect

feat(network): establish bounded BiDi loopback TCP transport
@seonghobae
seonghobae changed the base branch from feat/webdriver-bidi-response-document-budget to feat/webdriver-bidi-correlated-result-budget August 26, 2026 20:58
devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae
seonghobae changed the base branch from feat/webdriver-bidi-correlated-result-budget to feat/webdriver-bidi-locate-nodes-response-envelope August 26, 2026 21:08
devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae
seonghobae changed the base branch from feat/webdriver-bidi-locate-nodes-response-envelope to cursor/bc-76ee265e-c335-4e79-9ce1-985ad0d8ea71-aa6b August 26, 2026 21:30

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

@seonghobae
seonghobae merged commit 51d4182 into cursor/bc-76ee265e-c335-4e79-9ce1-985ad0d8ea71-aa6b Aug 26, 2026
5 checks passed
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