zeno-mobile-runner 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/CHANGELOG.md +497 -0
  2. package/CONTRIBUTING.md +42 -0
  3. package/FEATURES.md +111 -0
  4. package/LICENSE +21 -0
  5. package/README.md +176 -0
  6. package/SECURITY.md +34 -0
  7. package/build.zig +38 -0
  8. package/build.zig.zon +7 -0
  9. package/clients/README.md +149 -0
  10. package/clients/go/README.md +24 -0
  11. package/clients/go/examples/fake-session/main.go +93 -0
  12. package/clients/go/go.mod +3 -0
  13. package/clients/go/zmr/client.go +432 -0
  14. package/clients/kotlin/README.md +35 -0
  15. package/clients/kotlin/build.gradle.kts +35 -0
  16. package/clients/kotlin/settings.gradle.kts +15 -0
  17. package/clients/kotlin/src/main/kotlin/dev/zmr/FakeSession.kt +86 -0
  18. package/clients/kotlin/src/main/kotlin/dev/zmr/ZmrClient.kt +67 -0
  19. package/clients/python/README.md +29 -0
  20. package/clients/python/examples/fake_session.py +48 -0
  21. package/clients/python/pyproject.toml +13 -0
  22. package/clients/python/zmr_client.py +202 -0
  23. package/clients/rust/Cargo.lock +107 -0
  24. package/clients/rust/Cargo.toml +10 -0
  25. package/clients/rust/README.md +19 -0
  26. package/clients/rust/examples/fake_session.rs +70 -0
  27. package/clients/rust/src/lib.rs +461 -0
  28. package/clients/swift/Package.swift +16 -0
  29. package/clients/swift/README.md +36 -0
  30. package/clients/swift/Sources/ZMRClient/ZMRClient.swift +114 -0
  31. package/clients/swift/Sources/ZMRFakeSession/main.swift +86 -0
  32. package/clients/typescript/README.md +34 -0
  33. package/clients/typescript/examples/fake-session.mjs +36 -0
  34. package/clients/typescript/index.d.ts +144 -0
  35. package/clients/typescript/index.mjs +192 -0
  36. package/clients/typescript/package.json +8 -0
  37. package/docs/adr/0001-agent-native-runner-boundary.md +31 -0
  38. package/docs/adr/0002-app-local-zmr-contract.md +39 -0
  39. package/docs/adr/0003-ios-simulator-xctest-shim.md +41 -0
  40. package/docs/adr/0004-benchmark-claims-and-baseline-collection.md +37 -0
  41. package/docs/adr/README.md +12 -0
  42. package/docs/ai-agents.md +154 -0
  43. package/docs/app-integration.md +330 -0
  44. package/docs/benchmarking.md +273 -0
  45. package/docs/client-installation.md +133 -0
  46. package/docs/clients.md +98 -0
  47. package/docs/config.md +175 -0
  48. package/docs/demo.md +259 -0
  49. package/docs/frameworks.md +72 -0
  50. package/docs/install.md +95 -0
  51. package/docs/npm.md +356 -0
  52. package/docs/protocol-fixtures/README.md +8 -0
  53. package/docs/protocol-fixtures/core-session.requests.jsonl +8 -0
  54. package/docs/protocol-fixtures/core-session.responses.jsonl +8 -0
  55. package/docs/protocol-versioning.md +65 -0
  56. package/docs/protocol.md +560 -0
  57. package/docs/scenario-authoring.md +88 -0
  58. package/docs/trace-privacy.md +88 -0
  59. package/docs/troubleshooting.md +256 -0
  60. package/examples/android-app-auth-probe.json +89 -0
  61. package/examples/android-app-error-state.json +13 -0
  62. package/examples/android-app-login-smoke.json +192 -0
  63. package/examples/android-app-onboarding.json +12 -0
  64. package/examples/android-app-referral-deep-link.json +12 -0
  65. package/examples/android-shim-smoke.json +19 -0
  66. package/examples/demo-failure.json +12 -0
  67. package/examples/demo-fake.json +14 -0
  68. package/examples/ios-dev-client-open-link.json +26 -0
  69. package/examples/ios-dev-client-route-snapshot.json +24 -0
  70. package/examples/ios-shim-smoke.json +23 -0
  71. package/examples/ios-smoke.json +9 -0
  72. package/go.work +3 -0
  73. package/npm/agents.mjs +183 -0
  74. package/npm/app-config.mjs +95 -0
  75. package/npm/build-zmr.mjs +21 -0
  76. package/npm/commands.mjs +104 -0
  77. package/npm/generated-files.mjs +50 -0
  78. package/npm/index.mjs +75 -0
  79. package/npm/init-app.mjs +80 -0
  80. package/npm/package-scripts.mjs +72 -0
  81. package/npm/postinstall.mjs +21 -0
  82. package/npm/scaffold.mjs +179 -0
  83. package/npm/scenarios.mjs +93 -0
  84. package/npm/setup.mjs +69 -0
  85. package/npm/wizard.mjs +117 -0
  86. package/npm/zmr.mjs +23 -0
  87. package/package.json +118 -0
  88. package/schemas/README.md +26 -0
  89. package/schemas/action-result.schema.json +27 -0
  90. package/schemas/capabilities-output.schema.json +98 -0
  91. package/schemas/devices-output.schema.json +25 -0
  92. package/schemas/doctor-output.schema.json +51 -0
  93. package/schemas/explain-output.schema.json +51 -0
  94. package/schemas/import-output.schema.json +23 -0
  95. package/schemas/init-output.schema.json +71 -0
  96. package/schemas/json-rpc.schema.json +55 -0
  97. package/schemas/release-manifest.schema.json +43 -0
  98. package/schemas/release-readiness-output.schema.json +127 -0
  99. package/schemas/run-output.schema.json +43 -0
  100. package/schemas/scenario.schema.json +128 -0
  101. package/schemas/schemas-output.schema.json +26 -0
  102. package/schemas/semantic-snapshot.schema.json +116 -0
  103. package/schemas/snapshot.schema.json +60 -0
  104. package/schemas/trace-event.schema.json +14 -0
  105. package/schemas/trace-manifest.schema.json +59 -0
  106. package/schemas/validate-output.schema.json +42 -0
  107. package/schemas/version-output.schema.json +23 -0
  108. package/schemas/zmr-config.schema.json +75 -0
  109. package/scripts/android-emulator.sh +126 -0
  110. package/scripts/assert-ios-physical-ready.sh +213 -0
  111. package/scripts/benchmark-command.sh +307 -0
  112. package/scripts/benchmark.sh +359 -0
  113. package/scripts/benchmark_gate.py +117 -0
  114. package/scripts/benchmark_result_row.py +88 -0
  115. package/scripts/compare-benchmarks.py +288 -0
  116. package/scripts/create-android-demo-app.sh +342 -0
  117. package/scripts/create-ios-demo-app.sh +261 -0
  118. package/scripts/demo-android-real.sh +232 -0
  119. package/scripts/demo-ios-real.sh +270 -0
  120. package/scripts/demo.sh +464 -0
  121. package/scripts/device-matrix.sh +338 -0
  122. package/scripts/ensure-ios-shim-target.rb +237 -0
  123. package/scripts/install-android-shim.sh +281 -0
  124. package/scripts/install-ios-shim.sh +589 -0
  125. package/scripts/pilot-gate.sh +560 -0
  126. package/scripts/release-readiness.py +838 -0
  127. package/scripts/release-readiness.sh +91 -0
  128. package/scripts/run-android-pilot.sh +561 -0
  129. package/scripts/run-ios-pilot.sh +509 -0
  130. package/shims/android/README.md +21 -0
  131. package/shims/android/ZMRShimInstrumentedTest.java +152 -0
  132. package/shims/android/protocol.md +18 -0
  133. package/shims/ios/README.md +50 -0
  134. package/shims/ios/ZMRShim.swift +110 -0
  135. package/shims/ios/ZMRShimUITestCase.swift +518 -0
  136. package/shims/ios/protocol.md +74 -0
  137. package/skills/zmr-mobile-testing/SKILL.md +127 -0
  138. package/src/android.zig +344 -0
  139. package/src/android_device_info.zig +99 -0
  140. package/src/android_emulator.zig +154 -0
  141. package/src/android_screen_recording.zig +112 -0
  142. package/src/android_shell.zig +112 -0
  143. package/src/bundle.zig +124 -0
  144. package/src/bundle_redaction.zig +272 -0
  145. package/src/bundle_tar.zig +123 -0
  146. package/src/cli_devices.zig +97 -0
  147. package/src/cli_doctor.zig +114 -0
  148. package/src/cli_import.zig +70 -0
  149. package/src/cli_info.zig +39 -0
  150. package/src/cli_init.zig +72 -0
  151. package/src/cli_output.zig +467 -0
  152. package/src/cli_run.zig +259 -0
  153. package/src/cli_serve.zig +287 -0
  154. package/src/cli_trace.zig +111 -0
  155. package/src/cli_validate.zig +41 -0
  156. package/src/command.zig +211 -0
  157. package/src/config.zig +305 -0
  158. package/src/config_diagnostics.zig +212 -0
  159. package/src/config_paths.zig +49 -0
  160. package/src/device_registry.zig +37 -0
  161. package/src/doctor.zig +412 -0
  162. package/src/doctor_hints.zig +52 -0
  163. package/src/errors.zig +55 -0
  164. package/src/fake_device.zig +163 -0
  165. package/src/health.zig +28 -0
  166. package/src/importer.zig +343 -0
  167. package/src/importer_json.zig +100 -0
  168. package/src/importer_model.zig +103 -0
  169. package/src/ios.zig +399 -0
  170. package/src/ios_devices.zig +219 -0
  171. package/src/ios_lifecycle.zig +72 -0
  172. package/src/ios_shim.zig +242 -0
  173. package/src/ios_snapshot.zig +20 -0
  174. package/src/json_fields.zig +80 -0
  175. package/src/json_rpc.zig +150 -0
  176. package/src/json_rpc_methods.zig +318 -0
  177. package/src/json_rpc_observation.zig +31 -0
  178. package/src/json_rpc_params.zig +52 -0
  179. package/src/json_rpc_protocol.zig +110 -0
  180. package/src/json_rpc_trace.zig +73 -0
  181. package/src/main.zig +131 -0
  182. package/src/mcp.zig +234 -0
  183. package/src/mcp_protocol.zig +64 -0
  184. package/src/mcp_trace.zig +83 -0
  185. package/src/report.zig +346 -0
  186. package/src/report_html.zig +63 -0
  187. package/src/report_values.zig +27 -0
  188. package/src/run_options.zig +152 -0
  189. package/src/runner.zig +280 -0
  190. package/src/runner_actions.zig +109 -0
  191. package/src/runner_config.zig +6 -0
  192. package/src/runner_diagnostics.zig +268 -0
  193. package/src/runner_events.zig +170 -0
  194. package/src/runner_native.zig +88 -0
  195. package/src/runner_waits.zig +300 -0
  196. package/src/scaffold.zig +472 -0
  197. package/src/scenario.zig +346 -0
  198. package/src/scenario_fields.zig +50 -0
  199. package/src/schema_registry.zig +53 -0
  200. package/src/selector.zig +84 -0
  201. package/src/semantic.zig +171 -0
  202. package/src/trace.zig +315 -0
  203. package/src/trace_json.zig +340 -0
  204. package/src/trace_summary.zig +218 -0
  205. package/src/trace_summary_diagnostic.zig +202 -0
  206. package/src/types.zig +120 -0
  207. package/src/uiautomator.zig +164 -0
  208. package/src/validation.zig +187 -0
  209. package/src/version.zig +22 -0
  210. package/viewer/app.js +373 -0
  211. package/viewer/index.html +126 -0
  212. package/viewer/parser.js +233 -0
  213. package/viewer/styles.css +585 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,497 @@
