Skip to content

macOS engine: the stale-point guard refuses a same-label control that takes a removed control's place (#431) - #434

Merged
SSFSKIM merged 6 commits into
mainfrom
fix/431-recreated-identity
Nov 20, 2026
Merged

SSFSKIM merged 6 commits into
mainfrom
fix/431-recreated-identity

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Closes #431

What changes

This fixes #296's stale-point guard, which let a click through when the recorded control was removed and a different control with the same label slid into its place. On main the click then landed on the other control, 100% of the time on Chrome for Testing, Safari and Electron.

When the recorded node's handle is gone, a re-created candidate is now refused if any of the following holds (design ruling 889, the strict form, under recreatedRefused in native/engine/Sources/Engine/StalePoint.swift):

  1. A twin is in the record. The observation recorded another element of the node's role, in the same web area, whose label agrees under the match's own rule. An unread label part counts as agreeing, and an unread role counts as any role. The node's own control and its inert content don't count.
  2. The region wasn't recorded whole. The node's web area, judged on its own original ancestors, has a member that the walk missed. Membership is checked by child handle, so Chromium's double-listed table cells don't count as missing.
  3. The control is unknown. An action-name, role or parent read failed at the observation or at click time. .noValue means no actions, and the observation and click-time readers decode it the same way.
  4. Something is still alive. The recorded node's own handle, or its recorded control, is still alive (its role read is not kAXErrorInvalidUIElement).
  5. The control differs. The candidate's nearest control is not the recorded one, or is of another role, or is recorded elsewhere. A candidate the record holds as a different node also refuses, as does one in another web area (an iframe).

The same refusals apply to #305's recorded-hit path and the press verdict, and a refused match can never authorize delivery. Where another rule refuses first, such as #330's newElementOverPoint, its reason stands. #330's own lookup and every own-handle verdict are unchanged from main. So are position, role, label agreement and #298's edited-text exemption. The label is used only to refuse: nothing passes on it.

This is a plugin bump to 0.28.19.

Evidence

docs/evidence/2026-11-19-recreated-identity/README.md. Kit probe/431-qual, workflow 423762603; the README with every table is 3f97d533.

  • Twin cells: main clicked the other control on every row. The fix refused nodeGone on every row on all three lanes. The cells are twin, twinbtn, twindel, twincap, twindeep, twinrow, twincover at the text, and twinwide (Safari only).
  • Genuine re-creations: remount, retext, plain, like, btnremount and the two table cells were kept and landed on both heads. The Engine: a link whose text grows with a count (Inbox to Inbox (3)) is refused nodeGone by the stale-point guard #340 cells and wideoverlay gave the same answer and reason as main. No wrong target on the fix: 3,295 valid fix rows.
  • stalePoint.ms p50: within 2 ms of main on every lane.
  • The cost of the strict form (ruling 889's trade): a genuine re-render inside a container the record could not hold whole, cut by the node cap or the width rule, is refused. That cost 40 of 419 main-kept pairs on CfT, 80 of 440 on Safari and 40 of 420 on Electron. All of them are in capremount and wideremount; every other cell had none.

Limits

Review

  • reviewer-high on 3ece1a1a, the novelty proof: 6 wrong-target holes. Then the Safari run showed that WebKit defeats any novelty proof, which led to ruling 889's strict form.
  • reviewer-high on 849bcdad, the strict form plus the role check: 9 findings, all fixed in 38a55469. 7 were wrong-target keeps; the other 2 were regressions against main (Page-made suggestion lists take a coordinate click aimed at the control under them (wrong target, all browsers) #330's own-handle verdict, Chromium tables).
  • reviewer-medium on the narrow range 849bcdad..38a55469: 3 findings, fixed in 90282060. One was a regression against main: .noValue read as a failure.
  • reviewer-medium on 38a55469..90282060, regression-only (ruling 891's stop rule): correct, with no findings.

Tests: swift test in native/engine ran 1470 tests, 0 failures, 1 skipped. Mutation passes caught every mutant (12, 17, 5, 34 and 7 per wave).

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

…d where it lies, under no recorded control but the node's own (refs #431)

#296's re-created match took any element of the node's role, a frame within
2 pt and an agreeing label, so a same-label link that slid into a removed
one's place passed (#340's `twin`, 10/10 on CfT, Safari and Electron).
recreatedIsNew now also requires the candidate to be absent from the record,
its nearest recorded ancestor to have every child recorded and to list it now
(ruling 1ea561bc:881's coverage, by screenshotChildrenRecorded's flag), and
its control to be new or the recorded node's own (ScreenshotNode.control).
Any failed read refuses. Existing re-created tests now pass the observation's
lookup; RecreatedIdentityTests covers twin, a moved control, uncovered
regions, failed reads and genuine re-creations kept. Plugin 0.28.19.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…t tell it from another element (ruling 889) (refs #431)

Safari gives a link moved in the page new accessibility handles in the removed
link's own row (hosted smoke, run 44520748737), so 3ece1a1's novelty proof kept
twin, twincap and twindeep there. Ruling 889 replaces it: a re-created candidate,
on #296's path and #305's, refuses when the walk did not record the node's web
area (else the record) whole, judged on the node's own ancestors and by
membership of each listed child; when the record holds another element of the
node's role in its region whose label agrees by the match's own rule, other than
under the node's own control; when its control is unknown (an action-name read
failed at the observation); or when its control still lives without it.
#330's lookup takes the same membership. RecreatedIdentityTests covers twin on
own and new handles, twincap, twindeep, plain, like, remount and capremount.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…its gone one is refused (refs #431)

Finding 1's role half, put back: with the recorded node's control gone, a candidate
whose nearest control (an interactive role or AXPress, below the web area) has
another role than the recorded control's (a link's text under a button, a clickable
row's under a link) refuses; a failed parent, role or action-name read on the way
refuses. It only adds refusals (twinbtn).

Sminos-Session: cursor235#b93055dd (cua on macbook)
…bcda's nine findings (refs #431)

A sibling link under a shared clickable group is a twin, only the node's own
control and its inert content are exempt (1). The candidate's nearest control is
compared with the recorded one in every case: none where none was, the same
element while it lives, a new one of its role once gone (2). A node whose own
handle lives, or a candidate the record holds as another node, refuses (3, 8).
#330's lookup keeps main's count (4). The twin's label rule never falls past an
unread label (5). An unread role counts as a twin and an unknown control (6). The
candidate's nearest web area must be the node's (7). Coverage is by handle
membership, by count only where the handles are unknown (9).

Sminos-Session: cursor235#b93055dd (cua on macbook)
…s no actions as main does, and keeps #330's reason (refs #431)

The candidate's and a replacement control's membership in the record reads the
screenshot's whole handle map, framed and frameless, on #296's path and #305's.
The observation decodes action names as the click does (kAXErrorNoValue is none,
`decodedActionNames`), so a text with no actions stays inert content of its link.
A re-created match the record refuses is judged on as main judges it: a rule that
refuses keeps its reason (#330's newElementOverPoint), and a verdict that would
keep it becomes nodeGone, so a refused match never carries a pointer.

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

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

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-20T04:57:50.378431Z 79496a5 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.

@SSFSKIM
SSFSKIM merged commit f8f3465 into main Nov 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant