feat(cloud): select NEXT backend at runtime in Rust

Merged
TE
2d ago
+979-14

NEXT Cloud backend iteration currently requires separate app builds, and the native app and daemon choose deployments independently. This adds one Rust deployment table and a persisted per-bundle cmux cloud env get|set local|dev|preview-N|staging|prod --json selection. DEV defaults to dev, NEXT nightly defaults to prod, and Release/RC are locked to prod.

Leo: "let's also get our iteration loop good for the whole working on cloud type thing".

The CLI validates the app bundle before asking it to apply a saved change. The following app-wiring PR consumes this JSON and implements that apply method; an older app saves it and reports that a manual restart is needed. The helper waits for the exact app process to exit before reopening its bundle. Auth namespace revisions rotate only on an actual environment change, including when returning to an earlier environment. Preview share tokens retain their development issuer. NEXT nightly sharing now follows the selected deployment (prod by default), matching its API token issuer. Empty CMUX_SHARE_ROOM_URL still disables sharing. Classic deployment fallback behavior is preserved.

The state-root baseline declares this crate as the sole resolver for the validated per-bundle selection path. The table, persistence tests and CLI adapter stay in this seam so no second endpoint table is needed in the app.

Observed / Not run

šŸ¤– Generated with Codex

Agent session: agent session