You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1f95ea3
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(ios): declare runner screen-capture facts at the owning contract
#2728 asked for the runner's display facts at the owning cross-language contract,
not by per-consumer casts. The wire key was a TypeScript literal and the shape a
Swift struct pinned only by two hand-written Swift encode tests, so every consumer
restated a shape it did not own.
Move the read to packages/contracts/src/screen-capture-contract.ts and record the
wire key plus two measured Duo poses in the golden table
contracts/fixtures/screen-capture-metadata.json. The table names no field of its
own: this module's reader and ScreenshotMetadataPayload stay the only two
declarations of the shape, and each language decodes the table through its own, so
a renamed or dropped fact fails both lanes. The vitest twin asserts the host reads
exactly the facts a capture recorded and refuses anything that cannot describe one.
Negative control on a booted iPhone Duo: renaming pixelsPerPoint in the table alone
turns both lanes red, Swift with DecodingError.keyNotFound at
captures[0].metadata and vitest by refusing the payload.
"comment": "Cross-language golden table for the display facts one Apple runner capture reports about the image it encoded (#2728). The vitest twin is packages/contracts/src/screen-capture-contract.test.ts and the Swift twin is UnitTests/RunnerTests+AppScreenCaptureTests.swift, which decodes and re-encodes every capture through the production ScreenshotMetadataPayload — so a renamed or dropped fact fails both lanes. This table deliberately records no field list: the Swift struct and the TypeScript reader are the only declarations of the shape. Add a measured capture here, never to one suite.",
3
+
"key": "screenshotMetadata",
4
+
"captures": [
5
+
{
6
+
"name": "Open Duo, resolved inner panel LCD-1: the window is 951x669 pt on display 3 and the upright encoding is one pixel per axis under the 2853x2007 CoreDevice calls the panel",
7
+
"metadata": {
8
+
"displayID": 3,
9
+
"pixelWidth": 2852,
10
+
"pixelHeight": 2006,
11
+
"pixelsPerPoint": 3
12
+
}
13
+
},
14
+
{
15
+
"name": "Closed Duo, outer panel LCD: the same command following the app onto the other panel, reported by the window that moved with it",
0 commit comments