CmuxNext Cloud: the start's harness login decision calls Rust; the Swift copy and its tests go (step B)

Merged
TE
3d ago
+95-142

Leo: "But why are there so many tests in Swift? It's Cloud code. Why is it not in Rust?" and "Why are there so many of these tests in the first place?"

What

Step B of the move #32305 started: the NEXT Cloud start's harness login decision is now Rust's, and the Swift copy and its tests go.

  • Re-pins CCmuxAppFFI to cmux-app-ffi-2b457e203eac (base's newest FFI release; it carries #32305's cloud_harness_login* ops and #31927's hover ABI, which Swift does not call yet).
  • CloudHarnessLoginDecision (CmuxNextCloudCredentials, which now links CCmuxAppFFI) keeps only what the start knows so far. It reads the step, reason, readsMachine, guestTakesLogin, skippedTeamMachine and the record line from cmux-cloud-start-core in one FFI call. loginProvider, the vm-kind probe and its parse are FFI calls too. If the FFI does not answer, the start skips the login with reason ffi-failed, and the record says so, so the skip is never silent.
  • CloudStartChat+Login drops its own loginProvider and calls the decision's.
  • CloudStartChatLoginTests: its 6 decision tests are deleted; the crate's 10 cargo tests cover every case. One bridge test replaces them. The 3 build-gate tests stay, because the UserDefaults read stays in Swift.

No behavior change: the Rust rules are a 1:1 port, checked case for case in #32305.

Takes back #31305: on purpose. Its decision rules (the team-guest allowance included) now live, unchanged, in Rust (cmux-cloud-start-core, #32305), and this Swift type calls them. The behavior is the same.

Tests

  • cmux-ci run --class light --script scripts/ci/run-swift-testing-suites.sh ... CMUX_SWIFT_TEST_SUITES=CloudStartChatLoginTests at a6b1903b9f75: 4 tests in 1 suite passed.
  • scripts/cmux-next/check-app-ffi-pin.sh --verify-release: the sources match 2b457e203eac and the release checksum matches.
  • Rust side (from #32305): cargo test -p cmux-cloud-start-core gave 10 passed; the FFI cloud_harness_login test gave 4 passed.

Observed / Not run

I ran the suite above and the pin check. I did not run the full CmuxNext suite locally; CI runs it.

Changelog

none

šŸ¤– Generated with Claude Code

Agent session: agent session