Skip to content

repair(network): restack committed-navigation subscription on live origin binding - #277

Draft
seonghobae wants to merge 11 commits into
feat/webdriver-bidi-navigation-origin-bindingfrom
repair/webdriver-bidi-navigation-subscribe-restack-20260902
Draft

repair(network): restack committed-navigation subscription on live origin binding#277
seonghobae wants to merge 11 commits into
feat/webdriver-bidi-navigation-origin-bindingfrom
repair/webdriver-bidi-navigation-subscribe-restack-20260902

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Repairs the active #28 subscription stack without force-pushing or closing stale PR #262.

Current deadline repair

Current head is 117f6414e8a6db46eb2b32f4ebae85cf2a208371, a normal follow-up commit after the verified parent adoption below. A real-socket regression observed no subscription bytes but two outstanding commands where only one pre-existing command should remain. The sender now reuses the frame owner's existing timeout validator before registration. Both zero and over-limit deadlines preserve the unrelated command and leave the rejected identifier reusable; no bound or wire format changes.

Post-registration frame failures still conservatively retain correlation. A separate real-socket test covers this unchanged path using repeated masking-key rejection after a successful empty Pong. The response parser, typed command family, origin binding, and Proposed ADR are unchanged.

Fresh verification for this new source tree passed 11 focused subscription loopback tests, all 142 Python contracts, the complete locked Rust workspace check/tests, format, all-feature Clippy, warning-denying rustdoc, compileall, and diff checks. Numeric production coverage is 100%: 1,221 functions, 12,781 lines, 16,404 regions, and 1,418 branches. The unstable branch-measurement warning remains. New hosted checks must finish independently; earlier coverage is not transferred.

Historical verified parent adoption

Parent-adoption head was 3c0484174eeda0703492ba76b530be125e3e99dd, a normal merge of child 01038ba71fb276426cc67f90a91a3c431e194db5 and actual #261 934eb7d37568b439c442ffe1d1f6a9c8f8ed58a0. Both release records and crate-level capability descriptions were retained when resolving the two documentation conflicts.

The two subscription production modules, three integration-test files, and Proposed ADR text are byte-identical to 01038ba7.... The child's existing NavigationCommittedSubscription command family remains the sole two-line addition to the parent's correlation enum; no generic compatibility shim was restored. The former suggestion to add SessionSubscribe is historical: the current implementation already uses typed subscription registration and response correlation.

Product boundary

The command subscribes only to committed navigation in one already-registered context, revalidates that binding before I/O, registers its typed command before a possible remote side effect, and uses the existing bounded verified WebSocket. The bounded opaque receipt remains private in diagnostics. Invalid or ambiguous results and command-kind mismatches preserve unrelated outstanding commands.

This is protocol-correlation evidence, not browser authentication, proof that an event occurred, or navigation/action/policy/secret authority. That parent-adoption commit retained the existing correlation behavior, including invalid deadlines. The subsequent repair above changes only rejection before registration; post-registration retention remains.

Parent-adoption local verification

Native discovery reproduced zero inherited command-correlation release-contract tests before adoption; after reusing the parent fix the same expected-one assertion and test pass. Fresh verification passed 16 focused loopback tests, all 142 Python contracts, Rust 1.97.1 format, locked workspace check/tests, all-feature Clippy, warning-denying rustdoc, compileall, and diff checks.

Production coverage on nightly 2026-08-01 is numerically 100%: 1,220 functions, 12,774 lines, 16,397 regions, and 1,418 branches. The measurement warning --branch option is unstable remains visible. These results are not hosted GREEN, protected-main integration, or real-browser completion.

Preserved historical repair evidence

The original #262 unique subscription delta was reconstructed rather than copied wholesale. Historical #277 head 74fdedb6ee441a4055ee335bc5a5b96dee852661 failed native CI 33600076214: Rust contracts job 100151610266 exposed formatting failures (artifact 9854587900, ZIP SHA-256 d1c6ff0f9ff8f0cd970a41ce61b804460987d6d7a0dee41acbf7af9a7bec3fd9), and coverage job 100151609938 exposed three removed generic-correlation calls. Current typed registration/correlation fixes that incompatibility without reviving confused-response routing.

Historical review 5094483494 corrected the overbroad objection to deterministic unwrap_or; the actual prohibited production expect was removed in the parent routing repair. These findings and predecessor results are not current-head verification.

Parent-first governance

Keep Draft and unmerged. Hosted checks and reviews must be independently evaluated for this new head; predecessor, queued, skipped, cancelled, model-only, or author-only results are not passing evidence or counted approval. Parent #261 must integrate under current policy before retargeting or protected merge.

Do not close #262 or promote #263+ merely because this reconstruction exists. Require current-parent hosted GREEN and complete unique-delta/successor evidence first. No self-approval, bypass, force update, destructive rebase, workflow/ruleset/secret mutation, gate weakening, tag, release, or publication was performed.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae

