Skip to content

feat(core): admit correlated locateNodes results fail-closed - #184

Draft
seonghobae wants to merge 14 commits into
feat/webdriver-bidi-locate-nodes-response-envelopefrom
feat/webdriver-bidi-correlated-result-budget
Draft

feat(core): admit correlated locateNodes results fail-closed#184
seonghobae wants to merge 14 commits into
feat/webdriver-bidi-locate-nodes-response-envelopefrom
feat/webdriver-bidi-correlated-result-budget

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Stacked on exact PR #183 head 13a8a1a799a8098b1305876c9d0f318d0acaa6d1.

Buyer/security gap

The WebDriver BiDi stack could prove that a success envelope belongs to the exact consumed browsingContext.locateNodes command and retain the command's serialized maxNodeCount, but downstream code still needed one composition boundary that admitted the exact returned node batch and bound those nodes to current OriginWeave browser authority without allowing a stale/missing origin binding to mint handles.

The W3C WebDriver BiDi contract makes the locateNodes result an array of remote node values bounded by maxNodeCount. This child consumes exact command-correlation evidence, checks the exact result budget before item normalization, requires every admitted item to be a node with usable sharedId, and then binds admitted nodes only through exact current session/context/origin/document-epoch authority plus a validated WebDriver BiDi SemanticObservation proof.

Test-first lineage

  1. Earlier test-only and formatting heads established the missing correlated-result budget/admission API; the semantic RED was CI 32069128415, Rust contracts job 95508200722, which reached workspace compilation and failed because WebDriverBiDiLocateNodesResultAdmissionError and ValidatedWebDriverBiDiLocateNodesResponse::admit_result_nodes did not exist.
  2. Production heads through fe8bbf2b3fc57ebb5d7c95ec684d2ad77b9ff89c added/exported the non-cloneable correlated result batch and typed admission errors, checking exact result budget before remote-node normalization.
  3. The branch subsequently advanced compatibly to cfee13a04ac4ff7d51321d539035f979fc8dfebf, adding current OriginWeave authority binding for the admitted result. Exact CI 32075342997 showed Rust contracts green but Production coverage failed by exactly one LLVM region while functions/lines/branches remained complete.
  4. Exact coverage artifact exact-coverage-cfee13a04ac4ff7d51321d539035f979fc8dfebf localized the sole uncovered region to the error arm of BrowserAuthorityRegistry::require_context_origin(...) inside ValidatedWebDriverBiDiLocateNodesResult::bind_current_nodes.
  5. The missing realistic case was a document advance that clears current origin binding before the correlated result is consumed. Current test-only repair head 31faaac806ed98384fc84a759b96af94573a3955 adds correlated_result_rejects_missing_current_origin_binding: after advance_document, binding fails closed as BrowserRegistryError::ContextOriginNotBound rather than minting a node handle. No production behavior or gate was weakened.

Implemented contract

Current exact head 31faaac806ed98384fc84a759b96af94573a3955:

  • retains exact correlated command id, browsing context, and command maxNodeCount;
  • enforces result count before normalizing any remote node;
  • admits only remote type node with a usable sharedId;
  • requires exact WebDriver BiDi protocol family plus SemanticObservation capability proof before current-node binding;
  • requires the result's external browsing-context identifier to match the OriginWeave context being bound;
  • requires a currently bound canonical origin for the exact session/context;
  • requires the exact expected document epoch immediately before node minting;
  • fails closed on missing current origin binding, stale document epoch, wrong protocol/capability, cross-context rebinding, malformed node shape, result-budget overflow, and identifier-space exhaustion; and
  • keeps multi-node binding transactional when identifier allocation cannot complete.

The result/binding evidence is non-cloneable where consumption matters and does not make raw protocol identifiers durable Agent authority.

Exact-current GREEN evidence

On unchanged exact head 31faaac806ed98384fc84a759b96af94573a3955 against unchanged exact prerequisite 13a8a1a799a8098b1305876c9d0f318d0acaa6d1:

  • CI run 32076614947: success;
  • Rust contracts job 95531086443: repository contracts, canonical formatting, locked workspace check, full tests, strict Clippy, and rustdoc success;
  • Production coverage job 95531086494: exact owned production function/line/region/branch measurement and enforcement success;
  • Manifest V3 Compatibility run 32076615049: success;
  • formal reviews currently returned: none;
  • inline review threads currently returned: none; and
  • GitHub reports the Draft mergeable against its exact live prerequisite.

Skipped formatting-diagnostic helper steps are not passing evidence. Required protected-main central Security/SAST/OpenCode/Noema/Strix workflows not generated for this stacked Draft remain absent, not passing. No predecessor-head, prerequisite-head, stale, synthetic, status-only, or model-only evidence is promoted.

Truth boundary

This slice now proves structured correlated-result admission and current OriginWeave session/context/origin/document-epoch binding for node handles. It still does not parse/authenticate a raw BiDi JSON envelope, authenticate Chromium or the adapter process, perform browser transport I/O, prove that a structured result actually came from the authenticated browser wire, authorize an Agent policy decision or typed input, execute a browser action, or verify a post-condition. Those remain separate reviewed boundaries.

Keep Draft while #183 and its prerequisite stack remain active. No predecessor checks/reviews transfer. This scheduled actor does not merge, self-approve, alter workflows, add secrets, weaken checks, tag, or publish.

@coderabbitai

coderabbitai Bot commented Aug 17, 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: 8179ba0c-8a9c-4460-9b0d-e1d5767e24a2

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 changed the title feat(core): bind locateNodes result budget to response correlation feat(core): admit correlated locateNodes results fail-closed Aug 17, 2026
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