Skip to content

refactor: move surface ownership policy into catalog package - #13340

Closed
teamleaderleo wants to merge 3 commits into
mainfrom
integration/13276-policy
Closed

teamleaderleo wants to merge 3 commits into
mainfrom
integration/13276-policy

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Surface ownership decisions (may this selection move into this workspace?) live in the app target, so they can only be tested by building the app, and the pure rule is tangled with localized UI errors. This PR moves SurfaceOwnershipPolicy into CmuxSurfaceCatalogModel with package-level tests; the app keeps the SurfaceTransferRejection mapping and its localized message as an extension.

Depends on #13135 (the catalog package). This branch is #13135's head plus one commit; review that commit. It targets main and should land after #13135.

Change

  • SurfaceOwnershipPolicy (the rule: a local destination accepts any source; a Cloud destination accepts only its own machine and rejects empty or mixed selections) moves into the package as a public value with allows(source:), allows(resources:), allows(machines:).
  • Sources/Surfaces/SurfaceOwnershipPolicy.swift keeps only the app-facing rejection(for:) mapping.
  • Swift Testing coverage in the package: local destinations, matching and foreign Cloud machines, empty selections, mixed selections.
  • PaneDropContainer.swift (added on main since this PR was first opened) gains the package import because it names the policy type.

Rebuilt on the redone #13135 head; the commit cherry-picked cleanly apart from that import.

