Skip to content

STA-4150: reconcile client-hosted terminal link lifecycle - #15038

Closed
Jinwoo-H wants to merge 7 commits into
sta-4150-landing-desktop-activationfrom
sta-4150-landing-client-mirror-transport
Closed

Jinwoo-H wants to merge 7 commits into
sta-4150-landing-desktop-activationfrom
sta-4150-landing-client-mirror-transport

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​676 $\color{#cf222e}{\Huge{\mathbf{−}}}$​156 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​520
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​312 $\color{#cf222e}{\Huge{\mathbf{−}}}$​71 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​241

ELI5

When a paired terminal opens a link, the web page now lives in the desktop Electron client while the remote runtime remains the source of truth. This acceptance layer proves that path end to end and fixes close cleanup so closing the visible page also retires the exact authoritative remote record without disrupting the terminal.

What Changed

Stack 6/6 for STA-4150, based on #14957.

  • Re-resolve the authority registry's canonical placement after the client acknowledges close, then retire that exact generation.
  • Route close through the exact remote owner and retain the local guest until authoritative reconciliation.
  • Treat ambiguous multi-runtime ownership as unknown instead of destructively falling back locally.
  • Apply the same canonical-placement rule during recovery.
  • Add a paired Electron acceptance journey covering terminal link creation, local guest placement/input, zero screencast and PTY churn, no reconnect/error UI, clean close, and a still-live terminal afterward.

Why

Runtime publication clones immutable placement data, but retirement is identity-sensitive and requires the registry's canonical object. The previous close path acknowledged the client close and then tried to retire with the clone, leaving the logical host tab behind as browser_page_placement_stale. Re-resolving the canonical generation preserves the runtime as sole authority and keeps stale acknowledgements fenced.

Linked Issue

STA-4150

Visual Proof

N/A — there is no intentional visual redesign. The paired Electron acceptance test exercises the real rendered behavior and asserts that reconnect/error UI never appears.

Testing

  • Deterministic red baseline: 1/7 failed with browser_page_placement_stale.

  • Focused post-fix suite: 31/31 passed.

  • Fresh post-rebase paired Electron acceptance: 1/1 passed.

  • Additional paired Electron evidence before rebase: fresh build passed, 3/3 isolated repeats passed, and final post-review fresh build passed.

  • Full Node/CLI/web typecheck passed.

  • Focused oxlint and git diff --check passed.

  • Focused SOCKS/route/session review gate: 52/52 passed.

  • Stack rebase onto origin/main@2fdaa10fd1 was conflict-free; range-diff marked all 79 commits identical.

  • I manually tested these changes locally

  • Automated tests added/updated

Compatibility and release gates

No wire field, opcode, or semantic change is added by this layer. Old clients and omitted placement retain server-hosted behavior; explicit server/offscreen placement, browserless hosts, headed/headless runtimes, SSH/WSL/native execution routes, folder workspaces, git worktrees, and immutable page-generation fencing remain unchanged.

The cumulative feature is not release-complete. P1 gates are:

  • Decide and document whether all local desktop processes are trusted. The ephemeral loopback SOCKS listener uses NO_AUTH; tunnel pairing authentication does not authenticate the local caller. If local-process isolation is required, use OS-isolated IPC or supported proxy credentials.
  • Explicitly deny or capture alternate direct-egress paths, including QUIC/HTTP3, DoH, WebTransport and other UDP, plus real HTTPS, WebSocket, redirects/subresources, downloads, and network-service restart journeys.
  • Run the complete production placement/network-isolation journey on native Windows and Linux. Existing CI covers Electron boundaries, while the complete paired journey is currently real on macOS.

Physical mobile validation and broader real SSH/WSL/folder/browserless journeys remain residual coverage gaps.

Review

Three implementation-focused lifecycle/authority/compatibility reviews found no remaining P0/P1/P2 after the ambiguous-ownership fallback, RPC sentinel, and fixture cleanup findings were corrected. Two post-publication release reviews found no P0 and identified the explicit P1 gates above. All reviewers were read-only and made no external mutations.

Agent skill upstream boundary

  • Not applicable; this change copies or translates no upstream skill-installer material.

Notes

Draft only. Do not merge or mark ready as part of STA-4150 ownership.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Visual proof is N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and compatibility impact considered
  • Relevant lint, typecheck, deterministic tests, and paired Electron E2E pass

@Jinwoo-H Jinwoo-H changed the title sta 4150 landing client mirror transport STA-4150: reconcile client-hosted terminal link lifecycle Aug 17, 2026
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-landing-desktop-activation branch from f63ca30 to b928fac Compare August 17, 2026 09:56
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-landing-client-mirror-transport branch from 4a740f1 to 4e64200 Compare August 17, 2026 09:56
@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

Latest validation checkpoint (2026-08-17)

  • Pushed current rebased stack tip 4e64200e04; all six PRs remain draft, stack #14958 is clean, and no PR was merged or marked ready.
  • Fresh rebuilt paired-Electron E2E: 2/2 passed (headed host + headless host). Client placement renders in the viewing desktop with no screencast; browser.snapshot runs locally; disabling the kill switch preserves the existing page and routes only the next page to the server.
  • Final local gates: 32 focused files / 373 tests, full Node/CLI/web typecheck, native + type-aware lint, changed-code quality, 89 reliability gates, max-lines ratchet, and git diff --check.
  • Remaining release decisions are explicit and documented: local-process trust for the unauthenticated loopback SOCKS listener, unsupported non-WebRTC UDP/DoH/QUIC/WebTransport/network-service paths, and physical Windows/Linux/mobile acceptance beyond current CI/macOS evidence. No bespoke workaround was added.

@Jinwoo-H
Jinwoo-H marked this pull request as ready for review August 19, 2026 01:07
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-landing-desktop-activation branch from b928fac to 7e6bd45 Compare August 19, 2026 01:23
@Jinwoo-H
Jinwoo-H requested a review from brennanb2025 as a code owner August 19, 2026 01:23
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-landing-client-mirror-transport branch from 9d71c9a to fda719d Compare August 19, 2026 01:23
@Jinwoo-H Jinwoo-H closed this Aug 19, 2026
@Jinwoo-H Jinwoo-H reopened this Aug 19, 2026
@Jinwoo-H Jinwoo-H closed this Aug 19, 2026
@Jinwoo-H Jinwoo-H reopened this Aug 19, 2026
Jinwoo-H added a commit that referenced this pull request Aug 19, 2026
…untime browser suite

orca-runtime-browser.test.ts reached 810 counted lines here (max 800) and failed static analysis. The extraction matches the one #15038 already performs, so the file contents converge with that PR rather than diverging.
@Jinwoo-H
Jinwoo-H changed the base branch from sta-4150-landing-desktop-activation to sta-4150-landing-command-authority August 19, 2026 02:19
@Jinwoo-H
Jinwoo-H changed the base branch from sta-4150-landing-command-authority to sta-4150-landing-desktop-activation August 19, 2026 02:19
@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

Superseded by the consolidated PR #15448 (the full STA-4150 feature merged with latest main). This PR's diff remains as the per-layer review view; its CI was fully green at close.

@Jinwoo-H Jinwoo-H closed this Aug 19, 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.

1 participant