Skip to content

feat(core): gate protocol dispatch on current context origin - #120

Merged
seonghobae merged 262 commits into
feat/browser-protocol-capability-requirementfrom
feat/browser-context-origin-protocol-dispatch
Aug 26, 2026
Merged

feat(core): gate protocol dispatch on current context origin#120
seonghobae merged 262 commits into
feat/browser-protocol-capability-requirementfrom
feat/browser-context-origin-protocol-dispatch

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Partial implementation of #28, stacked on exact PR #118 head 1eae12991eb5a2f91ce2d1486e9008c9ac3663e3.

Buyer/security gap

PR #116 composes current OriginWeave session/context ownership with exact browser-protocol metadata before one callback, while PR #117/#118 establish and revalidate the canonical origin for the current document. Those boundaries remain independently callable. A trusted observation/navigation adapter could still use dispatch_if_context_current without proving that the origin it just sampled from the running browser is the exact origin currently bound to that session/context/document.

Dependency

This Draft targets unchanged exact #118 head 1eae12991eb5a2f91ce2d1486e9008c9ac3663e3, transitively on #117/#116 and the browser-protocol/session stack. Keep Draft while prerequisites remain active. No prerequisite check, review, status, coverage, or mergeability evidence transfers.

TDD / RCA sequence

  1. Test-only head a726f18b4057686cef92ca91da6b6bc07d8d5afd established the missing same-call origin/protocol composition boundary before production support existed.
  2. Production reached head cf58087b87c3a54fe1665c5ed5027b07b8b913af. CI run 31591690758 passed repository contracts, formatting, workspace checks, tests and exact Production coverage, but Rust contracts failed specifically at strict Clippy. The newly added dispatch method carried an oversized positional authority/metadata argument surface; keeping that shape or allowing the lint would make the public boundary harder to call safely.
  3. The current correction introduces BrowserContextOriginDispatchTarget, grouping the exact session/context target with the freshly sampled canonical origin. dispatch_if_context_origin_current now consumes that typed authority target instead of separate positional context/origin arguments. No lint allow or quality-gate weakening was introduced.
  4. Current exact head 144895d5b86ca6b4cceeb0653638e41e9578f130 passes CI run 31597315876; Rust contracts, tests, strict Clippy, rustdoc and exact Production coverage are all successful. Manifest V3 Compatibility run 31597315791 also succeeds on the same exact head. No formal reviews or inline review threads are currently returned.

Implemented boundary

The branch now requires a typed BrowserContextOriginDispatchTarget carrying the exact OriginWeave session/context pair plus the canonical origin sampled for immediate use. The registry revalidates that origin first and returns the current DocumentEpoch; only then does the descriptor validate exact OriginWeave protocol generation, runtime protocol family, adapter version, protocol/browser revisions and required capability before invoking one callback with the non-cloneable protocol-use proof and sampled epoch.

Origin mismatch, an unbound origin after document rotation, or protocol metadata mismatch all fail before callback execution.

Truth boundary

This slice composes deterministic registry origin state with deterministic protocol metadata validation only. It does not authenticate the adapter/browser process, derive the current URL/origin from Chromium, authorize a navigation destination or network/TLS/HTTP use, create semantic observations, execute browser I/O, grant Agent capability, or prove a post-condition. A trusted runtime must derive the expected canonical origin and runtime protocol metadata from the adapter that is about to perform I/O and prevent intervening registry mutation across its larger execution transaction.


Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 12, 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: 0b427493-f1b6-4ae2-a185-61f8b94e5c32

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 and others added 28 commits August 13, 2026 00:15
Close the locateNodes result-item gap by requiring the exact node remote
type and a usable sharedId within the registry identifier budget before
an untrusted adapter value can be retained as a later handle.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Require fail-closed rejection of whitespace and control injection in
accessibility roles, accessible names, BiDi sharedIds, and registry
external identifiers before production support exists.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
…websocket-session-correlation

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

feat(core): derive explicit BiDi loopback connect targets
…websocket-endpoint

feat(core): admit bounded WebDriver BiDi WebSocket endpoints
…response-document-budget

feat(core): bound raw WebDriver BiDi response documents
…loopback-tcp-connect

feat(network): establish bounded BiDi loopback TCP transport
…locate-nodes-response-correlation

feat(core): correlate WebDriver BiDi locateNodes responses
…correlated-result-budget

feat(core): admit correlated locateNodes results fail-closed
@seonghobae
seonghobae marked this pull request as ready for review August 26, 2026 21:09
devin-ai-integration[bot]

This comment was marked as resolved.

…locate-nodes-command

feat(core): serialize bounded WebDriver BiDi locateNodes commands
…locate-nodes-response-envelope

feat(core): classify WebDriver BiDi response envelopes
@seonghobae
seonghobae changed the base branch from feat/browser-context-origin-revalidation to feat/browser-protocol-runtime-adapter-version-binding August 26, 2026 21:30
@seonghobae
seonghobae changed the base branch from feat/browser-protocol-runtime-adapter-version-binding to feat/browser-protocol-validation-evidence August 26, 2026 21:30
…-origin-epoch-protocol-dispatch

fix(core): bind protocol dispatch to observed document epoch
devin-ai-integration[bot]

This comment was marked as resolved.

…-evidence' into HEAD

# Conflicts:
#	CHANGELOG.md
#	tests/test_repository_contract.py
devin-ai-integration[bot]

This comment was marked as resolved.

…response-envelope-parser

feat(core): parse bounded WebDriver BiDi response envelopes
…ocol-dispatch' into HEAD

# Conflicts:
#	CHANGELOG.md
…335-4e79-9ce1-985ad0d8ea71-aa6b

feat(core): consume SemanticObservation proof in bind_current_nodes
@seonghobae
seonghobae changed the base branch from feat/browser-protocol-validation-evidence to feat/browser-protocol-capability-requirement August 26, 2026 21:59
…-requirement' into HEAD

# Conflicts:
#	CHANGELOG.md
#	crates/originweave-core/src/lib.rs
#	tests/test_repository_contract.py

@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 4 new potential issues.

Open in Devin Review

Comment thread crates/originweave-core/src/browser_registry.rs
@seonghobae
seonghobae merged commit 3a1c63d into feat/browser-protocol-capability-requirement 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.

2 participants