You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8d3a32a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(daemon): let a finishing mutation record the tree it acted through (#3471) (#3539)
* feat(daemon): let a finishing mutation record the tree it acted through (#3471)
The history the gate reads. The session's deferred surface becomes a two-variant
claim — `stabilize` (the capture side still owes a quiet-window loop) or
`recheck` (a mutation dispatched through a captured tree whose own effect may
still be animating) — and a mutation that resolved a target records that tree at
the instant it finished, so the next press can ask whether its own coordinates
are still in play. ADR 0014's device side-effect seam retires the record, and a
press never erases a stabilization the capture side still owes.
The `targetStability` matrix cells, their Layer-3 scenarios on both runtime
paths, and the caller-facing help/docs land with it: the refusal is observable
from here.
Closes#3471.
* chore(gates): name the deferred-surface owner the recheck variant shares (#3471)
* fix(daemon): record only the tree a mutation actually acted through (#3471)
`chooseMovingTargetTree` preferred the session snapshot whenever its node array
differed from the tree the action resolved against, reasoning that a `--settle`
or `--verify` capture must have published something newer. Array identity cannot
establish that: a freshness capture and a `@ref` press's authorized frame reach
`session.snapshot` the same way, so the marker could record a surface this action
never looked at — the exact substitution its own docblock forbids, and a
`stationary` verdict made against the wrong tree. The baseline is now the
acted-through tree, always. A settled press simply owes its successor one
re-observation instead of being answered from a tree of unknown provenance.
The corroborated-failure path also dropped the tree. That sibling call reached
the same finalizer without `preActionTree`, so a corroborated iOS tap retired the
baseline a previous mutation had recorded and left the next press unscreened — a
dispatch that touched the device behaving like one that never looked at a tree.
It now passes the resolved target's own tree.
Help and website docs now scope the guarantee to what the gate actually covers:
ref and selector targets on the runtime path, dispatched (not "tapped") at the
resting position, `movedToRect` optional, and a raw-coordinate press explicitly
outside it.
Refusing to narrow the WRITER to press/click: the ADR 0011 cells scope which
commands the gate guards, while this marker asks whether a mutation just left an
animating surface, and a `fill` that opened a keyboard or a `longpress` that
started a drag answers that the same way a press does. The breadth is now pinned
by a test rather than left implicit.
* test(daemon): bracket the recorded baseline instant with the reads around it (#3471)
The bound was "within the last second" of assertion time, so a CI pause between the mark and the
comparison could fail the test while the marker itself stayed correct. Reading the clock before the
call and again in the assertion keeps the claim the test actually makes — the stamp is the mutation
END, not the action's start — and removes the slack the bound needed.
* docs(website): name the two dispatch routes the moving-target check does not cover (#3471)
The paragraph claimed the check runs for any @ref or selector target, which held for neither
exclusion. `click @ref` on a backend that dispatches to the element itself returns from
`maybeTapRefTarget` before the guard is reached, and the Maestro non-hittable coordinate fallback
is a fused runner request that never resolves a point at all. Both are now stated as the exceptions
they are, and "nothing was tapped" becomes "nothing was dispatched" for the same reason the command
metadata changed verb.
* fix(daemon): let a settle that proved rest record the tree that proved it (#3471)
Removing the session-snapshot preference took the baseline back to the tree the action started
from, and that broke a contract the repository already encodes: a press following a converged
`--settle` spends a tap and nothing else (test/integration/provider-scenarios/settle-observation.
test.ts asserts the runner transcript directly). A settled press is the case the screening exists
to answer cheaply — re-observing a surface the settle already proved quiet is the round trip
`--settle` was built to remove.
The provenance problem the review found stays fixed. Instead of inferring "newer" from a differing
node array, the finalizer forwards the action's own settle observation and the marker reads the one
field that carries the fact: `diff`, which the runtime attaches only when the loop converged AND
stored its settled tree as the session snapshot within one surface. `settled` alone is not that
fact — a sparse capture is refused by the store and a cross-surface transition withholds the diff,
and in both cases the session's newest tree belongs to some earlier capture. Everything that is not
a stored settled tree keeps the acted-through tree: a timed-out loop, a lone `--verify` capture, a
freshness capture, a `@ref` frame.
* refactor(daemon): hand the finalizer its optional values directly (#3471)
Both forwards were conditional property spreads, and the complexity ceiling counts each one as a
branch on the already-branching dispatch path — `check:fallow` flagged the function at threshold on
the previous commit. The finalizer's parameters are optional-with-undefined, so passing the value
directly states the same fact with two fewer branches: an absent settle or an unresolved target
forwards undefined, which is what the marker already treats as "no such evidence".
* docs(website): say the motion check could not confirm rest, not that the target moves (#3471)
The refusal covers two outcomes and the paragraph described only one. A re-check that never measured
a position refuses for the same reason a target that kept moving does, and a reader told the target
"was still moving" reads missing evidence as measured motion — then waits for motion that the gate
never observed. Same wording the typed reason's own docblock already uses.
* fix(interaction): report a refused press as an unconfirmed position, not as measured motion (#3471)
A `target_still_moving` refusal covers two outcomes and all three of its surfaces described only
one. The gate also refuses when a re-observation never measured a position at all — the `@ref` case
where reconciliation kept the authorized frame node — so "the target was still moving" reported an
observation the gate had not made, in the message, in the published hint, and in the website
paragraph. A caller told the target is moving waits for movement; the actual recovery there is to
re-resolve the target.
All three now state the confirmation that failed. The reason literal is untouched: `reason` is the
branch point, and the prose around it is not allowed to be more specific than the code that raised
it. The unmeasured `@ref` refusal asserts both halves of that — the new wording present, the motion
claim absent — so the text cannot drift back into a claim this path cannot support.
* refactor(daemon): cut the duplicate settle-branch test and the repeated baseline reasoning (#3471)
* docs(daemon): put the baseline's real shape in the docs that describe it (#3471)
Three places said less than the code does, all found in review:
- `MovingTargetBaseline.tree` named only the pre-action tree. #3538 asked for
this doc to be widened when the writer landed, because it cannot be read
truthfully from that layer: the converged-settle case records the tree that
settle published as rest, not the one the action started from.
- `markMovingTargetBaseline` listed "a raw coordinate" among the routes that
leave the session idle. A point target with `--verify` or `--settle` DOES
capture a tree in `resolvePointInteractionTarget`, so the idle list is the
routes with no tree of their own, not the point-shaped ones.
- `DeferredSurface.stabilize.baselineSignature` still pointed at
`markPostGestureStabilization`, which is `markSurfaceStabilization` now.
Also shrinks five comments that were narrating control flow rather than
stating the invariant: the field-owner claim, the retirement comment, the
carrier comment, and two guarantee cells. Line counts matter at this layer's
budget, and a claim in prose is worth less than the same claim in a name.
* test(interaction): name the wall-clock window the daemon-route scenario trusts (#3471)
The press-to-press scenario goes through the real daemon route, and production
installs no runtime clock on that route, so the gate's 500 ms window runs on the
wall clock: press B has to reach its gate read within 500 ms of press A
finishing. A host loaded enough to starve the process past that sends B idle,
and B spends the tap — the same `Unexpected provider call: ios.runner.tap` a
wiring regression gives, which is exactly the failure this scenario exists to
catch.
The alternative was threading a `clock` through the router deps so the daemon
composition could install one, for a guarantee the scenario does not own; the
harness-level `createContractClock` only reaches the in-process runtime, which
this scenario deliberately does not use. So the risk is named where it can be
read instead of paid for.
"Intentional: the fused runner request queries the element and taps it inside one XCTest request, so the runner aims at the element's own live frame at tap time rather than at a rect the daemon captured earlier and carried across a round trip — the capture-to-dispatch distance #3471 closes does not exist on this route. Its hittability semantics stay the runner's, as the offscreen cell above already records.",
227
+
};
228
+
196
229
// The two runtime tree paths (selector and ref resolution) run the SAME shared
197
230
// guard/observation implementations; only how the target is found
198
231
// (disambiguation) and how failures are described (errorTaxonomy) differ.
'gap: target-authored drag has no --settle/--verify observation of the destination; the tap-shaped runtime paths are the only ones with an opt-in evidence route today.',
391
425
trackingIssue: GAPS_UMBRELLA_ISSUE,
392
426
},
427
+
targetStability: {
428
+
kind: 'inapplicable',
429
+
reason:
430
+
"Drag endpoints name contact coordinates for one uninterrupted pointer plan (ADR 0013); re-pointing an endpoint after resolution would split the plan the gesture's integrity depends on, and a drag whose surface moved mid-gesture is the surface behavior, not a misaimed tap. #3471 guards the tap-shaped paths, where one captured point is the whole action.",
'gap: the fast path observes no post-action outcome by default; --settle/--verify disable it and delegate to runtime-ref instead of running here.',
476
515
trackingIssue: GAPS_UMBRELLA_ISSUE,
477
516
},
517
+
targetStability: {
518
+
kind: 'inapplicable',
519
+
reason:
520
+
'The fast path activates a provider-owned semantic handle rather than a point the daemon aimed from a capture, so there is no daemon-captured position that could have gone stale — the exposure #3471 guards is created by capture-to-dispatch distance and this path has none. Where the daemon does read a rect on this path, its preflight reads the same stored node the other guards judge.',
'Coordinates name a point, not an element; there is no target existence to wait for.',
539
583
},
540
584
outcomeObservation: TAP_OUTCOME_NOT_OBSERVED_GAP,
585
+
targetStability: {
586
+
kind: 'inapplicable',
587
+
reason:
588
+
'Coordinates are the escape hatch that dispatches the point it was given; there is no resolved element whose position could be confirmed, and re-resolving a caller-authored coordinate would replace the instruction rather than verify it.',
Copy file name to clipboardExpand all lines: src/commands/interaction/metadata.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -57,9 +57,9 @@ const FIND_ACTION_VALUES = [
57
57
58
58
constinteractionCommandDescriptions={
59
59
click:
60
-
'Activate a UI target by snapshot ref, selector, or coordinates. Prefer a ref or selector after a snapshot; use coordinates only when semantic targeting is unavailable. This can change app state. Success means the click was dispatched, not that it landed: use settle or verify to confirm the result without a follow-up snapshot, or wait for the expected screen.',
60
+
"Activate a UI target by snapshot ref, selector, or coordinates. Prefer a ref or selector after a snapshot; use coordinates only when semantic targeting is unavailable. This can change app state. Success means the click was dispatched, not that it landed: use settle or verify to confirm the result without a follow-up snapshot, or wait for the expected screen. A ref or selector target is re-checked for motion before dispatch when the session's previous action just animated the screen, and is dispatched at its resting position; one that has not stopped refuses with target_still_moving rather than acting where it was.",
61
61
press:
62
-
'Short-press a UI target by snapshot ref, selector, or coordinates. Use longpress instead when the target requires a context-menu or hold gesture. Success means the press was dispatched, not that it landed: use settle or verify to confirm the result, or wait for the expected screen.',
62
+
"Short-press a UI target by snapshot ref, selector, or coordinates. Use longpress instead when the target requires a context-menu or hold gesture. Success means the press was dispatched, not that it landed: use settle or verify to confirm the result, or wait for the expected screen. A ref or selector target is re-checked for motion before dispatch when the session's previous action just animated the screen, and is dispatched at its resting position; one that has not stopped refuses with target_still_moving rather than acting where it was.",
63
63
fill: 'Replace text in a UI input selected by snapshot ref, selector, or coordinates. Pass an empty text to clear the field. Inspect unconfirmed evidence and assert the expected value or resulting screen before continuing. Prefer refs or selectors after snapshot; use recordAs to keep sensitive text out of a recorded replay while sending it to the live app.',
64
64
longpress:
65
65
'Hold a UI target by snapshot ref, selector, or coordinates to open a context menu or perform another hold gesture. Set durationMs when the default hold duration is unsuitable.',
0 commit comments