Skip to content

Engine: the stale-point guard refuses a click when the app opened a window over the screenshot or the point left the screenshot's page (#316) - #332

Merged
SSFSKIM merged 5 commits into
mainfrom
fix/316-overlay-guard
Nov 8, 2026

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Summary

After ⌘L in Safari, a coordinate click on the page answered success but landed on the address field's panel, which the accessibility tree doesn't show. The stale-point guard now refuses that click, and two other wrong-target cases with it, with nothing posted:

  • W, a new window over the screenshot: the app has opened a layer-0 window above the screenshot's window since the screenshot. Safari's ⌘L panel is such a window.
  • G, the hit in another page: the recorded node lies in an AXWebArea, and the hit at the point doesn't lie inside it. This catches Chrome answering for a page the tab has left, and Firefox's urlbar list.

Both refuse as screenChangedSinceScreenshot. The meta's reason is newWindow or otherWebArea.

Closes #316

The rules (design session rulings 4701abd8 and 17dd203e; the spec's #316 Decision Log entry)

  1. The first candidate is withdrawn. It required a re-observation after any chord, Escape or Enter. It refused 61% of the clicks that would have landed.
  2. W.
    • What the screenshot keeps: the on-screen window numbers its capture already reads.
    • What is checked: at a coordinate click or a drag's start, in every app and both modes, the window list is read once. An app window at layer 0 above the target window that the screenshot's list didn't hold refuses.
    • No app is excepted (fork A). Chrome's omnibox popup after ⌘L refuses too, and costs one re-observation.
  3. G.
    • What the record keeps: each node's nearest AXWebArea.
    • What is checked: a hit that isn't the node itself must lie inside that web area. Its parents are walked up to the area (CFEqual, bounded at 300 levels).
    • Nested frames pass. This is an ancestor test, not an equality one: on main's still sweep, equality would have refused 36 Chrome frame clicks that landed.
  4. The cost fields. stalePoint.windowsMs and stalePoint.webAreaReads survive the element route's record.
  5. Docs. The guard paragraph in docs/cua-api/agent-cursor.md now states what is refused, and what is still missed with what to do about it. The surface inventory, the docs test and parity's docs oracle carry the same text.

Plugin 0.27.9.

Live proof (GitHub-hosted macOS 26.7.2: Safari 27.2, Chrome for Testing, stable Chrome 156, Firefox 159, TextEdit, Finder; main 73b4456 against the branch's ca4652a)

The evidence is in docs/evidence/2026-11-08-overlay-guard/. The A/B scored the engine's own refusals.

Cell Main Branch
Safari ⌘L and ⌘L+typing, clicks and drag starts 32/32 wrong, success answered 32/32 refused newWindow
Safari ⌘L+Escape 16/16 land 16/16 land
Chrome after a link, ⌘L+URL or suggestion+Return 40/40 land on the new page 40/40 refused otherWebArea
Firefox urlbar list 6 of 8 wrong 8/8 refused
Cost: Chrome ⌘L, then a page click 48 land 48 refused newWindow
Cost: Finder rename after Return 4 land 4 refused newWindow
stalePoint.ms p50 / p95 / max 0.19 / 1.74 / 10.75 0.80 / 4.15 / 8.24

The still-page gate

The gate is live clicks on unchanged pages and apps, with no key and no navigation.

Main Branch
Frames: same-origin, cross-site, nested, and the page around them (168 per head) 0 refused 0 refused
#305's toolbar cells: Safari's address field and 8 pt above it, Reload, Chrome's toolbar (44 per head) 0 refused 0 refused
Local page, Wikipedia, TextEdit, Finder 0 refused 3 refused
Total 0 / 473 3 / 492

The 3 refusals. They are all Wikipedia links in Chrome for Testing, whose recorded frame was a 1 pt sliver at the web area's bottom edge. There, Chrome's hit-test answers its own view group, outside the web area.

  • On main, the 3 were kept as nonInteractiveHit. The page got no event, and the engine answered success.
  • On the branch, they are refused truthfully. The design session accepted this as is (17dd203e).

Runs:

The kit is probe/316-measure (af721d0), off main.

Limits: what W and G still miss (unchanged on both heads)

Tests and review

Sminos-Session: cursor235#b93055dd (cua on macbook)

…opened a new window over the screenshot's, or when the point has left the screenshot's web area (refs #316)

The design session's ruling 4701abd8 on the spike's findings, two rules in the stale-point guard:
- W: the screenshot keeps the on-screen window numbers its capture already read (ShareableWindowCache's list). At a
  coordinate click or a drag's start, in every app and both desktop modes, the window list is read once, and a window
  of the app's at layer 0 above the click's window that the screenshot's list did not hold refuses before the tree is
  read (reason newWindow, the window's number in the meta). The refusal reuses screenChangedSinceScreenshot, with a
  sentence of its own: the remedy is the guard's (a new screenshot first), and no recorded element is at fault.
- G: each recorded node keeps its nearest AXWebArea at or above it in the record. A hit at the point must be that web
  area or lie inside it, its parents walked (parent reads only, bounded by stalePointAncestorLevels), else
  otherWebArea, refused. An iframe's hit passes inside the page's area; a node inside an iframe needs the iframe's
  document. An empty hit, and a node outside every web area, are judged as before.
The meta's stalePoint adds windowsMs (W's read) and webAreaReads (G's walk). NewWindowGuardTests, 4;
WebAreaGuardTests, 6; the existing guard suites unchanged.

Sminos-Session: cursor235#b93055dd (cua on macbook)
… agent-cursor.md, plugin 0.27.9 (refs #316)

The entry records the candidate withdrawn (61% false refusals), rules W and G as built with their emulated catches and
costs on run 2 (76 of 104 wrong clicks caught, 37 of 449 false refusals), the window-list read's measured cost, the
residue they still miss (#330's page suggestion lists, #331's TextEdit reflow, Safari after a re-observation), and
what the hosted check must verify. The paragraph's second half is a draft, final after the hosted A/B; the docs test,
repl-parity's docs oracle, PROVENANCE.md and the surface inventory's Table 3 addition (2026-11-08, #316) carry it.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…t and iframes of both origins pass (refs #316)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…heck's windowsMs and the walk's webAreaReads (refs #316)

The review of 73b4456..e62a745 (one P2): a shared-mode Chromium or Firefox click carried by #282's element route
replaces meta.stalePoint with StalePointGate.check's record, which kept only the first verdict and the total time, so
windowsMs never reached the meta on those clicks, recheck or not. The gate is now built from the first check's record
(init(first:record:recheck:)) and its record carries that windowsMs; stalePointPressVerdict's rebuilt verdict carries
the webAreaReads it was judged after. WebAreaGuardTests' new test fails without either part (mutate-316.py, 3 more).

Sminos-Session: cursor235#b93055dd (cua on macbook)
… Log entry records the A/B and the accepted gate exception (refs #316)

Sminos-Session: cursor235#b93055dd (cua on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T19:28:12.934153Z 9df5171 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Safari: after Cmd-L a coordinate click lands on the address-field overlay the AX tree doesn't show (wrong target)

1 participant