refactor: move screen recording onto platform runtime

Merged
TH
3mo ago
+15289-10587

Summary

  • Route record through the request-bound platform runtime and durable-capture lifecycle while preserving the public CLI and response shape.
  • Preserve exact-owner recovery, fencing, cancellation rollback, provider no-fallback, and platform-specific finalization across Android, Apple, HarmonyOS, and Web.
  • Remove the retired recording backend/provider route, keep trace execution separate, and add the R16 command-atomic cutover gate.

Stacked on #1720. This layer touches 259 files, confined to the screen-recording command family and its shared durable-capture lifecycle.

Validation

  • pnpm check:affected --run: 533 files / 4,522 tests passed; changed-line coverage 1,721/1,941 (88.67%); provider progress 53/53 commands and 67/67 device-observable flags.
  • Android helpers and iOS/macOS XCTest runner builds passed.
  • Live iPhone 17 Pro simulator and Pixel 9 Pro XL emulator flows exercised public start/open/stop, daemon-loss cleanup, replacement start, and playable artifact finalization. On exact head, iOS produced a 31.43-second, 876,761-byte H.264 MP4 and two subsequent starts/stops proved ownership release; earlier Android recovery produced playable H.264 MP4s.
  • Exact-head Web verification exercised public open/start/interaction/stop/close and produced a playable 69,498-byte, 27.7-second VP8 WebM.
  • Live verification exposed and closed exact process-identity regressions for simulator xcrun-to-simctl exec and Android missing/timeout-shaped /proc probes.
  • ADR 0019 records the command-unit cumulative and stack-base budgets. A same-toolchain size/dead-surface/bundler audit removed unreleased unused host fields; current output is 112 B raw and 47 B gzip below the reviewed bound. Bundler A/Bs were rejected when they worsened compressed/tarball size or were byte-neutral.
  • macOS TextEdit opened, but the host XCTest runner never became ready for recording even after a successful runner rebuild; no artifact was claimed. HarmonyOS hardware was unavailable. Both are recorded as residual practical-verification risks while the corresponding focused/package/CI coverage remains green.

No CLI docs or skills changed because public command behavior is preserved; ADR 0019 and structural gates own the internal cutover.