Skip to content

feat(browser): prepare route-scoped Electron partitions - #14516

Closed
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-execution-host-routesfrom
sta-4150-browser-route-partitions
Closed

Jinwoo-H wants to merge 1 commit into
sta-4150-browser-execution-host-routesfrom
sta-4150-browser-route-partitions

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​464 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​464
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​704 $\color{#cf222e}{\Huge{\mathbf{−}}}$​9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​695

Summary

  • Derive route and browser-profile scoped persistent Electron partitions from one full, path-safe SHA-256 aggregate.
  • Persist durable collision bindings before Chromium partition creation and fail closed on corrupt, oversized, mismatched, or sidecar-less partition state.
  • Apply existing browser session policy, fixed SOCKS5 routing, inherited-connection closure, and exact proxy verification before a partition enters the webview allowlist.
  • Permit only a blank initial webview attachment for a live route partition.

Why this stage is inert

  • No production code calls preparePage().
  • Client-host and tunnel capabilities plus RPC registration remain disabled.
  • Exact WebContents ownership and any post-attach navigation grant do not exist.
  • Existing server-hosted and offscreen browser placement is unchanged.
  • STA-4231 / fix(browser): acknowledge paired tab before navigation #14402 remains the separate merged Stage 0 compatibility fix.

Compatibility

This PR changes no RPC field, stream opcode, capability advertisement, or host publication. Old and new clients continue using current server placement. The contracts remain main-process only and do not assume a git worktree, local execution, headed host, browser-capable host, or one operating system. SSH, WSL, folder workspaces, browserless/headless hosts, and mixed versions remain unaffected until a later capability-gated activation stage.

Evidence

Red-before tests failed on component-linkable and Windows-unsafe names, unbounded binding reads, and Chromium data without binding metadata. The candidate is green on:

  • 6 focused files, 150 tests
  • full main browser suite: 55 files, 739 tests
  • durable-writer suite: 3 files, 28 tests
  • full Node, web, and CLI typecheck
  • cross-version terminal wire: 5 tests
  • native, type-aware, changed-code, reliability, and max-lines gates
  • fresh correctness and security/performance rereviews

Parent #14513 CI is fully green, including Linux and Windows packaging.

Activation blockers

Before any production caller is added, later stages must prove exact WebContents and page-generation registration, popup containment, persisted-worker hold, network-service recovery, teardown and partition GC, failed-binding reclamation, dev multi-writer fencing, UDP/QUIC/DoH/WebRTC denial, and real Electron traffic isolation on macOS, Linux, and Windows.

Stacked on #14513. Tracks STA-4150.

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-route-partitions branch 2 times, most recently from eb8ba86 to f98cc04 Compare August 14, 2026 20:14
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-route-partitions branch 2 times, most recently from d1cb538 to b9c80d0 Compare August 14, 2026 23:17
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-route-partitions branch from b9c80d0 to d8d277a Compare August 15, 2026 00:44
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-route-partitions branch from d8d277a to 358eab3 Compare August 15, 2026 00:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-route-partitions branch 3 times, most recently from f31c98f to f373b97 Compare August 15, 2026 08:53
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-route-partitions branch from f373b97 to 26e3c9e Compare August 15, 2026 10:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-route-partitions branch 2 times, most recently from 3a6e4a1 to f5cf2c8 Compare August 15, 2026 12:30
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing because this route-scoped partition preparation stage is already implemented on main (a93e31a9339). I reviewed the proposed production patch, body, discussion, and added regression intent against the current modules.

The full SHA-256 route/profile partition derivation, durable collision binding, bounded fail-closed metadata reads, rejection of Chromium data without binding metadata, exact SOCKS proxy verification, inherited-connection closure, and blank-only initial attachment are present in browser-route-identity.ts, browser-route-partition-binding-{store,file}.ts, browser-route-session-policy.ts, and window/main-window-webview-security.ts. The synchronous durable writer also retains failed-temp cleanup and Windows rename retry.

Main additionally supports versioned binding migration/retention-aware eviction and renderer-owned page retirement. Its proxy-first setup ordering intentionally supersedes the older test expectation that proxy installation had not begun when policy setup failed; failed preparation still closes connections and stays outside admission.

Validation: the six current partition/session/WebContents/main-window suites passed 106 tests with ORCA_BACKGROUND_LAUNCH=1 and two workers. This establishes supersession of this stage; it does not assert all of STA-4150’s original cross-platform activation criteria are complete.

@OrcaWin OrcaWin closed this Oct 26, 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.

2 participants