ci: guard NEXT code against new classic Cloud route calls

Merged
TE
3d ago
+450-0

Leo (2026-11-04): "ok and so in future, we shouldnt need to get so confused by classic cloud, right? like we dont touch it but we dont have to keep calling the same routes... were doing new cloud with cmux-platform and stuff"

What

A shrink-only lint, tests/test_classic_cloud_routes.py, that fails when NEXT code (Packages/macOS/CmuxNext/Sources, cmux-tui, webviews/src) adds a call to classic Cloud:

  • route:/api/vm and route:/api/runs: the classic route paths, in code and string literals.
  • base:cmux.com: a bare https://cmux.com (or www.) origin on a line that names an API base (api, base, origin, endpoint, server, backend). cmux.com with a path (deeplinks, docs, /pair, What's New, auth pages, files.cmux.com, /api/hang-reports, /api/models) never matches, and neither does a bare origin used as a browser probe, a settings sample, a demo tab or an OAuth client_uri.
  • base:cmux-staging: cmux-staging.vercel.app, which only ever served classic Cloud.

Comments, test files, fixtures, mocks, gallery files and Rust #[cfg(test)] modules are not scanned.

tests/classic-cloud-route-allowlist.json lists the 13 calls NEXT still makes today (file, pattern, exact count, one-line reason). It works like tests/send-path-cap-allowlist.json. The test fails on a match with no entry, on a count above or below the entry (so removing code means lowering the count), and on an entry that no longer matches. Against CMUX_GUARDS_BASE_SHA, an entry added or raised since the base fails unless its reason starts with keep: and says why. That leaves room for a reviewed move, such as Cloud config moving from Swift to Rust, without opening a hole for new debt.

Wired as a ci-group step in ci-guards.yml next to the send-path cap guard, so it runs in the Linux fast-guards job. Registered as linux-guard in tests/test-execution.toml.

Verification

  • python3 tests/test_classic_cloud_routes.py: 8 tests OK at the head, with and without CMUX_GUARDS_BASE_SHA set. The unit tests cover flagged forms, comment and non-API cmux.com URLs, #[cfg(test)] skipping, test-file scope, the shrink-only checks and the base ratchet.
  • tests/test_ci_run_guards.py and tests/test_ci_workflow_guards_are_wired.py pass. tests/test_ci_test_execution_registry.py has one error from its git-push fixture in this environment, and it fails the same way on base.

Changelog

none

risk: low (CI test only, no product code)

Agent session: agent session

🤖 Generated with Claude Code


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


Summary by cubic

Adds a CI guard that fails when NEXT code introduces a new call to classic Cloud, so NEXT's Cloud work stays on cmux-platform.

The guard scans Packages/macOS/CmuxNext/Sources, cmux-tui, and webviews/src for classic /api/vm and /api/runs route calls and bare cmux.com or cmux-staging.vercel.app API bases. tests/classic-cloud-route-allowlist.json lists the 13 calls NEXT still makes with exact counts; the list only shrinks. A new match, a raised count since the base (unless the reason starts with keep: and explains a reviewed move), or a stale entry all fail. Comments, test files, fixtures, and Rust #[cfg(test)] modules aren't scanned.

Wired as a ci-group step in ci-guards.yml next to the send-path cap guard and registered as a linux-guard test in tests/test-execution.toml. CI-only change; no product code.