Copy link
Copy Markdown
Contributor Author

RCA and exact-head refresh for 3c8692517ccae9dfa24ae001cec423188dad0da8:

  • The prior hosted Rust and coverage failures started at cargo fmt --check; the same failure reproduced locally.
  • After applying pinned rustfmt, I refreshed this stacked PR onto its current parent head ccfa13b95295bde4e7a93621ba9add12651aa3bf.
  • That refresh exposed an API mismatch: this subscription still used untyped response correlation while the parent now requires command-kind correlation. The fix assigns committed-navigation subscriptions their own command kind and rejects responses from other command families without retiring the pending subscription.
  • Added a regression proving a mismatched success response cannot consume the subscription request.
  • Updated the changelog and the existing WebDriver BiDi lifecycle ADR.

Local verification on the pushed head passed: Python tests (139), rustfmt, strict workspace/all-target/all-feature Clippy, all workspace/all-target/all-feature tests, rustdoc with warnings denied, and pinned-nightly LLVM function/line/region/branch coverage at 100%. Hosted exact-head checks remain authoritative. No review threads are open; this PR remains draft and stacked on #261.

Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Parent synchronization update: exact head 3ba09bc4e4f0ac2d5d74bf39bdfdf8a119c7aeea now includes #261 exact head 84195ec7bec17a828b49ac7e4d6dbe0863296353. The merge changed ancestry only because this branch already contained the identical pinned-rustfmt result. cargo fmt --all --check remains green locally; hosted checks on this new exact head remain authoritative.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Correction: the exact pushed head is 3ba09bc4f81bf98ce6a7f2b9b965fc2ff1ea3055 (the prior comment expanded the abbreviated SHA incorrectly). The parent SHA and all other synchronization evidence in that comment are unchanged.

Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Parent synchronization: exact head 265275875caec17d6973a833bcef8dd6e8ce920d now includes #261 exact head 7cecf402da665bd280447461d1015d6bcd0aad07. This was ancestry-only; cargo fmt --all --check remained green before the non-force push. Hosted checks on the new exact head remain authoritative.

Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Parent synchronization: exact head 2cd20d6e686aa9fda2485768dd4459ee59398783 now includes #261 exact head c1f877b770c1b2a52d76a062b09b996fc5653e1e. Strict Clippy and the complete workspace/all-target/all-feature test suite passed before the non-force push; hosted checks remain authoritative.

Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Reconstructed on exact current parent PR #261 head 95f7548bf07cbba76ab8b40577a11d1b6c99acb5; new exact #277 head is 0a7070b8fdc4a53d4b35f0b93be79a404d8d68c1.

The only merge conflict was CHANGELOG composition. Resolution preserved the parent navigation observation/epoch/origin entries, added the missing buyer-visible context-scoped session.subscribe exchange, retained the child’s distinct SessionSubscribe correlation family, and removed the now-parent-owned structural-routing claim. No generic correlation compatibility shim was reintroduced.

Local exact-head evidence: all three subscription test suites passed; documentation contracts passed (22 tests, 177 subtests); strict Clippy and rustdoc passed; full workspace tests passed after one policy-permitted retry of the known unrelated macOS revoked-socket NotConnected flake; production functions, lines, regions, and branches are each 100% covered. Exact-head GitHub checks are queued; PR remains Draft with no formal review on this head. Stale PR #262 is not closed until this exact head reaches terminal GREEN and unique-delta equivalence is rechecked.

Commit-Message-Assisted-by: Claude (via Claude Code)
Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Resolved the CHANGELOG restack conflict by preserving both the navigation-subscription correlation contract and the parent's coverage/error-vocabulary records. Non-force restacked on PR #261 exact head 7388e6a893b34e87ba965f061aaa26bf4d155b61; PR #277 is now exact head 16ab6d67fe668306224af0c17c4e7b3d423f2c97. Verification: rustfmt, all-feature/all-target check, strict Clippy, rustdoc, 141 Python contracts, and CI-equivalent pinned-nightly production function/line/region/branch coverage at 100%. Fresh hosted exact-head checks and ordered parent integration remain required.

Commit-Message-Assisted-by: Claude (via Claude Code)
Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Non-force restacked on PR #261 exact head 323ac9e147691e9f6572711f5a748e13f1036624; PR #277 is now exact head 01038ba71fb276426cc67f90a91a3c431e194db5. Verification: rustfmt, all-feature/all-target check, strict Clippy, rustdoc, 141 Python contracts, and CI-equivalent pinned-nightly production function/line/region/branch coverage at 100%. Fresh hosted exact-head checks and ordered parent integration remain required.

Preserve typed subscription production and test files while integrating current connection provenance and executable release contracts.

