feat(browser): add versioned WebDriver BiDi presentation boundary - #293
feat(browser): add versioned WebDriver BiDi presentation boundary#293seonghobae wants to merge 40 commits into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Fresh authoritative re-check on 2026-09-07 supersedes my earlier correction in this comment. The canonical W3C latest-published URL now resolves to WebDriver BiDi Working Draft, 3 September 2026 ( The substantive capability finding remains and is confirmed against the 3 Sep draft: Fresh exact-head CI adds an independent code-current RED on |
|
Current-head execution/PR-state checkpoint — exact I returned this PR to Draft because the live tree and hosted evidence no longer match the body’s “test-only” checkpoint or a Ready state. CI Standards traceability also needs repair. A fresh canonical W3C check now resolves Existing #292 writer lease remains the source/docs owner. Preserve this executed RED and repair in that lane: repository workspace contract first; then test-first capability/traceability correction; then minimal production change and exact-head Rust/Python/coverage/Clippy/rustdoc evidence. Do not create an overlapping source writer, do not transfer predecessor/coverage-only GREEN, and keep this PR Draft until those findings are resolved. |
seonghobae
left a comment
There was a problem hiding this comment.
Exact-head standards/provenance finding for 9f11b0c8268890b0620c94b6975d461f67511afa: the new test pinned_revision_tracks_current_published_working_draft currently requires 2026-09-03, but 3 September 2026 is the WebDriver BiDi Editor’s Draft (https://w3c.github.io/webdriver-bidi/), not a W3C published Working Draft. W3C’s current standards/publication index identifies 18 August 2026 as the published WebDriver BiDi Working Draft (https://www.w3.org/TR/, WebDriver → WebDriver BiDi; see also https://www.w3.org/TR/webdriver-bidi/all/). This means the test-first head is about to force a provenance regression: production’s WEBDRIVER_BIDI_PRESENTATION_REVISION = "2026-08-18" is aligned with the published-WD contract named by its rustdoc, while the test and PR body mislabel a mutable Editor’s Draft date as “latest-published”.
Do not observe this assertion failing and then change production to 2026-09-03 under the existing Published WebDriver BiDi Working Draft revision contract. Repair the test/provenance first. If this adapter is intentionally pinned to W3C published snapshots, retain 2026-08-18 and re-derive the Screen/Languages/other complete-surface RED against that exact 18-August snapshot. If the product instead wants to consume the 3-September Editor’s Draft, make that a distinct explicit contract (EditorDraft provenance), pin an immutable upstream commit/snapshot rather than the mutable w3c.github.io head, and update ADR/TRACEABILITY accordingly. Do not mix capability claims from the Editor’s Draft into a published-WD version identifier.
The existing partial-surface concern remains independently valid in principle, but its acceptance evidence must be evaluated against the version actually named by the contract. This review is advisory, does not clear the Draft, and does not authorize source mutation while the repository-wide writer lease remains active.
seonghobae
left a comment
There was a problem hiding this comment.
Second exact-head standards finding after resolving the publication-date provenance: PresentationSurface::ReducedMotion also cannot remain in the 18 August 2026 published WebDriver BiDi complete-surface set. The current W3C published snapshot’s EmulationCommand union includes forced-colors, geolocation, locale, network conditions, screen orientation/settings, scripting, scrollbar, timezone, touch, and user-agent overrides, but has no emulation.setMediaFeaturesOverride; the published document also contains no prefers-reduced-motion. By contrast, the mutable Editor’s Draft has subsequently carried media-feature work. Current #293 production and its new test both still assert ReducedMotion is standard-BiDi-complete, so simply repairing the date assertion to 2026-08-18 would leave a version-mixed capability map.
Please make the next test-first repair version-coherent: for the PublishedWorkingDraft(2026-08-18) contract, remove ReducedMotion from webdriver_bidi_presentation_surfaces() as well as incomplete Screen and ordered Languages; keep Viewport, DevicePixelRatio, and TimeZone only where the exact 18-August normative commands fully cover the canonical OriginWeave surface semantics. Then re-evaluate the canonical MissingSurface(...) ordering against that exact set rather than hard-coding an error derived from a mixed-version map. If future work adopts media-feature emulation from an Editor’s Draft, that belongs behind separately pinned immutable EditorDraft provenance and browser-version evidence, not under the 18-August published-WD identifier.
Authoritative evidence: W3C Standards/Drafts index and BTT publication page list WebDriver BiDi Working Draft 18 August 2026; the current published /TR/webdriver-bidi/ command union has no media-features command and no reduced-motion token. This is a standards/capability provenance correction only; it does not authorize source mutation while the repository-wide writer lease is active.
seonghobae
left a comment
There was a problem hiding this comment.
Correction to my immediately preceding ReducedMotion review (5134344240): retract that finding. I verified the exact upstream Git history instead of relying on the stale /TR/ body cache. In w3c/webdriver-bidi, commit 1e5e36c43adbe24f2a4052c2ec091635c006c352 on 18 August 2026 is list media features (#1149); its parent already contains emulation.setMediaFeaturesOverride with a generic media-feature name/value shape, and the commit changes that shape to an explicit feature map including "prefers-reduced-motion": "no-preference" / "reduce" / null. The cached W3C /TR/ content I inspected was still rendering the 29-June document despite the publication index having advanced to 18 August, so it was not valid evidence that the 18-August snapshot lacked media-feature emulation.
Accordingly, do not remove ReducedMotion on the basis of review 5134344240. The first review (5134336501) remains valid: W3C’s fresh standards/publication index lists 18 August 2026 as the latest published Working Draft, so the current test’s 2026-09-03 “latest-published” assertion is a provenance error unless the contract is deliberately changed to an immutable Editor’s Draft pin. Screen and ordered Languages still require exact 18-August semantic comparison before changing their completeness classification. This correction preserves the upstream-history evidence and supersedes only the ReducedMotion claim.
seonghobae
left a comment
There was a problem hiding this comment.
Exact-head refinement after checking the 18-August upstream source history: use an immutable specification identity, not a bare date, for the capability map. On 18 August itself, w3c/webdriver-bidi changed the media-feature CDDL at commit 1e5e36c43adbe24f2a4052c2ec091635c006c352 (list media features (#1149)): its parent already had emulation.setMediaFeaturesOverride with generic name/value entries, while that commit changed the same command to an explicit map containing prefers-reduced-motion. A date-only WEBDRIVER_BIDI_PRESENTATION_REVISION = "2026-08-18" therefore does not by itself prove which normative/source snapshot the adapter audited.
For the published-WD contract, bind provenance to the immutable W3C dated-TR identity (and record the upstream commit/digest used for doctoring if available), then derive the capability set from that exact snapshot. The same-day upstream source confirms two existing completeness concerns: emulation.ScreenArea contains only width and height, so it cannot certify OriginWeave’s canonical Screen surface if that surface also requires color depth; emulation.setLocaleOverride takes one locale string/null, so it cannot certify an ordered multi-language vector by itself. Conversely, prefers-reduced-motion is explicitly represented in the 18-August upstream media-feature work, so retain ReducedMotion unless the actual dated published snapshot proves otherwise.
Recommended test shape: assert (document_kind, immutable_spec_uri_or_digest) first, then assert semantic completeness per canonical PresentationSurface. Do not use a test named “tracks current published working draft”: a release-quality adapter must stay pinned even when W3C publishes a later draft. This supersedes the retracted ReducedMotion claim and sharpens review 5134336501; it does not authorize source mutation while another repository writer remains active.
|
Writer lease ACTIVE — fresh bounded lane for #293 standards/provenance repair at exact head |
|
Writer lease RELEASED — exact head |
seonghobae
left a comment
There was a problem hiding this comment.
Fresh authoritative correction for exact f0a3b66a4ff3034d8a4e23e9b75ca2679fd0d3de: the current W3C publication record now unambiguously lists WebDriver BiDi Working Draft, 3 September 2026 as the latest published revision. The canonical /TR/webdriver-bidi/ cover page identifies https://www.w3.org/TR/2026/WD-webdriver-bidi-20260903/ as “This version”, and W3C’s publication history lists 3 Sep, 1 Sep, 25 Aug, 24 Aug, then 18 Aug. Therefore the present WEBDRIVER_BIDI_PRESENTATION_REVISION = "2026-08-18" and pinned_revision_tracks_current_published_working_draft assertion are stale under their own “current published Working Draft” contract. This supersedes my later reviews 5134336501 / 5134344240, which incorrectly reclassified 3 Sep as Editor’s Draft-only; the earlier issue comments 5566991642 and 5568974198 had the publication state right.
The capability conclusion does not reverse with the date repair. In the dated 3 Sep WD, emulation.ScreenArea is still { width, height }, so standard BiDi still cannot satisfy #229’s coarse PresentationSurface::Screen invariant if that invariant also includes color depth. emulation.setLocaleOverride still takes one locale, so it still cannot certify the complete ordered Languages vector. Conversely, the dated 3 Sep WD does include emulation.setMediaFeaturesOverride with prefers-reduced-motion, so ReducedMotion should not be removed merely because of the superseded 18-Aug review.
Repair order: first restore a provenance RED requiring 2026-09-03 (or explicitly rename the contract if 18 Aug is intentionally a compatibility pin rather than “current published”); then update the publication/TRACEABILITY evidence without guessing source identity. The existing 1e5e36c... commit can remain historical evidence for the media-feature semantics it introduced, but it is not a same-day 3 Sep source snapshot. If a 3 Sep upstream SHA is required, establish its equivalence to the dated TR before promoting it; do not infer it only from commit date. After provenance is coherent, preserve the semantic RED that excludes complete Screen and Languages while retaining ReducedMotion, then make the minimal capability-map repair and obtain exact-head Rust/Python/coverage/Clippy/rustdoc evidence.
Current CI 34166151155 on this exact head is terminal skipped, so none of these assertions has executed on f0a3b66...; skipped is neither RED nor GREEN. Keep Draft. This review is advisory only and does not authorize source/docs mutation while the repository-wide writer lease is active.
|
Writer lease ACTIVE — fresh bounded #293 standards/provenance repair at exact |
seonghobae
left a comment
There was a problem hiding this comment.
Exact-head standards/cleanup review on 95f25789e555e83d65e6a828634c3fe2023b3582: fresh canonical W3C publication evidence now identifies the 3 September 2026 WebDriver BiDi document as the published Working Draft (/TR/2026/WD-webdriver-bidi-20260903/), with the Editor’s Draft linked separately. The earlier 18-August latest-publication correction is superseded.
The repair also closes a distinct cleanup-contract gap. The presentation plan sets viewport/DPR, timezone, and reduced-motion state, but predecessor cleanup only reset viewport/DPR. The pinned WD provides nullable reset paths for all three protocol configurations: null viewport/DPR restores the default/removes DPR override; timezone: null removes the timezone override; features: null unsets the media-feature override configuration. Current source therefore adds typed ResetTimezone and ResetMediaFeatures intents and makes plan_standard_presentation_cleanup return all three reset intents. This still proves only planning, not command transport, ACK, page-observed cleanup, or reuse safety.
Do not promote this Draft. Exact CI 34208766106 is terminal skipped, so this head has no executed hosted Rust/Python/Clippy/rustdoc/100%-coverage GREEN. ARCHITECTURE.md, CHANGELOG.md, and docs/doctoring.md also still carry the superseded 18-August / viewport-only cleanup wording and must be repaired before documentation completeness is claimed.
|
Writer lease RELEASED — bounded #293 repair published through exact |
|
Writer lease ACTIVE — exact |
seonghobae
left a comment
There was a problem hiding this comment.
Exact-head cleanup-ownership finding on 212a0ae2910cf62ba144db7cc0ff503e73d2f1cc: the typed cleanup is now symmetric in surface count, but ResetMediaFeatures is not yet proven symmetric in authority. In the 3 September 2026 W3C WD, emulation.setMediaFeaturesOverride stores one media-feature override configuration for the target scope, and features: null converts that configuration to unset; it is not a scoped “undo only prefers-reduced-motion that OriginWeave set” operation. The current enum rustdoc says “Remove media-feature overrides set for this presentation plan”, yet the planner neither snapshots the pre-existing configuration nor carries proof that the target context/user-context is exclusively owned by this presentation lifecycle.
Treat this as the next browser-runtime RED after the bounded documentation repair, not as a reason to widen this docs lease. A realistic test should seed another media override (for example prefers-color-scheme) in the exact target, apply OriginWeave reduced-motion, run cleanup, and prove that unrelated prior state is either restored or that an explicit exclusive-owned-context invariant makes clearing the entire configuration correct. An ACK is insufficient. The minimal causal fix should be one of: (a) bind presentation application/cleanup to an explicit exclusively owned ephemeral context/profile boundary and destroy it when restoration is not representable, or (b) introduce snapshot/restore authority for the complete pre-existing media configuration. Do not claim ResetMediaFeatures is a selective inverse until one of those invariants is executable.
|
Writer lease RELEASED — exact head |
|
Writer lease ACTIVE — exact |
|
Writer lease RELEASED — exact head |
|
Writer lease ACTIVE — exact |
|
Writer lease RELEASED — exact |
|
LEASE ACTIVE — bounded source/docs/PR-state slice at exact |
seonghobae
left a comment
There was a problem hiding this comment.
Exact-head follow-up on 7ccb610805023a130697fc46c8250778c900bc8e: the cleanup leak is narrower now, but the public capability/application contract can still silently under-apply a PresentationProfile.
webdriver_bidi_presentation_surfaces() still advertises PresentationSurface::ReducedMotion, and SetReducedMotion remains constructible, which is correct as protocol expressibility: the 3 September 2026 W3C WD includes prefers-reduced-motion in emulation.MediaFeatures. However plan_standard_presentation_commands(&context, &profile) accepts the complete canonical PresentationProfile and now returns only viewport/DPR + timezone, deliberately dropping profile.reduced_motion() with no typed incomplete/deferred-surface result. Parent #229's architecture contract says an adapter must not let unsupported/unapplied surfaces silently fall back to ambient browser values. A caller that treats this function name/result as the application plan can therefore send every returned command successfully while the page still observes the host/default reduced-motion value.
Keep the current no-destructive-media-reset repair; do not reintroduce features:null or a type-shaped ownership token. The next realistic RED should bind a profile with reduced_motion=true to a reusable target whose page initially observes no-preference, execute exactly the returned reusable plan, and prove that the API cannot represent that result as complete profile application. Minimal causal repair should make the distinction executable: for example separate expressible_surfaces from reusable_applied_surfaces, brand/rename the reusable planner, and return a typed deferred/missing-surface record (or otherwise fail closed when full-profile application is requested). matchMedia('(prefers-reduced-motion: reduce)').matches on pinned Chromium is the post-condition; command construction/ACK is not sufficient.
The existing source/docs/PR-state lease on this branch is still ACTIVE, so this is review-lane evidence only and does not claim or request a concurrent source edit.
seonghobae
left a comment
There was a problem hiding this comment.
Current-head carry-forward after ordinary docs-only child 476a8e09aa1aa7ab2e87cf7452a8ecfca47bf9c1: review 5141684301 remains valid. The intervening commit aligns ARCHITECTURE/CHANGELOG/ADR/doctoring to the two-command reusable lifecycle but does not change presentation_capabilities.rs, so plan_standard_presentation_commands(&context, &profile) still accepts a full PresentationProfile while silently omitting profile.reduced_motion() and returns no typed deferred/incomplete-surface witness.
This is distinct from the now-repaired apply/cleanup leak. Preserve the no-media-mutation reusable plan. The next RED should make application completeness fail closed: a reduced_motion=true profile plus a page initially observing no-preference must not be representable as a complete applied profile after executing only the reusable plan. Minimal repair should expose the difference between protocol-expressible surfaces and surfaces actually applied by the selected lifecycle, or make a full-profile planning API return a typed missing/deferred surface result. Pinned-Chromium matchMedia('(prefers-reduced-motion: reduce)').matches remains the post-condition; ACK is insufficient.
The active source/docs/PR-state lease still owns this branch, so I am not editing source or PR state concurrently.
Current checkpoint for #292
Exact prerequisite remains #229
024f63690cf05cfe6f0d4a430f0e18ea8fd2c4d6. Exact current head is476a8e09aa1aa7ab2e87cf7452a8ecfca47bf9c1. Keep this PR Draft.Capability boundary
Standard WebDriver BiDi claims only the four complete canonical surfaces
Viewport,DevicePixelRatio,TimeZone, andReducedMotion. Width/height alone do not prove #229’s completeScreensurface including color depth, and one locale does not prove the orderedLanguagesvector.Screen,Languages,HardwareConcurrency, andPlatformtherefore remain absent and complete-profile admission fails first withMissingSurface(Screen).The reusable-context branch plans two typed standard-BiDi application intents for one validated opaque browsing-context identifier: viewport+DPR and timezone. Reduced motion remains an expressible protocol capability but is not installed because standard cleanup cannot selectively restore prior media state. Planning performs no transport I/O and cannot mint acknowledgement, cleanup, ownership, or page-observed evidence.
Published-standard provenance — 2026-09-08
Fresh direct read of canonical
https://www.w3.org/TR/webdriver-bidi/identifies WebDriver BiDi Working Draft, 3 September 2026, immutable dated TRhttps://www.w3.org/TR/2026/WD-webdriver-bidi-20260903/, with 1 September 2026 as the previous version. The same publication page separately linkshttps://w3c.github.io/webdriver-bidi/as the Editor’s Draft.The pinned WD confirms nullable reset paths:
browsingContext.setViewportcan restore default viewport/remove DPR override;emulation.setTimezoneOverridewithtimezone: nullremoves the applicable timezone override;emulation.setMediaFeaturesOverridewithfeatures: nullunsets the complete media-feature override configuration.Media-cleanup authority repair
Review
5139941850identified thatfeatures: nullis not a selective inverse forprefers-reduced-motion: it clears the target’s complete media-feature override configuration. The previous generic cleanup planner therefore carried destructive authority that was unsafe for a reusable context with unrelated pre-existing media overrides.The ordinary forward lineage now fails closed:
d885fa1ea05c7669564b56fc68c142461a92927erequires reusable application to exclude reduced-motion state that its cleanup cannot restore.c91636b2d25c4af3e01a65e3dd0f862664ecce7dchanges the reusable plan to viewport/DPR plus timezone only while retainingSetReducedMotionas an expressible protocol capability.7ccb610805023a130697fc46c8250778c900bc8eremoves the caller-mintableExclusivePresentationContextand destructive media-reset export; a type constructed by a caller is not Browser Session ownership evidence.476a8e09aa1aa7ab2e87cf7452a8ecfca47bf9c1aligns ARCHITECTURE, CHANGELOG, ADR 0107, and doctoring with that source boundary.#292 must still prove in pinned Chromium that a Browser Session owner establishes and destroys a genuinely disposable user context/profile or restores the complete pre-existing media configuration, and it must observe post-cleanup browser state rather than trusting ACK.
Documentation repair on current head
Protected-source descriptions no longer claim three reusable commands or an implemented caller-attested exclusive reset. They distinguish the four standard protocol capabilities from the two symmetrically restorable reusable commands and keep reduced-motion application behind a separately proven Browser Session lifecycle.
This is source/docs consistency evidence, not an executed hosted browser or CI claim.
Evidence and remaining gates
Exact CI
34219091919foref263056...completed skipped while Draft. No exact-head hosted Rust/Python/Clippy/rustdoc/100%-coverage GREEN is claimed.After this source/docs repair, #292 still owns version-pinned real Chromium/BiDi/CDP application, request/ACK correlation, page-observed post-conditions, navigation/renderer/crash handling, post-cleanup observation, unsupported/partial-capability failures, disposable-context destruction or complete prior-state restoration evidence, and Chromium-specific remainder surfaces.
No generic DevTools/JavaScript pass-through, workflow/ruleset/secret change, self-approval, merge, tag, release, or publication claim belongs to this PR.
References
World Wide Web Consortium. (2026, September 3). WebDriver BiDi (W3C Working Draft). https://www.w3.org/TR/2026/WD-webdriver-bidi-20260903/
World Wide Web Consortium. (2026). WebDriver BiDi (Editor’s Draft). https://w3c.github.io/webdriver-bidi/
W3C WebDriver BiDi Working Group source. (2026, August 18). list media features (#1149) (
1e5e36c43adbe24f2a4052c2ec091635c006c352). w3c/webdriver-bidi@1e5e36c