feat(ios): add Chief Home to the classic mobile shell

Merged
AZ
16d ago
+231091-6443

Summary

  • Expose Mac-owned Chief status, conversations, transcript, send, stop, approval, answer, and open RPCs through the authenticated mobile bridge.
  • Advertise Chief capabilities and enforce ticket-scope authorization for read and mutation methods.
  • Add a classic iOS Home list with a pinned Chief entry, search, refresh, avatar, accessibility labels, scene refresh, and reset on Mac switch.
  • Add a Messages-style Chief transcript with polling, paging, queued sends, client-message correlation, typing state, stop action, and fail-closed unavailable behavior.
  • Add structured work, approval, and question cards. Approval and question actions call chief.approve / chief.answer, prevent duplicate taps, and collapse answered cards to receipts.
  • Open a dedicated Chief composer for multi-item, multi-select, and Other questions while keeping simple single-choice cards inline.
  • Keep the composer’s single Other field aligned with the existing chief.answer contract: it targets the first eligible unanswered item, then the first eligible multi-select item.
  • Add the Chief avatar to Home rows, the transcript header, and conversation details, including empty conversations.
  • Gate unsupported Chief reactions, edit, unsend, media, microphone, and accessibility affordances.
  • Preserve older pending cards across polling, bound transcript cache growth, and publish the authoritative participant identity as soon as a first send reveals it.
  • Keep answer follow-up rows from being pre-cached without events, retry Home subscriptions after transient RPC failures, and keep streamed draft tokens off the inbox refresh cursor.
  • Use messages-only owner reads for list previews so inbox refreshes do not calculate thread summaries.
  • Keep preview formatting in a constructable value type for scoped reuse and testing.
  • Build the Home conversation list from the authoritative Chief inbox on cold start, with a regression test for that path.
  • Isolate optional Chief Home from legacy workspace close/group test fixtures.

Testing

Local

  • swift package dump-package --package-path Packages/iOS/CmuxMobileShell — passed.
  • swift package dump-package --package-path Packages/iOS/CmuxMobileShellUI — passed.
  • swift package dump-package --package-path Packages/macOS/CmuxChief — passed.
  • swiftc -frontend -parse for the changed Chief backend, Home/question sheet, and backend test files — passed.
  • ./scripts/lint-ios-package-conventions.sh — passed with no unjustified convention violations.
  • git diff --check — passed.
  • python3 scripts/verify-local.py --only swift-syntax --swift-changed — passed on the final repair head.
  • swiftc -frontend -parse for the new owner preview API and its two callers — passed.
  • ./scripts/lint-ios-package-conventions.sh — passed with no unjustified convention violations on the final repair head.
  • The namespace lint included the new preview formatter and passed with no unjustified violations.
  • Per repository rules, no local Swift tests, simulator runs, or local xcodebuild test were run.

Exact-head hosted builds

  • The current final branch head is 05fd46d730112dd16523deda79f036f56778e920.
  • The earlier fleet artifacts at 17f3be65c49fa38b4b9ef90e93a1d22a763965c8 predate the final refresh-recovery repair and are retained only as historical evidence; current-head CI is the merge evidence.
  • Conflict-only merge gate passed against current main: base 709612a962a42daec52f90380ca3bfff03d8e4f8, head 05fd46d730112dd16523deda79f036f56778e920, speculative merge 437a586fcfac8693699c56d792190cf8f572a25d.

Runtime evidence

  • Fresh exact-head fleet simulator packet: artifacts/verify-remote/20261017-062726-chf30-ios-aws-m4pro-3/, verification step f20c1bca0675a5083f2dbc71, evidence SHA-256: ced090de2d1b4dc6e0f0d1beea78fc42f0c32f94f22a4d13dc284c334ab5e29.
  • The packet launched dev.cmux.ios.chf30 from the exact iOS artifact and cleaned up its isolated simulator. It reached the expected reconnect/no-paired-Mac state; Chief Home, transcript, send, stop, approval, question composer, and pairing interactions were not exercised because this verification lane does not pair a Mac.
  • The direct development backend responded at https://cmux-dev-backend-1.tail137216.ts.net:3869/; the local Tag Opener health endpoint passed and http://127.0.0.1:17320/chf30 was registered.
  • No physical-device verification was performed because the task did not authorize real-phone access.

Related work

  • Builds on the Chief Home/native workspace work in #21063 and #21146.

Impact map

  • Mobile RPC source of truth: MobileChiefClient and the existing authenticated Chief owner dispatch; send correlation also crosses ChiefConversationBackend, ChiefService+Control, and the Mac mobile event stream.
  • Direct callers and sibling entrypoints inspected: WorkspaceShellView, MobilePrimaryTabScaffold, existing mobile destinations, MobileHostService capability/ticket authorization, TerminalController+Chief, and the Chief owner/control-socket paths.
  • Persistence/API/platform effects: existing Chief JSONL and capability contracts remain the source of truth; no schema or release-metadata migration; unsupported operations return typed backend errors.
  • Chief remains request/response based, so the transcript polls while visible.

HIG reference

Changelog

Added: Chief Home and conversation access to the classic mobile shell.