Verify 16 focused tests, 142 Python contracts, full Rust checks and numerical 100% coverage. Retain the branch-measurement warning.

Commit-Message-Assisted-by: Codex (via Codex)
Signed-off-by: Seongho Bae <me@seonghobae.me>

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Current-parent read-only review finding; no source-writer takeover. The #277 adoption itself is now aligned with actual #261 and correctly retains the existing NavigationCommittedSubscription typed family. One doctoring item is stale on this exact head: ADR 0103 still cites/describes the 18 Aug 2026 WebDriver BiDi Working Draft. W3C's latest published Working Draft is 3 Sep 2026 (https://www.w3.org/TR/2026/WD-webdriver-bidi-20260903/). Recheck/update the dated reference while preserving the current product boundary. The 3 Sep draft still defines session.SubscribeParameters with required non-empty events, optional non-empty contexts/userContexts, and session.SubscribeResult { subscription }, so I found no source-shape reason to replace or rename the existing typed command family. Treat this as standards/TRACEABILITY freshness only; hosted GREEN and real-browser completion remain separate.

Copy link
Copy Markdown
Contributor Author

Follow-up to COMMENT review 5121358906, still read-only/no source ownership: current docs/doctoring.md has the same freshness drift in a stronger form. It says the 3 Sep 2026 text is an Editor's Draft while an older dated W3C Working Draft is the repository's latest published reference. As of 5 Sep, W3C /TR/webdriver-bidi/ identifies 3 September 2026 itself as the latest published Working Draft. Please update both ADR 0103's 18 Aug citation and the doctoring publication-status sentence together during the existing #277 writer lane. The current NavigationCommittedSubscription source shape remains aligned with the 3 Sep session.SubscribeParameters/SubscribeResult structure; no production-authority change is implied.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Current-head repair finding from the adopted parent, still read-only/no competing writer. WebDriverBiDiNavigationCommittedSubscriptionCommand::send currently registers NavigationCommittedSubscription correlation before calling write_text_frame, and invalid_frame_timeout_consumes_transport_and_retains_correlation asserts the id remains outstanding for Duration::ZERO. On this parent that is no longer causally correct: write_text_frame rejects zero/>max deadlines before frame construction/I/O, and rejects an adjacent reused masking key as MalformedFrame before any write. Both session.status and session.end already preflight invalid deadlines, and their frame-failure mapping retires the just-registered id when MalformedFrame proves no bytes were emitted. So #277 can leave a phantom outstanding subscription after a purely local rejection, causing avoidable id/resource exhaustion with no possible remote side effect.

Please preserve the existing NavigationCommittedSubscription family and ambiguous-write retention, but adapt the child to the current parent invariant: make invalid timeout RED expect zero correlation before I/O; add the no-write masking-key-preflight case; preflight the reviewed frame timeout before registration; and retire only this typed id when frame preflight returns MalformedFrame. Do not retire for write-mode/timeout/I/O failures after emission may have begun. Update the current body/doctoring sentence that says rejected deadlines intentionally retain correlation. This is independent of hosted GREEN and does not require workflow/provider/authority changes.

Reuse frame validation before reserving correlation. Prove invalid deadlines emit no command and preserve unrelated pending work.

Keep post-registration frame-failure retention. Verify 11 focused tests, 142 Python contracts, full Rust gates and numeric 100% coverage.

Commit-Message-Assisted-by: Codex (via Codex)
Signed-off-by: Seongho Bae <me@seonghobae.me>

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Exact-head follow-up on 117f6414e8a6db46eb2b32f4ebae85cf2a208371, read-only/no source-writer takeover. The deadline half of the prior finding is repaired correctly: zero and >max frame deadlines now fail before NavigationCommittedSubscription registration and preserve only pre-existing correlation. One causal half remains.

post_registration_frame_failure_keeps_the_outstanding_command deliberately reuses the immediately previous masking key. The frame owner rejects that adjacent key as WebDriverBiDiWebSocketFrameError::MalformedFrame during local frame preparation, and the loopback proves no subscription command bytes are emitted, yet this test requires the new subscription id to remain outstanding. That leaves a phantom request with no possible remote effect. The adopted parent already treats this MalformedFrame class as provably no-write for session.status / session.end and retires only the just-registered typed id; ambiguous timeout/I/O failures after write may have begun remain outstanding.

Minimal repair remains: RED the adjacent-key case to require preservation of unrelated pre-existing correlation but retirement/reusability of this exact NavigationCommittedSubscription id; on frame error retire only this id when the frame error class proves no bytes were emitted, while retaining correlation for ambiguous write failures. Do not broaden authority or change workflow/provider/gates.

The standards-doctoring item also remains current on this exact head: ADR 0103 still cites the 18 Aug 2026 WebDriver BiDi Working Draft, while W3C's latest published WD is 3 Sep 2026. This does not require renaming the existing typed subscription family.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant