cmux-cloud-start-core: the Cloud start's harness login decision in Rust over the app FFI (step A)
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 A of a two-step app FFI move: the NEXT Cloud start's harness login decision moves to Rust.
- New pure crate
cmux-tui/crates/cmux-cloud-start-core(harness_login): the step and reason acloud.startChatstart takes about its machine's Claude login,readsMachine,guestTakesLogin,skippedTeamMachine, the one-line record for the log andcloud.machines, the harness-family-to-provider map, and the guest/etc/cmux/vm-kindprobe and its parse. A 1:1 port of the app'sCloudHarnessLoginDecisionandCloudStartChat.loginProvider. cmux-layout-reducer-ffi's JSON channel serves it ascloud_harness_login,cloud_harness_login_provider,cloud_guest_kindandcloud_guest_kind_probe.- Wiring: workspace member, the
cmux-app-ffilock entry, the app FFI release push path, the app crate license gate's first-party list (and its test), and the swift job route.
Step B (next PR, after the FFI release this merge publishes): re-pin CCmuxAppFFI, make CloudHarnessLoginDecision a thin caller of these ops, and delete the Swift copy and the decision cases in CloudStartChatLoginTests (6 of its 8 tests; the 2 kept test the build gate's UserDefaults read, which stays in Swift). No app behavior change in this PR.
check the app FFI pin is expected red here: the FFI sources change without a new pin, as in every step A (#31945, #32055).
Tests
Ran on the fleet (cmux-ci test, run 41449956072, at 119ca3223258):
cargo test -p cmux-cloud-start-core: 10 passed (every case of the SwiftCloudStartChatLoginTestsdecision tests, plus the wire shape and the probe run undersh).cargo test --test cloud_harness_loginincmux-layout-reducer-ffi: 4 passed (the ops through the C ABI).cargo clippy --all-targets -D warningson both crates: clean.python3 -m unittest tests.test_app_crate_licenses,scripts/cmux-next/tests/app-ffi-release-paths.test.sh: pass.
Changelog
none
š¤ Generated with Claude Code
Agent session: agent session
Summary by cubic
Moves the NEXT Cloud start's harness login decision from Swift to a new Rust crate (cmux-cloud-start-core), served to the app over cmux-layout-reducer-ffi's JSON channel. This is step A of a two-step migration: no app behavior changes here.
- New pure crate ports the app's
CloudHarnessLoginDecisionandCloudStartChat.loginProvider(1:1), including the step, reason, machine-reading flags, log record, harness-to-provider map, and guest/etc/cmux/vm-kindprobe. cmux-layout-reducer-ffiexposes it ascloud_harness_login,cloud_harness_login_provider,cloud_guest_kind, andcloud_guest_kind_probeops.- Wires the crate into the workspace, app FFI lock, release push path, license gate, and swift job route.
Migration
Step B (next PR): re-pin CCmuxAppFFI, make the Swift CloudHarnessLoginDecision call these ops, and delete the Swift copy plus 6 of CloudStartChatLoginTests' 8 test cases. check the app FFI pin is expected red here.