Repository navigation
fix(replay): verify recorded targets through the request's own capture - #4705
Conversation
… not just settle The capture a post-action observation polls is admitted for any route whose own action binding carries none. `--settle` was the first such route and the owner was named after it; the owner is the route's, not the flag's. Renamed to `observation-capture.ts` with `resolveObservationCapture` and the `observation_capture_unavailable` phase. No behavior change: same plan, same admit-once/bind-once, same degradation and disclosure.
Replay captured its target-verification tree through the legacy interactor, while the commands the replay dispatches, and so the recording itself, capture through the request- bound runtime. On an iOS simulator those are two projections of one screen: the XCTest runner's tree wraps the screen's content in an `other "<screen title>"` node the Simulator AX bridge's tree does not have. `target-v1` ancestry therefore disagreed with itself and an unchanged screen replayed as `identity-mismatch` on `ancestry[...]`. Replay now admits the `capture-only` plan the selector family polls under, at the same request seams, and captures its verification through that one binding (#4622). Tested-by: iPhone 17 Pro Max simulator (iOS 27.0), Agent Device Tester 0.21.40-dev. `wait 'id="gesture-target-image"'` + `press` recorded with `--save-script`, replayed unbound on 0.21.36 fails at `press` with `ancestry[1]: recorded=scrollview observed=other/Agent Device Tester`; this build replays the same script to `Replayed 4 steps` with six `simulator-ax-bridge` acquires and zero runner `snapshot` sends on the request's log.
Size Report
Startup median (7 runs, lower is better):
|
|
This is ready at 4770c20: I found no blocking problems, and replay verification now goes through the request's own capture as intended. The smoke checks were still running when I posted. The iOS simulator run in the PR body is on 9f13cf4455, which is patch-identical to this head. Not blocking, take or leave: bindCaptureFor caches an |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 2 new findings on 4770c20. The verdict and the full list are in the summary comment.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on be1f349. The verdict and the full list are in the summary comment.
|
The code at be1f349 looks good, and both findings from the earlier review at 4770c20 are fixed: re-admission now keys on the ref lifetime and device reference, and an unavailable admission is no longer cached. What is still missing is live evidence. The PR body lists the simulator run as pending, and the earlier run at 9f13cf4 predates the bypass bind that every verification now takes. Could you run this on one booted iOS Simulator at be1f349: a replay script with an annotated Please also fix this, since it changes behavior from 4770c20: the The unresolved thread on re-admission keying (#4705 (comment)) is fixed at this head and outdated, so you can resolve it. The thread on caching an unavailable admission (#4705 (comment)) is also fixed at this head, apart from the note above, so you can resolve it too. Please also confirm, in that run or a test, that a bypass binding and a cached binding of the same device in one request coexist safely, and that the replay repair route publishes the new lifetime or device object that re-admission keys on. The 16 build and test checks passed. The remaining check is a review check, not a test job. There are no conflicts. The live simulator run above is what remains before merge. |
resolveObservationCapture now resolves to a typed outcome, not a bare capture, so the replay cell can tell the classes apart. A `refused` admission is the owner's declared support for the cell's plan: the cell keeps it, and the next annotated step reuses the degradation with one probe and one warning instead of re-probing and re-warning per step. The two transient failure outcomes still drop the cell so the next verification re-admits. Also pins that a bypassed capture binding and a cached action binding of one device coexist in one request, each disposed exactly once, and documents why holding one bypass binding per re-admission for the request's lifetime is safe.
|
Head 1. Live evidence at this head. One booted iPhone 17 Pro Max simulator (iOS 27.0), Agent Device Tester. The script replays an annotated
2. Stable refusal kept for the cell's lifetime. 3. Bypass vs cached binding coexistence. A new routed test drives one replay request over the real On the new thread about holding superseded bindings: each bypass binding's dispose is the owner's app-log reader cleanup (a no-op when no reader was started; capture operations hold no per-binding device state), the count is bounded by the plan's close/reopen steps under the request's device lock, and supersession only happens between steps — no two captures race across a supersession. That reasoning is now written at the bypass seam in Resolving |
This comment has been minimized.
This comment has been minimized.
|
At 4040651, the lifetime refresh and transient failure handling from the earlier review are fixed, but the live two-bind condition remains unverified. The supplied simulator report shows bridge acquisitions after reopen, but no raw trace or direct live binding count; the author reports that the live trace lacks a bind phase and the quoted bind count comes from a fake gateway. Please attach the head replay command, annotated script, and trace showing both successful clicks, two distinct admissions and binds serving simulator-ax-bridge, zero runner snapshot sends, and zero capture-unavailable warnings. The 17 reported checks passed at this commit. There are no known conflicts. Before merge, please supply the inspectable simulator evidence linking both request-bound captures to the verified clicks across close and reopen. Could the observation owner return a mutually exclusive capture, stable refusal, or retryable failure, emit the specific probe and bind diagnostics there, and let replay check only retry eligibility? This would first require changing the observation owner's return type while keeping the lifetime cell and bypass seam; no new ADR, cache owner, or cleanup API is needed. Not blocking: these can be taken or left: strengthen request-binding seam coverage with distinct projections and bound operations or a real parent-scope consumer; tag bindings to verify each is disposed exactly once; keep detailed observation diagnostics private; qualify the divergence contract's bind on successful admission and include the booted-state key; and narrow the retention comment to request cleanup ownership and per-capture source lookup. The earlier lifetime refresh thread is fixed by lifetime and device invalidation and the outer identity cache bypass. The transient failure thread is fixed by eviction of transient failures and retention of stable refusals. The retention thread does not apply because retention is unchanged, capture resolves its source per call, and the local disposer is inert. |
…t the owner The observation owner now answers with one of three mutually exclusive kinds and discloses each at its own seam: a bound `capture`, a `refused` fact about the owner's declared support, or a `retryable` failure of its own probe or bind. Replay only acts on retry eligibility, and a live request record can now count the cells that reached a runtime capture: `observation_capture_admitted` and `observation_capture_bound` name the command, plan and device.
|
Head 1. Inspectable live evidence at this head. The bind is now a diagnostic the owner emits, so the count comes from the real request record, not a fake gateway. Attached at https://gist.github.com/thymikee/3d1d74c8224551fc70b6f0d338926525: the annotated script, the replay command, the replay request's raw The script replays an annotated
2. Design question — adopted. From the not-blocking list, taken: the retention comment is narrowed to request-cleanup ownership and per-capture source lookup, and the divergence contract qualifies binding on successful admission and names the booted-state key. The rest are left as-is per your call.
|
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
This is ready at 506b507. The live simulator trace now shows the requested route: an annotated click, close, open, then the same click. The design question is answered by the observation owner's typed outcomes, and lifetime invalidation and transient-failure eviction stay fixed. All 17 checks pass, and there are no conflicts. Provider-aware mismatch reporting for older recordings remains the open part of #4622, as the PR body says. Not blocking, take or leave:
|
Summary
Replay now verifies recorded target evidence through the runtime capture route used by the commands it dispatches. This avoids ancestry mismatches caused by different iOS Simulator snapshot projections.
An unchanged session reuses its admitted capture. Close and reopen on the same device or open with a refreshed device re-admits and binds again. The observation owner answers with one of three mutually exclusive kinds — a bound capture, a stable refusal, or a retryable failure of its own probe or bind — and discloses each at its own seam; replay only acts on retry eligibility. Every observation still verifies the target.
Part of #4622. Twelve files, including the observation-capture owner, the request binding seam, and routed tests. Legacy recordings still lack producer identity.
Validation
506b50794c10a4d40a96341c9155f8cc14caddbfonorigin/main. Format, lint, typecheck and the routed suites (observation-capture, replay capture, replay target/runtime, execution: 1,772 tests) pass locally; CI owns the full lanes.--debugndjson record attached at https://gist.github.com/thymikee/3d1d74c8224551fc70b6f0d338926525 (plus an extract). The trace shows:Replayed 5 steps in 2.7swith both annotated clicks verified; two distinctobservation_capture_admitted+observation_capture_boundpairs (17:54:45.794 before the first click, 17:54:47.045 after the close/reopen, bothplan=selector-active-appon the same device — the re-admission route); eight capture acquisitions served byproducer: simulator-ax-bridge, four per cell; zero runnersnapshotsends (onlyuptime/appStatereadiness probes and the twotaps); zeroobservation_capture_unavailablewarnings.observation_capture_admittedandobservation_capture_boundwith command, plan, and device (506b507). Bypass-vs-cached binding coexistence and single disposal per binding remain pinned by the routed test over the real request runtime bindings; refusal-cell retention (two clicks, one facts probe, one warning) by another.9f13cf4455: the recorded wait and press replayed on the same simulator; six bridge acquisitions and zero runner snapshots.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.