1
+ # Changelog
2
+
3
+ All notable changes to Zeno Mobile Runner are tracked here.
4
+
5
+ ## Unreleased
6
+
7
+ ## 0.1.2 (2026-05-28)
8
+
9
+ ### Fixed
10
+
11
+ - Fixed the npm postinstall build path so packages installed without prebuilt
12
+ binaries build a runnable `zmr` executable from source.
13
+ - Moved the internal Zig test harness out of the executable entrypoint so the
14
+ published npm package can omit test-only source files safely.
15
+
16
+ ## 0.1.1 (2026-05-28)
17
+
18
+ ### Changed
19
+
20
+ - Reworked the public README around npm installation, React Native, Expo,
21
+ Flutter, native Android/iOS, and AI-agent mobile testing.
22
+ - Demoted language clients in the public positioning so TypeScript and Python
23
+ are presented as common starting points, while Go, Rust, Swift, and Kotlin
24
+ remain reference integrations.
25
+ - Removed release process, readiness, and positioning notes from the public
26
+ documentation tree.
27
+ - Added a framework guide for React Native selectors, Expo dev-client setup, and
28
+ Flutter platform-level semantics support.
29
+
30
+ ## 0.1.0 (2026-05-22)
31
+
32
+ ### Added
33
+
34
+ - `zmr doctor` for local environment diagnostics across Zig, ADB, Android devices, `xcrun`, and iOS simulators.
35
+ - `zmr init` for scaffolding a starter scenario.
36
+ - `zmr validate <scenario.json>` for preflight scenario validation without touching a device.
37
+ - Public JSON Schemas under `schemas/` for scenarios, snapshots, action results, trace events, and JSON-RPC messages.
38
+ - `schemas/validate-output.schema.json` for the machine-readable `zmr validate --json` preflight result.
39
+ - Stable public error-code mapping for CLI/protocol-facing failures.
40
+ - Top-level CLI failures now print stable `error[code]` messages instead of
41
+ Zig stack traces.
42
+ - JSON-RPC execution errors now include `publicCode` when a stable code is available.
43
+ - Demo documentation in `docs/demo.md`.
44
+ - Machine-readable protocol compatibility metadata in `runner.capabilities`.
45
+ - Go and Rust reference JSON-RPC clients with fake-session examples and CI
46
+ coverage.
47
+ - Go and Rust clients now expose the full core mobile control surface for
48
+ session lifecycle, app lifecycle, UI actions, waits, assertions, semantic
49
+ snapshots, trace polling, and trace export.
50
+ - Go and Rust fake-session examples now launch `zmr serve` with the fake-device
51
+ backend and exercise agent-style open-link, wait, tap, type, assertion,
52
+ snapshot, trace polling, and redacted export flows.
53
+ - `zmr-benchmark-command` for timing app-local baseline commands and writing
54
+ normalized rows that can be compared with ZMR benchmark results.
55
+ - `zmr-benchmark --results` / `--replace` for appending ZMR runs to a shared
56
+ comparison JSONL file.
57
+ - `zmr-compare-benchmarks` gates for candidate pass rate, failure count, mean
58
+ speedup, and p95 speedup.
59
+ - Feature catalog in `FEATURES.md`.
60
+ - Architecture decision records under `docs/adr/`.
61
+ - AI agent integration guide in `docs/ai-agents.md`.
62
+ - Simplified public README plus dedicated scenario authoring and client docs.
63
+ - Client installation guide for npm, Homebrew, TypeScript, Python, Go, Rust,
64
+ Swift, and Kotlin.
65
+ - SwiftPM and Kotlin/JVM reference clients for host-side native mobile team
66
+ automation.
67
+ - Swift and Kotlin fake-session demo entry points now run from `scripts/demo.sh`
68
+ and export redacted traces alongside the TypeScript, Python, Go, and Rust
69
+ client demos.
70
+ - Kotlin/JVM client calls now reject JSON-RPC error responses instead of
71
+ returning error payloads as successful raw strings.
72
+ - The npm package keeps `zmr-release-readiness` for app-local evidence checks
73
+ but keeps source-only helper scripts out of the app install command surface.
74
+ - `zmr-release-readiness` / `scripts/release-readiness.sh` now converts
75
+ app-local `evidence.jsonl` into explicit readiness summaries with missing
76
+ evidence listed for agents.
77
+ - `schemas/release-readiness-output.schema.json` and `zmr schemas --json`
78
+ metadata for agent-readable evidence output.
79
+ - `zmr-release-readiness --json` now includes `nextSteps` commands for missing
80
+ evidence so agents can continue blocked checks without scraping text.
81
+ - `zmr-release-readiness --json` now includes per-requirement status rows so
82
+ agents can see which evidence was satisfied, missing, failed, planned, or
83
+ insufficient.
84
+ - `zmr-compare-benchmarks` now supports `--evidence-out` so benchmark
85
+ comparisons can append structured evidence directly.
86
+ - `zmr-assert-ios-physical-ready` now accepts `--xcrun`, and
87
+ `zmr-pilot-gate` forwards custom `--xcrun` paths into the physical iOS
88
+ readiness preflight as well as the iOS pilot run.
89
+ - `zmr-pilot-gate` now accepts `--zmr-bin` and forwards the explicit runner
90
+ binary to Android, iOS, and physical iOS readiness checks for app-local CI.
91
+ - `zmr-pilot-gate` now records structured app-root and iOS app-artifact
92
+ evidence, and iOS pilots require `--ios-app-root` so production-readiness
93
+ evidence names the tested app source and build.
94
+ - Local readiness evidence now runs the generated public iOS simulator demo
95
+ five times by default, with `--local-ios-demo-runs <n>` for explicit run-count
96
+ tuning.
97
+ - Local readiness evidence can now run the generated public Android
98
+ emulator demo with `--local-android-avd <name>`, `--local-android-device`,
99
+ and `--local-android-demo-runs <n>`.
100
+ - `scripts/assert-ios-physical-ready.sh` now makes hardware readiness mode fail
101
+ unless the requested physical iOS device is present and ready, with retries
102
+ for transient CoreDevice list failures.
103
+ - `zmr doctor` now keeps physical iOS checks actionable on multi-device
104
+ machines by reporting disconnected/unavailable device counts even when one
105
+ physical device is ready.
106
+ - `zmr doctor --json` now emits structured `count` and `readyCount` fields for
107
+ Android, iOS simulator, and physical iOS device checks so agents do not need
108
+ to parse human-readable detail strings.
109
+ - Physical iOS discovery and lifecycle support through `xcrun devicectl`,
110
+ including install, launch, deep-link launch, clear-state uninstall, and
111
+ best-effort stop.
112
+ - GitHub issue templates for bug reports and feature requests.
113
+ - Reusable `zmr-mobile-testing` agent skill under `skills/`.
114
+ - `trace.events` JSON-RPC cursor polling for live trace events during long-running agent sessions.
115
+ - `observe.semanticSnapshot` JSON-RPC output with normalized roles, stable
116
+ selectors, center bounds, visible text summary, and recommended actions for
117
+ AI agents.
118
+ - `zmr mcp` stdio server for MCP-capable agents, exposing mobile-specific tools
119
+ for semantic snapshots, selector actions, waits, live trace polling, and
120
+ redacted trace export.
121
+ - `schemas/semantic-snapshot.schema.json` for the machine-readable semantic
122
+ observation contract.
123
+ - `src/cli_output.zig` as the focused home for CLI JSON/text output
124
+ serialization, keeping command routing easier to inspect.
125
+ - `src/runner_events.zig` as the focused home for runner trace events and
126
+ selector diagnostics, keeping scenario execution easier to follow.
127
+ - `src/json_rpc_protocol.zig` as the focused home for JSON-RPC wire-format
128
+ responses, keeping agent-facing dispatch easier to review.
129
+ - `src/trace_summary.zig` as the focused home for reading `trace.json` plus
130
+ `events.jsonl`, keeping run-output and explain-output diagnostics consistent
131
+ for agents.
132
+ - `src/ios_devices.zig` as the focused home for iOS simulator and physical
133
+ device discovery plus `xcrun` command construction, keeping `src/ios.zig`
134
+ focused on app lifecycle and UI actions.
135
+ - `src/android_shell.zig` as the focused home for Android shell action and
136
+ deep-link intent argument construction, keeping `src/android.zig` focused on
137
+ device orchestration.
138
+ - `src/json_fields.zig` as the shared typed JSON field reader for scenario and
139
+ JSON-RPC parameter parsing, reducing duplicated low-level parser code.
140
+ - `src/runner_diagnostics.zig` as the focused selector diagnostic JSON builder,
141
+ keeping `src/runner_events.zig` focused on trace event recording.
142
+ - `src/trace_summary_diagnostic.zig` as the focused trace diagnostic event
143
+ model and JSON serializer, keeping `src/trace_summary.zig` focused on
144
+ reading trace manifests and event streams.
145
+ - `src/run_options.zig` as the focused home for `zmr run`, `zmr serve`, and
146
+ `zmr mcp` option/config precedence, keeping `src/main.zig` closer to a thin
147
+ command router.
148
+ - `src/config_paths.zig` as the focused home for app-local `.zmr/config.json`
149
+ loading and relative path resolution across `doctor`, `run`, `serve`, and
150
+ `mcp`.
151
+ - `src/runner_native.zig` as the focused home for native selector action
152
+ dispatch and trace events, keeping `src/runner.zig` focused on scenario
153
+ orchestration and snapshot fallback behavior.
154
+ - `src/cli_devices.zig` as the focused home for the `zmr devices` command,
155
+ keeping `src/main.zig` closer to command routing.
156
+ - `src/cli_doctor.zig` as the focused home for `zmr doctor` flag parsing,
157
+ app-local config resolution, and output dispatch, keeping setup diagnostics
158
+ easier to review.
159
+ - `src/cli_validate.zig` as the focused home for `zmr validate` parsing and
160
+ result output, keeping the top-level command router smaller.
161
+ - `src/cli_info.zig` as the focused home for `zmr version` and `zmr schemas`
162
+ output, keeping metadata commands out of the top-level router.
163
+ - `src/cli_init.zig` as the focused home for `zmr init` app-local and
164
+ single-scenario scaffolding, keeping first-run DX code easier to inspect.
165
+ - `src/cli_import.zig` as the focused home for `zmr import flow-yaml`
166
+ migration parsing and dispatch, keeping onboarding/migration code out of the
167
+ top-level router.
168
+ - `src/cli_trace.zig` as the focused home for `zmr report`, `zmr explain`, and
169
+ `zmr export` parsing and dispatch, keeping trace-inspection commands out of
170
+ the top-level router.
171
+ - `src/cli_serve.zig` as the focused home for `zmr serve` and `zmr mcp`
172
+ parsing, app-local config resolution, trace setup, and Android/iOS server
173
+ dispatch, keeping agent server startup out of the top-level router.
174
+ - `src/cli_run.zig` as the focused home for `zmr run` parsing, app-local
175
+ config resolution, emulator preflight, trace setup, and Android/iOS scenario
176
+ dispatch, leaving `src/main.zig` as a thin command router.
177
+ - `src/main_tests.zig` and `src/test_harness.zig` as the focused homes for
178
+ command-router integration coverage and module test discovery, keeping
179
+ `src/main.zig` as a runtime-only router.
180
+ - `src/runner_tests.zig` as the focused home for runner orchestration tests,
181
+ keeping `src/runner.zig` focused on the runtime scenario engine.
182
+ - `src/trace_tests.zig` as the focused home for trace serialization,
183
+ redaction, artifact, and manifest tests, keeping `src/trace.zig` focused on
184
+ trace writing behavior.
185
+ - `src/android_tests.zig` as the focused home for Android adapter parser,
186
+ command construction, trace artifact, and native shim tests, keeping
187
+ `src/android.zig` focused on ADB/device behavior.
188
+ - `src/ios_tests.zig` as the focused home for iOS simulator, physical device,
189
+ screenshot, open-link, and XCTest-shim behavior tests, keeping `src/ios.zig`
190
+ focused on simctl/devicectl and shim orchestration.
191
+ - `src/config_tests.zig` as the focused home for `.zmr/config.json` parser,
192
+ diagnostics, artifact controls, and redaction controls, keeping
193
+ `src/config.zig` focused on the app-local config runtime contract.
194
+ - `src/doctor_tests.zig` as the focused home for setup diagnostics, remediation
195
+ hints, fake-device checks, and smoke-scenario validation coverage, keeping
196
+ `src/doctor.zig` focused on environment probe behavior.
197
+ - `src/doctor_hints.zig` as the focused home for setup error-code and
198
+ remediation-hint policy, keeping `src/doctor.zig` focused on running probes
199
+ and assembling checks.
200
+ - `src/bundle_tests.zig` as the focused home for trace archive, redaction, and
201
+ artifact omission coverage, keeping `src/bundle.zig` focused on deterministic
202
+ `.zmrtrace` packaging behavior.
203
+ - `src/scenario_tests.zig` as the focused home for scenario DSL parsing,
204
+ agent-grade flow primitive, simple action, and malformed-input coverage,
205
+ keeping `src/scenario.zig` focused on the runtime scenario parser.
206
+ - `src/report_tests.zig` as the focused home for HTML report and trace
207
+ explanation coverage, keeping `src/report.zig` focused on report rendering
208
+ behavior used by local demos and agent diagnostics.
209
+ - `src/report_html.zig` as the focused home for shared HTML escaping,
210
+ document framing, file writing, and artifact links used by trace and
211
+ benchmark reports.
212
+ - `src/importer_tests.zig` as the focused home for flow-YAML migration
213
+ coverage through the public file import API, keeping `src/importer.zig`
214
+ focused on migration parsing and JSON emission internals.
215
+ - `src/validation_tests.zig` as the focused home for scenario preflight and
216
+ source-location diagnostics coverage, keeping `src/validation.zig` focused
217
+ on public validation result construction.
218
+ - `src/command_tests.zig` as the focused home for command execution timeout
219
+ and ADB escaping coverage, keeping `src/command.zig` focused on subprocess
220
+ and shell-argument behavior.
221
+ - `src/trace_summary_tests.zig` as the focused home for partial visual capture
222
+ explanation coverage, keeping `src/trace_summary.zig` focused on trace
223
+ summary parsing for CLI and agent diagnostics.
224
+ - `src/semantic_tests.zig` as the focused home for agent semantic snapshot
225
+ role/action coverage, keeping `src/semantic.zig` focused on observation
226
+ normalization.
227
+ - Focused test modules for small public contracts: `src/types_tests.zig`,
228
+ `src/selector_tests.zig`, `src/health_tests.zig`,
229
+ `src/device_registry_tests.zig`, `src/schema_registry_tests.zig`, and
230
+ `src/version_tests.zig`, keeping these runtime modules lean and easier to
231
+ audit.
232
+ - `src/uiautomator_tests.zig`, `src/fake_device_tests.zig`, and
233
+ `src/android_emulator_tests.zig` as focused homes for parser, fake-device,
234
+ and emulator-preflight coverage, keeping Android runtime helpers easier to
235
+ review before release pilots.
236
+ - Focused CLI parser test modules for `doctor`, `import`, `info`, `init`,
237
+ `trace`, and `validate`, keeping command entry modules shorter while
238
+ preserving parse-error coverage.
239
+ - Focused parser test modules for `zmr run` and `zmr serve` startup options,
240
+ keeping the primary execution and agent-server command modules focused on
241
+ config resolution and runtime dispatch.
242
+ - Focused public-contract test modules for config path resolution, run/serve
243
+ option precedence, JSON-RPC protocol metadata, and CLI output helpers.
244
+ - Focused public-contract test modules for error classification, iOS device
245
+ discovery parsing, runner event diagnostics, and `.zmr` scaffold generation.
246
+ - `src/ios_shim_tests.zig` as the focused home for XCTest shim command,
247
+ selector, screenshot, snapshot, and response parsing contracts, keeping
248
+ `src/ios_shim.zig` focused on the shim protocol implementation.
249
+ - `src/json_rpc_tests.zig` as the focused home for JSON-RPC dispatch,
250
+ live-trace, event-stream, and protocol-fixture tests.
251
+ - `src/json_rpc_methods.zig` now owns JSON-RPC method execution while
252
+ `src/json_rpc.zig` stays focused on stdio/tcp transport and request framing.
253
+ - JSON-RPC method dispatch is now grouped by protocol area: core/session,
254
+ app lifecycle, observation, UI actions, waits, assertions, and trace tools.
255
+ This keeps the agent-facing server surface easier to audit before release.
256
+ - `src/json_rpc_params.zig` now owns JSON-RPC parameter parsing for selectors,
257
+ primitive fields, directions, and defaults, keeping method dispatch focused
258
+ on protocol behavior.
259
+ - `src/json_rpc_trace.zig` now owns JSON-RPC live trace event streaming and
260
+ simple trace payload helpers, keeping method dispatch focused on routing.
261
+ - `src/json_rpc_observation.zig` now owns JSON-RPC snapshot response
262
+ serialization and trace artifact events, keeping method dispatch focused on
263
+ observation routing.
264
+ - `src/mcp_protocol.zig` now owns MCP response framing, initialization output,
265
+ errors, and tool catalog JSON, keeping the MCP server focused on tool
266
+ execution for agent integrations.
267
+ - `src/mcp_trace.zig` now owns MCP trace-event polling and redacted trace
268
+ export tool responses, keeping the MCP server focused on dispatching
269
+ agent-requested tools.
270
+ - `src/runner_waits.zig` now owns selector wait, assertion, and scroll polling
271
+ behavior, while `src/runner.zig` stays focused on scenario execution and UI
272
+ actions.
273
+ - `src/runner_actions.zig` now owns selector tap/type/erase behavior, keeping
274
+ action targeting separate from high-level scenario orchestration.
275
+ - `src/trace_json.zig` now owns trace JSON serialization and redaction rules,
276
+ leaving `src/trace.zig` focused on trace writing and manifest lifecycle.
277
+ - `src/bundle_tar.zig` now owns deterministic tar entry writing, leaving
278
+ `src/bundle.zig` focused on trace bundle entry selection and redaction policy.
279
+ - `src/importer_model.zig` and `src/importer_json.zig` now own flow-import
280
+ intermediate types and scenario JSON emission, leaving `src/importer.zig`
281
+ focused on translating source flow syntax.
282
+ - `src/config_diagnostics.zig` now owns `.zmr/config.json` field-path
283
+ diagnostics, leaving `src/config.zig` focused on parsing the runtime config
284
+ contract.
285
+ - `src/android_device_info.zig` now owns Android device listing plus window,
286
+ viewport, and density parsers, leaving `src/android.zig` focused on ADB app
287
+ lifecycle, actions, screenshots, and shim orchestration.
288
+ - `src/android_screen_recording.zig` now owns Android screenrecord process
289
+ lifecycle and trace artifact pulling, leaving `src/android.zig` focused on
290
+ app/device orchestration.
291
+ - `src/ios_lifecycle.zig` now owns physical iOS `devicectl` install, launch,
292
+ stop, and uninstall helpers, leaving `src/ios.zig` focused on simulator
293
+ lifecycle, XCTest shim orchestration, screenshots, and snapshots.
294
+ - `src/ios_snapshot.zig` now owns PNG viewport parsing for screenshot
295
+ artifacts, keeping iOS adapter snapshot orchestration easier to review.
296
+ - `scripts/coverage.sh` now guards `kcov` with
297
+ `ZMR_KCOV_TIMEOUT_SECONDS`, so release gates fail fast instead of hanging on
298
+ macOS tracing authorization stalls.
299
+ - Field, line, and column diagnostics in `zmr validate --json` for invalid scenarios.
300
+ - Scenario authoring guide plus onboarding, referral deep-link, and error-state templates.
301
+ - Adapter-level settle hook after mutating scenario actions, with native shim idle support and shell fallback.
302
+ - Trace viewer side-by-side screenshot and UI tree inspection with selectable node details.
303
+ - App-specific trace redaction denylist/allowlist controls for persisted node text, resource ids, and trace events.
304
+ - Release builds now generate SPDX SBOM and third-party license notice artifacts.
305
+ - Release builds now generate a Homebrew formula with per-platform checksums.
306
+ - Release builds now generate `RELEASE_MANIFEST.json`, a machine-readable
307
+ artifact inventory with sizes and SHA-256 digests.
308
+ - Release integrity verification now validates generated archives, metadata
309
+ files, `RELEASE_MANIFEST.json`, and `SHA256SUMS` before packaged binary
310
+ smoke tests.
311
+ - Tagged release workflow now publishes GitHub artifact attestation for release
312
+ archives and metadata.
313
+ - Tagged release workflow now builds the npm tarball, attests it, uploads it
314
+ with the release assets, and publishes with npm provenance when `NPM_TOKEN`
315
+ is configured.
316
+ - Release manifests and checksum verification now include generated npm
317
+ tarballs when present.
318
+ - Native selector wait timeouts now capture one final snapshot when possible,
319
+ giving iOS XCTest-shim failures the same visible text and candidate
320
+ diagnostics as snapshot-based waits.
321
+ - Added `scripts/sign-macos-release.sh` for credentialed release users to sign
322
+ macOS release archives and refresh checksums before upload.
323
+ - Added `scripts/notarize-macos-release.sh` for credentialed release users to
324
+ submit signed macOS archives to Apple notarytool, persist receipts, and
325
+ refresh release metadata before upload.
326
+ - iOS simulator `clearState` is now idempotent when the app is already uninstalled and documented as best-effort uninstall by bundle id.
327
+ - Android pilot wrapper can reset the emulator and boot from a named snapshot before running smoke flows.
328
+ - Android pilot wrapper can capture an optional MP4 screen recording for visual flake triage.
329
+ - Android and iOS pilot wrappers now run early setup preflights and print
330
+ structured `zmr doctor --json` diagnostics for missing devices/simulators.
331
+ - Android pilot wrapper `--adb` overrides now propagate into the underlying
332
+ `zmr run` and repeated-run benchmark calls.
333
+ - Added `scripts/pilot-gate.sh` and the `zmr-pilot-gate` npm bin for the
334
+ external Android+iOS pre-release pilot gate.
335
+ - `zmr-pilot-gate` now resolves app-local relative paths from the caller's
336
+ checkout, including when invoked through npm's `node_modules/.bin` symlink.
337
+ - The iOS shim installer now resolves multi-project workspaces by matching
338
+ `--bundle-id` when multiple projects contain the same `--app-target`.
339
+ - The iOS shim installer now patches app-local `.zmr/config.json` with
340
+ `tools.iosShimPath` so selector-grade iOS runs use the installed shim by
341
+ default.
342
+ - `zmr init --app`, `zmr-init`, and `zmr-wizard --package-json` now scaffold
343
+ a `zmr:pilot` / `scripts.pilotGate` command for external release pilots.
344
+ - `zmr init --app`, `zmr-init`, and `zmr-wizard` now scaffold
345
+ `.zmr/device-matrix.json` plus `zmr:matrix` / `scripts.matrix` so the
346
+ generated app-local setup can run local Android/iOS matrix gates immediately.
347
+ - `zmr-wizard --expo-dev-client-scheme` now scaffolds Android and iOS Expo
348
+ development-build open-link smoke scenarios and package scripts.
349
+ - Scenario JSON now supports `assertNoneVisible` for app-wide crash/error
350
+ guards after navigation or sign-in steps.
351
+ - Scenario JSON now supports zero-config `assertHealthy` guards for common
352
+ mobile redboxes, crash overlays, and development-client load failures.
353
+ - Health guard policy now lives in a focused `src/health.zig` module so
354
+ contributors can extend default mobile error detection without editing runner
355
+ orchestration.
356
+ - Public schema discovery now lives in `src/schema_registry.zig`, keeping CLI
357
+ command dispatch smaller while preserving `zmr schemas --json` output.
358
+ - Device readiness and `zmr devices --json` serialization now live in
359
+ `src/device_registry.zig`, so CLI and JSON-RPC agents share one portable
360
+ readiness policy for Android, iOS simulators, and physical iOS devices.
361
+ - `zmr init` and `zmr init --app` now scaffold `assertHealthy` into starter
362
+ smoke scenarios so source/archive installs get the same safer default as the
363
+ npm wizard.
364
+ - JSON-RPC and all reference clients now expose `assert.healthy` /
365
+ `assertHealthy` so agents can run the same health guard outside scenario
366
+ files.
367
+ - Swift and Kotlin clients now include fake-server package tests that exercise
368
+ the JSON-RPC session path and `assert.healthy` helper.
369
+ - Android snapshots now include display density DPI when available.
370
+ - Traced Android `zmr run` sessions can capture an opt-in `screenrecord.mp4`, and redacted exports omit screen recordings.
371
+ - Redacted `.zmrtrace` exports now keep replayable screenshot artifact paths by replacing PNG screenshots with safe placeholder images.
372
+ - `zmr export --redact --omit-screenshots` and JSON-RPC
373
+ `trace.export` `omitScreenshots` can omit screenshot artifacts entirely from
374
+ redacted bundles.
375
+ - `zmr run` can now boot an Android AVD, restore a snapshot, reset the emulator, and wait for boot readiness before running a scenario.
376
+ - `zmr run` can create a missing Android AVD from an installed system image before booting it.
377
+ - iOS pilot runs now execute a selector-driven `ios-shim-smoke` flow and export its report/bundles when `--ios-shim` is provided.
378
+ - iOS XCTest shim snapshots now include element `value` fields, and the Zig
379
+ mapper falls back from empty labels to values so text-field contents appear
380
+ in UI trees and agent observations.
381
+ - Added `scripts/release-gate.sh` as the one-command local release gate for formatting, tests, demo, coverage, packaging, and release smoke.
382
+ - Android shim installer can now copy the instrumentation source directly into an app module and idempotently patch AndroidX test dependencies in Gradle.
383
+ - Android shim installer now idempotently patches Gradle `testInstrumentationRunner` when `--gradle-file` is provided and no runner is already configured.
384
+ - Android shim installer now reuses an existing Gradle `testInstrumentationRunner` for the generated shim command when `--runner` is omitted.
385
+ - Troubleshooting guide for doctor output, scenario validation, shims, trace inspection, and release-gate failures.
386
+ - CI and tagged-release workflows now run the same `scripts/release-gate.sh` local acceptance gate.
387
+ - `zmr doctor` now includes remediation hints for missing or warning checks, including machine-readable `hint` fields in JSON output.
388
+ - Added `schemas/doctor-output.schema.json` for machine-readable setup diagnostics.
389
+ - The no-device demo now shows `zmr doctor --json` remediation hints for missing shim setup.
390
+ - `zmr doctor --config` now validates configured Android and iOS smoke scenario files and reports remediation hints for missing or malformed files.
391
+ - `zmr doctor --json --config` now reports malformed config files as structured `config` checks instead of raw CLI errors.
392
+ - Config parsing now rejects non-boolean values for boolean fields instead of silently falling back to defaults.
393
+ - Config parsing now rejects unknown fields so app-local config typos do not silently fall back to defaults.
394
+ - Config parsing now rejects empty strings for schema-required path, id, redaction list, and script command values.
395
+ - `zmr doctor --json --config` now includes stable `errorCode` and `fieldPath` values for actionable app-local config errors.
396
+ - `zmr doctor` now warns, with stable setup error codes, when ADB sees zero devices, `xcrun` sees zero booted iOS simulators, `devicectl` sees zero paired physical iOS devices, or physical iOS devices are listed but disconnected/unavailable.
397
+ - Physical iOS device discovery now exposes the commandable CoreDevice
398
+ identifier from `devicectl` as the `serial` value agents pass back to
399
+ `--device`, with the hardware UDID retained only as a parser fallback.
400
+ - `scripts/run-ios-pilot.sh --ios-device-type physical` now rejects listed but
401
+ disconnected/unavailable physical device identifiers before install with
402
+ `setup.ios.physical_device_not_ready` and prints the matched device state.
403
+ - `zmr doctor --json` now includes stable setup `errorCode` values for missing tools, failed tool commands, and missing shim commands.
404
+ - `zmr doctor --strict` now exits non-zero when any diagnostic check is warning or missing, so CI and setup scripts can fail before device orchestration.
405
+ - `zmr init --app` now scaffolds an app-local `.zmr/config.json`, Android smoke scenario, iOS smoke scenario, and `traces/` gitignore entry without requiring npm.
406
+ - `zmr init --json` now emits machine-readable created files and next-step commands for app and scenario bootstraps.
407
+ - Added `schemas/init-output.schema.json` for the machine-readable `zmr init --json` contract.
408
+ - `zmr import flow-yaml` now converts a supported subset of mobile-flow YAML commands into native `.zmr/*.json` scenarios.
409
+ - Added `schemas/import-output.schema.json` for the machine-readable `zmr import --json` contract.
410
+ - The no-device demo now shows config-driven `zmr doctor --json` smoke scenario diagnostics for missing files and malformed JSON.
411
+ - `zmr devices --json` now emits machine-readable Android device, iOS
412
+ simulator, and physical iOS discovery output for setup scripts.
413
+ - `zmr devices --json` and JSON-RPC `device.list` now include a portable
414
+ `ready` boolean so agents can avoid disconnected physical devices without
415
+ duplicating platform state rules.
416
+ - `zmr doctor --json` now includes a state breakdown for listed-but-not-ready
417
+ physical iOS devices, such as `disconnected=1, unavailable=1`.
418
+ - Added `schemas/devices-output.schema.json` for the machine-readable `zmr devices --json` contract.
419
+ - `zmr version --json` now emits machine-readable runner and protocol compatibility metadata for installers and generated clients.
420
+ - Added `schemas/version-output.schema.json` for the machine-readable `zmr version --json` contract.
421
+ - `runner.capabilities` now reports Android, iOS simulator, and physical iOS
422
+ support as structured `platformSupport` metadata, with `iosPreview: false`.
423
+ - Added `schemas/capabilities-output.schema.json` for the machine-readable
424
+ `runner.capabilities` JSON-RPC result.
425
+ - `zmr explain --json` now emits machine-readable failure triage for agents and CI.
426
+ - Added `schemas/explain-output.schema.json` for the machine-readable `zmr explain --json` contract.
427
+ - `zmr schemas --json` now emits a machine-readable index of packaged public schema contracts.
428
+ - Added `schemas/schemas-output.schema.json` for the machine-readable `zmr schemas --json` contract.
429
+ - `zmr run --json` now emits a machine-readable terminal run summary while preserving failed scenario exit codes.
430
+ - Added `schemas/run-output.schema.json` for the machine-readable `zmr run --json` contract.
431
+ - Partial iOS visual captures now surface `partialFailure` in `zmr run --json`
432
+ and semantic-extraction diagnostics in `zmr explain --json`, separating
433
+ captured screenshot artifacts from failed accessibility/XCTest extraction.
434
+ - Added `zmr-device-matrix` / `scripts/device-matrix.sh` for local Android/iOS
435
+ multi-device smoke gates with `matrix.jsonl`, `summary.json`, and pass-rate
436
+ thresholds.
437
+ - `zmr-device-matrix` rows now support `iosDeviceType: "physical"` so matrix
438
+ runs can exercise physical iOS devices through the same `zmr run` flag used
439
+ by pilot gates.
440
+ - Added `zmr-compare-benchmarks` / `scripts/compare-benchmarks.py` for generic
441
+ candidate-vs-baseline benchmark reports without naming app projects or
442
+ third-party tools in public fixtures.
443
+ - Added `zmr-demo-ios` and `zmr-create-ios-demo-app` flows for a generic
444
+ simulator app with the XCTest shim installed, selector-grade smoke scenario,
445
+ and redacted trace output.
446
+ - Added `zmr-create-android-demo-app` for a generic native Android APK and
447
+ `.zmr` smoke scenario built with Android SDK command-line tools.
448
+ - Added `zmr-demo-android` for a one-command public Android demo that creates,
449
+ installs, runs, benchmarks, and traces the generated app on an emulator or
450
+ device.
451
+ - `zmr validate --json` now reports missing step selectors as `selector.invalid` with `fieldPath: "$.steps[].selector"` instead of falling back to `internal.error`.
452
+ - `zmr validate --json` now reports unknown scenario action typos as `scenario.invalid` with `fieldPath: "$.steps[].action"` and source location diagnostics.
453
+ - `zmr validate --json` now reports invalid `scrollUntilVisible.direction` values as `scenario.invalid` with `fieldPath: "$.steps[].direction"`.
454
+ - `zmr validate --json` now reports missing `openLink.url` values as `scenario.invalid` with `fieldPath: "$.steps[].url"`.
455
+ - `zmr validate --json` now reports missing `typeText.text` values as `scenario.invalid` with `fieldPath: "$.steps[].text"`.
456
+ - `zmr validate --json` now reports missing `swipe.x1`, `swipe.y1`, `swipe.x2`, and `swipe.y2` values as `scenario.invalid` with field-specific `fieldPath` values.
457
+
458
+ ### Changed
459
+
460
+ - README now links to install, demo, schema, and roadmap materials.
461
+ - Protocol documentation now includes concrete request/response examples and error shapes.
462
+ - Protocol versioning now defines the pre-`v1.0.0` compatibility contract and breaking-change policy.
463
+ - Android `openLink` now avoids blocking `am start -W`, retries when Android leaves the launcher foregrounded, and lets selector waits absorb transient observation command timeouts.
464
+ - iOS simulators are supported for lifecycle, snapshots, logs, deep links,
465
+ clear-state-by-uninstall, and selector-driven XCTest shim interaction.
466
+ - iOS XCTest shim commands now retry once when Xcode/CoreSimulator reports a
467
+ transient server bootstrap failure, reducing fresh-simulator flake while
468
+ preserving immediate failures for real command and assertion errors.
469
+ - Physical iOS devices are supported for local lifecycle and selector-grade
470
+ XCTest shim interaction. Screenshot artifacts use the XCTest shim; log
471
+ capture remains simulator-first.
472
+ - npm package contents now exclude internal test sources, caches, traces, and
473
+ build outputs while keeping runtime source, prebuilds, docs, examples, shims,
474
+ schemas, viewer assets, release scripts, and language clients available.
475
+ - Shipped TypeScript and Rust client metadata now matches the runner
476
+ prerelease, with package tests guarding future drift.
477
+
478
+ ### Known Limitations
479
+
480
+ - Physical iOS log capture is not complete yet.
481
+ - Broad cloud-device-farm certification is not included in this dev-preview
482
+ release.
483
+ - Real app performance summaries should come from equivalent app-local
484
+ candidate and baseline `zmr-compare-benchmarks` reports, not from generic
485
+ public fixtures.
486
+
487
+ ## 0.1.0-dev.1
488
+
489
+ Initial local dev preview:
490
+
491
+ - Zig CLI and JSON-RPC runner.
492
+ - Android ADB/UI Automator adapter.
493
+ - iOS simulator lifecycle, snapshots, logs, deep links, and selector-driven
494
+ XCTest shim preview.
495
+ - Scenario runner with waits, assertions, selectors, retries, and trace writing.
496
+ - Fake-device test harness and no-emulator demo.
497
+ - Release archive script and CI workflows.
@@ -0,0 +1,42 @@
1
+ # Contributing
2
+
3
+ ZMR is a Zig-based mobile test runner for external agents and local test files.
4
+ Keep changes small, typed, traceable, and covered by tests.
5
+
6
+ ## Local Checks
7
+
8
+ Run the focused checks for your change first, then run the release gate before a
9
+ PR:
10
+
11
+ ```bash
12
+ zig fmt --check build.zig src
13
+ bash -n scripts/*.sh tests/*.sh
14
+ bash tests/benchmark-results-test.sh
15
+ bash tests/android-emulator-script-test.sh
16
+ bash tests/android-pilot-script-test.sh
17
+ bash tests/ios-pilot-script-test.sh
18
+ bash tests/release-metadata-test.sh
19
+ bash tests/homebrew-formula-test.sh
20
+ node --test tests/viewer-parser.test.mjs tests/npm-package.test.mjs
21
+ bash tests/public-safety-test.sh
22
+ zig test src/main.zig -target aarch64-macos.15.0
23
+ ./scripts/coverage.sh
24
+ ./scripts/build-release.sh
25
+ ./scripts/release-smoke.sh dist/*.tar.gz
26
+ npm pack --dry-run
27
+ ```
28
+
29
+ ## Test Expectations
30
+
31
+ - Keep Zig coverage at or above 90%.
32
+ - Add fake-device or fake-shim tests before emulator/simulator-only tests.
33
+ - Public examples must use generic app ids and fake data.
34
+ - Do not commit raw traces, private app identifiers, tokens, or screenshots.
35
+
36
+ ## Design Expectations
37
+
38
+ - Keep the public interface in scenario files, JSON-RPC, and documented CLI
39
+ flags.
40
+ - Keep platform shims behind adapter boundaries.
41
+ - Preserve ADB/simctl fallback behavior until native shims are proven stable.
42
+ - Prefer deterministic trace evidence over terminal-only diagnostics.
package/FEATURES.md ADDED
@@ -0,0 +1,111 @@
1
+ # Features
2
+
3
+ Zeno Mobile Runner is a local, agent-native mobile test runner for Android,
4
+ iOS simulators, and physical iOS devices. It is designed for external agents and normal test files: ZMR
5
+ controls devices, exposes typed observations, executes actions, waits for UI
6
+ state, and writes deterministic traces. It does not embed an LLM.
7
+
8
+ ## Platform Support
9
+
10
+ - Android emulators and connected devices through ADB, UI Automator, and an
11
+ optional app-local instrumentation shim.
12
+ - Android emulator lifecycle helpers for boot, wait-ready, reset, snapshot
13
+ restore, optional AVD creation, and optional screen recording.
14
+ - iOS simulators through `xcrun simctl` for lifecycle, install, launch, deep
15
+ links, screenshots, logs, clear-state-by-uninstall, and device discovery.
16
+ - Physical iOS devices through `xcrun devicectl` for discovery, install,
17
+ launch, deep-link launch, clear-state-by-uninstall, and best-effort stop.
18
+ - iOS selector actions through an app-local XCTest/XCUIAutomation shim on
19
+ simulators and physical devices.
20
+
21
+ ## App Integration
22
+
23
+ - npm-first installation with `zeno-mobile-runner` as a dev dependency.
24
+ - `npx zmr-wizard` scaffolds `.zmr/config.json`, Android and iOS smoke
25
+ scenarios, optional app package scripts, and `traces/` gitignore rules.
26
+ - `zmr init --app` provides the same app-local bootstrap for source and archive
27
+ installs.
28
+ - `.zmr/config.json` is schema validated, auto-discovered from app checkouts,
29
+ and overridden by explicit CLI flags.
30
+ - Android and iOS shim installers generate app-local commands and source files
31
+ without requiring ZMR state outside `.zmr/`.
32
+
33
+ ## Agent Interface
34
+
35
+ - JSON-RPC v1 over newline-delimited stdio or localhost TCP.
36
+ - MCP stdio server with mobile-native tools for AI agents, including semantic
37
+ snapshots, selector actions, waits, trace polling, and trace export.
38
+ - `runner.capabilities`, `device.list`, `session.create`,
39
+ `observe.snapshot`, `observe.semanticSnapshot`, UI actions, waits,
40
+ assertions, live trace events, and redacted trace export.
41
+ - TypeScript, Python, Go, Rust, Swift, and Kotlin reference clients.
42
+ - Machine-readable CLI output for `zmr version --json`, `zmr schemas --json`,
43
+ `zmr doctor --json`, `zmr devices --json`, `zmr validate --json`,
44
+ `zmr run --json`, and `zmr explain --json`.
45
+ - Public JSON Schemas for scenarios, snapshots, semantic snapshots, action
46
+ results, trace events, protocol messages, setup diagnostics, and release
47
+ manifests.
48
+
49
+ ## Scenario Execution
50
+
51
+ - JSON scenarios with launch, stop, clear state, open link, tap, type, erase
52
+ text, hide keyboard, swipe, back/home-equivalent navigation, waits,
53
+ assertions, snapshots, optional steps, conditionals, repeats, sleeps, and
54
+ scroll-until-visible.
55
+ - Selector matching for text, text contains, content description, resource id,
56
+ class name, role/class, enabled/visible/selected state, and bounds-aware
57
+ target validation.
58
+ - Wait and retry behavior around transient observation failures.
59
+ - Import helper for a documented subset of common mobile-flow YAML commands
60
+ into native `.zmr/*.json` scenarios.
61
+
62
+ ## Traces And Diagnostics
63
+
64
+ - Deterministic trace directories with `trace.json`, `events.jsonl`,
65
+ snapshots, screenshots, UI hierarchy artifacts, logs, timings, action inputs,
66
+ assertion results, and optional Android screen recordings.
67
+ - Static trace viewer with timeline, screenshot and UI tree inspection,
68
+ selected node details, payloads, artifact links, and snapshot replay
69
+ controls.
70
+ - `zmr explain` summarizes failed traces for humans and agents.
71
+ - Redacted `.zmrtrace` export can replace or omit screenshots, omit screen
72
+ recordings, and redact common secrets plus app-configured denylist fields.
73
+
74
+ ## Reliability And Benchmarks
75
+
76
+ - `zmr-benchmark` repeats ZMR scenarios with pass-rate, failure-count, and p95
77
+ duration gates.
78
+ - `zmr-benchmark-command` records normalized rows for app-local baseline
79
+ commands without hardcoding another tool.
80
+ - `zmr-compare-benchmarks` compares candidate and baseline rows into generic
81
+ reports.
82
+ - `zmr-device-matrix` runs local Android/iOS smoke gates across configured
83
+ devices.
84
+ - `zmr-pilot-gate` coordinates Android and iOS app-local pre-release pilot
85
+ checks.
86
+
87
+ ## Shipping Surface
88
+
89
+ - Release archive builder with checksums, SPDX SBOM, third-party notices,
90
+ generated Homebrew formula, and `RELEASE_MANIFEST.json`.
91
+ - npm package tarball generation with bundled prebuilt binaries.
92
+ - `zmr-release-readiness` checks repeated app/device evidence for teams that
93
+ want a machine-readable readiness summary.
94
+ - Tagged release workflow with artifact attestation and optional npm
95
+ provenance publishing.
96
+ - Security, contribution, trace privacy, troubleshooting, protocol versioning,
97
+ app integration, benchmarking, and npm packaging docs.
98
+ - Reusable agent skill under `skills/zmr-mobile-testing/`.
99
+
100
+ ## Current Limitations
101
+
102
+ - Current release status is `0.1.2`, a public developer preview rather than
103
+ a production-stable `1.0.0`.
104
+ - Physical iOS log capture is still simulator-first. Physical iOS screenshots
105
+ are available when the XCTest/XCUIAutomation shim is configured.
106
+ - Broad cloud device farm certification is out of scope for this preview.
107
+ - Public benchmark fixtures are generic. Performance claims for a real app
108
+ should come from equivalent app-local candidate and baseline runs.
109
+ - Screenshot and video redaction is conservative: redacted exports can replace
110
+ screenshots with placeholders or omit visual artifacts, but they do not mask
111
+ pixels inside original raw captures.