base red: the Release login copy's rules are CmuxNextCloudCredentials' CloudLoginCopyGate (arch app_lines +141 from #33324)

Merged
LA
11h ago
+337-242

Fixes the #33324 part of the arch-ratchet red over the last green arch tip 6500d46a95f4 ([app_lines] CmuxNextApp Swift lines: +195). Culprit per commit: 84aa409a31c (#33324) +141. The other culprits: #33567 (+74) is #33730, #33155 (+1) was #33610.

Takes back #33324: only its rules move to packages; every decision, its order and every text and locale are the same.

Cause

#33324 added 141 CmuxNextApp lines for the Release copy of the person's Claude login: the gate rules (switch first, then the consent, asked once; an automatic recovery never asks; Claude only; the transfer's last check), the build gates, and the one-time consent dialog.

Fix

  • The rules move to CmuxNextCloudCredentials as CloudLoginCopyGate (copyAllowed, automaticAllowed, recoveryAllowed, stillAllowed, read(into:), askConsent(_:)), with Leo's three conditions as its doc.
  • The build gates move to CloudCredentialTransfer+Switch (offersLoginCopy, allowsCreatorTeamGuest), next to passesHarnessLogin.
  • The consent dialog's spec moves to CmuxNextCloudUI as CloudLoginCopyConsent, with its 5 keys moved to a new CmuxNextCloudUI CloudCredentialRecovery.xcstrings (every locale unchanged; checked key by key).
  • The App keeps the wiring: reading the switch, cmux.json and presenting the dialog (CloudStartChat.loginCopyGate).

arch-ratchet.py --base HEAD^ --head HEAD: app_lines -77. No arch exception.

Risk: risk_tier.py grades the files normal. This PR moves the Release consent and switch checks without a change to them; the review was asked to check each decision against the base.

Red at the base, green at the head

Command: python3 scripts/cmux-next/arch-ratchet.py --base PARENT --head COMMIT

New test CloudLoginCopyGateTests pins the gate (dogfood reads nothing; switch then consent, asked once; automatic never asks; Claude only; the last check).

Changelog

none

Observed / Not run

Observed on the fleet at 11fdedff013: compile-check CmuxNext passed (job eb6578f46a32127bbe8f7f08, 292 s); suites CloudLoginCopyGateTests, CloudStartChatLoginTests, CloudCredentialRecoveryTests and CloudCredentialTransferTests passed (key a141-suites-11fdedff01). prepush-gate.py, lint-ios-package-conventions.sh, check-xcstrings-keys.py and lint-xcstrings.py passed.
Not run: the dialog on screen (the spec is the same values; no capture).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Takes back #33324 by moving the Release Claude login copy rules out of the main app into packages, cutting CmuxNextApp by 77 lines with no behavior change: every decision, its order, and every text and locale stay identical.

  • The gate rules (switch first, then consent asked once; automatic recovery never asks; Claude only; the transfer's last check) move to CloudLoginCopyGate in CmuxNextCloudCredentials.
  • The build gates move to CloudCredentialTransfer+Switch (offersLoginCopy, allowsCreatorTeamGuest).
  • The consent dialog spec and its 5 keys move to CloudLoginCopyConsent in CmuxNextCloudUI with all locales unchanged.
  • The App keeps only the wiring: reading the switch, cmux.json, and presenting the dialog.
  • Adds CloudLoginCopyGateTests to pin the gate's rules.