Skip to content

feat(browser): plan client page reconciliation - #14617

Closed
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-client-host-compositionfrom
sta-4150-browser-client-page-reconciliation
Closed

Jinwoo-H wants to merge 1 commit into
sta-4150-browser-client-host-compositionfrom
sta-4150-browser-client-page-reconciliation

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​268 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​268
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​270 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​262

Summary

  • add a bounded, immutable planner that compares runtime page intent with client-hosted inventory
  • retain only exact current authority/profile/execution-host matches without navigation
  • reclaim only an exact persisted previous authority across a real epoch transition on the same browser-host client
  • separate orphan close, missing restore, and mismatch closeThenRestore so replacement cannot race destruction proof
  • fail atomically on duplicate, invalid, or over-capacity inventory

This is a production-inert STA-4150 semantics layer on #14613. It adds no exchanged field, capability advertisement, inventory transport, placement publication, or production caller.

Linear: STA-4150

Compatibility

  • no remote wire shape or semantic change
  • no behavior change for old/new clients, server placement, browserless/headed/headless hosts, SSH/WSL, folder workspaces, or git worktrees
  • numeric generations may restart under a new authority epoch, but same-epoch downgrade and cross-client reclaim are rejected
  • outcomeUnknown pages are never adopted

Evidence

Baseline failed because the reconciliation planner did not exist.

  • focused planner: 1 file / 28 tests
  • placement/lease package: 5 files / 58 tests
  • pnpm run typecheck
  • pnpm run lint (85 reliability gates and zero-warning native/type-aware audits)
  • pnpm run check:code-quality:changed (zero findings)
  • formatting and git diff --check
  • two fresh read-only authority/resource reviews; one caught same-epoch reclaim and the follow-up review is clean

Remaining work

Authenticated inventory transport, executor inventory, runtime integration, pending-close settlement, ambiguity recovery, and real reconnect/restart journeys remain later layers. Do not merge or mark ready.

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-reconciliation branch from b2a6a5f to 71b8b29 Compare August 14, 2026 22:14
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-composition branch from 7f41342 to 059dc1e Compare August 14, 2026 23:17
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-reconciliation branch from 71b8b29 to 42ffb3a Compare August 14, 2026 23:18
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-composition branch from 059dc1e to ed2d4b9 Compare August 15, 2026 00:44
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-reconciliation branch from 42ffb3a to 9713201 Compare August 15, 2026 00:44
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-composition branch from ed2d4b9 to e162ba6 Compare August 15, 2026 00:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-reconciliation branch from 9713201 to cfbedbc Compare August 15, 2026 00:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-composition branch from e162ba6 to d4ac51d Compare August 15, 2026 02:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-reconciliation branch 2 times, most recently from 0e9143e to f4f58e1 Compare August 15, 2026 03:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-composition branch from 713104f to e87ccd6 Compare August 15, 2026 08:53
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-reconciliation branch 2 times, most recently from 509bb26 to ad8c20f Compare August 15, 2026 10:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-composition branch from 49c4384 to b8e9a03 Compare August 15, 2026 11:34
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-reconciliation branch 2 times, most recently from 634bda5 to cdcb3ec Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-composition branch from b8e9a03 to 6dd3ef8 Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-host-composition branch from 6dd3ef8 to f3d7a91 Compare August 16, 2026 09:09
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-reconciliation branch from cdcb3ec to 0c209f7 Compare August 16, 2026 09:09
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing because the reconciliation planner and its regression coverage are already implemented on main (a93e31a9339).

src/main/runtime/browser-host/browser-host-page-reconciliation-plan.ts builds the same bounded immutable retain/reclaim/close/restore/closeThenRestore plan, rejects duplicate or invalid inventories atomically, retains only exact active matches, and keeps mismatch destruction ahead of restoration. The adjacent test suite carries the original exact-match, orphan/missing page, mismatch, same-epoch rejection, counter-restart, outcomeUnknown, bounds, and immutability cases.

Main has additionally tightened reclaim to the same runtime and authenticated paired device; the earlier cross-runtime reclaim latitude in this draft would weaken those newer fences. The plan is now composed by the lease registry reconciliation orchestrator rather than remaining an inert future module. This closes the superseded planning stage, not the broader STA-4150 acceptance matrix.

@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