Skip to content

refactor: move screen recording onto platform runtime - #1724

Draft
thymikee wants to merge 1 commit into
agent/platform-runtime-recordingfrom
agent/platform-runtime-recording-cutover
Draft

refactor: move screen recording onto platform runtime#1724
thymikee wants to merge 1 commit into
agent/platform-runtime-recordingfrom
agent/platform-runtime-recording-cutover

Conversation

@thymikee

@thymikee thymikee commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Route record through the request-bound platform runtime and the 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 256 files, confined to the screen-recording command family and its shared durable-capture lifecycle.

Validation

  • pnpm check:affected --run: 532 files / 4,518 tests passed; changed-line coverage 88.65%, changed-branch coverage 80.30%; 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. ffprobe verified HEVC simulator MP4s and H.264 Android MP4s.
  • Live verification exposed and closed exact process-identity regressions for simulator xcrun to simctl exec and Android missing/timeout-shaped /proc probes.

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

@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstack.github.io/agent-device/pr-preview/pr-1724/

Built to branch gh-pages at 2026-08-10 22:13 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.13 MB 2.17 MB +31.7 kB
JS gzip 695.9 kB 708.6 kB +12.7 kB
npm tarball 827.4 kB 836.3 kB +8.9 kB
npm unpacked 2.88 MB 2.91 MB +32.1 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.5 ms 26.3 ms -0.2 ms
CLI --help 65.8 ms 65.6 ms -0.2 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/dispatch.js +41.4 kB +12.9 kB
dist/src/runtime2.js +25.3 kB +7.6 kB
dist/src/internal/daemon.js -2.8 kB +840 B
dist/src/sdk-batch-runner.js +1.2 kB +356 B
dist/src/session.js +1.7 kB +330 B

@thymikee

Copy link
Copy Markdown
Member Author

Not ready at exact 2db0a9b0:

  • [P2] Linux/Vega record start now falls through narrowDeviceBinding and reports the internal Runtime operation screenRecordingStart is unavailable with no hint, replacing the prior operator-facing record is not supported on this device. Give the screen-recording unavailability fact/handler a record-specific public message and recovery hint, with a production-route regression.
  • [P2] src/daemon/handlers/__tests__/record-runtime.test.ts is a new 549-line file. AGENTS.md requires extraction above 500 LOC and explicitly says tests are not exempt. Split start from stop/recovery and move the shared runtime harness to a sibling fixture.
  • ADR 0019 says future command units must define and review their own cumulative package budget rather than inherit checkpoint headroom. This unit adds +31.7 kB raw JS, +12.7 kB gzip, +8.9 kB tarball, and +32.1 kB unpacked versus refactor: extract durable capture resource lifecycle #1720, but the PR/ADR records no reviewed recording-unit budget. Reconcile and document that acceptance before readiness; the green per-PR Size job does not make the decision.
  • Practical evidence covers iOS simulator and Android emulator only in summary prose. This cutover changes Apple/macOS, Android, HarmonyOS, Web and provider recording routes. Attach exact-head command/output evidence with artifact/playability, recovery/replacement-start and session cleanup; run the other available changed routes, and explicitly record unavailable HarmonyOS hardware as residual risk.

All exact-head CI checks are green and the architectural cutover otherwise traces coherently. PR is stacked on draft #1720. Do not label ready.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant