agent-device 0.21.0 → 0.21.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 (328) hide show
  1. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.0.apk → agent-device-android-ime-helper-0.21.2.apk} +0 -0
  2. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.2.apk.sha256 +1 -0
  3. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.0.manifest.json → agent-device-android-ime-helper-0.21.2.manifest.json} +4 -4
  4. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.2.apk +0 -0
  5. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.2.apk.sha256 +1 -0
  6. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.0.manifest.json → agent-device-android-snapshot-helper-0.21.2.manifest.json} +6 -6
  7. package/apple/snapshot-bridge/README.md +58 -1
  8. package/apple/snapshot-bridge/SnapshotBridge.m +6 -0
  9. package/apple/snapshot-bridge/SnapshotBridgeCapture.h +25 -0
  10. package/apple/snapshot-bridge/SnapshotBridgeCapture.m +138 -0
  11. package/apple/snapshot-bridge/SnapshotBridgeRuntime.h +1 -0
  12. package/apple/snapshot-bridge/SnapshotBridgeRuntime.m +32 -3
  13. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.h +12 -0
  14. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.m +20 -0
  15. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerScrollViewportPolicy.swift +413 -0
  16. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSelectorMatchPolicy.swift +15 -15
  17. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSystemSurfaceHostPolicy.swift +72 -0
  18. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTapPointPolicy.swift +63 -14
  19. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +668 -82
  20. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +48 -4
  21. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+BlockingSystemModalResolution.swift +39 -4
  22. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +1078 -211
  23. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +290 -0
  24. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Environment.swift +1 -1
  25. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Exceptions.swift +10 -10
  26. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +250 -74
  27. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift +101 -42
  28. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +13 -13
  29. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +55 -43
  30. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +71 -4
  31. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXPresentation.swift +144 -7
  32. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScreenRecorder.swift +13 -1
  33. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollGesture.swift +216 -17
  34. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +206 -22
  35. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +289 -42
  36. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotBackendCapabilities.swift +92 -22
  37. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +617 -122
  38. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTiming.swift +79 -4
  39. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +71 -71
  40. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +92 -6
  41. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +67 -67
  42. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +4 -4
  43. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +17 -17
  44. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +30 -30
  45. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryReadiness.swift +31 -31
  46. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputCandidatePolicy.swift +28 -0
  47. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputProbe.swift +101 -0
  48. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +19 -19
  49. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +55 -17
  50. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +26 -5
  51. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +126 -75
  52. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/RecordingExportSupport.swift +8 -12
  53. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +9 -9
  54. package/dist/src/absence-observation-errors.js +1 -0
  55. package/dist/src/adapter.js +1 -1
  56. package/dist/src/adb-executor.js +1 -1
  57. package/dist/src/adb-failure.js +1 -1
  58. package/dist/src/agent-browser-lifecycle.js +1 -1
  59. package/dist/src/agent-browser-process-record.js +1 -1
  60. package/dist/src/agent-browser-provider.js +1 -1
  61. package/dist/src/agent-browser-tool.js +1 -1
  62. package/dist/src/agent-device-client.js +2 -2
  63. package/dist/src/ai-sdk.d.ts +1 -1
  64. package/dist/src/ai-sdk.js +1 -1
  65. package/dist/src/alert-runtime.js +1 -1
  66. package/dist/src/android-input-ownership.js +1 -1
  67. package/dist/src/app-catalog.js +1 -1
  68. package/dist/src/app-deployment-resolution.js +1 -1
  69. package/dist/src/app-helpers.js +1 -1
  70. package/dist/src/app-inventory-contract.js +1 -1
  71. package/dist/src/app-inventory.js +1 -1
  72. package/dist/src/app-launch.js +2 -2
  73. package/dist/src/app-lifecycle.js +3 -3
  74. package/dist/src/app-lifecycle2.js +1 -1
  75. package/dist/src/app-log-files.js +1 -1
  76. package/dist/src/app-log-runtime2.js +3 -3
  77. package/dist/src/app-resolution.js +1 -1
  78. package/dist/src/apple-runner-platform.js +1 -0
  79. package/dist/src/application-lifecycle-interaction.js +1 -1
  80. package/dist/src/archive.js +1 -1
  81. package/dist/src/artifact-download.js +1 -1
  82. package/dist/src/auth-session.js +1 -1
  83. package/dist/src/auth.js +1 -1
  84. package/dist/src/back-mode.js +1 -1
  85. package/dist/src/backend-snapshot-options.js +1 -1
  86. package/dist/src/boot-diagnostics.js +1 -1
  87. package/dist/src/browser-launch.js +1 -0
  88. package/dist/src/capture.js +1 -1
  89. package/dist/src/catalog.js +1 -1
  90. package/dist/src/cli-config.js +1 -1
  91. package/dist/src/cli-help.js +30 -26
  92. package/dist/src/cli.js +4 -4
  93. package/dist/src/click-button.js +1 -1
  94. package/dist/src/client-metro-companion.js +1 -1
  95. package/dist/src/client-metro.js +1 -1
  96. package/dist/src/client-types.d.ts +28 -13
  97. package/dist/src/code-signature-cache.js +1 -1
  98. package/dist/src/code-signature.js +1 -1
  99. package/dist/src/command-metadata.js +1 -1
  100. package/dist/src/command-schema.js +3 -3
  101. package/dist/src/command-tools.js +2 -2
  102. package/dist/src/command.js +1 -1
  103. package/dist/src/config.js +1 -1
  104. package/dist/src/connection-runtime.js +1 -1
  105. package/dist/src/connection.js +3 -3
  106. package/dist/src/contracts.d.ts +1 -1
  107. package/dist/src/contracts.js +1 -1
  108. package/dist/src/daemon-client-lifecycle.js +1 -1
  109. package/dist/src/daemon-process.js +1 -1
  110. package/dist/src/daemon-shutdown-report.js +1 -1
  111. package/dist/src/daemon.js +1 -1
  112. package/dist/src/debug-symbols-facade.js +1 -1
  113. package/dist/src/device-boot.js +1 -0
  114. package/dist/src/device-claim-inspection.js +1 -1
  115. package/dist/src/device-claim-rule.js +1 -1
  116. package/dist/src/device-input-state.d.ts +1 -1
  117. package/dist/src/device-inventory-context.js +1 -1
  118. package/dist/src/device-rotation.js +1 -1
  119. package/dist/src/device-selection-resolver.js +1 -1
  120. package/dist/src/device-session.js +1 -1
  121. package/dist/src/device2.js +1 -1
  122. package/dist/src/diagnostics.js +1 -1
  123. package/dist/src/dispatch-resolve.js +1 -1
  124. package/dist/src/doctor2.js +1 -1
  125. package/dist/src/durable-resource.js +1 -1
  126. package/dist/src/engine-eval-script.js +1 -0
  127. package/dist/src/error.js +1 -1
  128. package/dist/src/exec.js +1 -1
  129. package/dist/src/file.js +1 -1
  130. package/dist/src/find.js +1 -1
  131. package/dist/src/finders.js +1 -1
  132. package/dist/src/format.js +1 -2
  133. package/dist/src/generic-settle.js +1 -1
  134. package/dist/src/gesture-plan.js +1 -1
  135. package/dist/src/gesture-runtime.js +1 -1
  136. package/dist/src/harmonyos.js +1 -1
  137. package/dist/src/hdc.js +1 -1
  138. package/dist/src/helper.js +2 -2
  139. package/dist/src/human-control-contract.js +1 -1
  140. package/dist/src/human-control.js +1 -1
  141. package/dist/src/index.d.ts +1 -1
  142. package/dist/src/index.js +1 -1
  143. package/dist/src/input-actions.js +1 -1
  144. package/dist/src/input-actions2.js +2 -2
  145. package/dist/src/install-artifact-facade.js +1 -1
  146. package/dist/src/install-source-network-transport.js +1 -1
  147. package/dist/src/install-source2.js +1 -1
  148. package/dist/src/interaction-positionals.js +1 -1
  149. package/dist/src/interaction-ref-policy.js +1 -1
  150. package/dist/src/interaction.js +1 -1
  151. package/dist/src/interaction2.js +1 -1
  152. package/dist/src/interactor.js +5 -5
  153. package/dist/src/interactor2.js +1 -1
  154. package/dist/src/interactors.js +1 -1
  155. package/dist/src/internal/bin.js +1 -1
  156. package/dist/src/internal/daemon.js +2 -2
  157. package/dist/src/internal/png-worker.d.ts +3 -0
  158. package/dist/src/internal/png-worker.js +1 -1
  159. package/dist/src/internal/run-script-http-child.js +1 -1
  160. package/dist/src/inventory.js +2 -2
  161. package/dist/src/inventory2.js +1 -1
  162. package/dist/src/inventory3.js +1 -1
  163. package/dist/src/inventory5.js +1 -1
  164. package/dist/src/ios-snapshot-acquisition.js +1 -1
  165. package/dist/src/ios-snapshot-planning.js +1 -1
  166. package/dist/src/ios-snapshot-runtime.js +1 -1
  167. package/dist/src/ios-system-surface.js +1 -0
  168. package/dist/src/lease-scope.js +1 -1
  169. package/dist/src/lease.js +1 -1
  170. package/dist/src/limrun-runtime-dependencies.js +1 -1
  171. package/dist/src/limrun.d.ts +1 -1
  172. package/dist/src/linux.js +1 -1
  173. package/dist/src/local-interactor-operation-set.js +1 -1
  174. package/dist/src/location-coordinates.js +1 -1
  175. package/dist/src/managed-device-scope.js +1 -1
  176. package/dist/src/mechanics.js +16 -16
  177. package/dist/src/mobile-snapshot-semantics.js +1 -1
  178. package/dist/src/mp4-atoms.js +1 -0
  179. package/dist/src/multitouch-support.js +1 -1
  180. package/dist/src/observation.js +1 -1
  181. package/dist/src/open-target-resolution.js +1 -0
  182. package/dist/src/owner-identity.js +3 -3
  183. package/dist/src/parameterized-recorded-fill.js +1 -1
  184. package/dist/src/perf-facade.js +2 -2
  185. package/dist/src/perf-process-identity.js +1 -0
  186. package/dist/src/perf-runtime-operation-builder.js +1 -1
  187. package/dist/src/perf-runtime-plan.js +1 -1
  188. package/dist/src/perf.js +1 -1
  189. package/dist/src/physical-device-control.js +1 -1
  190. package/dist/src/platform-request-scope.js +1 -1
  191. package/dist/src/platform-runtime-android-adb-host.js +1 -1
  192. package/dist/src/platform-runtime-app-log-process.js +1 -1
  193. package/dist/src/platform-runtime-host.js +1 -1
  194. package/dist/src/platform-runtime-managed-owner.js +1 -1
  195. package/dist/src/platform-runtime-open-target.js +1 -1
  196. package/dist/src/platform-runtime-operation-host.js +2 -2
  197. package/dist/src/platform-runtime-runtime-hints.js +2 -2
  198. package/dist/src/platform-runtime-screen-recording-android-host.js +1 -1
  199. package/dist/src/platform-runtime-screen-recording-apple-runner-host.js +1 -1
  200. package/dist/src/platform-runtime-screen-recording-apple-runner-transport.js +1 -1
  201. package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
  202. package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
  203. package/dist/src/platform-runtime-screen-recording-process-host.js +1 -1
  204. package/dist/src/platform-runtime-unavailable.js +1 -1
  205. package/dist/src/platform-runtime.js +1 -1
  206. package/dist/src/platform-runtime2.js +1 -1
  207. package/dist/src/png-crop-bytes.js +1 -0
  208. package/dist/src/png-worker-contract.js +1 -1
  209. package/dist/src/png.js +1 -0
  210. package/dist/src/prepare-kind.js +1 -1
  211. package/dist/src/process.js +1 -1
  212. package/dist/src/provider-device-runtime.js +1 -1
  213. package/dist/src/provider-session-ownership.js +1 -1
  214. package/dist/src/provider-webdriver.js +1 -1
  215. package/dist/src/proxy.js +1 -1
  216. package/dist/src/quality-warnings.js +1 -0
  217. package/dist/src/react-native.js +1 -1
  218. package/dist/src/record-runtime.js +1 -1
  219. package/dist/src/rect-center.js +1 -1
  220. package/dist/src/register-builtins.js +1 -1
  221. package/dist/src/registry.js +36 -36
  222. package/dist/src/remote-config2.js +1 -1
  223. package/dist/src/replay-divergence.js +1 -1
  224. package/dist/src/replay.js +2 -2
  225. package/dist/src/reporting.js +9 -8
  226. package/dist/src/request-admission.js +1 -1
  227. package/dist/src/request-cancel.js +1 -1
  228. package/dist/src/request-cancellation.js +1 -1
  229. package/dist/src/request-runtime-binding.js +1 -1
  230. package/dist/src/retry.js +1 -1
  231. package/dist/src/runner-cache-metadata.js +2 -2
  232. package/dist/src/runner-client.js +1 -1
  233. package/dist/src/runner-disposal.js +1 -1
  234. package/dist/src/runner-operations-facade.js +1 -1
  235. package/dist/src/runner-presentation.js +1 -1
  236. package/dist/src/runner.js +1 -1
  237. package/dist/src/runtime-transport-hints.js +1 -1
  238. package/dist/src/runtime.js +3 -3
  239. package/dist/src/runtime10.js +1 -0
  240. package/dist/src/runtime2.js +4 -4
  241. package/dist/src/runtime3.js +1 -1
  242. package/dist/src/runtime4.js +5 -4
  243. package/dist/src/runtime5.js +1 -1
  244. package/dist/src/runtime6.js +1 -1
  245. package/dist/src/runtime7.js +1 -1
  246. package/dist/src/runtime8.js +1 -1
  247. package/dist/src/runtime9.js +1 -1
  248. package/dist/src/screen-recording-live-handle.js +1 -1
  249. package/dist/src/screen-recording-options.js +1 -1
  250. package/dist/src/screen-recording-resource-recovery.js +1 -1
  251. package/dist/src/screenshot-density.js +1 -1
  252. package/dist/src/screenshot-runtime.js +1 -1
  253. package/dist/src/screenshot.js +1 -1
  254. package/dist/src/screenshot3.js +3 -3
  255. package/dist/src/script.js +1 -1
  256. package/dist/src/scroll-command.js +1 -1
  257. package/dist/src/scroll-gesture.js +1 -1
  258. package/dist/src/sdk-batch-runner.js +2 -2
  259. package/dist/src/sdk-batch.js +2 -2
  260. package/dist/src/sdk-contracts.d.ts +69 -26
  261. package/dist/src/sdk-contracts.js +2 -2
  262. package/dist/src/sdk-device.js +1 -1
  263. package/dist/src/sdk-finders.d.ts +1 -1
  264. package/dist/src/sdk-finders.js +1 -1
  265. package/dist/src/sdk-io.js +1 -1
  266. package/dist/src/sdk-remote-config.d.ts +1 -1
  267. package/dist/src/sdk-remote-config.js +1 -1
  268. package/dist/src/sdk-selectors.d.ts +80 -16
  269. package/dist/src/sdk-selectors.js +1 -1
  270. package/dist/src/selection.js +0 -0
  271. package/dist/src/selector-runtime.js +1 -1
  272. package/dist/src/selectors.js +1 -1
  273. package/dist/src/semantic-index.js +1 -1
  274. package/dist/src/server.js +3 -3
  275. package/dist/src/session-allocation.js +1 -1
  276. package/dist/src/session-observation.js +1 -0
  277. package/dist/src/session-routing.js +1 -1
  278. package/dist/src/session-runtime-admission.js +1 -1
  279. package/dist/src/session-snapshot.js +1 -1
  280. package/dist/src/session-store.js +3 -3
  281. package/dist/src/session-target-evidence.js +1 -1
  282. package/dist/src/session2.js +5 -5
  283. package/dist/src/settings.js +1 -1
  284. package/dist/src/simulator-boot.js +3 -0
  285. package/dist/src/simulator.js +1 -1
  286. package/dist/src/snapshot-quality-backend-capabilities.js +1 -1
  287. package/dist/src/snapshot-runtime-binding.js +1 -1
  288. package/dist/src/snapshot-runtime.js +1 -1
  289. package/dist/src/snapshot-state.js +1 -1
  290. package/dist/src/snapshot2.js +1 -1
  291. package/dist/src/snapshot3.js +1 -1
  292. package/dist/src/snapshot4.js +1 -1
  293. package/dist/src/src.js +1 -1
  294. package/dist/src/src7.js +2 -2
  295. package/dist/src/src8.js +2 -2
  296. package/dist/src/string-enum.js +1 -1
  297. package/dist/src/takeover.js +1 -1
  298. package/dist/src/telemetry.js +1 -1
  299. package/dist/src/tool-provider.js +2 -2
  300. package/dist/src/tool-provider2.js +1 -1
  301. package/dist/src/tool-provider3.js +1 -1
  302. package/dist/src/toolchain-probe.js +1 -1
  303. package/dist/src/touch-reference-frame.js +1 -0
  304. package/dist/src/touch-runtime.js +1 -1
  305. package/dist/src/transport.js +1 -1
  306. package/dist/src/tree.js +1 -1
  307. package/dist/src/tv-remote.js +1 -1
  308. package/dist/src/type-text-runtime.js +1 -1
  309. package/dist/src/update-check.js +1 -1
  310. package/dist/src/vars.js +2 -0
  311. package/dist/src/verified-file.js +1 -1
  312. package/dist/src/version.js +1 -1
  313. package/dist/src/video.js +2 -2
  314. package/dist/src/viewport.js +1 -0
  315. package/dist/src/web.js +1 -1
  316. package/dist/src/web2.js +1 -1
  317. package/dist/src/webdriver-ios-snapshot.js +1 -1
  318. package/dist/src/webdriver-source.js +1 -1
  319. package/dist/src/window-state.js +1 -0
  320. package/package.json +4 -2
  321. package/server.json +2 -2
  322. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.0.apk.sha256 +0 -1
  323. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.0.apk +0 -0
  324. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.0.apk.sha256 +0 -1
  325. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-trim.swift +0 -93
  326. package/dist/src/platform-runtime-apple-resources.js +0 -1
  327. package/dist/src/runner-selector-query.js +0 -1
  328. package/dist/src/snapshot-quality-verdict.js +0 -1
