Skip to content

base red: move #26770's GitHub connection logic into CmuxNextAccounts (tip arch red from 8219b5769870) - #32567

Merged
lawrencecchen merged 3 commits into
feat-cmux-nextfrom
base-red-arch-26770
Nov 2, 2026
Merged

lawrencecchen merged 3 commits into
feat-cmux-nextfrom
base-red-arch-26770

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The feat-cmux-next tip 152c505 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 4464796. #28410 brings +14 and its own exception covers it. #26770 (8219b57) 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): signedInScope and live(auth:ownerAPI:preview:), the owner-API call (bearer token, x-cmux-team, idempotency key, refusal versus retryable status), and the open through LinkRouter. They were an extension at the end of AccountsService.swift.
  • GitHubConnections+Entrypoints.swift (new): connectResult(), the accounts.githubConnect action result that was AccountsHandlers.githubConnectResult; accountsPageState(_:) and runAccountsPage(_:accounts:), the Settings Accounts page state and gestures (GitHub gestures, then AccountsPageAction, then the GitHub refresh after refresh, focus or a team switch) that were inline in PageFactory.
  • The App now only binds them: one lazy var github line in AccountsService, the action bind in AccountsHandlers, and two provider lines in PageFactory.
  • CmuxNextAccounts now depends on CmuxNextActions (core) and CmuxNextPages (ui), for ActionResultValue/ActionWorkFailure, PageError and LinkRouter. There is no cycle, and no layer row goes up. The comment that lists the package graph is updated to match.
  • GitHubConnectionsTests calls model.connectResult() in place of AccountsHandlers.githubConnectResult(model). The test stays in CmuxNextAppTests (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 152c505) After (head)
4464796..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
8219b57^..H (#26770 alone) app_lines +65: push refused no architecture count rises (App lines 158008, the same as at 3a4a117)
152c505..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
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.swift and GitHubConnections+Entrypoints.swift hold the live connection factory, the accounts.githubConnect result, and the Settings Accounts page state and gestures.
  • The App now binds them only: one lazy var github line, one action bind, and two provider lines in PageFactory.
  • CmuxNextAccounts now depends on CmuxNextActions and CmuxNextPages; no cycles and no layer counts rise.
  • GitHubConnectionsTests calls model.connectResult() and stays in CmuxNextAppTests.

Written for commit 9f300a0. Summary will update on new commits.

View guided diff Turn on auto-fix

@lawrencecchen lawrencecchen added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 9f300a0: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr32567 -f ref=base-red-arch-26770 -f platform=macos -f backend_mode=local

Default changes

This pull request changes 2 defaults at 9f300a073d93 (what everyone gets without configuring anything):

  • tunable-source.CmuxNextApp/Handlers/AccountsHandlers.swift:bind: "df9b051651bc930469164629a242646c8e4e2e7c08818b993f65171175983617" -> "6fdd48c62704a3a3566e25b22f4ffa0f4be2fc9507ea088a4493e4c06d96cf0a"
  • tunable-source.CmuxNextApp/Handlers/AccountsHandlers.swift:githubConnectResult: "eae0623357f1aeda6d1253abe95ef06f3663671088418ae8138d82cccb54c9d8" -> (none)

Signed off on this commit by review (claude-opus-5.5 review subagent).

Merge receipt: merged as ffe20b50740e with these defaults changed, signed off by review (claude-opus-5.5 review subagent).

Regenerate the snapshot with python3 scripts/ci/defaults_guard.py snapshot.

Shipped in:

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (claude-opus-5.5 review subagent): SHIP at 9f300a0

Independent review, correctness first. The PR is a pure move: each moved block is equivalent line by line (the owner-API call, team header, idempotency key, 5xx/408/429 retry vs refusal, reply checks, LinkRouter open; the githubConnect result; the Settings Accounts gesture routing). The lazy var still evaluates ownerAPIBaseURL() and preview at the same time as before, and PageFactory captures the same locals. Access control under InternalImportsByDefault, MainActor isolation and the App imports all check out. There is no dependency cycle (Actions and Pages do not reach Accounts, and no layer edge points up). check-package-dependency-lists.py passes, the arch ratchet over 8219b57^..head shows no rise, and prepush-gate reports no new violations.
Low: defaults_guard reports changed tunable-source fingerprints in AccountsHandlers.swift (bind; githubConnectResult removed). These are declaration fingerprints only, and no default changed.

Fleet at this head: compile 4038af54fb5e1d866f96108e passed (CmuxNext, app, cmux-tui). GitHubConnectionsTests 5b978e985761487ae9057a8c: "Test run with 19 tests in 1 suite passed".

@lawrencecchen lawrencecchen added the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Nov 2, 2026
@lawrencecchen
lawrencecchen merged commit ffe20b5 into feat-cmux-next Nov 2, 2026
232 of 250 checks passed
@lawrencecchen
lawrencecchen deleted the base-red-arch-26770 branch November 2, 2026 21:13
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Swift logic follow-up (tip watcher swift-logic row, STATUS 13027 "SWIFT LOGIC CULPRITS"; lead order).

This PR raised swift_logic_lines by +37 at its merge commit ffe20b5: scripts/cmux-next/swift-logic-lines.py before and after the merge, with the same table (the tip's, c6be943). The largest declarations of the rise:

  • extension GitHubConnections in Packages/macOS/CmuxNext/Sources/CmuxNextAccounts/GitHubConnections+Live.swift: +37 lines counted as Swift logic (no row in plans/cmux-next/swift-logic-classes.tsv)
  • extension GitHubConnections in Packages/macOS/CmuxNext/Sources/CmuxNextAccounts/GitHubConnections+Entrypoints.swift: +35 lines counted as Swift logic (no row in plans/cmux-next/swift-logic-classes.tsv)

plans/cmux-next/layer-ownership.md says Rust owns every state, list and rule and Swift is the platform shell. Please move the new logic of this PR in a follow-up: to Rust (the crate that owns the area; the owner lists in STATUS 12147-12165 name the target per area), or at least out of the app into its package. If a declaration above is platform code (AppKit, Core Animation, OS calls, strings, tokens, DEBUG tooling), reply here and the table gets a PLATFORM row with your reason instead.

The swift-logic row is a report, not a gate: nothing blocks on this comment.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 9f300a07 Deployed Nov 2, 2026 by lawrencecchen via namespace autofix #12662
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant