Repository navigation
Description
Part of #1531.
Scope
A viewer of a leased iPhone Duo simulator, on the console's Watch page or through GET /v1/leases/{id}/stream, sees the panel in use, upright, in both poses, and the open stream switches panels within 5 s of a fold with no reconnect. Any source whose picture changes size mid-stream (an iPhone that rotates) gets a new scale and a new meta frame. The log children the panel follower starts end with their helper, SIGKILL included. Taps are not changed here (the next task).
If it goes wrong, a viewer of an unfolded Duo still sees black, or a picture squeezed into the first size, or a log stream process is left running inside the simulator after the stream ends.
Technical spec
Commit 84c85b1.
Rows
Behaviours: B1, B2, B3, B4, B5, B6, B7
Stored state: S1
Interfaces: I1, I2, I3, I4, I8, I10, I11
Existing code: X1, X2, X3, X4, X10, X11, X12 (the src/drivers/ios/AGENTS.md line), X13, X14 (both the swift test line and the "iOS foldable" machine row), X15 (Panels.swift), X16, X18, X9 (unchanged, confirm)
Facts
| # | Fact | Source |
|---|---|---|
| F1 | Killing simctl spawn <udid> log stream … with SIGKILL ends the log inside the simulator; a /bin/sh watchdog whose stdin is a pipe held by its parent kills simctl when the parent is SIGKILLed: both gone within 3 s |
run in the spec session on an iOS 26.5 iPhone 16 simulator, pgrep -fl "^log stream" before → pid 59815, after the parent's kill -9 → none |
| F2 | xcrun simctl io <device> screenshot [--display=<display>] <file or url> writes a PNG, - for stdout |
xcrun simctl io help (Xcode 27.1) |
| F3 | On an iOS 27.1 Duo, simctl io enumerate lists screen 1 as primary (cover) and screen 3 as primary-1 (inner); simctl io screenshot --display=3 of the unfolded inner panel is 2853×2007, upright |
the spec session's tap run, /private/tmp/claude-501/-Users-aitwar--t3-worktrees-simlock-t3-ee5a475d-67e086bd42be8963/636e892f-9e78-4d1c-8677-025fb0eccee9/scratchpad/patched-inner.png |
| F4 | agent-device 0.21.35 has fold closed | half-open | open, and folds a simulator in a scoped set through --ios-simulator-device-set |
agent-device help foldable |
| F5 | The slow lane finds agent-device through SIMLOCK_E2E_AGENT_DEVICE |
e2e/slow-agent-device.test.ts:52 |
| F6 | The proof of concept (draft #1525, branch spike/1457-iphone-duo-panels) has a working parser, follower, rotator and the Lifecycle.swift rescale; reuse what fits the rows, it is not the spec |
git show origin/spike/1457-iphone-duo-panels --stat |
| F7 | The iPhone Duo device type needs an iOS 27.1 or later runtime (minRuntimeVersion 27.1) |
the tap run: simctl create … iPhone-Duo … iOS-26-5 → SimError 403 "Incompatible device" |
Modules touched
Searches: metaEmitted, session.scaler, preferredScreenSize, FramebufferSurfaceSelector, simlock-stream-width, Wire.fd, claimStdout. vendor/screen-capture (library SimlockCapture, program simlock-screen-capture, a new test target), src/stream/definition.ts (header descriptions only), e2e/: adds e2e/slow-ios-foldable.test.ts, extends e2e/slow-ios-stream.test.ts (B7); docs/internal/agent-rules/toolchain.md (the swift test line and the "iOS foldable" machine row); docs.
Rules in play
- ADR 0075 §1–§3, §5: the panel pick, the log as a hint, a mid-stream size change, the children die with the helper.
- ADR 0031 §3: a source still delivers at least 5 pictures a second; the turned inner picture keeps FrameCapture's idle repeat.
- vendor-and-third-party-code.md rules 6 and 11:
Panels.swiftand the test target are listed invendor/screen-capture/NOTICE.mdas ours, in the same change. - documentation.md rule 9: the stream's OpenAPI header descriptions and
watching-the-screen.mdxchange in this PR; rule 7:src/drivers/ios/AGENTS.md's rotation gap is rewritten. - testing.md rule 3: what a viewer sees is tested at the stream route in the slow lane; the parser, follower and rescale at their Swift seams.
- safety.md rule 2: the follower reads a leased device's log and screenshots only; it changes nothing on it.
Tests
Seam: swift test --package-path vendor/screen-capture for the Swift rows (a new test target), and e2e/slow-ios-foldable.test.ts (new) modelled on e2e/slow-ios-stream.test.ts for the device rows.
- B1: a log line names the panel in use: settled swap
.inner:pri .cover:aux→ inner;.cover:pri .inner:aux→ cover; an arrow (.inner:off→pri) → none; the header without the category tag → none; twopri→ none; an unrelated line → none. - B2: the follower picks at start: one panel → not started; cover lit → cover; inner lit → inner; both dark → cover then the boot log's move; both lit → cover then the boot log's move; boot log unread in 10 s → cover; more than two panels → first, one log line.
- B3: the follower follows: a live move → once; the same panel again → nothing; a live move during the boot read → the live one wins; the live log ends → restarted after 1 s; no line in 30 s → stays, one log line.
- B4: a viewer of a leased Duo, each part decoded with
ffmpeg: opened folded → cover 494×720 lit; opened unfolded → inner 720×506 lit, matchingsimctl io screenshot --display=3; unfold then fold with the stream open → three meta frames, each part decodes and is lit, each switch within 5 s (decided by the maintainer 2026-11-12: the lane measured 3.7–4.0 s on this host). - B5: a picture that changes size: same size → one meta frame; a new size → a meta frame before its first frame, and a keyframe; back → another meta frame.
- B6: the capture's
logchildren end with it: stdin closed; SIGTERM; SIGKILL; each within 5 s; the child ending by itself ends the watchdog. - B7: an iPhone 16 lease: one meta frame, no follower, no
logchild (in the existinge2e/slow-ios-stream.test.ts).
Done when
swift test --package-path vendor/screen-capturepasses, with B1, B2, B3, B5 and the watchdog part of B6 in it.- toolchain.md's machine-check table has the "iOS foldable" row X14 names.
- Slow lane, iOS foldable (toolchain.md row):
scripts/slow-e2e.sh e2e/slow-ios-foldable.test.tspasses, with no case skipped (B4, B6). - Slow lane, iOS:
scripts/slow-e2e.sh e2e/slow-ios-stream.test.tspasses (B7). pnpm buildcopies the rebuiltsimlock-screen-capture, andpnpm test:changedpasses.website/src/content/docs/docs/using-devices/watching-the-screen.mdx, the OpenAPI descriptions ofsimlock-stream-widthandsimlock-stream-height,src/drivers/ios/AGENTS.md,vendor/screen-capture/NOTICE.mdanddocs/internal/agent-rules/toolchain.mdsay what the rows say.
Out of scope
- Taps, the input helper and its screen config (the next task).
- Two viewers sharing one capture (One capture per lease, shared by every viewer of its screen #602).
Depends on
Written by an agent.
Activity
test: a log line names the panel in use (#1534)
feat(capture): read the panel in use from SpringBoard's log line (#1534)
test: the follower picks the panel at start (#1534)
feat(capture): the panel follower picks the lit panel at start (#1534)
test: the follower follows live moves (#1534)
feat(capture): the panel follower follows live moves and restarts a l…
test: a capture's log children end with it (#1534)
feat(capture): a watchdog ends a command when its stdin pipe closes (#…
feat(capture): a foldable simulator streams the panel in use, upright (…
20 remaining items
fix(capture): the watchdog's follow-up runs from its main script, whi…
V3RON commentedon Nov 12, 2026
Delivery run
Merged: none
Parked: #1534 — fix-check on PR #1536 found 3 blocking issues (R6–R8) at the round cap
Decided: #1534 — fold-switch bound → 5 s (maintainer)
Written by an agent.
fix(capture): each log command ends by a token of its own, and the fo…
test: the 5 s switch bound counts from the start of the fold command (#…
github-actions commentedon Nov 12, 2026
#1536 was closed without merging. Claim released; the label is unchanged, so the next agent starts from the branch and the last handoff.
feat(capture): a foldable simulator's stream shows the panel in use a…
feat(ios): taps land on the panel of a foldable that is in use (#1559)