Repository navigation
Extract the Apple runner client from src/platforms/apple/core/runner into package ownership #2040
Copy link
Copy link
Closed
Labels
needs-triageNew or unreviewed issueNew or unreviewed issue
Description
Post-#2038 extraction track (see the roadmap discussion on that PR). This is the largest single mass left in root platform code and has zero file overlap with the perf/trace migration, so it can run fully in parallel with it.
Scope
src/platforms/apple/core/runner/ (~344 kB source) — the XCUITest runner client: artifact cache, build/prewarm, request transport, session lifecycle. Destination: packages/platform-apple (or a dedicated package if its size and consumer set justify one — decide at the start and record the choice).
Current production consumers (19 files, enumerated 2026-08-26 on the #2038 head — re-derive with grep -rln "core/runner/" src before starting)
- Composition roots:
src/platform-runtime-apple-application-tools.ts,platform-runtime-apple-automation-keep-hot.ts,platform-runtime-screen-recording-apple-runner-{host,transport}.ts,src/provider-device-runtime.ts - Daemon (these are also the refactor(snapshot): assign and scope the Wave 4 shared presentation debt (#1739) #1983 shared capture/interaction debt files — coordinate, don't widen):
snapshot-session.ts,selector-runtime.ts,request-recording-health.ts,session-device-utils.ts,request-platform-providers.ts,apple-runner-options.ts,server/daemon-runtime.ts - Platforms:
apple/{alert,interactions,interactor,doctor}.ts,apple/os/macos/desktop-scroll.ts,apple/os/tvos/remote.ts - CLI:
src/cli/commands/daemon.ts
Constraints
- Branch from main only after Migrate audio probe to platform runtime with durable resource lifecycle #2038 merges — it created
src/platforms/apple/doctor.ts(a runner consumer) and this would conflict with it otherwise. - Do not touch
src/platforms/apple/core/perf.ts/perf-xctrace.tsor anysession-perf*file — perf/trace is owned separately and in flight. - ADR-0019 R13: the package façade must stay metadata-eager and implementation-lazy; the eager-closure budgets gate (
src/__tests__/eager-closure-budgets.ts) pins this — move rows deliberately, never as slack. - R11: new exported subpaths must be added in
scripts/layering/package-boundaries.test.ts. - Wire parity: runner request/response shapes are consumed by the Swift runner itself — byte-identical protocol, no drive-by changes.
- Precedents for the record format: refactor(snapshot): establish presentation ownership boundary #2005 / Extract snapshot policy from daemon to host-side facet (#1983) #2014 (ownership-slice extractions under refactor(snapshot): assign and scope the Wave 4 shared presentation debt (#1739) #1983), not a refactor(daemon): platform-free daemon — broader migration waves (successor to #1696) #1739 command unit — this moves mechanics, it migrates no command.
Acceptance
- Runner mechanics live under
packages/, with root keeping at most composition-root wiring. - The daemon platform-import scan (
scripts/layering/daemon-modularity.tsbaseline) shrinks or the residual edges are itemized. - All layering/fallow/budget gates green;
pnpm check:affected --rungreen; a refactor(snapshot): assign and scope the Wave 4 shared presentation debt (#1739) #1983-style record posted describing what moved and what deliberately stayed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs-triageNew or unreviewed issueNew or unreviewed issue
Activity
refactor(apple): extract the runner client into @agent-device/apple-r…
refactor(apple): colocate the XCUITest runner client into packages/pl…
refactor(apple): colocate the XCUITest runner client into packages/pl…