Cloud: the machine creator is owner on shared teams (next)

TE
5d ago
+190-34

The creator of a Cloud machine now receives owner on a shared team of any size. Other members still receive team; their existing mayUse, connect, exec and filesystem access is unchanged. The link token signs the same caller-specific answer.

Leo, answering whether the creator counts as owner on a shared team:

yeah let's just go ahead we need to not worry that much about these and just get the initial end to end flows working and working well adn looking good and feeling good

This is the feat-cmux-next half. The production web change lands separately on main, because Vercel deploys web/ from main. Contrary to the original brief, #28479 (aca9b0ca) landed on main, so this PR also ports its attach-only bounded membership lookup to next (including next's SSH attach route). The guest-wide kind is unchanged. Each web attach checks that the creator remains in the team; missing, errored or timed-out membership reads answer team. The existing three-second lookup is forked under the request and joined at the response, and cancels when that request ends.

Takes back #28479: Leo explicitly authorized creator ownership for shared teams, removing the one-member restriction while retaining the failure-to-team behavior. Supersedes the personal-team-only caller rule of #26223 and #27940 for creators.

Risk: the caller-specific owner answer allows the creator's own agent sessions on a shared machine. It does not restrict teammate access, change guest-wide ownership, or make agent tokens owners. No capture: API classification and token behavior only; no UI layout changes.

Validation:

  • cd web && bun test tests/vm-attach-vm-kind.test.ts: 13 pass / 2 fail with the one-member rule at 1e3bd2a293122e81bab256c154338f34518bd5f1; 15 pass / 0 fail at the final head. Covers a three-member team, both attach transports, a teammate, removed creator, missing/error/timeout reads, exact IDs and personal accounts.
  • Web typecheck, complexity, managed relay catalog, changed-file ESLint, web lint script and static pre-push gate passed.
  • Exact-head Linux run 41160283115: 258 web tests passed, 85 database-gated tests skipped, zero failures; backend typecheck passed. Its red-test setup then stopped because the shallow snapshot lacked the parent commit.
  • Exact-head Linux run 41160615786 passed the corrected backend red/green discriminator and focused owner-answer, connect and link-token tests. The old personal-team predicate was reinstated only in the isolated runner for the red step, then the reviewed source was restored for green.
  • Independent gpt-6-astra high/fast review: SHIP at a8a78db99885ecc0ee02e57ad3adb3bb203a2ace. Non-blocking follow-up: the alternate Run attach-ticket route omits the team directory; handed to the Cloud area owner for tracking.

Observed / Not run

The checks above ran before the base update. At final head a8a78db99885ecc0ee02e57ad3adb3bb203a2ace, the full backend test job passed, as did the fast gates and CI guard group. The two release-notary failures (RunsOnFallbackTests.test_a_picked_signing_label_has_a_rerun_alternative and RunsOnFallbackTests.test_no_runs_on_chain_ends_on_the_reserved_side_label) match base run 41171054996 at ac3d2e91865347e8a0ddda72b615fc078b056c71 per scripts/ci/test_reds.py: own: false, both tests shared, no crash or truncation. Both runs completed all 19 tests with the same two failures. The dependent Guard status reports that same base red. The original fleet compile status waiter timed out without a controller result. Recovery job 02217963ad542b4c98c9bbee then passed on Linux at the same head via cmux-ci compile-check --ref a8a78db99885ecc0ee02e57ad3adb3bb203a2ace --app --release --recipe-version 2: app passed (116 seconds), cmux-tui passed (40 seconds). No live VM or UI dogfood was used. The main counterpart #28788 merged as 633553a426a8d2c92f8f51223231137b03e250de.

Agent session: agent session