Skip to content

Test build: launcher for Mac (do not merge) - #63

Draft
andersalm wants to merge 100 commits into
cursor/signed-update-notice-61f8from
test/launcher-mac-dmg
Draft

andersalm wants to merge 100 commits into
cursor/signed-update-notice-61f8from
test/launcher-mac-dmg

Conversation

@andersalm

@andersalm andersalm commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator
  1. Expert view: Trace ownership and the requested final state through every lifecycle caller, including Undo and Quit, and challenge process identity with a real forged argv0.
  2. Raw material: Started from pinned 592bb51293ad553e82ab73c9b4d65f7cd7fe869c: runtimeUpdate.ts:86, runtimeGateway.ts:353, runtimeGateway.ts:852, and runtimeTarget.ts:127. Also read original elastos-runtime #486 and the pinned Runtime v2.0.0 controller source.
  3. Methods: Trace callers, test compiled production modules with signed fixtures and deterministic lifecycle interleavings, run a native forged-argv0 counterexample, then run the complete launcher suite and GitHub Electron/Runtime checks. Local packaged verification uses only the guarded loader-only verifier.
  4. Independent check: Identical focused tests against the pinned original production code yield 29 failures and 5 preexisting passes; the fixed code passes all 34. The full local suite passes 293 tests with 290 passes, 0 failures and 3 platform skips. Exact-head CI receipts follow below.

The Mac launcher follows signed Runtime releases on the selected channel with a 2.0.0 floor, adopts an independently proved installed Home, and keeps lifecycle requests ordered.

  • Enforce the floor in verifiedHeadForRollback for both Restore and the CID saved before Update. Signed 1.9.9 heads cause no restore/update mutation.
  • Clear ownership and report Stopped/Error on spawned and adopted controller exits. home --browser owns gateway-child restarts; the launcher waits for an explicit Start after controller exit.
  • Serialize lifecycle control calls, including Start, Stop, Restart, Mac Update/Undo and the Stop used for removal or Quit. A failed Stop retains its supervisor; a later Stop or Quit cancels a pending update restart. A refused signal reports Error instead of leaving Stopping cached. Mac controls retry a complete ownership proof at most three times for transient metadata gaps; the final signal identity check is never skipped. Persistent refusals use fixed diagnostic codes, with whitelist-only test output. The crash check verifies the renderer’s actual Needs attention label.
  • Verify macOS executable paths against the installed binary or the selected source's install_path, including a different basename or symlink. A bundled 24-line Mac helper uses proc_pidpath and proc_pidinfo to supply the executable and precise birth time; both are rechecked before TERM/KILL. Bound lock/status reads and bind controller adoption to the host generation and parent. A stale controller record grants no authority over that controller; Stop can still use the separately proved orphaned host. Write previous-head.json with a temporary file, fsync and rename.
  • Keep the Electron profile/logs under ~/.elastos-launcher/electron, preserve Runtime's own update decisions with a launcher-owned signed fallback when missing, and keep explicit control of Home when closing the window or quitting.
  • Manual Mac packages retain Developer ID signing when available and use the guarded ad-hoc fallback otherwise. Test notarization is opt-in; tagged builds keep strict notarization/stapling. No tag or release is part of this work.

Validation for 66d8dd0ebc64da2ee368b82c0734883d9edc98f5:

  • Local elastos-heavy npm test: 293 tests, 290 passed, 0 failed, 3 platform skips.
  • Test: PASS, 293 tests, 290 passed, 0 failed, 3 skips.
  • Runtime smoke: PASS, all 9 jobs on this exact head.
  • Build: PASS, all three platform builds; release skipped.

Focused fail-before/pass-after evidence from test/runtime-round4.test.js (same test source, real compiled consumers):

592bb51: tests 34; pass 5; fail 29
66d8dd0: tests 34; pass 34; fail 0
Item Representative regression names Before → after
1 rollback and update reject a signed head below floor default before mutation; applyRuntimeUpdate rejects signed 1.9.9 from stdout without updating or storing it not ok → ok
2a spawned controller exits clear ownership and allow an explicit Start; adopted controller exits clear ownership and allow an explicit Start not ok → ok
2b Mac update preserves the supervisor and never starts after failed Stop; Mac rollback serializes a later quit and leaves Home stopped; Undo in the launch controller uses the active target lifecycle not ok → ok
3 adoptInstalledGatewayProcess rejects a lookalike executable and accepts the stored install_path; rechecks host/controller birth; caps the host lock before reading it; Mac adoption uses the real executable even when argv0 names the installed binary not ok → ok
4 previous-head store fsyncs a temporary file before rename and preserves the old record on failure not ok → ok

The Mac Electron scenario kills its own spawned controller, requires Error, stops any retained proved Home, and explicitly starts a healthy Home again. It also gracefully terminates its adopted controller, requires Stopped and unhealthy Home, then explicitly starts Home. Existing install, Open, window close, Update, adoption, Quit, foreign-listener and packaged-profile checks remain.