Validation

  • Package tests on Linux (same harness as refactor: move the surface catalog's value types into a package #13135: the real package sources and tests, dependencies reduced to the files the package uses): 9 tests in 3 suites pass.
  • App compile: covered by this PR's macOS compile admission on the pushed head; the existing app-host drag/drop, movement, restore, focus and capture tests are unchanged.

Remaining gap

Should not merge before #13135; until then this PR's diff also shows #13135's commit. The app-host suite has not been run on this head.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 334 files, which is 34 over the limit of 300.

To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 78bd62c6-1e4a-4694-b22a-daca155f20fb

📥 Commits

Reviewing files that changed from the base of the PR and between bf13034 and 64f4f78.

⛔ Files ignored due to path filters (2)
  • .github/swift-warning-budget.tsv is excluded by !**/*.tsv
  • cmux.xcworkspace/contents.xcworkspacedata is excluded by !**/*.xcworkspace/contents.xcworkspacedata
📒 Files selected for processing (334)
  • .github/workflows/ci-macos.yml
  • .github/workflows/cloud-command-deadlines.yml
  • CLI/CMUXCLI+VMTransfer.swift
  • CLI/cmux.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Package.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/README.md
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/CloudTabNameAuthority.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/CloudTabNameSource.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/CloudTuiTerminalProjectionTarget.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/CloudVMState+SnapshotComparison.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/CloudVMTabState.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/CmuxTuiSnapshotParser.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/SurfaceCatalogModel.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/SurfaceCatalogSnapshot.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/SurfaceDeviceInstanceID.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/SurfaceDevicePresence.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/SurfaceMachineID.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/SurfaceOwnershipPolicy.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/SurfaceProjectionIdentity.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/SurfaceResourceID+Ports.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/SurfaceResourcePlacement.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/VMMachineKind.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Tests/CmuxSurfaceCatalogModelTests/SurfaceCatalogMetadataTests.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Tests/CmuxSurfaceCatalogModelTests/SurfaceIdentityTests.swift
  • Packages/macOS/CmuxSurfaceCatalogModel/Tests/CmuxSurfaceCatalogModelTests/SurfaceOwnershipPolicyTests.swift
  • Sources/App/MacDevicesComposition.swift
  • Sources/AppDelegate.swift
  • Sources/ClosedItemHistory.swift
  • Sources/Cloud/CloudDiagnosticFailure.swift
  • Sources/Cloud/CloudDisplayCoordinator.swift
  • Sources/Cloud/CloudGuestDisplay.swift
  • Sources/Cloud/CloudGuestDisplaySnapshot.swift
  • Sources/Cloud/CloudMachineLink.swift
  • Sources/Cloud/CloudMachineLinkManager.swift
  • Sources/Cloud/CloudMachineRefreshCoordinator.swift
  • Sources/Cloud/CloudMachineSurfacePresentation.swift
  • Sources/Cloud/CloudNotificationPlacement.swift
  • Sources/Cloud/CloudNotificationSync.swift
  • Sources/Cloud/CloudSidebarDebugLabWindow.swift
  • Sources/Cloud/CloudTerminalCreationRequest.swift
  • Sources/Cloud/CloudTerminalCreationRetryResolution.swift
  • Sources/Cloud/CloudTerminalNavigationCatalog.swift
  • Sources/Cloud/CloudTreeDeletionPresentation.swift
  • Sources/Cloud/CloudTreeDeviceRow.swift
  • Sources/Cloud/CloudTreeMachineResources.swift
  • Sources/Cloud/CloudTreeNode.swift
  • Sources/Cloud/CloudTreeNodeActions+WorkspaceLifecycle.swift
  • Sources/Cloud/CloudTreeNodeActions.swift
  • Sources/Cloud/CloudTreeNodeBuilder+Devices.swift
  • Sources/Cloud/CloudTreeNodeBuilder+Ports.swift
  • Sources/Cloud/CloudTreeOutlineView+Devices.swift
  • Sources/Cloud/CloudTreeOutlineView+Displays.swift
  • Sources/Cloud/CloudTreeOutlineView+MachineMenu.swift
  • Sources/Cloud/CloudTreeOutlineView.swift
  • Sources/Cloud/CloudTreeRemoteWorkspaces.swift
  • Sources/Cloud/CloudTreeRowContentView.swift
  • Sources/Cloud/CloudTreeStyleGalleryWindow.swift
  • Sources/Cloud/CloudTreeTerminalNavigationCoordinator.swift
  • Sources/Cloud/CloudTuiCommandLine+Placement.swift
  • Sources/Cloud/CloudTuiCommandLine.swift
  • Sources/Cloud/CloudTuiManualMirrorSession.swift
  • Sources/Cloud/CloudTuiPersistentRequestBuilder.swift
  • Sources/Cloud/CloudTuiPersistentResourceConnection.swift
  • Sources/Cloud/CloudTuiTerminalProjectionTarget.swift
  • Sources/Cloud/MachineCreateOperation.swift
  • Sources/Cloud/MachineCreateRequest.swift
  • Sources/Cloud/MachineSnapshotBuilder.swift
  • Sources/Cloud/MachinesPanelView.swift
  • Sources/Cloud/MachinesPanelViewModel.swift
  • Sources/Cloud/NewMachineModel.swift
  • Sources/Cloud/PortForward/CloudBrowserAccessState.swift
  • Sources/Cloud/PortForward/CloudPortRoutePlan.swift
  • Sources/Cloud/Sidebar/CloudSidebarNotificationCoordinator.swift
  • Sources/Cloud/Sidebar/CloudSidebarOrganizationStore.swift
  • Sources/Cloud/Sidebar/CloudTreeOutlineView+Organization.swift
  • Sources/Cloud/Sidebar/SurfaceCatalog+SidebarOrganization.swift
  • Sources/Cloud/Sidebar/SurfaceResource+CatalogOrdering.swift
  • Sources/Cloud/Sidebar/TerminalController+CloudSidebar.swift
  • Sources/Cloud/SurfaceResourceDragPayload.swift
  • Sources/Cloud/VMCapabilities.swift
  • Sources/Cloud/VMClient.swift
  • Sources/Cloud/VMClientSocketCommands.swift
  • Sources/CloudTerminalCreationCoordinator.swift
  • Sources/CommandPalette/CurrentWorkPalettePresentation.swift
  • Sources/Devices/AppDelegate+NewDeviceWorkspace.swift
  • Sources/Devices/DeviceDirectory.swift
  • Sources/Devices/DeviceDirectoryIdentityIndex.swift
  • Sources/Devices/DeviceDirectoryMerge.swift
  • Sources/Devices/DeviceDirectoryRecord.swift
  • Sources/Devices/DeviceIrxClient.swift
  • Sources/Devices/DeviceIrxPeerTransportProvider.swift
  • Sources/Devices/DeviceLink.swift
  • Sources/Devices/DeviceLinkAuthorization.swift
  • Sources/Devices/DeviceLinkRuntime.swift
  • Sources/Devices/DevicePresenceFrame.swift
  • Sources/Devices/DeviceRegistryDirectoryClient.swift
  • Sources/Devices/DeviceRouteSelector.swift
  • Sources/Devices/DeviceSurfaceProvider+Mutations.swift
  • Sources/Devices/DeviceSurfaceProvider+TerminalLayout.swift
  • Sources/Devices/DeviceSurfaceProvider.swift
  • Sources/Devices/DeviceSurfaceProviderRegistry.swift
  • Sources/Devices/DeviceWorkspaceCreationCoordinator.swift
  • Sources/Devices/DeviceWorkspaceLayoutCoordinator.swift
  • Sources/Devices/DeviceWorkspaceLayoutHost.swift
  • Sources/Devices/DeviceWorkspaceProjection+Layout.swift
  • Sources/Devices/DeviceWorkspaceProjection.swift
  • Sources/Devices/DevicesPanelViewModel.swift
  • Sources/Devices/DevicesPreferencesModel.swift
  • Sources/Devices/SurfaceCatalog+DeviceNames.swift
  • Sources/Devices/Workspace+DeviceLayout.swift
  • Sources/Devices/Workspace+DeviceMachineContext.swift
  • Sources/DockSplitStore+BrowserActions.swift
  • Sources/Hive/HiveComputersService.swift
  • Sources/PaneDropContainer.swift
  • Sources/Panels/BrowserPanel+CloudConnection.swift
  • Sources/Panels/PanelStableSurfaceIdentity.swift
  • Sources/RemoteTui/RemoteTuiMachine.swift
  • Sources/RemoteTui/SSHTuiWorkspaceCoordinator.swift
  • Sources/RemoteTui/TerminalController+SSHTui.swift
  • Sources/RemoteTui/TerminalController+SSHTuiSessions.swift
  • Sources/RemoteTui/Workspace+SSHTuiStatus.swift
  • Sources/SessionBrowserPanelSnapshot.swift
  • Sources/SessionPersistence.swift
  • Sources/Surfaces/AppDelegate+SurfaceOwnership.swift
  • Sources/Surfaces/CloudAgentNameContext.swift
  • Sources/Surfaces/CloudMachineLoadingReservation.swift
  • Sources/Surfaces/CloudPaneCreationFailure.swift
  • Sources/Surfaces/CloudPaneCreationFailureStore.swift
  • Sources/Surfaces/CloudPlacementCoordinator.swift
  • Sources/Surfaces/CloudRenameCoordinator.swift
  • Sources/Surfaces/CloudTerminalAttachmentResolver.swift
  • Sources/Surfaces/CloudTerminalCreationReceipt.swift
  • Sources/Surfaces/CloudTerminalLayoutCreation.swift
  • Sources/Surfaces/CloudTerminalLayoutCreationResult.swift
  • Sources/Surfaces/CloudTerminalPaneClosure.swift
  • Sources/Surfaces/CloudTerminalPaneReservation.swift
  • Sources/Surfaces/CloudTerminalSourcePlacement.swift
  • Sources/Surfaces/CloudVMTabState.swift
  • Sources/Surfaces/CloudWorkspaceBindingReconciliation.swift
  • Sources/Surfaces/CloudWorkspaceCreationCoordinator.swift
  • Sources/Surfaces/CloudWorkspaceCreationHost.swift
  • Sources/Surfaces/CloudWorkspaceCreationOperation.swift
  • Sources/Surfaces/CloudWorkspaceDeletionLedger.swift
  • Sources/Surfaces/CloudWorkspaceLayoutTranslator.swift
  • Sources/Surfaces/CloudWorkspaceProjectionCoordinator.swift
  • Sources/Surfaces/CloudWorkspaceProjectionEnvironment.swift
  • Sources/Surfaces/CloudWorkspaceProjectionPlan.swift
  • Sources/Surfaces/CloudWorkspaceRenameService+Admission.swift
  • Sources/Surfaces/CloudWorkspaceRenameService+Reconciliation.swift
  • Sources/Surfaces/CmuxTuiSnapshotParser+Displays.swift
  • Sources/Surfaces/CmuxTuiSnapshotParser+Placement.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+AgentNaming.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+CloseTerminal.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+Displays.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+Environment.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+FileDelivery.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+GuestURL.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+Hosting.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+LayoutCreation.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+ManualMirror.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+Notifications.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+PendingCreationRecovery.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+PlacementSync.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+PortForward.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+Refresh.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+TabRename.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+TerminalCreation.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+TerminalIO.swift
  • Sources/Surfaces/CmuxTuiSurfaceProvider+TerminalPrimitives.swift
  • Sources/Surfaces/CmuxTuiSurfaceProviderRegistry.swift
  • Sources/Surfaces/CmuxTuiSurfaceProviders.swift
  • Sources/Surfaces/CurrentWorkInput.swift
  • Sources/Surfaces/CurrentWorkQueryService.swift
  • Sources/Surfaces/CurrentWorkSnapshot.swift
  • Sources/Surfaces/DockSplitStore+SurfaceOwnership.swift
  • Sources/Surfaces/LocalSurfaceProvider.swift
  • Sources/Surfaces/PendingRemoteCreation.swift
  • Sources/Surfaces/SurfaceCatalog+AgentIcons.swift
  • Sources/Surfaces/SurfaceCatalog+CloudBinding.swift
  • Sources/Surfaces/SurfaceCatalog+CloudDirectoryMetadata.swift
  • Sources/Surfaces/SurfaceCatalog+CloudPorts.swift
  • Sources/Surfaces/SurfaceCatalog+CloudRenameSubmission.swift
  • Sources/Surfaces/SurfaceCatalog+CloudTerminalNavigation.swift
  • Sources/Surfaces/SurfaceCatalog+CloudWorkspaceProjection.swift
  • Sources/Surfaces/SurfaceCatalog+Displays.swift
  • Sources/Surfaces/SurfaceCatalog+Groups.swift
  • Sources/Surfaces/SurfaceCatalog+NameAuthority.swift
  • Sources/Surfaces/SurfaceCatalog+Ownership.swift
  • Sources/Surfaces/SurfaceCatalog+ProjectionQueries.swift
  • Sources/Surfaces/SurfaceCatalog+Snapshot.swift
  • Sources/Surfaces/SurfaceCatalog+WorkspaceDeletion.swift
  • Sources/Surfaces/SurfaceCatalog+WorkspaceMembership.swift
  • Sources/Surfaces/SurfaceCatalog.swift
  • Sources/Surfaces/SurfaceCatalogQueryService.swift
  • Sources/Surfaces/SurfaceCatalogSnapshot+DeviceVisibility.swift
  • Sources/Surfaces/SurfaceLayoutTerminalCreating.swift
  • Sources/Surfaces/SurfaceOwnershipPolicy.swift
  • Sources/Surfaces/SurfacePaneFactory+CloudManualMirror.swift
  • Sources/Surfaces/SurfacePaneFactory+ProjectionLayout.swift
  • Sources/Surfaces/SurfacePaneFactory.swift
  • Sources/Surfaces/SurfacePlacementSyncing.swift
  • Sources/Surfaces/SurfaceProjection+WorkspaceMembership.swift
  • Sources/Surfaces/SurfaceProjectionIdentity+Workspace.swift
  • Sources/Surfaces/SurfaceProjectionIdentity.swift
  • Sources/Surfaces/SurfaceProjectionMaterialization+Key.swift
  • Sources/Surfaces/SurfaceProjectionMaterialization.swift
  • Sources/Surfaces/SurfaceProjectionRestoreStore.swift
  • Sources/Surfaces/SurfaceProvider+MaterializationValidation.swift
  • Sources/Surfaces/SurfaceProvider.swift
  • Sources/Surfaces/SurfaceRemotePlacement.swift
  • Sources/Surfaces/SurfaceResource+AgentIcon.swift
  • Sources/Surfaces/SurfaceResource+CloudTitle.swift
  • Sources/Surfaces/SurfaceSocketCommands.swift
  • Sources/Surfaces/SurfaceWorkspaceCreationReceipt.swift
  • Sources/Surfaces/TerminalController+CloudTerminalCreation.swift
  • Sources/Surfaces/TerminalController+CurrentWork.swift
  • Sources/Surfaces/Workspace+BrowserDuplication.swift
  • Sources/Surfaces/Workspace+CloudDisplayOwnership.swift
  • Sources/Surfaces/Workspace+CloudDragSplitRouting.swift
  • Sources/Surfaces/Workspace+CloudLayoutProjection.swift
  • Sources/Surfaces/Workspace+CloudMachineLoading.swift
  • Sources/Surfaces/Workspace+CloudManualMirror.swift
  • Sources/Surfaces/Workspace+CloudPaneRouting.swift
  • Sources/Surfaces/Workspace+CloudPlacementFailure.swift
  • Sources/Surfaces/Workspace+CloudTerminalCreation.swift
  • Sources/Surfaces/Workspace+CloudTerminalReservation.swift
  • Sources/Surfaces/Workspace+SurfaceCatalog.swift
  • Sources/Surfaces/Workspace+SurfaceOwnership.swift
  • Sources/TerminalController.swift
  • Sources/Workspace+DetachedSurfaceTransfer.swift
  • Sources/Workspace+ForkConversationContextMenu.swift
  • Sources/Workspace+TerminalLinkOpening.swift
  • Sources/Workspace.swift
  • Sources/WorkspaceCloudBindingState.swift
  • Sources/WorkspaceSurfaceResourceDrop.swift
  • cmux.xcodeproj/project.pbxproj
  • cmuxTests/CloudCatalogQueryTestProvider.swift
  • cmuxTests/CloudClosedPanelRestoreTests.swift
  • cmuxTests/CloudDesktopAccessTests.swift
  • cmuxTests/CloudDesktopOpenFixture.swift
  • cmuxTests/CloudDesktopOpenTestProvider.swift
  • cmuxTests/CloudDirectoryLifecycleTests.swift
  • cmuxTests/CloudDirectoryTestFixture.swift
  • cmuxTests/CloudDisplayCatalogTests.swift
  • cmuxTests/CloudGuestURLRoutingTests.swift
  • cmuxTests/CloudInitialWorkspaceNamingTests.swift
  • cmuxTests/CloudMachineNotificationEventTests.swift
  • cmuxTests/CloudMachineOrderingFixture.swift
  • cmuxTests/CloudMachineWorkspaceAdoptionTests.swift
  • cmuxTests/CloudMachineWorkspaceTestProvider.swift
  • cmuxTests/CloudManualMirrorTransportTests.swift
  • cmuxTests/CloudNameAuthorityFixture.swift
  • cmuxTests/CloudNameAuthorityTestProvider.swift
  • cmuxTests/CloudNameAuthorityTests.swift
  • cmuxTests/CloudNativeLayoutProjectionTests.swift
  • cmuxTests/CloudNotificationDismissParityHarness.swift
  • cmuxTests/CloudNotificationDismissParityTests.swift
  • cmuxTests/CloudNotificationSyncTests.swift
  • cmuxTests/CloudOperationRecorderTests.swift
  • cmuxTests/CloudPaneCreationRetryTests.swift
  • cmuxTests/CloudPlacementCoordinatorTests.swift
  • cmuxTests/CloudPlacementTestProvider.swift
  • cmuxTests/CloudPortOpenRegressionTests.swift
  • cmuxTests/CloudPortRoutePlanTests.swift
  • cmuxTests/CloudPortsVPNAffordanceTests.swift
  • cmuxTests/CloudProviderRefreshCoordinatorTests.swift
  • cmuxTests/CloudRenameOptimismTests.swift
  • cmuxTests/CloudSidebarConsistencyTests.swift
  • cmuxTests/CloudSidebarNativeDropTests.swift
  • cmuxTests/CloudSidebarNotificationTests.swift
  • cmuxTests/CloudSidebarOrderingTests.swift
  • cmuxTests/CloudSidebarRenameFixture.swift
  • cmuxTests/CloudSidebarRenameReconciliationTests.swift
  • cmuxTests/CloudSidebarSurfaceRegressionTests.swift
  • cmuxTests/CloudSurfaceDragFeedbackTests.swift
  • cmuxTests/CloudSurfaceDragFixture.swift
  • cmuxTests/CloudSurfaceMoveOwnershipTests.swift
  • cmuxTests/CloudSurfaceOwnershipTests.swift
  • cmuxTests/CloudTerminalCreationCoordinatorTests.swift
  • cmuxTests/CloudTerminalDragSplitRoutingTests.swift
  • cmuxTests/CloudTerminalLayoutCreationTests.swift
  • cmuxTests/CloudTerminalNavigationCapabilityTests.swift
  • cmuxTests/CloudTerminalNavigationFixture.swift
  • cmuxTests/CloudTerminalNavigationTests.swift
  • cmuxTests/CloudTerminalPaneReservationTests.swift
  • cmuxTests/CloudTerminalPlacementTestProvider.swift
  • cmuxTests/CloudTerminalPlacementTests.swift
  • cmuxTests/CloudTreeAvailabilityTests.swift
  • cmuxTests/CloudTreeMachineMenuTests.swift
  • cmuxTests/CloudTreeMachineResourcesTests.swift
  • cmuxTests/CloudTreeNativeDragOwnershipTests.swift
  • cmuxTests/CloudTreeOneMachineManyWorkspacesTests.swift
  • cmuxTests/CloudTreeWorkspaceTitleLayoutTests.swift
  • cmuxTests/CloudVMStateSnapshotComparisonTests.swift
  • cmuxTests/CloudWorkspaceBindingRegressionTests.swift
  • cmuxTests/CloudWorkspaceCreationSidebarProvider.swift
  • cmuxTests/CloudWorkspaceDeleteOptimismTests.swift
  • cmuxTests/CloudWorkspaceDeleteTestProvider.swift
  • cmuxTests/CloudWorkspaceDeletionLedgerTests.swift
  • cmuxTests/CloudWorkspaceLayoutTranslatorTests.swift
  • cmuxTests/CloudWorkspaceLiveProjectionTests.swift
  • cmuxTests/CloudWorkspaceMembershipTests.swift
  • cmuxTests/CloudWorkspaceRenameSurfaceParityTests.swift
  • cmuxTests/CloudWorkspaceRestoreNamesTests.swift
  • cmuxTests/CmuxTuiSurfaceProviderTests.swift
  • cmuxTests/CurrentWorkCommandPaletteTests.swift
  • cmuxTests/CurrentWorkQueryServiceTests.swift
  • cmuxTests/CurrentWorkReducerTests.swift
  • cmuxTests/DeviceDirectoryLifecycleTests.swift
  • cmuxTests/DeviceDirectoryMergeTests.swift
  • cmuxTests/DevicePresenceWireTests.swift
  • cmuxTests/DeviceRouteSelectorTests.swift
  • cmuxTests/DeviceWorkspaceProjectionTests.swift
  • cmuxTests/DevicesCloudTreeBuilderTests.swift
  • cmuxTests/DevicesSidebarModeTests.swift
  • cmuxTests/LastSurfaceClosePreferenceTests.swift
  • cmuxTests/LocalSurfaceProviderTests.swift
  • cmuxTests/MachineCreateCoordinatorTests.swift
  • cmuxTests/MachinesPanelModelTests.swift
  • cmuxTests/RemoteTerminalFilePreviewLoaderTests.swift
  • cmuxTests/SSHTuiMigrationTests.swift
  • cmuxTests/SetAutoTitleSocketTests+CloudSidebar.swift
  • cmuxTests/SidebarCloudWorkspaceBadgeTests.swift
  • cmuxTests/SurfaceCatalogQueryServiceTests.swift
  • cmuxTests/SurfaceCatalogTests.swift
  • cmuxTests/SurfaceMachineIDDeviceEncodingTests.swift
  • cmuxTests/SurfacePaneFactoryFocusTests.swift
  • cmuxTests/SurfaceProjectionIdentityTests.swift
  • cmuxTests/SurfaceSocketCommandTests.swift
  • cmuxTests/TabManagerSessionSnapshotTests.swift
  • cmuxTests/WorkspaceCreateInitialInputTests.swift
  • cmuxTests/WorkspaceTitleProvenanceTests.swift
  • scripts/stage-cloud-navigation-tests.py
  • tests/run_cloud_command_deadline_tests.sh

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Parked — Thornquay 💠 (triage, 2026-09-23). Rides on #13135 — it inherits exactly the same 8-file conflict set and adds nothing of its own (its delta is 4 files / 78 insertions). Sources/Surfaces/SurfaceOwnershipPolicy.swift on main is byte-identical to the merge-base version, so there is zero independent drift. Land it immediately after #13135; do not rebase it separately.

Redone from current main instead of rebasing #13135 (1.8k commits behind,
with main-side edits to the moved files and ~100 new consumers).

