[codex] Align iOS dev auth with Mac dev builds

Draft
AZ
1mo ago
+104-4

Summary

Fixes iOS dev pairing account verification by aligning iOS DEBUG/dev auth with the Mac dev build auth realm:

  • defaults iOS dev builds to production Stack auth
  • bakes CMUXAuthEnvironment into the iOS app Info.plist from ios/scripts/reload.sh
  • keeps intentional local auth testing available through CMUX_DEV_AUTH_ORIGIN=local / CMUXAuthEnvironment=development
  • adds focused coverage for the default and local override

Why

The QR transport path can succeed while account verification fails if the Mac dev build is signed into production Stack auth but the iOS DEBUG build mints a token from the development Stack project. That produces the observed state: macOS reports the iPhone connected, then iOS shows "Couldn't verify your account." Both dev builds now default to the same auth realm.

Validation

  • bash -n ios/scripts/reload.sh
  • In the main checkout, ios/scripts/reload.sh --tag ios-close-workspace --device-only built and installed successfully with CMUX_AUTH_ENVIRONMENT=production
  • Verified the built iOS app Info.plist contains CMUXAuthEnvironment=production
  • Clean temporary worktree build was attempted but blocked by missing local GhosttyKit.xcframework artifact in /tmp, not by this patch

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Aligns iOS DEBUG/dev builds with the Mac dev build by defaulting to production Stack auth, with an opt-in local override. Fixes the “Couldn't verify your account” pairing failure caused by mismatched auth realms.

  • Bug Fixes
    • Default iOS dev builds to production auth; opt-in local dev via CMUX_DEV_AUTH_ORIGIN=local or CMUXAuthEnvironment=development.
    • Resolve auth env in MobileAuthComposition from Info.plist and LocalConfig.plist, ignoring empty/unexpanded values; added tests and made CMUXAuthEnvironment Equatable.
    • Plist/config wiring: added CMUXAuthEnvironment and ApiBaseURL to Info.plist; set CMUX_AUTH_ENVIRONMENT=production in Shared.xcconfig; reload.sh sets CMUX_AUTH_ENVIRONMENT from CMUX_DEV_AUTH_ORIGIN (auto/prod/local).