docs(adr-0011): narrow the offscreen rescue comment to the per-request surface policy - #2465
docs(adr-0011): narrow the offscreen rescue comment to the per-request surface policy#2465thymikee wants to merge 3 commits into
Conversation
The offscreen guarantee's live rescue runs the runner's direct querySelector, which consumes the single activeApp that prepareActiveCommandContext resolved for the snapshot tree as well, including an in-place system surface. Record that the tree and the rescue read the same surface so the cell's rationale stays accurate. Closes #2452
Size Report
Startup median (7 runs, lower is better):
|
|
The new same-surface guarantee is stronger than the implementation at a4e639d. Snapshot capture and the rescue query are separate runner requests; each resolves the foreground surface again, and the probe does not receive or compare the captured surface identity. A sign-in sheet can appear or dismiss between them. Please narrow the comment to the per-request selection policy, or enforce and test the cross-request identity before claiming it. This also remains dependent on #2448. |
…t surface policy The snapshot capture and the live rescue are separate runner requests, and each calls prepareActiveCommandContext on its own, so only the selection policy is shared, not the surface instant. State that, and say plainly that a surface appearing or dismissing between the two requests is not detected. Closes #2452
|
You are right, and I took the narrowing option rather than enforcing cross-request identity. Confirmed against the code first: Pushed
What it deliberately no longer claims:
And it now states the gap outright: this is not a same-instant guarantee, no captured surface Enforcing and testing cross-request surface identity is a behavior change and a much larger one, so Still depends on #2448 merging first for the system-surface clause. PR body updated to match. Gates on |
|
The cross-request guarantee is correctly removed at 2a52a4d. One sentence still needs narrowing: ordinary simulator captures can use the AX bridge, so capture and rescue do not always both pass through |
An eligible iOS simulator snapshot is served by the host AX bridge (packages/platform-apple/src/snapshot-route.ts), which never reaches the runner's prepareActiveCommandContext. The rescue's direct querySelector always does, so the two requests share that surface policy only when the capture is runner-routed too - which is the case #2448 forces for the system surface. Keep the unchanged statement that no surface identity crosses the two requests.
|
You are right, and I traced it rather than taking it on faith. Narrowed at What the sentence now claims Why each clause is true
Gates at |
Summary
Comment-only change to the
offscreencell in the ADR 0011 guarantee matrix(
packages/contracts/src/interaction-guarantees.ts, 1 file, +8/-6 lines). No behavior change.The cell already documents the iOS live rescue (
confirmOffscreenTargetVisiblere-checks awould-be refusal against a tree-independent read and retargets at the live rect). What it did not
record is how that read picks its surface, and how little it shares with the capture.
The rescue is its own runner request:
confirmIosOffscreenTargetVisible→queryDirectIosSelector→ the Apple runner'squerySelector, with no bridge alternative, and inthe runner
querySelectorreachesexecuteOnMainPreparedonly throughprepareActiveCommandContext. The bulk capture has a second route:createAppleSnapshotRouteserves an eligible iOS simulator capture from the host AX bridge and only falls back to XCTest on
failure, a disabled generation, or target-resolution failure. So a bridge-served capture never
touches that seam, and the comment now limits the shared-policy claim to a runner-routed
capture. #2448 is what puts the system-surface case (the
ASWebAuthenticationSessionsign-insheet) back on the runner — the bridge would serve the occluded app tree — which is where the two
reads do share the seam.
The comment still does not claim the two requests observe the same surface instant: the probe
carries only the node's id/label plus the guard's own
rootViewport, no captured surfaceidentity, so a surface that appears or dismisses between capture and rescue is undetected.
(Revision
a4e639d2overclaimed a same-surface guarantee;2a52a4d3overclaimed a universallyshared seam. Enforcing cross-request surface identity would be a behavior change, out of scope.)
Depends on #2448 for the system-surface clause; merge after it. Nothing #2448 touches is modified
here.
Closes #2452
Validation
Tested at
e905700fff.pnpm format(oxfmt, repo-wide) produced no further diff;pnpm lint,pnpm typecheck, andpnpm check:affected --runall pass — the latter covering format, lint,typecheck, layering, fallow, build, and
vitest relatedon the changed file (2 files, 12 tests:the ADR 0011 honesty/completeness gate and the interaction contract coverage test). The changed
file was staged before the layering scan, which reads tracked files only.
No runtime validation applies: the diff is a source comment, so no device, simulator, or runner
path changes. The honesty gate only checks that referenced
viasymbols exist, and those areuntouched.