Skip to content

A foldable simulator's stream shows the panel in use and switches on a fold #1534

Closed

Description

@V3RON

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.swift and the test target are listed in vendor/screen-capture/NOTICE.md as ours, in the same change.
  • documentation.md rule 9: the stream's OpenAPI header descriptions and watching-the-screen.mdx change 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; two pri → 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, matching simctl 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 log children 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 log child (in the existing e2e/slow-ios-stream.test.ts).

Done when

  • swift test --package-path vendor/screen-capture passes, 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.ts passes, with no case skipped (B4, B6).
  • Slow lane, iOS: scripts/slow-e2e.sh e2e/slow-ios-stream.test.ts passes (B7).
  • pnpm build copies the rebuilt simlock-screen-capture, and pnpm test:changed passes.
  • website/src/content/docs/docs/using-devices/watching-the-screen.mdx, the OpenAPI descriptions of simlock-stream-width and simlock-stream-height, src/drivers/ios/AGENTS.md, vendor/screen-capture/NOTICE.md and docs/internal/agent-rules/toolchain.md say what the rows say.

Out of scope

Depends on

Written by an agent.

Activity

  1. added
    task:draft
    platform:ios
    on Nov 11, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Nov 11, 2026
  3. self-assigned this
    on Nov 11, 2026
  4. 20 remaining items

  5. removed
    task:ready
    on Nov 12, 2026
  6. removed their assignment
    on Nov 12, 2026
  7. added
    task:blocked
    on Nov 12, 2026
  8. V3RON commented on Nov 12, 2026

    @V3RON
    ContributorAuthor

    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.

  9. added
    task:ready
    and removed
    task:blocked
    on Nov 12, 2026
  10. self-assigned this
    on Nov 12, 2026
  11. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor

    #1536 was closed without merging. Claim released; the label is unchanged, so the next agent starts from the branch and the last handoff.

  12. added 2 commits that reference this issue on Nov 15, 2026
    5eb64e1
    353dcc7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:iostask:ready

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions