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 6dc1e34
Browse filesBrowse the repository at this point in the historyBrowse files
fix(interaction): measure the moving-target gate by adoption, not bounds (#3471) (#3548)
* fix(interaction): measure the moving-target gate by adoption, not bounds (#3471)
The gate's `measured` flag accepted any capture whose rect agreed with the
dispatched one. ADR 0014 keeps the authorized frame node when a captured node's
identity differs, so a replacement control that took over the ref at the frame's
own coordinates produced two agreeing "observations" while the dispatch went to
the stale point. A look now counts only when the captured node matches the
dispatched node's rect AND its local identity — the ADR 0014 adoption question in
the value form that survives the session store's clone. One unmeasured look ends
the recheck, so the refusal reports no `movedToRect` rather than a stale one,
which is what its published shape now says.
Screening for `stationary` compared positions across surfaces: a same-identity
node on a newly arrived iOS system sheet could excuse both re-observations. The
baseline's `surfaceBundleId` must now match the resolved surface's, the same line
`post-action-surface.ts` draws.
The hint interpolated a raw selector inside single quotes, so a label carrying an
apostrophe taught a `wait` command that cannot run; it goes through the kernel's
`shellQuoteIfNeeded` like the daemon's other recovery hints. That also moves the
hint beside the refusal that publishes it, since contracts may not reach
`device-shell` without growing its own eager closure.
The lost-target test asserted only "not the motion refusal" and now names
`ref_not_found` with `dispatched: 'no'`.
* fix(interaction): keep a cross-surface look from certifying rest (#3471)
The re-observations that certify a resting position agreed on the rect alone, while the screening
that decides whether to recheck at all already compares surfaces. The same line has to hold in
both: an iOS system sheet presented during the sample gap carries the same control at the same
rect, and the gate would have read that as rest and dispatched onto the sheet (#2438's transition,
guarding the other half of the same decision). A measured look now carries the surface it was
measured on, and two looks agree only on one surface.
The unmeasured refusals also pin what they withhold — no `movedToRect` when no look measured a
position — and the `@ref` branch of the published recovery is now asserted on a real refusal rather
than in the contracts suite the hint left.
* ref(kernel): decide one position for two captured rects in one place (#3471)
`movingTargetRectsStable` and `MOVING_TARGET_GATE_RECT_TOLERANCE_PX` copied the
4-field abs-compare against `RECT_TOLERANCE_PX = 1` that `rectsWithinTolerance`
already ran for the post-gesture surface checks, and its own comment named that
file as the source of the band. Two copies of one rule: change either band and
the gate and the no-effect check disagree about the same pair of rects.
`areCapturedRectsAtSamePosition` is that comparison, exported once from
`@agent-device/kernel/rect-center` beside `normalizeRect` and
`areRectsApproximatelyEqual`. It normalizes first, so a rect that reports no
position never reports one position with another, and it owns the 1 px band
while `areRectsApproximatelyEqual` keeps its 0.5 px band for "do these two
values denote one point" — a different question, with a different reason to be
strict. Both call sites now delegate: `rectsWithinTolerance`'s five surface
comparisons call the helper directly, and the gate imports it in place of the
contracts copy. The contracts module keeps the decision and the window; the
band was never its fact to hold, so its constant and loop are gone along with
the tests that pinned the constant's value.
The band's assertions moved to `rect-center.test.ts` with the rule, including
the per-axis 1 px / 2 px boundary and the asymmetry check the old suite made on
the moved-to values rather than on the rule.
Verified by mutating the band: at 0.5 px `a one-pixel shift is capture rounding,
not motion` reddens, and relaxing the comparison to ignore the `width` axis
reddens `the declared window is the 500 ms transition budget`'s neighbour,
`one axis is enough to move`.
* fix(ref): let the frame model report which tree a ref's node was read from (#3471)
`measureRefObservation` re-derived the adoption rule that
`reconcileFreshObservation` had already applied: it looked the ref up in the
capture again and required the dispatched node to match it on rect and local
identity. Two implementations of one ADR 0014 step 5 decision, so the day
reconciliation gains or drops a rule, the gate can call a look "measured" on an
adoption the rule no longer grants — or refuse one it does grant.
`reconcileFreshObservation` now states what it chose, on every branch:
`adoptedFrom: 'observation' | 'authorized-frame'`. The value rides the ref's
`ResolvedInteractionTarget`, which is where a caller reads the node, rect and
`preAction` it dispatched, so the provenance travels with the evidence it
describes rather than being inferred from it afterwards. The gate reads that
field: a look measured the target exactly when the resolution says it read the
dispatched node out of the observation, and the look's surface now comes from
that same capture through `surfaceScopedNodes` — the way the selector branch
reads its resolution's `preAction` — instead of reaching for
`snapshot.iosSystemSurfaceBundleId` directly.
The two refusal tests are the ones that pay for this, and they are the reason
rect agreement is still not enough: a different control that took over the ref
at the frame's own coordinates produces two agreeing rects, and only the
reported provenance says the dispatch read them from the authorized frame.
Verified by mutating the reported value on each branch: reporting
'authorized-frame' where the observation was adopted reddens `the @ref path
takes its own observations, because its resolution spends none`; reporting
'observation' on either keep-the-frame branch reddens `a ref the second
observation cannot re-measure is refused, never self-agreed` and `a replacement
that took the ref at the frame coordinates is refused, not agreed`.
* ref(capture): give the settle loop the one capture-position rule too (#3471)
`stableCaptureSignalsEqual` kept the repository's third copy of the "did this
rect move" band: a 4-field abs-compare against a local `GEOMETRY_TOLERANCE_PX = 1`
that rounded each field first. `areCapturedRectsAtSamePosition` is now the one
place that decides it, so the quiet window, the post-gesture surface check and the
moving-target gate cannot drift apart when the band changes.
The rounding was load-bearing rather than cosmetic: comparing raw backend geometry
against 1 px would restart the quiet window on pairs this loop has always called at
rest, because a rect quantized to the pixel can sit up to 2 px apart raw and still
be one pixel apart in the unit the band is measured in. So the quantization moves to
`stableCaptureNodeSignal`, the one place a signal mints a rect, and the comparison
becomes the shared rule over integers. The band is therefore unchanged, stated as a
test rather than as a claim: 0.51 against 2.4 is rest, 0.51 against 3.4 is not, and
reverting the quantization reddens it.
`GEOMETRY_TOLERANCE_PX` and the local loop are deleted.
0 commit comments