Fix SSH releases missing remote daemon assets
Fixes #12648.
Summary
Released apps still need cmuxd-remote for SSH bootstrap, but the daemon, embedded manifest, and release uploads were removed. Restore the supported daemon and reject releases whose app manifest and artifact checksums disagree.
- Build Darwin/Linux arm64/amd64 binaries, embed the manifest before signing, verify it through the signed bundle’s CLI, and publish every required asset. NIGHTLY uses immutable names shared by its app variants.
- Bundle compressed, checksum-verified daemon resources in unpublished fast/branch dogfood apps. Those builds can bootstrap without referencing unpublished GitHub assets; public releases retain their download path.
- Retain the restored daemon’s authentication and filesystem hardening. Fix the native macOS cold-start lock race and prevent a blocked PTY input write from blocking resize or reattachment at different dimensions.
Trade-offs: restoring the daemon also restores the CLI, persistent PTYs, proxying, and relay code the shipped client still requires. A daemon-free migration must replace those together. Unpublished dogfood bundles grow to include the four compressed platform assets. No relay methods are added to the allowlist.
Testing
- Test-only packaging commit
e604d8d5d1failed the two bundled-asset integrity regressions in CI; the fix passes all 12 verifier cases. - Native macOS Go daemon suite and race suite passed on a leased fleet Mac. A separate baseline copy with the old PTY mutex reproduced both resize and changed-size reattach timeouts; the fixed tests verify the actual PTY dimensions.
- Remote Swift selection passed 36 tests in four suites, including seven bundled-resource cases and the existing HTTP/checksum behavior.
- Stable and nightly asset tests built all four targets in each variant. The 10 release-asset guard tests, nightly workflow guard, Swift length check, Xcode normalization, package grouping, and lockfile policy passed.
- Merged at head
a8989a2e08as8c43c63db1. The redAgent notification semanticscheck on that head was not caused by this PR: the job never ran a test, it failed compilingcmuxTests/MobilePairingConnectionTransitionTests.swiftagainst aMobilePairingModelinitializer thatmaindid not have yet when this branch last merged it.mainhas since fixed that (#12478, #12726), and this branch never touched either file.
Localization audit: the Swift changes introduce no new literal app UI/help/error text; failures use Foundation’s localized Cocoa errors. Added packaging-script diagnostics are internal release tooling.
Runtime verification
App-level SSH was exercised on tagged Debug builds against a reachable macOS arm64 host (cmux-mac-mini), covering both ways a build obtains its daemon.
Bundled-manifest path (what unpublished fast/branch nightlies use), on a8989a2e08. Local-build fallback disabled, embedded manifest 0.64.24-verify.a8989a2e08 whose GitHub release URL does not exist, so a network download could not have succeeded.
remote.build.downloadedlogged 189 ms after the platform probe, i.e. a local decode ofResources/remote-daemons/*.deflate. All four bundled assets decode withNSData.decompressed(using: .zlib)and match the embedded SHA-256s.- One digest across the manifest, the local cache, and the binary installed on the host.
remote.bootstrap.readyin 6.2 s with all seven capabilities the client requires; proxy ready; commands execute on the remote host.- Disconnect in under 1 s with the remote shell and persistent daemon still alive; reconnect in about 3 s onto the same shell PID with its exported variable intact.
- Relay:
cmux pingfrom the remote shell reaches the local app; reading an unowned local workspace from the remote returnsremote_relay_denied.
Dev go build fallback path, on ee2c84bcd1 (this branch merged with main through #12726; verified after this PR had merged, and identical to main at 8c43c63db1 in every SSH, daemon, and CLI file). Daemon 0.64.24-dev-45a38ea95985 built from daemon/remote, uploaded, and handshaken.
- #12726's new daemon admission accepted it (client
0.64.24, Debug build, 12-hex dev fingerprint). - A fresh attach holds the local tty raw (
-icanon -isig -echo -icrnl -ixon -opost). An arrow-key select menu with focus reporting moves per keypress (reads1b5b49,1b5b42,1b5b42,0d, no literal^[[on screen), and Ctrl-C interrupts the remote program while the attach process survives. - Disconnect/reconnect again returns the same shell PID and environment.
Release contract vs. #12726's exact-version admission. The CLI now rejects an attach unless the daemon's hello version equals the app's CFBundleShortVersionString (Debug builds also accept <version>-dev-<12 hex>). This PR already pins that: build_remote_daemon_release_assets.sh stamps main.version from the same --version it writes into the manifest, tests/test_remote_daemon_release_assets.py runs the built native artifact's hello and asserts that version for stable, nightly, and rc, and verify_remote_daemon_release.py requires manifest.appVersion == CFBundleShortVersionString on the signed bundle.
Not covered at runtime. Only a darwin-arm64 host was exercised; darwin-amd64 and both Linux targets are covered by the build and checksum tests, not by a live session. The reporter-style Darwin x86_64 host was offline during testing. The proxy check shows the tunnel carries traffic but does not distinguish egress host. The release and nightly workflows have not yet been observed running end to end with these steps.
Tagged dev builds were launched locally for this dogfood. This PR merged at 2026-09-17T08:00Z; the ee2c84bcd1 verification above completed after that. On main at 8c43c63db1 the nightly build guard, the nightly prune guard, and the 12 daemon release verification tests pass.