SurfaceMachineID, SurfaceResourceID, SurfaceResource, the CloudVM state
documents and the cmux-tui snapshot parser are pure values that the Cloud
sidebar, SurfaceCatalog, the socket commands and the CLI all share. They move
from the app target into Packages/macOS/CmuxSurfaceCatalogModel (depends on
CmuxCore, CMUXDebugLog and CMUXMobileCore only). SurfaceCatalog, the owner,
stays in the app.

Besides the move: declarations become public, structs that relied on the
synthesized memberwise initializer get an explicit public init with the same
parameters, cmuxDebugLog becomes CMUXDebugLog.logDebugEvent, and the parser's
port helpers and SurfaceResourceID.portKey move out of two larger app files
because the parser calls them. VMMachineKind.swift was also a member of the
cmux-cli target, so the CLI links the package.

Since #13135 was cut, main split SurfaceMachineID, SurfaceDeviceInstanceID and
SurfaceDevicePresence out of SurfaceCatalogModel.swift; they move too (hence
the CMUXMobileCore dependency, for cmxCanonicalDeviceID). Main's new fields
(agent, device workspace detail/unread/pin, machine presence,
displayCreationMachines, displayPorts) are public and in the explicit inits.
CmuxTuiSnapshotParser.mergingDisplays stays in the app's +Displays extension,
where main moved it.

