Skip to content

feat(browser): authenticate page command results - #14553

Closed
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-host-command-dispatchfrom
sta-4150-browser-host-command-results
Closed

Jinwoo-H wants to merge 1 commit into
sta-4150-browser-host-command-dispatchfrom
sta-4150-browser-host-command-results

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{+}}}$​643 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​639
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​724 $\color{#cf222e}{\Huge{\mathbf{−}}}$​121 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​603

STA-4150: https://linear.app/stably/issue/STA-4150/refactor-remote-browser-to-client-hosted-electron-webviews

Stacked on #14550. This inert server half adds a runtime-owned page-command ledger and result RPC contract with exact negotiated-connection/device/epoch/host/page authority, FIFO issue and settlement order, immutable command/result snapshots, payload-matched replay, bounded outstanding/page/cache state, shared-schema payload validation, execution-host grant checks, and outcome-unknown fencing on lease loss or exact page retirement.

Causal evidence: the unchanged focused import was red on parent 8bd3775 because the server ledger did not exist. Fresh adversarial review additionally reproduced a retirement deadlock, same-device sibling-socket result admission, oversized typed-command delivery, and retirement-completion reentry; deterministic regressions for each are green on the candidate.

Validation: 31 focused ledger/registry/RPC tests; 351 runtime/browser/protocol files with 5,003 passed and 5 existing skips; full node/CLI/web typecheck; native and type-aware zero-warning audits; changed-code quality; reliability and max-lines gates; formatting and diff checks; three clean fresh rereviews.

Compatibility: both browser-host methods remain outside production registration. No capability advertisement, persisted/mobile surface, production caller, Electron behavior, placement default, server/offscreen behavior, SSH/WSL routing, folder/worktree behavior, or old-client event shape changes. Legacy and non-v1 attach behavior remains unchanged.

Activation remains blocked on a bidirectional JSON request sender over the existing negotiated attach socket, command persistence/replay and outcome reconciliation across reconnect, exact production execution-host resolution, navigation policy, runtime-main-renderer lifecycle wiring, inventory/reclaim, non-cooperative destruction, and real headed/headless/browserless/SSH/WSL/physical cross-platform and mixed-version proof. This PR does not claim end-to-end result delivery or enable client placement.

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-command-results branch 2 times, most recently from 06f495c to fbde433 Compare August 14, 2026 20:14
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-command-results branch from fbde433 to 7e02cdb Compare August 14, 2026 21:01
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-command-results branch from 7e02cdb to 02c3d5d Compare August 14, 2026 23:17
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-command-results branch 2 times, most recently from 12ba5ba to 61fcd62 Compare August 15, 2026 00:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-command-results branch from 61fcd62 to 63ea8b3 Compare August 15, 2026 02:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-command-results branch from 63ea8b3 to a27ce6f Compare August 15, 2026 03:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-command-results branch 2 times, most recently from 581893d to a3549cb Compare August 15, 2026 10:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-command-results branch 2 times, most recently from 973e002 to 3fe1ad8 Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-host-command-results branch from 3fe1ad8 to 4de6f68 Compare August 16, 2026 09:09
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing because this command/lifecycle stage is already implemented on main (a93e31a9339). I compared the complete production patch, body/discussion, and introduced regression intent against the current modules.

The runtime-owned command ledger now lives under src/main/runtime/browser-host/. It retains shared-schema parsing before admission, per-page issue/settlement sequences, bounded outstanding/page/cache state, immutable snapshots, exact payload/result replay, outcome-unknown on terminal loss/retirement, and execution-host grant admission. browser.clientHost.commandResult still requires runtime client kind, authenticated paired device, negotiated capability, exact runtime authority and the lease connection ID; a sibling socket cannot submit results. All 22 introduced regression names remain, including capacity, immutable snapshots and retirement reentry. Later negotiated reconnect preserves and replays outstanding commands during grace instead of treating every transport loss as terminal.

Validation: six current dispatcher, lease, composition, ledger, and result-RPC suites passed 84 tests with ORCA_BACKGROUND_LAUNCH=1 and two workers. This closes the redundant stage, without asserting completion of every original STA-4150 activation blocker.

@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