cmux NEXT checks: No new SwiftUI and canary coverage pass again (re-point moved entries, lint keeps moved files, Sleepy shims)

Merged
TE
13d ago
+127-44

Base run 40146316318 ("cmux-next checks", e8697614) fails two steps. This fixes both at the source. The three Labs reports-basket views were ported to AppKit in #25031 (merged, no allowlist entry), so with this PR the step reports 0 findings.

1. Checks job structure (SwiftCanaryFleetCoverage): #24978 added the production target CmuxNextUiLayerPreview, which CmuxNextApp does not reach (ci-target-graph.json). It joins the swift-canary-fleet case list, so a change to it runs the Mac canary instead of being vouched for by the app compile.

2. No new SwiftUI: 9 findings go to 0 (#25031 fixed the 3 basket findings). Allowlisted files after this PR: 156.

  • CmuxNextApps/Section/AppIconView.swift, AppSectionFrame.swift: lawrencecchen moved them from Store/Views/ in 84b3fc57. Both were allowlisted under the old path. 91d4ac2f then deleted the old-path entries as stale instead of re-pointing them. This re-points them. It restores entries that were already there; it does not widen the list.

  • Why it could happen, and the fix to the lint: a stale entry said "delete its line" even when the file had only moved, and the --base "a moved file keeps its entry" rule (f61b6a13) relies on git rename detection, which misses a move that also rewrote the file (AppIconView went from 123 lines to 38). The lint now (a) names the moved file's new path in the stale-entry finding ("change the line to the new path instead of deleting it") and (b) under --base, accepts an entry swapped one-for-one for the gone entry with the same file name. New cases in check-no-swiftui.test.sh cover both, and each fails against the old checker.

  • CmuxNextDesign/NightSky/NightSky.swift (02ce3d05): it was only the NSViewRepresentable shim around the Core Animation NightSkyView, for its single consumer SleepySceneView (allowlisted, Sleepy Mode wave 1 item 4). The shim now lives as a private type in SleepySceneView.swift, so CmuxNextDesign's sky is AppKit only.

  • Tests/CmuxNextAppTests/SleepySceneCostTests.swift, SleepySkySnapshotTests.swift (7b76fa24): they imported SwiftUI only to construct NSHostingView. SleepySceneView.hostView(...) -> NSView is now the one place the scene is bridged into AppKit. The tests and SleepyOverlayWindows call it, so all three drop SwiftUI, and SleepyOverlayWindows.swift's allowlist entry is deleted.

  • CmuxNextUiLayerPreview/UiLayerPreviewView.swift (#24978) gets an entry, with this justification: #24978 made it a Debug-only SwiftPM leaf product that exists to host real production SwiftUI (HairlineDivider, Icon, CmuxDialogActionButton) in the standalone UiLayerHost hot-reload preview. Per its body it is "off by default, excluded from CmuxNextApp and release app targets". An AppKit port would defeat its purpose, and it goes when those SwiftUI adapters go (design wave 4).

  • The --base growth check, after review 1: the same-name pairing is strictly one-to-one. The name must be unique among both the gone entries and the added entries, so one deleted Old/X.swift cannot admit two new X.swift files. A new entry for a file that already imported SwiftUI at the base adds no SwiftUI, so it is printed as a note: line, not a finding. The step passes and the growth stays visible. The allowlist still cannot admit a file that this PR makes import SwiftUI. This PR's own step prints three such notes (AppIconView, AppSectionFrame, UiLayerPreviewView) and passes. Self-test cases cover each rule, and each case fails when its rule is removed.

No capture: no visible change. Sleepy Mode draws the same SwiftUI tree in the same NSHostingView with the same NightSkyView; only the file that holds the representable and the line that builds the hosting view moved. Nothing else is UI-visible. No screenshot, for that reason.

Risk: low. Python lint and its self-test, one workflow case list, and a Swift file-placement change in Sleepy Mode. Verified locally: check-no-swiftui.py (ok: 0 findings, 156 allowlisted), check-no-swiftui.test.sh ok, the SwiftCanaryFleetCoverage logic (graph-reachable set equals the case list). Fleet cmux-ci compile-check --package CmuxNext passed (job 3a0e78dfe95b, 221 s) on this PR's commit before the base merge. That merge touches none of this PR's files.

Who introduced what: AppIconView/AppSectionFrame move by lawrencecchen (84b3fc57), with the entries deleted by a Leo lane (91d4ac2f); NightSky and the Sleepy tests by lawrencecchen (02ce3d05, 7b76fa24); UiLayerPreview by a Leo lane (#24978); the reports basket by a Leo lane (#24616), later edited by lawrencecchen.

šŸ¤– Generated with Claude Code

Agent session: cosmic-gray