fix(ios): refuse snapshot-derived input without a screen origin

Merged
SH
2d ago
+839-29

Summary

Fixes #4399. Deferred private AX can return window-local rectangles without a known screen origin. The SDK previously promoted that local root to a screen viewport and reported successful taps at the wrong point.

Preserve viewport authority through native/provider presentation, compaction, and stored cloning. Keep uncertain trees readable, omit their trusted viewport, and refuse capture-derived mutations with window-origin-unknown / dispatched: no. Known geometry, independent coordinate/native paths, and query budgets retain their behavior.

26 files. Scope includes provider acquisition, find focus/type, Maestro selectors, and snapshot-based gesture fallback because they share the geometry; owning docs and behavioral regressions cover these seams.

Validation

Base: b6fa2ecb583137866d267f56b2597c4f633412d6. Head: 2c30d548499e615061b77ec527d7842ae40398d0.

pnpm check:affected --run --head 2c30d548499e615061b77ec527d7842ae40398d0 passed clean/exact: 19,096 unit tests, three existing skips; 373 related tests. All runnable checks passed; the production-export gate passed at 16763e0. The strengthened positive test passed. Removing the provider evidence handoff caused six unsafe-input failures; restoring it passed.

Native payload XCTest: 1/1 passed at 16763e0. All 631 runtime JavaScript files and native source are identical in this final test-only follow-up.

Same cold recording-start → snapshot → ref/selector press: baseline a8774f3632eb432a1dadbde8627da30586f9ee39 dispatched two wrong taps with counter zero; original fixed 3d1ae71e00ec75fa7e59e7c2624ec55b3f249b2b returned typed refusals and zero native taps. Healthy placed/full-screen controls advanced counters. Recordings retain their original attribution.

Final test proof. Device/provider proof: Review follow-up evidence.

GitHub: 14 checks passed, two skipped; all six review threads resolved. Natural unknown-origin evidence observed derived; missing has regression coverage.