cmux NEXT Cloud: diff viewer and file viewer read the VM (#25581)

Merged
AU
6d ago
+3838-316

Fixes #25581.

Cloud diff and text-file tabs read the VM through its daemon. Terminal links, explicit file actions, diff-file opens, and Markdown source/page switches retain the file's machine. A same-path Mac file cannot substitute for VM content or become a saved local route. Finder and external-editor actions remain local-only.

Cloud diffs are read-only. Offline notices name the machine and retain the patch or draft; a healthy unchanged fingerprint clears the notice. Text pages use remote reads, revision-checked saves, and cancellable change watching. The two-second stat watch is needed because the daemon has no file-event subscription. Remote HTML/SVG stay source-only; remote images, browser previews, and local draft recovery are unavailable.

Diff tabs are daemon-backed and movable. Pending and repeated opens report confirmed surfaces, creation failures finish placement work, and concurrent Changes opens place one diff beside the chat. Dock placement resolves durable tab identity within its owning machine and retains pending docking intent across simultaneous opens.

Verification

Head: 6e54ac82041a5e6dc83f6c2b14839aaf29a20341. Merged base: 83fb6a39979cd1824c8f6e4987e44ccb65ba872b. Both histories are preserved through normal merges and pushes.

  • Fleet 085e7a9981d9627f9b2bee70: 10 native suites passed, 65 tests total, including all 8 CloudDiffPlacementTests, 9 CloudFileRoutingTests, file/diff viewer tests, docking, side-open strips, remote wiring, and terminal-link security. The concurrent Changes test failed on the previous head af250d819582a0945d7db285eaa5cf022583bc72 (fleet 98084176286d1eb0ba39cb4f), reporting a failed second move; it passed at this head. The corrected test-only baseline 582c242b8c119459e6fae8b67d19bf2ba9b13b49 also reproduced the earlier docking timeout (fleet 7d958f9d5525e43a11e3a22d).
  • The additional ClickedLinkFocusTests suite executed 10 tests with 3 failures. All three test names also failed on base 625b1ca07f9d8aaebeab023a446f8f56dd34e264 (fleet aa2572660878c0daa7adf46e, 5 failures total). The merged base changes only this suite's cleanup trait, not its assertions or the link-placement implementation. These inherited browser-placement failures are not a green suite claim.
  • Offline terminal routing and scheme-less web fallback each have a test-only red before the repair: bdfcc11742d4be9977a6d36b3a0e7f266f648f79 and b9e8aad210337798fa29e3b2e33ab0d6cbce5d85. All 9 routing tests passed at this head.
  • Freestyle VM: cd webviews && bun test test/diff-viewer-freshness.test.tsx test/file-page-machine.test.ts passed 9 tests / 34 expectations. Full web lint passed in 75.8 seconds, scheduled sequentially to fit VM memory. Exact source trees: webviews 2611a120c3e54c3ee8aa87a1081f5d5bb2f9bcdb, web 8e045a7d1fab5b0799310191fb3793c2a7c89599.
  • Swift syntax, diff whitespace, and the installed pre-push gate passed. No force push, check skip, or hook bypass was used.
  • Exact-head tagged build passed: fleet db3353e21b895a6da7f94b32, tag issue-25581-cloud-docking-verified, SHA-256 cc3cf43e21e1130bc0d04a8dc7d0c17d1830a55fbf2d4eb3ccc8c183f11d7b9b. Actual bundle name, publication digest, and worker cleanup were verified.
  • Fresh-home launch passed on a capture Mac: Home appeared at 10 seconds and the app stayed up for 30 seconds without crashing.
  • Independent exact-head correctness review found no blockers. The review-dependent defaults guard passed.

Focused native regression command (the same suite executed on the failing baseline and repaired head):

cmux-ci run --class light --script scripts/ci/package-test-lane.sh \
  --ref SHA --arg=suite --arg=Packages/macOS/CmuxNext \
  --arg=CloudDiffPlacementTests \
  --env CMUX_CI_XCODE_APP=/Applications/Xcode_26.6.app

Observed / Not run

App-size moves (2026-10-31, maintainer agent): the PR's new App code moved to packages, and the +709 app_lines exception is gone. Evidence for the moves:

  • Head 78180c57a638: fleet compile-check c94ea8cf063b passed. Fleet step 07d89cb4356d passed 7 of 9 suites.
  • CloudDiffPlacementTests and CloudFileRoutingTests first gave "no result (no cmux-tui)": the fleet's cmux-tui-client component key missed workers/cmux-vm/cli (fixed in cmuxterm-hq #5717). After that fix deployed, both suites RAN and passed at 78180c57a638: fleet step 89c3e7ce2ade, 8 and 9 tests. They also passed at an unpublished cmux-tui tree, built from source on the fleet (step 7fc9c4e24c7a).
  • The cmux-next swift test red at 78180c57a638 is a base finding: all 5 failed tests also fail on the plain feat tip a7a448a195b2 (step 594d18ba0358).

Seven added localization keys are populated across all 21 locales. The placement and terminal-routing repairs add no strings. The existing independently reviewed +709 App-line exception remains unchanged.

The current-head release-notary failure matches the base failure: missing Glaeda signing-hook digest df0e90b42c73838e01855a51636b7ed5c47fd918faf76ab815b5ce78aec54e57. Guard status wraps that failure.

Live Cloud end-to-end transport remains UNVERIFIED. Fake-daemon tests, compilation, and the fresh-home launch do not establish that behavior. No capture: existing native scenes lack a connected Cloud VM; earlier gallery captures were refused by the privacy tool, and the fresh-home screenshot was not uploaded because agent-author privacy metadata was unavailable.

Try it

Open the tagged build through the team Tag Opener. It is published with a local backend; the non-launching tag check passed. In a connected Cloud workspace, open a terminal file path or Changes. It should show VM content and follow changes. Switch Cloud Markdown between source and page, then disconnect: the viewer should name the machine and retain content. Repeated Changes opens should keep one diff beside the chat. Remote diffs stay read-only.

Changelog

Fixed: Cloud diff and file viewers show VM content, preserve file identity through source/page actions, and report when the machine is offline.