Repository navigation
Commit 5dee3be
authored
fix(ios): carry the snapshot viewport across the runner boundary as a declared fact (#2908)
* fix(ios): carry the snapshot viewport across the runner boundary as a declared fact
The runner spelled "viewport unknown" as CGRect.infinite, which
SnapshotGeometry.isGeometricallyActionable read as "everything is
actionable" before computing any center, while the host-AX path models
the same state as IosViewportEvidence and declines to publish the bit.
One state, two encodings, opposite directions, across a language
boundary.
SnapshotViewport now carries the three cases the host already uses --
reported, derived, and missing { reason } -- and refuses an unusable box
at declaration, so no caller has to re-check what it was handed. The
unknown-viewport policy is stated once, at the Swift decision site, and
fails CLOSED: no box means no supportable claim about where a tap lands.
Clipping stays a separate question from containment; a capture with no
box has no clip and no root clip for the cumulative invariant to
violate, which is an absent answer rather than an unbounded one.
* test(ios): pin the hittable predicate with a cross-language vector table
The fixed 320x240 fold fixture cannot reach an edge-of-viewport center, a
node rect neither language's null/empty check refuses, or an unknown
viewport, so the predicate's two implementations disagreed on two of
them: CGRect.infinite is built of finite Doubles and its center is (0,0),
and a negative width passes an empty check while its center lands inside
-- both actionable in Swift and not actionable in TypeScript. The private
AX bridge's JSON frame parser can hand over either.
contracts/fixtures/snapshot-actionability-policy.json is replayed by
ActionabilityPolicyTests (Swift) and by scripts/ios-snapshot-differential
.test.ts (TypeScript), which also asserts the host's own instrument:
resolveViewportEvidence refuses a regular presentation without a positive
finite viewport, which is why the TypeScript predicate has no unknown
viewport case. Rows come in pairs sharing one center so a `false` that
the guard, rather than containment, decides cannot go quiet.
* refactor(ios): plot the quarter-turn test through the shared rect predicate
`SnapshotGeometrySpace.isPlottable` and `SnapshotGeometry.isPositiveFinite`
were the same five comparisons, written twice in one package, which is how
#2891 started: one question with two encodings that can drift apart.
`.null`, an inverted box, and an infinite box are refused identically by
both, so the coordinate-space table needs no new rows.
* fix(ios): make the viewport type the only place a box becomes a fact
`SnapshotViewport.reported(box:)` normalised an unusable box to
`.missing(reason: .invalid)`, and the commit said no caller had to
re-check what it was handed — while `.reported(rect:)` stayed a public
case that accepted `CGRect.infinite` on the way past that claim. The
associated value is now a box with an internal initialiser, so outside
this package a viewport fact is only reachable through the two
factories, and the case labels cannot be named around them.
MSG2
* test(ios): write down the one input the two predicates cannot share
The table replayed `{"infinite": true}` as `CGRect.infinite` in Swift and as a
rect with infinite components in TypeScript, so its infinity row never put the
same number in front of both sides. `CGRect.infinite` is made of finite Doubles:
TypeScript would call those components actionable, and only the platform that can
name the value can refuse it. The row is now Swift-only and carries `asymmetry`
naming that, every row declares both `swift` and `typescript`, and a shared
non-finite row replaces it with numbers both sides actually see.
Also states three claims the code had not been checked against: a published
`hittable: false` is retained rather than filtered out, the runner's viewport fact
decides only runner bits because the host re-derives its own from the capture's
root node, and `viewportFromRoot` — not only `resolveViewportEvidence` — is what
makes the TypeScript `viewport` argument total.
* fix(ios): leave hittable absent without a viewport box; only a reported viewport anchors a rotation
A capture with no viewport box can still decide a disabled or degenerate
node, but not containment, so the runner now omits hittable instead of
declaring false, matching the host bridge's undefined bit. The interface
orientation moves into SnapshotViewport.reported, so a derived or missing
viewport cannot anchor a rotation, and SnapshotGeometrySpace takes the
viewport fact rather than a sentinel CGRect.
* chore(gates): route the actionability vector table to the differential lane
contracts/fixtures/snapshot-actionability-policy.json is read by both
sides of scripts/ios-snapshot-differential, and packages/kernel/src/rect.ts
holds the TypeScript predicate that table replays, so a change to either
must select that lane rather than rely on the generic golden-table rule
reaching only the unit and Swift builds.1 parent 6508ef8 commit 5dee3be
33 files changed
Lines changed: 837 additions & 249 deletions
File tree
- apple
- runner/AgentDeviceRunner/AgentDeviceRunnerUITests
- UnitTests
- snapshot-presentation
- Sources
- AgentDeviceSnapshotPresentation
- SnapshotPresentationConformance
- Tests/AgentDeviceSnapshotPresentationTests
- contracts/fixtures
- docs/adr
- packages
- kernel/src
- platform-apple/src/runner/__tests__
- scripts
- check-affected
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | 225 | | |
227 | 226 | | |
228 | 227 | | |
| |||
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
262 | | - | |
263 | | - | |
| 261 | + | |
264 | 262 | | |
265 | 263 | | |
266 | 264 | | |
| |||
275 | 273 | | |
276 | 274 | | |
277 | 275 | | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
283 | 279 | | |
284 | 280 | | |
285 | 281 | | |
286 | | - | |
287 | | - | |
| 282 | + | |
| 283 | + | |
288 | 284 | | |
289 | | - | |
| 285 | + | |
290 | 286 | | |
291 | 287 | | |
292 | | - | |
| 288 | + | |
293 | 289 | | |
294 | 290 | | |
295 | 291 | | |
296 | 292 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 293 | + | |
301 | 294 | | |
302 | | - | |
303 | | - | |
| 295 | + | |
| 296 | + | |
304 | 297 | | |
305 | | - | |
| 298 | + | |
306 | 299 | | |
307 | 300 | | |
308 | | - | |
| 301 | + | |
309 | 302 | | |
310 | 303 | | |
311 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | 124 | | |
132 | | - | |
| 125 | + | |
| 126 | + | |
133 | 127 | | |
134 | 128 | | |
135 | 129 | | |
| |||
138 | 132 | | |
139 | 133 | | |
140 | 134 | | |
141 | | - | |
| 135 | + | |
142 | 136 | | |
143 | 137 | | |
144 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 24 | + | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
281 | | - | |
282 | | - | |
| 280 | + | |
283 | 281 | | |
284 | 282 | | |
285 | 283 | | |
| |||
435 | 433 | | |
436 | 434 | | |
437 | 435 | | |
438 | | - | |
439 | | - | |
| 436 | + | |
440 | 437 | | |
441 | 438 | | |
442 | 439 | | |
| |||
455 | 452 | | |
456 | 453 | | |
457 | 454 | | |
458 | | - | |
459 | | - | |
| 455 | + | |
460 | 456 | | |
461 | 457 | | |
462 | 458 | | |
463 | 459 | | |
464 | 460 | | |
465 | | - | |
| 461 | + | |
466 | 462 | | |
467 | 463 | | |
468 | 464 | | |
| |||
492 | 488 | | |
493 | 489 | | |
494 | 490 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
500 | 494 | | |
501 | 495 | | |
502 | 496 | | |
| |||
524 | 518 | | |
525 | 519 | | |
526 | 520 | | |
527 | | - | |
528 | | - | |
| 521 | + | |
529 | 522 | | |
530 | 523 | | |
531 | 524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 49 | + | |
53 | 50 | | |
54 | | - | |
55 | | - | |
56 | 51 | | |
57 | 52 | | |
58 | 53 | | |
| |||
70 | 65 | | |
71 | 66 | | |
72 | 67 | | |
73 | | - | |
74 | 68 | | |
75 | 69 | | |
76 | 70 | | |
| |||
140 | 134 | | |
141 | 135 | | |
142 | 136 | | |
143 | | - | |
144 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
234 | | - | |
| 238 | + | |
235 | 239 | | |
236 | | - | |
| 240 | + | |
237 | 241 | | |
238 | | - | |
| 242 | + | |
239 | 243 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | | - | |
517 | | - | |
| 516 | + | |
518 | 517 | | |
519 | 518 | | |
520 | 519 | | |
| |||
641 | 640 | | |
642 | 641 | | |
643 | 642 | | |
644 | | - | |
| 643 | + | |
645 | 644 | | |
646 | 645 | | |
647 | 646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
468 | | - | |
| 467 | + | |
469 | 468 | | |
470 | 469 | | |
471 | 470 | | |
472 | 471 | | |
473 | 472 | | |
474 | 473 | | |
475 | | - | |
| 474 | + | |
476 | 475 | | |
477 | 476 | | |
478 | 477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
62 | | - | |
63 | | - | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
| 97 | + | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
0 commit comments