Repository navigation
Cloud NEXT: route rename and idle policy through CloudDO (HQ brief 09) - #34096
teamleaderleo wants to merge 5 commits into
Conversation
|
Validation receipt for HQ brief 09 (2026-11-03): |
teamleaderleo
left a comment
There was a problem hiding this comment.
Independent review — CloudDO settings route (continuation of HQ #6236 / brief 34)
Exact head: a77378425d7c1ac855c70b49c63912d5c9156554 · Source-contract verdict: no new blocking defect found in the rename/idle-policy path. Runtime verdict: macOS/Cloud integration unverified, so retain the PR's draft/HOLD state pending its own focused suites and one app-server readback.
I independently traced the complete 5-file change into the current platform reducer and vendored protocol:
CloudMachineSettings.swiftsendscloud.machine.renamewith{machine,name}andcloud.machine.idle_policy.setwith{machine,idle_seconds}; both use a unique key, request.userorigin, and demand an acknowledgement for the same machine and exact new value beforeCloudServiceupdates its local row.- Platform
cmux-platform main@794483e7aaee755341c8cbfaf334a7b2148111df,src/server/cloud/domain/Cloud.ts:632–654, implements both ops with creator/adminmayManageauthorization and a{machine:publicMachine(row)}result. Its pinned protocol accepts names 1–80 characters and idle seconds 0–604800. The client's 0–10080 minutes conversion matches exactly. CloudAppLinks.ops(local:)downgrades a requested.userto.scriptunlessconnection.userOriginAllowed; the local client cannot simply assert user provenance on an untrusted connection. Classic mode retains its/api/vmpath.- The Cloud page already uses the canonical CloudDO operations and trims/refuses blank rename values. This PR fixes the native
CloudServiceroute, rather than duplicating page logic. A cleared machine name remains unsupported by CloudDO's 1–80-character contract, as the PR author acknowledges. - List refresh decodes
idle_policy.idle_secondsinto integer-minute UI values; for an existing 61-second policy the code intentionally showsnil, and leaves a fractional policy unchanged server-side.
Executed bounded experiment: Swift 6.2.1 on Linux, compiling the 32-line exact production CloudMachineSettings helper body with minimal JSON/CloudAppOp test doubles (no actual platform connection). 12/12 assertions passed: rename, idle settings 0/15/1440/10080 minutes; negatives −1 and 10081 rejected before a call; wrong machine ID and wrong policy acknowledgements refused; exactly five accepted calls; unique nonempty mutation keys and .user request origin; 15 min = 900 seconds. This executes the actual helper logic, but tests only a stubbed transport and does not validate the Swift package integration, platform authorization, signed binary, or a real machine.
Targeted next checks for the owner:
- Run the PR's
CloudMachineSettingsTestsandCloudIdlePauseTestson macOS, including exact success/refusal transport cases, then an app-server readback after a list refresh. - Exercise account/team changes and a scripted/non-user-origin request: owner/server rejection must leave the machine row unchanged.
- Test the native rename action's empty/whitespace name explicitly: CloudDO rejects it; the Cloud page blocks it. Either provide a clear validation error before the request or intentionally exclude the clear-name action.
- Confirm the current CloudDO 24 h idle backstop is visible even if a machine policy is 7 days or 0.
Actual work: cross-repo contract inspection plus executed isolated Swift assertions, no code pushed to the existing owner branch, no VM, credentials, merge or deployment.
HQ brief 09: complete the safe CloudDO settings routes
Source inspection at
cmux feat-cmux-next@6c3fe3648ba4b44e7bf38c4982a665ec2d5d5712andcmux-platform main@794483e7aaee755341c8cbfaf334a7b2148111df. Follow-up to cmux#32866, which already moved app-server Pause/Resume to CloudDO.Problem
CloudService.renameMachineandCloudService.setIdlePausestill unconditionally call the classicCloudAPIClient(PATCH /api/vm/{id}andPUT /api/vm/{id}/idle-pause). NEXT app-server creates/listing usecloud.machine.create/listwith CloudDOvm_<20>IDs; these classic routes require the older registry.Change
.appServermode route rename tocloud.machine.rename {machine,name}and idle policy tocloud.machine.idle_policy.set {machine,idle_seconds}, each with one mutation key and verified app user origin. Classic mode keeps its original API calls.MachineNamecontract (1–80 characters).idle_policy.idle_secondsfrom CloudDO records into the existing app minute field, so a list refresh preserves a setting. Fractional-minute policies remain unspecified in the app's minute-only display.Explicit exclusions
deleteMachinestill requires a separate G8 person-approvedcloud.machine.deleteflow. It must preserve the native destructive confirmation, team pin, same-key retries acrossapproval.pendingandmutation.indeterminate, and tombstone/list reconciliation. This draft intentionally leaves deletion for its owning issue. Also, the app-server create currently rejects nondefault requests, including--persistent(CloudMachineRequest.isDefault); this PR changes the existing idle-policy set operation only.Validation / review
cmux-platform/src/server/cloud/domain/Cloud.tshandles both settings asupdatewithmayManage; the vendored protocol requiresidle_secondsand returns{machine}.CloudMachineSettingsTestsandCloudIdlePauseTestsplus a genuine app-server machine check before shipping. Kept draft deliberately.Refs: HQ #6236 brief 09, cmux-platform #510, cmux #32866.
🤖 Investigated and proposed via ChatGPT.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Routes machine rename and idle-pause settings through CloudDO for app-server machines, which the classic
CloudAPIClientroutes can't handle because they require older registry IDs.cloud.machine.renameandcloud.machine.idle_policy.set; classic mode keeps the original API calls.Written for commit a773784. Summary will update on new commits.