Skip to content

fix(apple): answer alert get on a quiet screen with status none - #5039

Merged
thymikee merged 1 commit into
callstack:mainfrom
strzhao:forge/alert-get-none-ios
Nov 23, 2026
Merged

thymikee merged 1 commit into
callstack:mainfrom
strzhao:forge/alert-get-none-ios

Conversation

@strzhao

@strzhao strzhao commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

alert get is the "is anything up?" probe, but on Apple backends a quiet screen failed: the runner's typed ALERT_NOT_FOUND passed through as COMMAND_FAILED, so iOS exited non-zero where Android and the tree driver answer status: none (#5002).

The Apple read leg now settles typed absence into the tree driver's own record, via a new readAppleAlertStatus bound to the interactor's readAlert leg only. alertIfPresent reads that record as absence, so the launch-confirmation port keeps its exact behavior. macOS rides the same leg and answers the same way. The acting legs are unchanged: alert accept|dismiss with no alert still refuse with alert-not-found and the scoped-snapshot hint.

Adjacency: #4859 (in review) reshapes found-alert wording recognition; this PR only reshapes the no-alert answer and shares no paths with it.

Before / after

Before (iOS simulator, no alert up, per the #5002 repro) — exits non-zero:

COMMAND_FAILED: alert not found
hint: Read the diagnostics log for the failing step.

After (readAppleAlertStatus, asserted by the new unit test) — exits 0:

{
  "kind": "alertStatus",
  "platform": "ios",
  "action": "get",
  "alert": null,
  "status": "none",
  "message": "No alert visible"
}

Validation

pnpm vitest run packages/platform-apple/src/__tests__/alert.test.ts   38 passed (7 new)
pnpm vitest run packages/platform-apple                             1768 passed
pnpm vitest run alert command-surface contracts --project unit-core 1456 passed
pnpm tsc -b                    exit 0
pnpm format                    clean
pnpm generate:command-docs     "commands.md is current", zero diff

pnpm check:affected --run --head 62faf70d852a2ba48c4a1c583f984bb44f6aed80: format, lint, typecheck passed; the layering gate fails on 11 pre-existing violations (R89 untyped-reason literals, R88 promise-race ratchet). Detach control at base 0d38f89b11da: violation lists byte-identical (cmp exit 0) — zero PR-introduced violations, base-blocked.

Simulator: a booted iPhone 17 was available, but no live run: the shared agent-device daemon home is owned by a daemon from another in-flight worktree and exposes no isolated-home override. Unit evidence stands in.

Refs #5002

🤖 Generated with Claude Code

…stack#5002)

The Apple get leg passed the backends' typed absence through as a
COMMAND_FAILED failure, so the "is anything up?" probe exited non-zero
on iOS while Android and the tree driver answered the same screen with
an alertStatus record whose status is none. readAppleAlertStatus now
settles a typed absence into that record, on the runner and the macOS
helper alike, and alertIfPresent reads the none record as absence so the
launch-confirmation port keeps its answer. The acting legs are
unchanged: accept and dismiss still end their window on the typed
alert-not-found refusal with the scoped-snapshot fallback.
@thymikee

Copy link
Copy Markdown
Member

Thanks for the fix. The change at 62faf70 is ready: alert get on a quiet Apple screen now answers with status: none, and alert accept and dismiss still fail with alert-not-found. Not blocking, and fine to take or leave: no test calls createAppleInteractor().readAlert, so reverting the one-line swap in interactor.ts keeps every new test green while #5002 returns; the none record in alert.ts repeats the capture-kit shape as Record<string, unknown> and could reuse its type; the commands.md note about branching on status should say that only none is reported on every platform, since a visible Apple alert still returns the raw runner payload; and the new dismiss test duplicates the accept test, and the body says 7 new tests while the diff adds 6. The Body rules check failed on the PR body text rather than on this diff, so it needs a re-run on the current body. No conflicts. Not verified here: a live iOS or macOS run, where alert get --json with no alert up should exit 0 with data.status set to none.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 23, 2026
@thymikee
thymikee merged commit ecb2089 into callstack:main Nov 23, 2026
16 of 19 checks passed
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.

2 participants