base red: move the Cloud machine row's server-state mapping out of CmuxNextApp (app_lines +21)

Merged
LA
8d ago
+39-33

Summary

Base red, priority zero (STATUS 1442). arch-ratchet refuses the feat-cmux-next tip: [app_lines] CmuxNextApp Swift lines: +21 over 2a5cdb20f8b7..504cfa8559dd (12 first-parent commits, 0 direct pushes).

Culprit, by the repo's own rule (arch-ratchet.py --base <parent> --head <commit> for each first-parent commit in the range):

CommitPRapp_lines
504cfa8559d#29146 (a paused Cloud machine reads Paused)+24, refused (RightSidebar/MachineSectionRow+App.swift, no exception entry)
1eb0d491455#25658-3
the other 100

The range total is -3 + 24 = +21. #25651 shows -660 App lines by git show --numstat, but the rule counts Swift lines only: 660 of those are Resources/Cloud.xcstrings, and its Swift lines move 36 from CloudStrings+Network.swift to CloudHandlers+Domains.swift (net 0). The 11:56Z batch (#25651, #25658, #25667, #25703, #25735) counted as one range (2a5cdb20f8b7..b7888598700) is -3, so it does not add to the red.

Fix forward with a move (no revert, no exception row): the mapping from a Cloud machine's server status and stage to the row's MachineServerState moves from CmuxNextApp to MachineServerState.cloud(_:stagePaused:stageFailed:) in CmuxNextServer, next to MachineServerState. CmuxNextServer now depends on CmuxNextCloud (ui -> service, a downward edge the layer gate allows). The App keeps only the composition-root call in MachineSectionRow.rows. No behavior change; MachineSectionServerStateTests read the same cases through the moved function.

Testing

arch-ratchet, this head (2672dcb1965):

  • --base 504cfa8559dd (before, the culprit alone): [app_lines] ... +24 ... push refused.
  • --base origin/feat-cmux-next --head HEAD: app_lines -22 (CmuxNextApp -22), no architecture count rises.
  • --base 2a5cdb20f8b7 --head HEAD (the watcher's range): app_lines -1, no architecture count rises.

python3 scripts/cmux-next/prepush-gate.py: no new violations.

Observed / Not run

Observed:

  • The arch-ratchet runs and the prepush gate above.
  • Fleet compile: cmux-ci compile-check --ref 2672dcb196597783b5fcd43a7dcc9ba6b63219a2 --app, job a8c4f03668c6e66bf6c99653: compile check app: passed (76 s).
  • Fleet tests: cmux-ci run --class light --script scripts/ci/package-test-lane.sh --arg=suite --arg=Packages/macOS/CmuxNext --arg=MachineSectionServerStateTests,MachineSectionLayoutTests --label suites, step b09948433ae50bcc3265f71e on aws-m4pro-6: Test run with 3 tests in 1 suite passed (MachineSectionServerStateTests) and Test run with 17 tests in 2 suites passed (MachineSectionLayoutTests, MachineSectionViewTests).

Not run: no local Swift build or test (fleet only). No tagged build: the change has no behavior change. ci-target-graph.json is generated; the PR autofix regenerates it for the new CmuxNextServer -> CmuxNextCloud edge (not hand-edited).

Review (claude-review-subagent): SHIP at 2672dcb196597783b5fcd43a7dcc9ba6b63219a2

Changelog

none

Proof

No capture: no visible change; the mapping moves between targets with the same cases.