@@ -65,14 +65,14 @@ extension RunnerTests {
65
65
  case failed(SnapshotCaptureFailure, phase: SnapshotCapturePhase)
66
66
  }
67
67
 
68
- /// The failure phase is part of the result, so penalty policy cannot infer it from duration
69
- /// or error text.
68
+
69
+
70
70
  let outcome: Outcome
71
71
  let timing: SnapshotCaptureTiming
72
72
  }
73
73
 
74
- /// The penalty breaker observes only acquisition facts. Presentation is a separate phase and
75
- /// cannot arm the breaker, even when it is slower than the acquisition that produced the tree.
74
+
75
+
76
76
  private static func snapshotXCTestPenaltyReason(
77
77
  kind: SnapshotBackendKind,
78
78
  attempt: SnapshotBackendAttempt,
@@ -108,3 +108,78 @@ extension RunnerTests {
108
108
  }
109
109
  }
110
110
 
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
@@ -1,36 +1,36 @@
1
1
  import XCTest
2
2
 
3
- // The synthesized text-entry commit wait, end to end: the deadline that bounds it, the two waits
4
- // that run it, the observation/pacing they poll through, and the value-free cadence line that path
5
- // is allowed to log. Split from RunnerTests+SynthesizedTextEntry.swift, which keeps the
6
- // private-XCTest synthesis boundary and the route policies; the pure outcome functions these wrap
7
- // stay there next to the rules they encode. Everything that touches the polled field value now
8
- // lives in this one file, which is the surface apple-runner-log-redaction.test.ts guards.
3
+
4
+
5
+
6
+
7
+
8
+
9
9
  extension RunnerTests {
10
- /// One commit wait's running deadline.
11
- ///
12
- /// A synthesized burst can be *throttled* rather than dropped: on a loaded simulator the
13
- /// characters keep landing, just slowly, and everything touching the input system slows with
14
- /// them (#1874). A flat wall-clock budget cannot tell that apart from a wedged pipeline, so it
15
- /// condemned both at the same instant — and the throttled case is a working command reported as
16
- /// `TEXT_INPUT_COMMIT_NOT_OBSERVED`, which is what turned an environment episode into a red
17
- /// lane on branches touching no iOS code.
18
- ///
19
- /// So time is granted against *progress* — the observed value's expected-prefix growing, the
20
- /// same length-only evidence `logCommitCadence` already emits — with an absolute `ceiling`, so a
21
- /// pipeline delivering one character per stall window cannot hold a command open forever. A
22
- /// pipeline making no progress at all still expires at exactly the `stallBudget` the flat
23
- /// deadline used, so nothing that fails today starts passing merely by waiting longer.
24
- ///
25
- /// Started by the poll loop from its own first `now()`, and held as a local `var` there. The
26
- /// wait's setup reads the field's placeholder first, an AX round-trip that takes seconds on
27
- /// exactly the loaded host this exists for; charging that to the deadline made the wait give up
28
- /// sooner than the flat budget it replaced.
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
29
  struct SynthesizedCommitDeadline {
30
30
  private let startedAt: Date
31
31
  private let stallBudget: TimeInterval
32
32
  private let ceiling: TimeInterval
33
- // Nothing has landed yet, and an observation of "still nothing" must not read as progress.
33
+
34
34
  private var bestPrefixLength = 0
35
35
  private var lastProgressAt: Date
36
36
 
@@ -41,10 +41,10 @@ extension RunnerTests {
41
41
  self.lastProgressAt = startedAt
42
42
  }
43
43
 
44
- /// Records one observation's expected-prefix length. Only forward movement counts: a shorter
45
- /// read — the app clearing the field mid-flight, or a value that could not be read at all,
46
- /// which measures as 0 — is not evidence the burst is still landing, so it neither buys time
47
- /// nor takes any back.
44
+
45
+
46
+
47
+
48
48
  mutating func record(expectedPrefixLength: Int, at now: Date) {
49
49
  guard expectedPrefixLength > bestPrefixLength else { return }
50
50
  bestPrefixLength = expectedPrefixLength
@@ -57,16 +57,16 @@ extension RunnerTests {
57
57
  }
58
58
  }
59
59
 
60
- /// Blocks until the synthesized bare-type text is observable in the target field, so `type`
61
- /// cannot report ok while trailing characters are still uncommitted on a slow simulator.
62
- ///
63
- /// Observation only. A stalled prefix cannot be told apart from a suffix still queued in the
64
- /// event stream, so re-synthesizing the difference risks committing it twice after the command
65
- /// already reported success (#1676 rejected exactly that repair). Reporting `.notObserved` is
66
- /// what the caller does instead: the partial value is the agent's to resolve, and a named
67
- /// failure beats a success that misdescribes the field. Text carrying a submit key is skipped
68
- /// outright: the app may clear or rewrite the field on submit, so `textBefore + typedText` is
69
- /// not the value to wait for.
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
70
  func awaitSynthesizedFirstResponderCommit(
71
71
  app: XCUIApplication,
72
72
  target: TextEntryTarget,
@@ -95,16 +95,16 @@ extension RunnerTests {
95
95
  return outcome
96
96
  }
97
97
 
98
- /// Blocks until the synthesized replacement text (`fill`) is observable in the target field, so
99
- /// `fill` cannot report ok while the select-all-and-retype it posted is still uncommitted — or
100
- /// silently wrong — on a slow or channel-penalized simulator (this route runs only when the
101
- /// XCTest channel is already penalized, and never resolves an `XCUIElement`, so it previously had
102
- /// no verification at all).
103
- ///
104
- /// Unlike the append route, the expected value is the final text itself — replacement mode
105
- /// clears the field first, so there is no `textBefore` prefix to account for — and unlike the
106
- /// append route, a settled mismatch is always reported rather than trusted: see
107
- /// `awaitSynthesizedReplacementCommitOutcome`'s doc comment.
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
108
  func awaitSynthesizedReplacementCommit(
109
109
  app: XCUIApplication,
110
110
  target: TextEntryTarget,
@@ -131,9 +131,9 @@ extension RunnerTests {
131
131
  return outcome
132
132
  }
133
133
 
134
- /// The emitted cadence line, as a pure function so its output is assertable. Only lengths and
135
- /// a timestamp are representable here; there is no String parameter, so observed field
136
- /// contents cannot reach runner.log through this boundary whatever they contain.
134
+
135
+
136
+
137
137
  static func commitCadenceLogLine(
138
138
  elapsedMs: Int,
139
139
  observedLen: Int,
@@ -142,9 +142,9 @@ extension RunnerTests {
142
142
  "[DEBUG-1874] poll t=\(elapsedMs)ms observedLen=\(observedLen) expectedPrefixLen=\(expectedPrefixLen)"
143
143
  }
144
144
 
145
- /// The typed boundary for commit-wait cadence evidence. The poll path must log through this
146
- /// function and never through a raw NSLog: every parameter is an Int, so the polled value's
147
- /// contents are unrepresentable at the call site.
145
+
146
+
147
+
148
148
  static func logCommitCadence(
149
149
  elapsedMs: Int,
150
150
  observedLen: Int,
@@ -160,16 +160,16 @@ extension RunnerTests {
160
160
  )
161
161
  }
162
162
 
163
- /// The placeholder/observe/pacing ingredients shared by the append route
164
- /// (`awaitSynthesizedFirstResponderCommit`) and the replacement route
165
- /// (`awaitSynthesizedReplacementCommit`). What must NOT be shared is which outcome function
166
- /// consumes them: see `awaitSynthesizedReplacementCommitOutcome`'s doc comment for why append
167
- /// mode's "trust a diverged value" rule is wrong for replacement mode. Each caller therefore
168
- /// calls its own named outcome function directly, with real argument labels — deliberately not
169
- /// a stored closure/function-value parameter here, which would erase those labels at the call
170
- /// site and make the observe closure unrecognizable to the static content-redaction check in
171
- /// `apple-runner-log-redaction.test.ts` (`extractObserveClosure` locates the labeled closure
172
- /// literal by its text; a closure passed as a plain function value carries no such label).
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
173
  private func synthesizedCommitPollingIngredients(
174
174
  app: XCUIApplication,
175
175
  target: TextEntryTarget,
@@ -188,9 +188,9 @@ extension RunnerTests {
188
188
  for: self.resolveTextEntryElement(app: app, target: target),
189
189
  treatingPlaceholderAsEmpty: true
190
190
  )
191
- // Cadence evidence stays value-free: the polled value is user content typed through
192
- // `type`/`fill` and must never reach runner.log. Lengths and the expected-prefix walk
193
- // are enough to distinguish throttling (prefix grows slowly) from a wedge (it freezes).
191
+
192
+
193
+
194
194
  Self.logCommitCadence(
195
195
  elapsedMs: Int(waitStartedAt.timeIntervalSinceNow * -1000),
196
196
  observedLen: observedText?.count ?? -1,
@@ -198,8 +198,8 @@ extension RunnerTests {
198
198
  )
199
199
  return observedText
200
200
  },
201
- // XCUI resolution shares the automation channel with the in-flight synthesized event.
202
- // Sparse reads let the target consume that event instead of continuously interrupting it.
201
+
202
+
203
203
  waitForNextObservation: { self.sleepFor(TextEntryTiming.synthesizedCommitPollInterval) }
204
204
  )
205
205
  }
@@ -1,10 +1,10 @@
1
1
  import XCTest
2
2
 
3
- // Runner-local policy for AX-free/private synthesized iOS gestures.
4
- //
5
- // This policy is intentionally separate from the TS interaction guarantee matrix:
6
- // ADR 0011 models element-targeting guarantees, while this module models command
7
- // paths that must keep scroll/drag/sequence usable when XCTest AX is unhealthy.
3
+
4
+
5
+
6
+
7
+
8
8
 
9
9
  enum RunnerAccessibilityHealth: String, Equatable {
10
10
  case unknown
@@ -89,8 +89,14 @@ func synthesizedGesturePolicy(_ kind: SynthesizedGesturePolicyKind) -> Synthesiz
89
89
  fallbackPolicy: .xctestCoordinateAllowed
90
90
  )
91
91
  case .scroll:
92
+
93
+
94
+
95
+
96
+
97
+
92
98
  return SynthesizedGesturePolicy(
93
- keyboardPolicy: .whenAccessibilityHealthy,
99
+ keyboardPolicy: .requiredWhenAvailable,
94
100
  fallbackPolicy: .privateSynthesisRequired
95
101
  )
96
102
  case .synthesizedDrag:
@@ -150,3 +156,83 @@ extension RunnerTests {
150
156
  }
151
157
  }
152
158
 
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
@@ -1,7 +1,7 @@
1
1
  import XCTest
2
2
 
3
- // AX-independent text synthesis: private-XCTest boundary, pacing plan, and route policy.
4
- // The verified XCUIElement path remains in TextEntry/TextTyping.
3
+
4
+
5
5
  extension RunnerTests {
6
6
  enum SynthesizedReplacementRouteOutcome {
7
7
  case notApplicable
@@ -127,12 +127,12 @@ extension RunnerTests {
127
127
  sleepFor(request.delaySeconds)
128
128
  }
129
129
  }
130
- // The private synthesize call returns at post time, not commit time (same as bare `type`,
131
- // see awaitSynthesizedFirstResponderCommit) — but this route never resolves an XCUIElement,
132
- // so without this wait it had no way to notice a dropped or still-in-flight character at all
133
- // and reported ok purely because the event posted. Wait here, on the same request.target
134
- // (element nil, refreshPoint set) that gated this route, so each poll re-resolves via the
135
- // refresh point rather than trusting a stale element handle.
130
+
131
+
132
+
133
+
134
+
135
+
136
136
  let commit = awaitSynthesizedReplacementCommit(
137
137
  app: request.app,
138
138
  target: request.target,
@@ -182,12 +182,12 @@ extension RunnerTests {
182
182
  case diverged
183
183
  }
184
184
 
185
- // The private synthesize call returns once the event record is posted, not once the target
186
- // app has committed the characters, so intermediate reads walk prefix-by-prefix toward the
187
- // expected value. Anything off that prefix path means the app transformed the input
188
- // (formatter, mid-text caret, autocomplete) and the runner must not second-guess it. An
189
- // unreadable value — secure field, or the element stopped resolving — ends the wait the
190
- // same way.
185
+
186
+
187
+
188
+
189
+
190
+
191
191
  static func synthesizedTextCommitProgress(
192
192
  observedText: String?,
193
193
  expectedText: String
@@ -201,9 +201,9 @@ extension RunnerTests {
201
201
  return expectedText.hasPrefix(observedText) ? .pending : .diverged
202
202
  }
203
203
 
204
- /// Length of the shared prefix of two strings. Feeds value-free commit-wait logging: the
205
- /// expected-prefix walk over time distinguishes throttled delivery (grows slowly) from a
206
- /// wedged pipeline (freezes) without ever logging the field's contents.
204
+
205
+
206
+
207
207
  static func commonPrefixLength(_ lhs: String, _ rhs: String) -> Int {
208
208
  var length = 0
209
209
  for (l, r) in zip(lhs, rhs) {
@@ -213,32 +213,32 @@ extension RunnerTests {
213
213
  return length
214
214
  }
215
215
 
216
- /// How the commit wait ended. Distinct from `SynthesizedTextCommitProgress`, which classifies a
217
- /// single observation: this is the whole wait's verdict, and it exists so the deadline can be
218
- /// told apart from success. The wait used to return `Void`, which made an expired deadline
219
- /// indistinguishable from a committed one — `type` then reported ok with a partial value in the
220
- /// field (#1874, #1844).
216
+
217
+
218
+
219
+
220
+
221
221
  enum SynthesizedTextCommitOutcome: Equatable {
222
- /// The wait's success case, but its meaning is route-specific: for append mode (bare `type`),
223
- /// the expected text committed OR the app transformed the input in a way the runner must not
224
- /// second-guess; for replacement mode (`fill`), it means only an exact match — see
225
- /// `awaitSynthesizedReplacementCommitOutcome`'s doc comment for why replacement mode has no
226
- /// "trust it" case.
222
+
223
+
224
+
225
+
226
+
227
227
  case settled
228
- /// There was nothing to wait for — no readable baseline, or the text carries a submit key.
228
+
229
229
  case unobservable
230
- /// The deadline expired with the expected text still not observed.
230
+
231
231
  case notObserved
232
232
  }
233
233
 
234
- /// The commit wait's decision, with observation, pacing and the clock injected so both deadline
235
- /// branches are exercisable without a simulator (the macOS host lane runs this; the member
236
- /// wrapper below binds the real XCUI reads).
237
- ///
238
- /// The deadline is a local `var`, started from this loop's own first `now()` and advanced from
239
- /// the same observation the progress check reads, so "did the burst move" and "is time up" are
240
- /// two statements in one loop. The budget defaults to the shipped one, so only a test that is
241
- /// asking about time has to name it.
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
242
  static func awaitSynthesizedCommitOutcome(
243
243
  expectedText: String,
244
244
  placeholder: String?,
@@ -248,24 +248,24 @@ extension RunnerTests {
248
248
  observe: () -> String?,
249
249
  waitForNextObservation: () -> Void
250
250
  ) -> SynthesizedTextCommitOutcome {
251
- // A placeholder-equal AX value cannot prove a commit: an input handler may clear even a
252
- // previously non-empty field after dispatch, making the empty field render the same value.
253
- // Refuse before polling because no later read can distinguish those states.
251
+
252
+
253
+
254
254
  if Self.textMatchesPlaceholder(expectedText, placeholder: placeholder) {
255
255
  return .notObserved
256
256
  }
257
257
  var deadline = SynthesizedCommitDeadline(startedAt: now(), stallBudget: stallBudget, ceiling: ceiling)
258
- // The deadline is checked AFTER an observation, never before one, so the last thing that
259
- // happens before condemning a commit is a read. Checking first would condemn a commit that
260
- // landed during the final poll sleep — the exact loaded-host timing this wait exists for.
258
+
259
+
260
+
261
261
  while true {
262
262
  let observedText = observe()
263
263
  switch synthesizedTextCommitProgress(observedText: observedText, expectedText: expectedText) {
264
264
  case .committed, .diverged:
265
265
  return .settled
266
266
  case .pending:
267
- // One clock sample, so the instant an observation is recorded at is the instant it is
268
- // judged against.
267
+
268
+
269
269
  let sampledAt = now()
270
270
  deadline.record(
271
271
  expectedPrefixLength: Self.commonPrefixLength(observedText ?? "", expectedText),
@@ -277,9 +277,9 @@ extension RunnerTests {
277
277
  }
278
278
  }
279
279
 
280
- /// The command-level consequence of a commit wait. `.unobservable` is not a failure: there was
281
- /// no baseline to compare against, which is the pre-existing contract for submit-key text and
282
- /// unreadable fields, not evidence that anything went wrong.
280
+
281
+
282
+
283
283
  static func textEntryFailure(
284
284
  forCommitOutcome outcome: SynthesizedTextCommitOutcome
285
285
  ) -> TextEntryFailure? {
@@ -291,22 +291,22 @@ extension RunnerTests {
291
291
  }
292
292
  }
293
293
 
294
- /// The replacement-mode counterpart of `awaitSynthesizedCommitOutcome`. It must NOT reuse that
295
- /// function's `synthesizedTextCommitProgress`: prefix-walk's `.diverged` case exists to trust an
296
- /// app that transforms bare-`type` input (formatter, autocomplete) rather than second-guess it —
297
- /// but that same rule silently accepts a dropped-character corruption too, because a value with a
298
- /// hole in the middle ("ada@example" -> "aexample") is neither a matching prefix NOR the full
299
- /// string, yet still gets classified `.diverged` -> `.settled` -> reported `ok: true`. This is not
300
- /// a hypothetical: it is the exact shape of the corruption this wait exists to catch (`fill`
301
- /// reporting success over "Avelace"/"aexample"-style drops), verified against both live examples
302
- /// before writing this comment.
303
- ///
304
- /// `.replacement` mode does not need prefix tolerance for legitimate transforms either:
305
- /// `isRepairableTextEntryMismatch` (RunnerTests+TextTyping.swift) already treats every mismatch in
306
- /// `.replacement` mode as repairable unconditionally, with no formatter/autocomplete carve-out —
307
- /// `fill` fully owns the field via select-all, so there is no legitimate reason for the settled
308
- /// value to be anything other than exactly what was requested. A settled non-match is therefore
309
- /// always the wait's failure case, never a `.settled` pass-through.
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
310
  static func awaitSynthesizedReplacementCommitOutcome(
311
311
  expectedText: String,
312
312
  placeholder: String?,
@@ -325,9 +325,9 @@ extension RunnerTests {
325
325
  if observedText == expectedText {
326
326
  return .settled
327
327
  }
328
- // Prefix growth cannot settle this wait — a value with a hole in the middle is still a
329
- // failure, see the doc comment above — but it is the same evidence that the burst is still
330
- // landing, so it buys the same time here as it does in append mode.
328
+
329
+
330
+
331
331
  let sampledAt = now()
332
332
  deadline.record(
333
333
  expectedPrefixLength: Self.commonPrefixLength(observedText ?? "", expectedText),
@@ -2,7 +2,7 @@ import XCTest
2
2
  import AgentDeviceSnapshotPresentation
3
3
 
4
4
  extension RunnerTests {
5
- // MARK: - Blocking System Modal Snapshot
5
+
6
6
 
7
7
  func blockingSystemAlertSnapshot(deadline: Date = .distantFuture) -> DataPayload? {
8
8
  #if os(macOS)
@@ -42,8 +42,8 @@ extension RunnerTests {
42
42
  nodes.append(actionNode)
43
43
  }
44
44
 
45
- // Action controls are the interaction contract. Informative text is useful context, but
46
- // must not make a usable modal miss the bounded system-modal probe deadline.
45
+
46
+
47
47
  let contentDeadline = deadline.addingTimeInterval(-0.5)
48
48
  for content in informativeElements(in: modal, deadline: contentDeadline) {
49
49
  guard Date() < contentDeadline,
@@ -86,7 +86,7 @@ extension RunnerTests {
86
86
  }
87
87
  }
88
88
 
89
- // Don't start the second (sheet) enumeration once the shared probe deadline is spent (#1244).
89
+
90
90
  if Date() >= deadline {
91
91
  NSLog("AGENT_DEVICE_RUNNER_SYSTEM_MODAL_PROBE_DEADLINE stage=sheets")
92
92
  return nil