Skip to content

cmux-cloud-start-core: the Cloud start's harness login decision in Rust over the app FFI (step A) - #32305

Merged
teamleaderleo merged 1 commit into
feat-cmux-nextfrom
lane/cloud-startchat-rust
Nov 2, 2026
Merged

teamleaderleo merged 1 commit into
feat-cmux-nextfrom
lane/cloud-startchat-rust

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

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 a cloud.startChat start takes about its machine's Claude login, readsMachine, guestTakesLogin, skippedTeamMachine, the one-line record for the log and cloud.machines, the harness-family-to-provider map, and the guest /etc/cmux/vm-kind probe and its parse. A 1:1 port of the app's CloudHarnessLoginDecision and CloudStartChat.loginProvider.
  • cmux-layout-reducer-ffi's JSON channel serves it as cloud_harness_login, cloud_harness_login_provider, cloud_guest_kind and cloud_guest_kind_probe.
  • Wiring: workspace member, the cmux-app-ffi lock 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 119ca32):

  • cargo test -p cmux-cloud-start-core: 10 passed (every case of the Swift CloudStartChatLoginTests decision tests, plus the wire shape and the probe run under sh).
  • cargo test --test cloud_harness_login in cmux-layout-reducer-ffi: 4 passed (the ops through the C ABI).
  • cargo clippy --all-targets -D warnings on 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 CloudHarnessLoginDecision and CloudStartChat.loginProvider (1:1), including the step, reason, machine-reading flags, log record, harness-to-provider map, and guest /etc/cmux/vm-kind probe.
  • cmux-layout-reducer-ffi exposes it as cloud_harness_login, cloud_harness_login_provider, cloud_guest_kind, and cloud_guest_kind_probe ops.
  • 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.

Written for commit 119ca32. Summary will update on new commits.

View guided diff Turn on auto-fix

…st, served over the app FFI (step A)

The NEXT Cloud start's harness login decision (the App's
CloudHarnessLoginDecision and CloudStartChat.loginProvider: the step, the
reason, readsMachine, guestTakesLogin, skippedTeamMachine, the record line,
the harness family to provider map and the guest vm-kind probe and parse)
moves to a new pure crate, cmux-cloud-start-core. cmux-layout-reducer-ffi's
JSON channel serves it as ops cloud_harness_login,
cloud_harness_login_provider, cloud_guest_kind and cloud_guest_kind_probe.

Step A of a two-step FFI move: step B re-pins the app FFI, makes the Swift
side call these ops and deletes the Swift copy and its tests
(CloudStartChatLoginTests' decision cases). No app behavior change here.

Wiring: workspace member, app-ffi lock entry, the app FFI release push
path, the app crate license gate's first-party list and the swift job route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-548f18c0a6d1ebb48240
@teamleaderleo teamleaderleo added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 119ca32: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr32305 -f ref=lane/cloud-startchat-rust -f platform=macos -f backend_mode=local

Shipped in:

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/41454213833 at 986d466 failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at f21d85e. This pull request is one of 5 merged since: #32305, #32312, #32182, #32265, #31743.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions github-actions Bot added risk:high Risk tier (docs/ci/risk-tiers.md) and removed risk:normal Risk tier (docs/ci/risk-tiers.md) labels Nov 2, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 2, 2026

Copy link
Copy Markdown

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp3n454wfq/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpu0l00665/summary-fail.json (live):/summary-fail.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 119ca32

Reviewer: codex gpt-6.1-sol xhigh, fast tier.

SHIP at 119ca32

Visual verdict: no images; Leo tries the build

I found no correctness, regression, security, or integration issues. License and app FFI release path checks pass; Cargo was unavailable in this box for local Rust execution.

Follow-ups: none

@teamleaderleo teamleaderleo removed the risk:high Risk tier (docs/ci/risk-tiers.md) label Nov 2, 2026
@teamleaderleo
teamleaderleo merged commit 8b62425 into feat-cmux-next Nov 2, 2026
250 of 272 checks passed
@teamleaderleo
teamleaderleo deleted the lane/cloud-startchat-rust branch November 2, 2026 13:27
@github-actions github-actions Bot added the risk:high Risk tier (docs/ci/risk-tiers.md) label Nov 2, 2026
teamleaderleo added a commit that referenced this pull request Nov 2, 2026
#32305 changed app FFI sources (cmux-cloud-start-core harness login)
without a re-pin, so the cmux-next checks FFI pin step went red on base.
Same diff as the release bot's #32121.


Agent-Session: https://cmux.com/deeplink/agent?id=aid-1fa4777434cab9ff131a

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo added a commit that referenced this pull request Nov 2, 2026
…, which also carries #32305's ops)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-548f18c0a6d1ebb48240
teamleaderleo added a commit that referenced this pull request Nov 2, 2026
…ift copy and its tests go (step B) (#32403)

* CmuxNext Cloud: the start's harness login decision calls cmux-cloud-start-core; the Swift copy and its tests go (step B)

Re-pins CCmuxAppFFI to cmux-app-ffi-8b624259cf79 (#32305, which added
the cloud_harness_login* ops). CloudHarnessLoginDecision keeps what the
start knows and reads the step, the reason, readsMachine, guestTakesLogin,
skippedTeamMachine and the record line from the Rust rules in one FFI call;
loginProvider, the vm-kind probe and its parse are FFI calls too. An FFI
that does not answer skips the login with reason ffi-failed (never silent).

CloudStartChatLoginTests drops its six decision tests (the Rust crate's
10 cargo tests cover every case) for one bridge test; the build gate's
UserDefaults tests stay, since that read stays in Swift.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-548f18c0a6d1ebb48240

* CCmuxAppFFI: pin cmux-app-ffi-2b457e203eac (base's newest FFI release, which also carries #32305's ops)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-548f18c0a6d1ebb48240

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo added a commit that referenced this pull request Nov 2, 2026
The repin job now runs check-app-ffi-pin.sh --verify-release before it
pushes app-ffi-repin, and writes the pin through GitHub's contents API so
the commit is the release App's, signed by GitHub. The review reconciler
reviews such a PR on first sight and the lander lands it, so base is red
on the FFI pin for about the build time instead of until someone notices
(#32305, #31927, #32436).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-1fa4777434cab9ff131a
teamleaderleo added a commit that referenced this pull request Nov 2, 2026
The repin job now runs check-app-ffi-pin.sh --verify-release before it
pushes app-ffi-repin, and writes the pin through GitHub's contents API so
the commit is the release App's, signed by GitHub. The review reconciler
reviews such a PR on first sight and the lander lands it, so base is red
on the FFI pin for about the build time instead of until someone notices
(#32305, #31927, #32436).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-1fa4777434cab9ff131a
teamleaderleo added a commit that referenced this pull request Nov 2, 2026
#32477)

The repin job now runs check-app-ffi-pin.sh --verify-release before it
pushes app-ffi-repin, and writes the pin through GitHub's contents API so
the commit is the release App's, signed by GitHub. The review reconciler
reviews such a PR on first sight and the lander lands it, so base is red
on the FFI pin for about the build time instead of until someone notices
(#32305, #31927, #32436).


Agent-Session: https://cmux.com/deeplink/agent?id=aid-1fa4777434cab9ff131a

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 119ca322 Deployed Nov 2, 2026 by teamleaderleo via cmux-tui tree preflight #101339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant