Skip to content

Apple platform + runner: simplification and correctness audit (tracking) #2803

Description

@thymikee

Purpose

A tracking issue for a simplification and correctness audit of the Apple side: packages/platform-apple (about 32k lines of production TS) and apple/runner (about 17.5k lines of Swift plus ObjC bridges), at 01328de411.

Method:

  1. Four read-only audits applied community Swift skills: AvdLee and twostraws Swift Concurrency and Swift Testing, the Swift API Design Guidelines, and jazzychad's ios-code-audit.
  2. A second model cross-reviewed every finding against the code.
  3. The top claims were spot-checked by hand.

Findings refuted in review are not filed here.

Verdict: the core machinery earns its complexity: runner lifecycle, lease detach/adopt, recycle ledger, readiness preflight, command journal, three-tier snapshot plan, and the private-AX ladder pinned by conformance fixtures. The waste sits at the edges. Removing it cuts about 1–1.5k production lines, and moving the inline tests (#2792) takes about 3.9k lines out of production Swift files.

Each child issue is one PR (or a small series of pure-move PRs) inside one module group.

Bugs (ready-for-agent)

Cuts (ready-for-agent)

Decided 2026-09-23 (codex cross-check + code verification), now ready-for-agent

Already tracked elsewhere

#2662 covers runner-session cleanup: the response decoder, a state enum, and the curl-through-simctl transport.

Measure before acting (not filed)

  • The outer 3× read-only retry in runner/runner-client.ts:42-56. It predates the recycle ledger (Runner resilience under agent-abuse command patterns #1105).
  • The runner's private-AX tier, about 1.4k lines. It could go only if the host bridge learns to read custom actions, and removing it weakens recovery while the bridge circuit is open.

Suggested order

  1. fix(ios-runner): snapshot capture plan reads and writes main-owned target state off the main thread #2781fix(ios-runner): non-interactive query sweep outlives its 1s tier slice and causes RUNNER_BUSY #2783 together (runner main-thread correctness).
  2. fix(ios): pass the scoped simulator set to the AX bridge and fold simctl spawn calls #2784, fix(ios): physical-device install lost devicectl hints; delete the dead install/uninstall/push paths #2785 and fix(ios): runtime clang builds must not use -Werror; cache the fold helper build #2796.
  3. The dead-code cuts chore(ios-runner): delete the unreachable synthesized .continuous drag profile #2790 and chore(ios-runner): remove env knobs nobody sets, the dead back wire command, and unreachable paths #2791.
  4. refactor(ios-runner): move ~3.9k lines of inline unit tests out of production Swift files; split CommandExecution under 1,000 lines #2792, then the rest.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions