Simulator evidence is recorded in DECISION.md. This is the same scenario on the physical lane.
Use a purpose-specific session name; close it afterwards. Do not reuse another lane's session.
UDID=<thymikee-iphone udid from: agent-device devices --platform ios>
S="--platform ios --udid $UDID --session apex2682-physical"
bin/agent-device.mjs open com.callstack.agentdevicelab $S --foregroundThe fixture must show its own surface (Metro/dev-client per examples/test-app/README.md); an
already-installed bundle id is not evidence.
bin/agent-device.mjs screenshot --out /tmp/2682-1-app.png $S→ fixture app.- Hand off inside the app (prefer a real in-app handoff; the AccessorySetupKit/permission or an
external link surface both qualify). Fallback that exercises the identical runner path:
xcrun devicectl handle URL/a user tap that opens Safari or Settings. bin/agent-device.mjs screenshot --out /tmp/2682-2-foreign.png $Sbin/agent-device.mjs snapshot -i $S | tee /tmp/2682-3-snapshot.txtbin/agent-device.mjs snapshot -i $S(again, app already foreground)bin/agent-device.mjs close $S
- Step 3 shows the other app; step 4 shows the fixture app's tree.
- Nothing in either output says why. The only record is in the session's
runner.log:AGENT_DEVICE_RUNNER_ACTIVATE bundle=com.callstack.agentdevicelab state=<2|3> reason=<reason>. - A run where step 3 still shows the fixture app is not evidence — the handoff must be visible.
- Step 4 carries, as a warning line and as
data.targetActivationfrom PR2:The session app was not foreground when this command arrived (prior state runningBackground), so the runner activated it before answering (reason <stale_target|bundle_changed|missing_after_wait|interaction_foreground_guard>). Any capture taken earlier in this session described the only app other than the session app with an active accessibility session (pid <N>), not the session app. Re-capture now that the session app answers, or drive the other app in its own session. - Step 5 carries no disclosure — the fact belongs to the command that activated.
<N>is a liveness claim and the sentence is written to claim no more:otherActiveApplicationPidis present only when exactly one application other than the session app held an active accessibility session.activeApplicationsexposes no ordering, so nothing here proves which app owned the screen. A pid that is not an AX-active application of the session is a bug; an absent pid is not.
priorState is read at RunnerTests+Lifecycle.swift inside activateTarget before
XCUIApplication.activate() runs, and the fact is stamped only in the branch where activate() is
actually called. Assert the pair on the same device run:
runner.log:AGENT_DEVICE_RUNNER_ACTIVATE_FACT bundle=... reason=... priorState=2 otherActiveApplicationPid=<N>— the same line'spriorStateis what the response must carry;state=on the precedingAGENT_DEVICE_RUNNER_ACTIVATEmust be non-foreground.- The response can therefore never report
priorState: runningForeground. Both directions are pinned in the runner unit lane (UnitTests/RunnerTests+LifecycleCacheTests.swift): the already-foreground call assertspendingTargetActivation == niland the backgrounded call asserts the stampedpriorStateequalsXCUIApplication.State.runningBackground.rawValue. - Correlate
<N>with the app from step 3:xcrun devicectl list processes --device $UDID(or the physical-lane equivalent of the simulator'sps) should find that pid alive. Confirming it is AX-active is what the runner probed; confirming it owned the screen is not what this fact claims. On a physical deviceproc_pidpath-style resolution is deliberately NOT attempted.
- Whether
activeApplicationsreports more than the session app while a foreign app is foreground on real hardware (decides how oftenotherActiveApplicationPidis present at all). - That screenshot stays lifecycle, #2438 in-place system-host serving still applies (Apple Pay sheet
from Automation lab → Open Apple Pay), and ADR 0005
targetReseton external relaunch is untouched.
press <x> <y> and press @ref answered from a live ref frame consume no capture, so they carry no
disclosure even though the runner may have re-activated the app to serve them. Treat a silent
interaction as "unknown", never as "no repair". Follow-up: #2694.
Driven with bin/agent-device.mjs after pnpm build && pnpm clean:daemon, session apex2682-pr3,
off-app handoff via xcrun simctl openurl <UDID> https://example.com before each command. Every
command below re-activated the session app, and each answered with targetActivation plus the
appended warning:
| Command | Result |
|---|---|
snapshot -i |
warning first in warnings, ahead of the AX-backend warning; targetActivation carried |
snapshot -i --level digest |
targetActivation survives the digest projection |
find "Tab Bar" --first |
disclosed on the matched response |
press 'label="INFO"' |
disclosed on the interaction response |
wait 'label="INFO"' 8000 |
disclosed on the satisfied response |
otherActiveApplicationPid on the simulator was the Safari process, consistent across commands (pid 33878).
The false-attribution class is covered by unit tests rather than a device run, because the device
cannot show a cache hit on command: src/daemon/__tests__/capture-disclosure-target-activation.test.ts
pins that a cache-reused tree discloses nothing, and
src/daemon/interaction/internal/__tests__/interaction-target-activation-disclosure.test.ts pins that
a press which consumed no capture is not disclosed against an older tree.