303 app, CLI and test files gain `import CmuxSurfaceCatalogModel`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo force-pushed the integration/13276-policy branch from 3c33ef0 to a5753d3 Compare September 24, 2026 07:03
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Rebuilt on the redone #13135 (head 9e24d3703f): cherry-picked this PR's one commit as a5753d310b, plus the package import in PaneDropContainer.swift, which is new on main and names SurfaceOwnershipPolicy. The package's 9 tests pass on Linux. Base stays main; land after #13135.

teamleaderleo and others added 2 commits September 24, 2026 00:29
The iOS/package conventions lint rejects public all-static types in
packages. CmuxTuiSnapshotParser, CloudWireNumber and
CloudVMEventFeedRecoveryDecision were internal static namespaces in the app
and moved unchanged; reshaping them is a separate change, so each carries the
lint's inline lint:allow justification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SurfaceOwnershipPolicy's pure rule (local accepts anything; a Cloud
destination accepts only its own machine and rejects empty or mixed
selections) moves into CmuxSurfaceCatalogModel with package tests. The app
keeps the SurfaceTransferRejection mapping as an extension.

Replayed onto the redone #13135; PaneDropContainer.swift (new on main since
the original) gains the package import because it names the policy type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo force-pushed the integration/13276-policy branch from a5753d3 to 64f4f78 Compare September 24, 2026 08:23

