Skip to content

feat(network): exchange bounded BiDi locateNodes over WebSocket - #205

Merged
seonghobae merged 123 commits into
feat/webdriver-bidi-websocket-frame-transportfrom
feat/webdriver-bidi-websocket-locate-nodes-exchange
Aug 26, 2026
Merged

feat(network): exchange bounded BiDi locateNodes over WebSocket#205
seonghobae merged 123 commits into
feat/webdriver-bidi-websocket-frame-transportfrom
feat/webdriver-bidi-websocket-locate-nodes-exchange

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Stacked on live PR #204 branch feat/webdriver-bidi-websocket-frame-transport at exact base c1bc7e78f3a9debf4f517fb6b5f11dd67be4ad92.

Buyer/runtime boundary

This branch composes the bounded BiDi browsingContext.locateNodes command/response contract with the peer-verified RFC 6455 frame transport. WebDriverBiDiWebSocketEstablished::exchange_locate_nodes serializes the exact command into one masked client text frame, applies one end-to-end deadline plus per-frame ceilings, bounds interleaved Ping/Pong handling and fragmented text-response work, subjects response bytes to bounded UTF-8/document admission, correlates the response to the exact command id, and returns only normalized untrusted node evidence. exchange_locate_nodes_and_bind_current_nodes performs current authority binding only after that wire exchange succeeds.

Current reconstruction and masking-key contract

The child was reconstructed non-destructively on the live #204 exact tree; predecessor checks/reviews are not transferred. Ping handling checks the remaining exchange budget before drawing caller-owned Pong entropy and checks it again before wire write, so callback time is charged while already-expired exchanges consume zero entropy.

RFC 6455 requires a fresh unpredictable 32-bit client masking key per frame; it does not require lifetime or exchange-wide uniqueness. The current exchange therefore rejects only an immediately adjacent client-key repeat. A later independently generated random collision after an intervening different key remains admissible. Real loopback TCP/RFC 6455 regressions cover both adjacent fail-closed reuse and the valid A-B-A collision path. The diagnostic states this adjacent rule precisely rather than claiming that any key previously used in the exchange is rejected.

The response path admits at most 64 interleaved Ping/Pong control frames, at most 256 text-message fragments, and the existing bounded response-document byte budget. Binary/Close/reserved/orphan-continuation/second-data-message shapes fail closed. Review observations about the initial-fragment count, the core bind helper, and the single-final-frame byte guard were verified against current source as non-defects: the first data frame establishes fragment 1; the network wrapper already holds a validated wire result; and a final unfragmented text payload is still subjected to BoundedWebDriverBiDiResponseDocument::from_utf8_bytes, which enforces the same 65,536-byte document budget before parsing/correlation.

Exact-current evidence

Current exact head: df321a8f8694579b5eab83ad84497b097cc30807.
Current exact base: c1bc7e78f3a9debf4f517fb6b5f11dd67be4ad92.

  • Predecessor head dec5092494fbcd9de0e7a397d014c3607364f3fd reached CI run 32988891086 and failed in the realistic loopback regression locate_nodes_command_mask_reuse_fails_before_second_wire_write: the test still expected the superseded lifetime-reuse diagnostic even though production had correctly moved to the adjacent-key contract.
  • Current head df321a8f8694579b5eab83ad84497b097cc30807 repairs that exact test-harness contract drift by matching the production diagnostic client masking key was reused for consecutive frames on this established WebSocket; the wire-level assertion that no second frame is emitted after adjacent-key rejection remains unchanged.
  • GitHub currently exposes no pull-request workflow/check run bound to df321a8f8694579b5eab83ad84497b097cc30807, so no CI, exact production coverage, rustdoc, SAST, Security Scan, OpenCode, Noema, Strix, or other scanner result is promoted as exact-current passing evidence.
  • Current inline review threads are resolved after either source repair or exact current-source verification of information-only findings.
  • There is no qualifying independent APPROVED review for this exact head.

Safety boundary

This slice does not authenticate Chromium/ChromeDriver process provenance, widen TLS/destination authority, authorize typed input or policy, inherit ambient authority, or prove a browser post-condition. Failures consume the affected transport state rather than manufacturing reusable success.

Protected-main AGENTS.md remains authoritative. No merge, self-approval, force-push, destructive rebase, workflow/ruleset/secret mutation, tag, release, publish, or stale-evidence promotion is part of this branch update.

@coderabbitai

coderabbitai Bot commented Aug 20, 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: 052abde3-13b1-47a7-aced-38de58e52b90

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.

@seonghobae
seonghobae marked this pull request as ready for review August 26, 2026 12:44
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae
seonghobae merged commit 6c5ef5e into feat/webdriver-bidi-websocket-frame-transport Aug 26, 2026
4 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