fix(daemon): commit recording exports with producer proof

Closed
TH
21h ago
+3299-1021

Superseded by #5099 (direct recording exports) and #5100 (suite recording delivery, stacked on #5099). This PR retains the earlier review and validation record.

Summary

Refs #4970. Bind remote recording exports to the producing reservation, lifetime, tenant, and lease. Keep client placement and the standalone recording ID when a suite recording finishes during cleanup.

Before / after

  • Remote record stop authorizes the exact manifest. A proof retry requires the producer's file identities. Missing evidence leaves the export unpublished.
  • Android checkpoints file identities before it records native completion. Recovery verifies that checkpoint before serving the export. If proof is absent, recovery records native completion and leaves the file on the host.
  • Failed checkpoint reads and writes return a path-free retriable error. The daemon logs the OS error. Confirmed disposal retains the finished completion and any verified identities.
  • Older recordings without producer evidence return LEASE_OUTPUT_MISMATCH on remote stop. Stop and download active recordings before an upgrade. Finished files remain on the daemon host for local recovery.
  • test --record-video holds standalone IDs while the archive copy is pending. Archive and standalone downloads consume their own outputs.

Validation

  • 39d7b51ad1 passed 41 focused tests. All 13 runnable affected checks passed at the exact commit. All 16 hosted checks passed after the iOS smoke rerun. Both proof-less recovery cases failed on a37fcbd6a2.

  • Artifact IDs derive from the reservation and stay stable on retry.

  • Tested the a555931c3 daemon on Pixel 7 with Android 16 and the T3 0.21.41 client. The suite used UIAutomator. A separate snapshot verified android-helper 0.22.0-dev.

<T3 bound CLI> test settings.ad --record-video --no-test-ime --artifacts-dir <client root> --json
Suite passed 1/1. Archived H.264 video decoded all 388 frames.
Standalone without lease: 401 LEASE_OUTPUT_MISMATCH.
Standalone with lease after archive download: 200, matches all 4,672,599 archive bytes.
Both consumed IDs: 404 RESOURCE_EXPIRED.
  • At f801a3d546, both HTTP binary directions with the 0.22 nightly delivered matching video, chunk, and telemetry bytes.