@teamleaderleo teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review of 64f4f78230: ownership decisions are unchanged. This is #13135's head plus one commit. It should merge after #13135, which leaves this commit's four files and one import as the diff.

Semantics. The old app rejection(for:) overloads and the new allows(...) rules agree on every input:

Destination Source / selection Before After
local (cloudMachine == nil) anything, including an empty selection allowed allowed
cloud a .cloud("a"), or a non-empty all-a selection allowed allowed
cloud a .local, nil, .cloud("b") .cloudMachineMismatch .cloudMachineMismatch
cloud a empty selection, or mixed a/b .cloudMachineMismatch .cloudMachineMismatch

rejection(for resources:) used to delegate to the machines overload through map(\.machine), and allows(resources:) does the same. The public init(cloudMachine:) has no default, which matches the old implicit memberwise init for a let. The app keeps the SurfaceTransferRejection mapping as an extension, so CloudTreeOutlineView+Organization.swift:80, PaneDropContainer.swift, and the existing cmuxTests/CloudDisplayCatalogTests.swift:152-154 call sites are source-compatible. The added imports in those two app files are needed because both name the type.

CI on 64f4f78230

  • swift-package-tests ran the new suite: "9 tests in 3 suites passed", including all five Surface ownership policy tests (job).
  • macOS compile admission was still queued and cli-pipe-regressions still running when I checked. This head has no compile evidence yet, and it needs a green compile admission before merge.

My #13135 review covers the file move this PR inherits.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Obsolete: #14390 moved the policy into CmuxCloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant