cloud link: wire outgoing Native broker

TE
2d ago
+20943-1257

HOLD: integration build only

Wire the app-owned Native Cloud child into the cmux link process. The child now accepts --native-cloud-broker-fd, validates the signed v2 enrollment bootstrap, serves bounded newline broker requests for cloud.machine.connect_info and cloud.machine.link_token, and routes VM peers only through the enrolled mesh tunnel. Legacy relay and direct/Freestyle routes remain available for non-Native links.

Leo's request: "we care about our new cloud" and a signed NEXT DEV build whose Cloud uses the new Worker and app-server link.

Validation: cargo fmt; focused broker/route tests and cmux-tui compile check will run on the fleet.

agent-identity footer --repo manaflow-ai/cmux
agent session


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


Summary by cubic

Wires the app-owned Native Cloud child into the cmux link process. The child accepts --native-cloud-broker-fd, validates the signed v2 enrollment bootstrap, serves bounded newline broker requests for cloud.machine.connect_info and cloud.machine.link_token, and routes VM peers only through the enrolled mesh tunnel. Legacy relay and direct/Freestyle routes remain available for non-Native links.

Cloud start

  • cloud.startChat starts a new chat's first send in Cloud: the App picks a free machine the person owns (or creates one), copies the folder with Move to Cloud's sync, opens the chat there, and closes this Mac's unstarted tab.
  • The folder named by the page is copied only when it is inside the pane's roots; each send gets its own copy on the machine, and a retry lands on the same machine, copy and chat tab so the prompt is never sent twice.
  • A chat's first send that a revoked OAuth token failed is sent again once, 2 s later; later failures are shown as before.

Native receiver

  • The VM's original enrollment identity is read under root and served to the supervised child over an authenticated socket; no account bearer, install private key or grant secret leaves the root host.
  • Adds cloud.vm.network_policy and cloud.vm.receiver.lifecycle with structured peer policy, bounded request/reply frames, and a receiver lifecycle phase state machine.
  • A machine's creator answers owner on any team; members and agent tokens keep team access.
  • Signed NEXT DEV builds now default to the development Worker and staging sign-in with isolated credential persistence so the channel works without launch overrides.