The initial CI Test failure exposed a Mac fixture using the x64 runner's default architecture. Both Mac fixture calls now pass arm64; a simulated x64 host replay passes all 15 update cases. Native testing also showed that ps comm is spoofable; the final executable identity uses libproc. A positive test against a hardened fixture in a private directory exposed vmmap path redaction; its identical fail-before/pass-after replay against the vmmap implementation is retained. The helper targets macOS 11 explicitly, with both Mach-O headers checked, and the package verifier executes the actual unpacked helper before any packaged launch. These and other reproduced findings were recorded in the failure ledger (1216–1221, 1223–1227, 1229–1230, 1232–1233, 1232–1233).

Premortem passed with the actual PR base. Checked explicit host inputs, real-module fixtures, complete test/caller coverage, both version-floor paths and every signal stage, and secret output. The default premortem cannot resolve origin/develop here, and the two elastos-runtime shell gate scripts do not exist in this launcher repository; both were attempted and are not passed. The rented Rust full check does not apply to this Node/Electron branch, which is not pushed to develop.

Linux spawn arguments, index.ts Linux window handling and windowsRuntime.ts are unchanged from 592bb51. The round-3 DMG remains untouched at SHA-256 9a44f80920955223145b49cbb5107319e8c43ac69e0141ddddb5b74d598c4ed2. The new DMG, SHA-256 file and full per-test verification report are in ~/omp-inbox/launcher/next/. SHA-256: 528bb08032ead6ce32f0766e09bf28239e5b16fde229511afb2a025a01e802ff. The delivered app passed image checksum verification, deep/strict code-signature verification, packaged native-helper execution, both macOS 11 architecture headers and the guarded local loader-only check. Full packaged launches ran only on the GitHub runner. A real signed Stable upgrade to a newer version remains unavailable; same-version Update and signed verification are exercised. This PR stays draft. No merge, tag or release.

Final Mac runner evidence:

Home retained after controller crash: false
PASS controller crash reports Error; Stop and explicit Start recover a healthy Home
PASS adopted controller exit reports Stopped and explicit Start starts Home again
PASS Stop works for the adopted Home
PASS Quit and stop Home closes the listener

The retained-orphan path is covered by the direct adoption regression; this live crash run observed Home already stopped. Test and all nine smoke jobs checked out b85f3586599f8686a296e1e04f511861b0f08104, whose tree equals head 66d8dd0 (parents include that head). Full local per-test fail/pass lines, all check results and failure-ledger records are in the verification report. No ready/merge/tag/release action was taken.

andersalm and others added 30 commits November 7, 2026 20:39
Set up imports the distro and returns while it is stopped. The next
Install click is the first command into that distro. These tests fail
while that command is still the 20 second tool check.

Co-authored-by: Cursor <cursoragent@cursor.com>
The 3 minute wait ran only when Install itself imported the distro.
Set up imports first, so Install saw a listed distro and used the
20 second tool check for the first boot. CI run 42237456986 failed
20.3 seconds after that click.

Co-authored-by: Cursor <cursoragent@cursor.com>
The wait, the 20 second tool check, and the test already show the order.
A second copy of that fact in a comment is not needed.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Jetson uses glibc 2.35, and the bundled fpm binary is x86.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the Ubuntu 22.04 arm64 jobs, and poll Linux status from Node so the page CSP allows the check.

Co-authored-by: Cursor <cursoragent@cursor.com>
Version 26.16.1 already downloads fpm-1.17.0-ruby-3.4.3-linux-arm64v8, so the system fpm install is obsolete.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Windows Install job reached Open my computer and /healthz.
It did not click Open Home, Stop, Start, or the update check.

Co-authored-by: Cursor <cursoragent@cursor.com>
…is absent.

Co-authored-by: Cursor <cursoragent@cursor.com>
Runtime 2.0.0 does not write update-check.json.
The Mac branch derives that record from the signed head.
Windows now writes the same record inside the distro.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Windows Update stays one command. The Linux test fails until that restart lands.

Co-authored-by: Cursor <cursoragent@cursor.com>
A closed window leaves Home and the tray. Update and Undo stop Home, run the command, and start Home again.

Co-authored-by: Cursor <cursoragent@cursor.com>
The update controller does not hold the listen socket. Its child does.

Co-authored-by: Cursor <cursoragent@cursor.com>
elastos gateway never enters the update controller, so System update inside Home cannot run on Windows. Start home --browser, signal the proved controller on Stop, and start Home again after Update and Undo.

Co-authored-by: Cursor <cursoragent@cursor.com>
A tag build is a release: it must notarize and fail closed. Test builds
(dispatch without the notarize input) still skip Apple. Drops a test that
pinned the workflow expression text.
Matches the platform names (Login Items, Startup apps) and Docker Desktop's
wording, avoids 'sign in' (Home passkey sign-in), and says Home keeps running
when the window is closed.
… drag start

Run 42501403861: the e2e read #logs-content with innerText, which is empty
while Details is closed (install had reached Open Home); textContent reads it.
The top-strip drag moved the window 60 x 35 for a 60 x 45 OS drag, because
macOS starts dragging after a few points; assert real movement instead of an
exact delta.
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