feat(mobile): delegate eligible Android presses to device readiness

Draft
TH
13h ago
+198-7

Summary

  • Add Android-only targetReadiness: 'device', gated by the daemon's bounded-geometry capability. The default path keeps its transition policy.
  • Delegate identified control presses only after an actual completed prior press. Startup, back, other commands, no-op toggles, failed mutations, anonymous targets, and nested controls keep adapter checks.
  • Seven files, including public types, reference docs, patch changeset, and an opt-in benchmark switch. Benchmark app/tests are unchanged.
mobile({ platform: 'android', targetReadiness: 'device' })
flowchart LR
  A[Prior successful press] --> B{Capability and identified target?}
  B -->|Yes| C[Device geometry guard]
  B -->|No| D[Adapter transition policy]

Verified

Ran it locally: yes

Built CLI on the original Android benchmark APK, Pixel_7_CI/API36, one worker, zero runner retries. Both columns link built SDKs: baseline ddba75f5b4, candidate fc612424d1; adapter runtime 59307b1570, final test-only head 5e1d8952f4.

Original 42-case suiteTarget baselineThis branch plus runtime
Passed4242
Fixture recovery taps00
Elapsed321.25s273.12s

E2E_MOBILE_DEVICE_READINESS=1 BENCH_ENGINE=agent-device e2e run --config e2e.android.config.ts --workers 1 --retries 0

Runtime PR. All identities, timings, APK hash, method, safety, and test-app evidence.

Root pnpm check and 352 mobile unit tests passed against the actual pinned SDK. Fresh independent reviews have no unresolved findings.

Draft blocker: published agent-device@0.21.28 drops the capability. Release the linked runtime, then update this dependency and lockfile before enabling or merging. The linked-SDK benchmark does not prove a clean-install opt-in works yet. Experimental direct-engine parity remains open.