Skip to content

refactor(apple): make runner surface policy explicit - #4251

Merged
thymikee merged 5 commits into
mainfrom
refactor/surface-policy
Nov 6, 2026
Merged

thymikee merged 5 commits into
mainfrom
refactor/surface-policy

Conversation

@thymikee

@thymikee thymikee commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Replace the RUNNER_COMMAND_RESOLVES_SURFACE boolean with an explicit RunnerSurfacePolicy: none, app-windows, observed-screen and resolved-modal. TypeScript and Swift both check it against one shared fixture. The host names the lit panel for app-windows and observed-screen, and the runner books an app window only for app-windows. ADR 0025 drops the drifted command lists and keeps the typed refusal contract, one sentence per rule, each linked to its owner or test. Follow-up to #4122 and #4189; independent of #4250. 11 files, no scope expansion.

Simplicity pass: the fixture is now a command→policy map. Parity is one assertion in the existing runner-command-traits.test.ts and one Swift XCTAssertEqual. The unconsumed unavailable panel-read variant (three reasons, no reader) is gone. Size: +347/−70 (net +277) → +170/−61 (net +109).

Validation

Head 67d90c8124: pnpm check:affected --run --head passed, exactCommit=true, unit suite included (run-4poRjw). The ADR-only commit follows d2de6a8702, where the evidence below was taken:

  • iOS and macOS runner builds and the isolation scan passed. The Swift parity and read-only fixture tests pass on iPhone 17 Pro Max.
  • Live, worktree CLI, iPhone Duo unfolded with the inner panel lit: press 'label="Form"', fill, get text, snapshot -i and readText passed in portrait, landscape-left and landscape-right. screenshot (669×951 lit panel) and record start/stop also passed. iPhone 17 Pro Max single-panel snapshot and tap passed. Duo folded back; simulators shut down.

CI owns coverage, integration and device lanes.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.06 MB 6.06 MB +1.6 kB
Package (unpacked) 6.06 MB 6.06 MB +1.6 kB
Package (download) 1.83 MB 1.83 MB +463 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 39.8 ms 52.2 ms +12.4 ms
CLI --help 89.4 ms 118.2 ms +28.8 ms

Keep the cross-language fixture as a command-to-policy map, check it in the
existing trait test, and drop the unconsumed panel-read omission reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee marked this pull request as ready for review November 5, 2026 22:04

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 11 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docs/adr/0025-foldable-apple-panels.md Resolved
Comment thread docs/adr/0025-foldable-apple-panels.md Resolved
Comment thread docs/adr/0025-foldable-apple-panels.md Resolved
@apex-sentinel-staging

apex-sentinel-staging Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Apex Sentinel

Verdict: approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No findings.

Reviewed with this repository's own Sentinel configuration (e6ac165961de).

Reply under an inline comment with @apex-sentinel-staging note ... or @apex-sentinel-staging pivot ... to re-check that finding.
Comment @apex-sentinel-staging review on this conversation to run a full review.

Earlier reviews

Review of d2de6a87 · 05.11.2026 22:13 UTC

Apex Sentinel

Verdict: approve

No findings.

1 finding below minor not shown (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (e6ac165961de).

State each typed refusal once, linked to the owner or test that enforces it,
while the command lists stay in the policy fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

thymikee commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

The code at 67d90c8 looks ready, and it keeps the existing behavior. Not blocking, and you can take or leave both: (1) the parity tests pin the command-to-policy map but not what prepareCommandSurface does with each policy, so a mutation that makes .observedScreen book the lit panel would turn no test red; one RunnerRequestPanelTests case where a screenshot command with litPanel against a windowless app reaches the system surface instead of a booking refusal would pin the rule that only app-windows commands book before dispatch (RunnerSurfacePolicy.swift#L32); (2) resolved-modal has no reader that tells it apart from none, which is the same argument the PR body uses to delete the unavailable variant, so would it help to name it in the ADR as a classification label with no routing of its own (runner-client.ts#L34)?

CI is green with 17 of 17 checks passing at 67d90c8, and there are no conflicts. Nothing else must happen before merge. The live iPhone Duo evidence from d2de6a8 still covers this head, which changes only the ADR since then.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 5, 2026
@thymikee
thymikee merged commit 8c6f553 into main Nov 6, 2026
17 checks passed
@thymikee
thymikee deleted the refactor/surface-policy branch November 6, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant