Skip to content

feat(platform): durably retire the legacy GUI capture writer - #965

Draft
simonvanlaak wants to merge 7 commits into
mainfrom
t3/platform-legacy-capture-retirement
Draft

simonvanlaak wants to merge 7 commits into
mainfrom
t3/platform-legacy-capture-retirement

Conversation

@simonvanlaak

@simonvanlaak simonvanlaak commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

The replacement host needs a durable way to stop the existing GUI from admitting new captures before adopting its writer role. This adds the fixed, privileged @apparent/native-host/legacy-capture port: read the GUI writer state, then explicitly retire it using that process's epoch/revision. It seals admission before the config transaction and persists the protected legacyCaptureWriter marker. Restart observes the marker and continues refusing legacy starts. Active work is preserved; busy or uncertain ownership cannot authorize retirement.

The operation requires a strong generated process incarnation and refuses an unqualified fallback before configuration observation. Ordinary config writes cannot create, remove, or overwrite the marker. An uncertain publication keeps the live process sealed and reports unknown; the client never retries automatically. Existing snapshot, pen, clipboard and installed routes retain their contracts.

Validation: independent source review and repaired-delta rechecks approved; 13 focused root tests, the native config suite, 21 public-client tests and the ordinary packed headless consumer passed. The full Linux root suite passed 958 tests with 14 existing ignored on the frozen source. After current-base integration, root compilation and the focused native/config suites passed again; the newer Engine changes affect Mac source and still need Mac qualification.

Native Linux: frozen source d5c8421911614fee847a5a6f939dd769b439d3c6, executable SHA-256 57d528cd3f619f6634a031272c075e5210860e4704458196ddfd14934bf9d97b. The public compiled client exercised the actual GUI in local Xvfb and one isolated Omarchy guest: exact PID/start/socket ownership, foreign and stale refusal, one durable retirement, unchanged synthetic settings, rejected legacy starts, restart with a new epoch, persisted retired-observed state and old-epoch refusal. No recording, clipboard or permission action was requested. Guest retention verified; disk and expiry were cleaned up. The affected source files are unchanged by the integrated base. These are native-port tests, not pill/window or installed-route proof.

Native Mac: the normal installer built and signed source 8101e0fe4f1e37ff56073a168ac5dc6eefebebf8 on macOS 26.6.2 ARM64 with Rust 1.99.1, Swift 6.4 and SDK 27. The public compiled port passed installed-GUI retirement, stale/foreign refusal, legacy-start refusal, restart persistence and exact PID/start/socket cleanup. The first driver attempt stopped before any retirement request on a /tmp versus /private/tmp path-string comparison; the same built app passed after filesystem-realpath comparison and a native alias/foreign-path control. That original failure remains retained. The initial Mac filesystem suite exposed a timestamp-based temporary-directory collision (4 passed, 1 setup failure); the existing host-fixture atomic-counter pattern repairs it, and all 6 unchanged-plus-regression cases passed on Linux and Mac. No product implementation changed for that fixture fix.

Source inputs were checked against all 1,675 original tracked blobs before and after the app build. The GUI executable SHA-256 was 09e482eb520e8ffb31396f7a3713d6980f024c4397e00c7bf7c0a599efd12377. Logs, signature and inventory evidence were retained and key hashes checked. The full private app archive was created remotely but was not downloaded before the session cap; it is unavailable locally and is not an admitted artifact. Provider cleanup is confirmed, the owned queue ticket is absent, and the run cost $0.45 for 30 billed minutes.

Current-base integration includes main a68e8d495ca4f5a55a34dc212012926b4eb73ff6; compilation, all 13 focused writer tests and all 6 config integration cases passed. Required fresh PR checks and affected Mac compilation remain gates. Exact-main GUI/package admission, compatible old-binary/bootstrap transition qualification and installed adoption remain separate delivery/activation gates. This scope covers only the legacy GUI capture writer. It supplies no global SDK/runtime clearance, owning-client close, hotkey release, capture exclusion, new dispatcher, Onboarding change, installed activation or release authorization.

This branch has not been deployed

No deployments
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