base red: move #26770's GitHub connection logic into CmuxNextAccounts (tip arch red from 8219b5769870)
Summary
The feat-cmux-next tip 152c5059d1c7 is red in arch-ratchet: [app_lines] CmuxNextApp Swift lines: +79 (CmuxNextApp +79), 14 allowed by the exceptions this push adds, judged over the last green arch tip 44647965b353. #28410 brings +14 and its own exception covers it. #26770 (8219b5769870) brings the other +65.
This PR moves the App-side logic of #26770 into CmuxNextAccounts, which already owns GitHubConnections. Behavior does not change: the code moves as it is.
GitHubConnections+Live.swift(new):signedInScopeandlive(auth:ownerAPI:preview:), the owner-API call (bearer token,x-cmux-team, idempotency key, refusal versus retryable status), and the open throughLinkRouter. They were an extension at the end ofAccountsService.swift.GitHubConnections+Entrypoints.swift(new):connectResult(), theaccounts.githubConnectaction result that wasAccountsHandlers.githubConnectResult;accountsPageState(_:)andrunAccountsPage(_:accounts:), the Settings Accounts page state and gestures (GitHub gestures, thenAccountsPageAction, then the GitHub refresh after refresh, focus or a team switch) that were inline inPageFactory.- The App now only binds them: one
lazy var githubline inAccountsService, the action bind inAccountsHandlers, and two provider lines inPageFactory. CmuxNextAccountsnow depends onCmuxNextActions(core) andCmuxNextPages(ui), forActionResultValue/ActionWorkFailure,PageErrorandLinkRouter. There is no cycle, and no layer row goes up. The comment that lists the package graph is updated to match.GitHubConnectionsTestscallsmodel.connectResult()in place ofAccountsHandlers.githubConnectResult(model). The test stays inCmuxNextAppTests(its other subjects did not move).
No accounts owner is listed in plans/cmux-next/OWNERS.md.
Testing
Arch ratchet, run as tip-watcher.py runs it (python3 -I scripts/cmux-next/arch-ratchet.py --repo WT --base B --head H):
| Range | Before (tip 152c5059d1c7) | After (head) |
|---|---|---|
| 44647965b353..H (the watcher's range) | app_lines +79, 14 allowed: push refused | app_lines -18 (with the 14 of #28410's exception counted): no architecture count rises |
| 8219b5769870^..H (#26770 alone) | app_lines +65: push refused | no architecture count rises (App lines 158008, the same as at 3a4a117c97f4) |
| 152c5059d1c7..H (this PR) | n/a | app_lines -65: no architecture count rises |
--audit at the head: app_lines 158008 (tip 158073, last green 158026); blocking_allow_escapes 1 and observer_sites 354, the same as the tip and the last green tip. No other row goes up.
python3 scripts/cmux-next/prepush-gate.py: no new violations. risk_tier.py classify: normal.
Fleet, at the head:
- Compile:
cmux-ci compile-check --app --package CmuxNext --recipe-version 2, job 4038af54fb5e1d866f96108e: passed (CmuxNext 261 s, app 34 s, cmux-tui 14 s) - Tests:
scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNext GitHubConnectionsTests, job 5b978e985761487ae9057a8c (class light, aws-m4pro-9): "Test run with 19 tests in 1 suite passed", exit 0
Observed / Not run
Observed: the arch ratchet ranges and the audit above, the prepush gate, the risk classifier, and the fleet compile and test jobs above.
Not run: a tagged build, and a live GitHub connect from Settings. The change moves code and does not change behavior, so the fleet compile and the existing GitHubConnectionsTests are the evidence.
Changelog
none
Proof
No capture: the code moves out of the App, and the UI does not change.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Moves #26770's GitHub connection logic from the App into CmuxNextAccounts, fixing the architecture-ratchet violation that made the feat-cmux-next tip red. Behavior does not change; the code moves as-is.
- New
GitHubConnections+Live.swiftandGitHubConnections+Entrypoints.swifthold the live connection factory, theaccounts.githubConnectresult, and the Settings Accounts page state and gestures. - The App now binds them only: one
lazy var githubline, one action bind, and two provider lines inPageFactory. CmuxNextAccountsnow depends onCmuxNextActionsandCmuxNextPages; no cycles and no layer counts rise.GitHubConnectionsTestscallsmodel.connectResult()and stays inCmuxNextAppTests.