refactor: extract BrowserSystemProxyMirror and RemoteTmuxNotificationOSCFilter into packages
Moves two self-contained value types out of the app module into the packages that already own their area. Pure move + access-level pass; no behavior change.
| type | from | to | app-host tests unblocked |
|---|---|---|---|
BrowserSystemProxyMirror | Sources/Panels/ | CmuxBrowser/Sources/CmuxBrowser/Proxy/ | 30 |
RemoteTmuxNotificationOSCFilter | Sources/ | CmuxRemoteSession/Sources/CmuxRemoteSession/RemoteTmux/ | 20 |
Both have zero app-target references (Foundation / CFNetwork / Network only), and every call site already imports the destination package, so no app file needed a new import:
Sources/Panels/BrowserPanel.swiftalreadyimport CmuxBrowserSources/RemoteTmuxSessionMirror.swift,Sources/RemoteTmuxSessionMirror+OutputRouting.swiftalreadyimport CmuxRemoteSession
This is the type-extraction half of RFC #13108 applied to the test-placement problem in #13519. The tests are not moved here — the two existing cmuxTests files just gain the package import so they keep compiling. Relocating the suites into CmuxBrowserTests / CmuxRemoteSessionTests is a follow-up.
Why these two: the leverage ranking
Re-derived from the app-host test audit's per-suite placement data (a Swift-tokenizer symbol index over 1,308 cmuxTests suites resolved against 179 package targets and the app target). 1,148 tests in 209 suites are blocked only by app types that are not host-coupled — class "(b) movable after a small extraction". Ranking each suite by the tests unblocked once its whole app-type closure is extracted:
| tests | types to extract | suite | destination |
|---|---|---|---|
| 38 | 1 member (dragged) | SidebarWorkspaceDropPlannerTests | CmuxSidebarProviderKit |
| 30 | 1 type | BrowserSystemProxyMirrorTests | CmuxBrowser — this PR |
| 28 | 7 types (+10 members) | CloudTunnelCoordinatorTests | new/none |
| 27 | 1 member (surfaceUUID) | FeedEventClassificationTests | none |
| 22 | 2 members | ClaudeHookLifecycleCleanupTests | none |
| 20 | 1 member (maxTitleLength) | AutoNamingEngineTests | none |
| 20 | 1 type | RemoteTmuxNotificationOSCFilterTests | CmuxRemoteSession — this PR |
| 20 | 5 types (+10 members) | CloudEnvDeliveryTests | new/none |
| 19 | 3 types (+10 members) | TabManagerSurfaceCreationTests | none |
| 18 | 3 types (+7 members) | AgentNotificationGateTests | CmuxSettings |
| 17 | 1 type + 1 free fn | DebugDogfoodCredentialResolverTests | none (#if DEBUG) |
| 16 | 1 free fn | BrowserSimpleUserGesturePopupRetargetingTests | CmuxBrowser |
| 16 | 1 member | SidebarBranchOrderingTests | CmuxSidebar |
| 15 | 5 types (+3 members) | PhonePushSerialDeliveryQueueTests | CmuxPhonePush |
The two in this PR are the only entries at the top of that list whose entire closure is one file with no app references and an existing destination package — i.e. the whole cut is a git mv plus public. The 38-test and 27-test rows above are single members (app-only extensions on package types), a different and smaller kind of move; the larger rows need multi-type clusters and a new package.
Correction to the audit's "247 tests behind RestorableAgentSessionIndex"
Worth recording, because it redirects the next slice. Simulating the cut — de-host a type and drop its edges into host-coupled types, then reclassify every suite — gives 0 newly movable tests for RestorableAgentSessionIndex's three host neighbours individually:
0 CmuxTopProcessSnapshot
0 SessionIndexStore
0 AgentHibernationController
The 247 counted tests standing behind the edge, not tests the cut frees: those suites reach host code by several routes, so removing one route changes nothing. RestorableAgentSessionIndex is also a 2,655-line struct spread over ~10 extension files (sqlite, Codex/Claude/OpenCode transcript scanning, process census) — not a reviewable slice, and not the cheap one.
Where the entangled 1,097 actually unblock, greedily (same simulation, marginal tests per cut):
step1 +AuthEnvironment 113
step2 +RemoteInteractiveShellBootstrapBuilder 213
step3 +ManagedFileTransferPolicy 286
step4 +GhosttyConfig 345
step5 +RemoteTmuxController 397
step6 +BrowserHistoryStore 442
AuthEnvironment is the single highest-leverage seam in the app module for this purpose (113 tests on its own), not the session-index cluster.
Blocked by in-flight work
AgentNotificationGate (18 tests, destination CmuxSettings) is a clean extraction except that Sources/TerminalController.swift is one of its three call sites and would need the new import. That file belongs to an in-flight PR, so it is left for a follow-up. Same for KeyboardShortcutSettingsFileStore (13 tests) via Sources/KeyboardShortcutSettings.swift.
Checks
swift testinPackages/macOS/CmuxBrowser— 308 tests in 45 suites, passswift testinPackages/macOS/CmuxRemoteSession— 181 tests in 29 suites, pass- Access-level pass verified by compiling a throwaway cross-module probe against each package's public surface (
==on the synthesizedEquatable,Proxycases,implicitExclusions,proxyConfigurations(),filter(_:onNotification:),maxBufferedBytes), then removed python3 scripts/normalize-pbxproj.py,python3 tests/test_normalize_pbxproj.py,./scripts/check-pbxproj.sh./tests/test_ci_pbxproj_test_wiring.sh,python3 scripts/check-workspace-package-groups.py --checkpython3 scripts/ci/validate_test_execution_registry.py(no registry change: no test files added)
🤖 Generated with Claude Code
Summary by cubic
Moves BrowserSystemProxyMirror into CmuxBrowser and RemoteTmuxNotificationOSCFilter into CmuxRemoteSession so their app-host tests can move out of cmuxTests later. Pure relocation plus an access-level pass; no behavior change.
- Both types had zero app-target references, and their call sites already imported the destination packages.
- Public signatures now use
public import Foundationandpublic import Network;CFNetworkstays internal. - The two
cmuxTestssuites gain the package import to keep compiling; moving the test suites themselves is a follow-up.