Skip to content

feat(browser): fence client host leases - #14484

Closed
Jinwoo-H wants to merge 2 commits into
sta-4150-paired-browser-tunnelfrom
sta-4150-browser-host-leases
Closed

Jinwoo-H wants to merge 2 commits into
sta-4150-paired-browser-tunnelfrom
sta-4150-browser-host-leases

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​786 $\color{#cf222e}{\Huge{\mathbf{−}}}$​28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​758
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​732 $\color{#cf222e}{\Huge{\mathbf{−}}}$​56 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​676

Summary

  • add runtime-owned browser-host leases, authority epochs, exact host selection, and monotonic host/page/tunnel generations
  • bind tunnel authorization to the paired device and exact native execution-host runtime revision
  • notify replaced or released desktop hosts with an epoch-and-generation-bound revocation
  • prove the lease-to-SOCKS-to-runtime HTTP path over an isolated paired E2EE subscription

This is the third inert layer for STA-4150, stacked on #14470. Neither RPC method is registered in production and neither capability is advertised, so this does not change live browser behavior or mixed-version peers.

Causal evidence

Before lease enforcement, an authenticated paired runtime could self-assert its paired device ID and receive a ready tunnel generation without any server-owned browser-host lease. The unchanged authorization oracle failed before this layer and passes after exact lease, epoch, host-generation, device, and execution-revision validation.

A fresh review also found that server-side replacement alone left the old desktop believing its lease was live. The final implementation emits an exact revocation; server and client tests cover replacement, release, premature and mismatched events, malformed reasons, duplicate readiness, closure, and reporting.

Validation

  • 10 focused files / 60 lease, route, SOCKS, flow-control, lifecycle, and paired E2EE tests
  • 14 files / 85 unique tunnel, lease, binary-router, and remote-runtime tests
  • cross-version terminal wire: 5 tests
  • pnpm typecheck
  • native and type-aware code-quality audits
  • reliability-gate manifest and max-lines ratchet
  • fresh correctness and security/performance reviews: no inert-stage blockers

Deliberately deferred before activation

  • bounded attach/open admission, aggregate route/host/process memory ledgers, and fair scheduling
  • page-placement retirement
  • SOCKS local-process trust decision
  • SSH/WSL/Linux/physical-Windows and old/new-peer journeys
  • Electron partition proxy/no-fallback proof and UI activation

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch from c9a41ab to 30c3e6f Compare August 14, 2026 07:51
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch from 30c3e6f to 6cf85d8 Compare August 14, 2026 08:48
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch from 6cf85d8 to 92cc518 Compare August 14, 2026 09:14
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch from 92cc518 to 5bfe5fe Compare August 14, 2026 10:18
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch 2 times, most recently from 3bc90fb to c8fd430 Compare August 14, 2026 20:14
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch 4 times, most recently from f9a0f4b to c628bfb Compare August 15, 2026 00:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch 2 times, most recently from fb4a809 to 7a46457 Compare August 15, 2026 03:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch from 7a46457 to 6145741 Compare August 15, 2026 08:53
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch 2 times, most recently from ecc6c0b to 995b3de Compare August 15, 2026 11:34
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch from 995b3de to 0b7e3ea Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-leases branch from 0b7e3ea to 33965d4 Compare August 16, 2026 09:09
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing because the browser-host lease stage is already implemented on main (1a723194c32), after extraction into the browser-host runtime modules.

I read the complete production patch, body and available discussion and compared its regression intent. Main still mints the runtime authority epoch and monotonic host/page/tunnel generations, binds host identity to the authenticated paired device, rejects stale epochs/generations, selects an exact eligible host or rejects ambiguity, and fences the old route on replacement without allowing stale cleanup to remove the new one. Page admission/retirement is now bounded and stronger than this original stage.

Authenticated attach still requires the client-host capability and exact runtime, emits server-owned readiness and exact epoch/generation revocation, and connects cleanup to the caller connection. The client connection validates the runtime and schemas, rejects premature/mismatched revocation and malformed readiness, and releases late-acquired subscriptions. Later negotiated reconnect support deliberately preserves exact authority during grace; legacy clients keep immediate teardown.

Tunnel attach still requires both capabilities plus a live exact lease and native runtime revision; the revision check now resides in the execution-route resolver. Route generations remain server-owned, binary data before readiness is rejected, and route/lease loss closes the exact session. Current routing additionally supports granted SSH/WSL hosts, host-admin permission and aggregate memory admission. The old inactive-registration assertion is superseded by production activation.

Validation: the additional tunnel authorization RPC suite passed all 13 tests. The preceding runs passed the current lease/protocol/registry/authenticated attach suites (179 tests in 10 suites), reconnect and route/composition suites (127 in 8), and real paired-runtime tunnel integration within the 58-test authority suite. No new live Electron/platform run was performed. Relevant HEAD..origin/main contracts are unchanged.

@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