Skip to content

Engine: a control relabelled in place is refused as relabelled, its label's words compared with numbers set aside (#298) - #355

Merged
SSFSKIM merged 25 commits into
mainfrom
fix/298-relabelled
Nov 10, 2026
Merged

SSFSKIM merged 25 commits into
mainfrom
fix/298-relabelled

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Summary

When an app relabels a control in place, keeping the same element (Save becomes Delete), the stale-point guard used to let the click through. The click landed on what was now Delete. Now, when the recorded node is found by its own handle and its label's words have changed, the click is refused before anything is posted, as screenChangedSinceScreenshot with the reason relabelled. The sentence names the old and new labels, and tells the model to take a new screenshot.

Closes #298

The rule (design session rulings 31a62775, 1ea561bc:553, 1ea561bc:565; the spec's #298 Decision Log entry)

  • The label: the node's title, else its description, else its value when it is an AXStaticText.
  • Its words: the lowercased letter runs, after setting aside every number together with the words that follow it up to the next punctuation mark. So "Like (12)" → "Like (13)", "1 item" → "2 items" and "Inbox" → "Inbox (3)" pass, while "Save" → "Delete" and "Follow" → "Following" refuse.
  • The same-handle check: it refuses when the recorded node is found by its own handle with its frame still holding the point, both labels are non-empty, and the words differ.
  • The re-created path: stalePointLabelsAgree also compares an AXStaticText's value by words. Titles and descriptions keep exact equality.
  • Exempt:
    • AXWindow, AXWebArea, and the AXTabButton subrole;
    • text the model types into an editable region: an AXStaticText whose nearest recorded AXTextArea or AXTextField ancestor is the region its AXEditableAncestor names at the click. A link or chip with AXPress inside the region stays judged.
  • Failed reads never decide: a failed label read never falls through to another source, and a failed role, action or ancestor read never grants the exemption.
  • The walk's cost: AXEditableAncestor isn't read during the observation. It's read live only at the click, and only where the value comparison would refuse.

Docs: docs/cua-api/agent-cursor.md's stale-point paragraph names the refusal and the label changes it misses. The surface inventory, the docs test, parity's docs oracle and PROVENANCE.md carry it.

Plugin 0.27.24.

Live proof (GitHub-hosted macOS 26.7.2: Safari, Chrome for Testing, Firefox, Finder, TextEdit, and AppKit fixtures)

The evidence is in docs/evidence/2026-11-10-relabelled/.

Gate Run Result
Refusals, with the full shared sweep (HN, a GitHub PR, Wikipedia, MDN, a fixed live clock, a lazy feed, an SPA re-render, a late banner, #305's sweep, Finder, TextEdit, a mail-like table) https://github.com/SSFSKIM/cua/actions/runs/42732128619 36 relabelled refusals, all expected (Save→Delete 21, Delete→Delete all 4, Follow→Following 4, Play→Pause 4, "Save changes?"→"Delete file?" 3); 0 on kept or shared cells
Typed editors and the negative control https://github.com/SSFSKIM/cua/actions/runs/42749519072 0 relabelled on 9 typed-editor cells; the Save→Delete link inside the edited region refuses 3/3; every editor reads as AXTextArea
Paired walk cost (warmed, fixed windows, head order rotated, 20 rounds) https://github.com/SSFSKIM/cua/actions/runs/42749562318 p50 within 10% of main everywhere: Firefox −2.6%, Finder −0.3%, TextEdit +1.2%

The spike: probe/298-measure, runs https://github.com/SSFSKIM/cua/actions/runs/42557315991, https://github.com/SSFSKIM/cua/actions/runs/42558915827 and https://github.com/SSFSKIM/cua/actions/runs/42559900886. A replay of #296's false-positive spike refused 0 of 132 kept cells.

Limits

  1. A label that differs only by a number passes ("Order #1234" → "#1235", "Delete 1 file" → "3 files").
  2. Words that roll without a number refuse ("just now" → "1 minute ago").
  3. A translation in place refuses (Save → Guardar).
  4. A toggle whose label stays the same passes.
  5. A contenteditable exposed as a plain AXGroup, not an AXTextArea, gets no exemption, so typed text there can refuse. This is the safe side. No measured browser exposes one, so it's unit-tested only.
  6. A same-width re-created link whose words change (linkmono, Save → Send) refuses nodeGone rather than relabelled. Main keeps it.
  7. A hit that Stale-point guard may refuse ordinary clicks on still pages (GitHub code view, Safari toolbar, Finder title bar): live check #305 keeps on its own handle, above the recorded node, isn't judged by this rule: Engine: a hit kept by #305 on its own handle is not judged by the relabelled rule (a relabelled toolbar button over a page view) #351.

Tests and review

  • Engine: 1,127 tests pass, 1 skipped as before. New: RelabelledGuardTests, RelabelledEditableTests (7) and UnreadableLabelTests, plus VisibleFirstTests for the record-only reads. Docs node tests: 35/35.
  • Mutations: 74 rule parts were removed in turn, and 67 fail a test. Of the 7 survivors, one is equivalent and six are reachable only by a live click.
  • reviewer-high: 4 bounded rounds over 7f6eb3d..f8a3500, the last CORRECT.
    • Round 1: editable descendants refused; a failed label read fell through to another source.
    • Round 2: the fallback ancestry resolved to a link; a failed action read counted as non-actionable.
    • Round 3: correct.
    • Round 4 (the walk-cost move): correct.
  • CI: ci-gate on 67230b8, all five gates including parity-browser: GREEN, https://github.com/SSFSKIM/cua/actions/runs/42756924871

…over the point since the screenshot, as newElementOverPoint (refs #330)

The design session's ruling 11bec0ed on #330's spike (rule dL, "dL hit chain, listed"):
- The observation keeps, beside the stale-point record, every element its walk recorded, framed or frameless, with
  whether the walk recorded all of its children (screenshotChildrenRecorded, ObservedScreenshot.recorded).
- Where the recorded node lies in an AXWebArea and #296's checks and rule G keep the point, rule G's walk of the hit's
  parents (liesIn now returns the chain) is read from the web area down: the topmost element the record lacks whose
  parent the record holds with every child refuses when that parent's AXChildren lists it now. A budget-cut parent, an
  unlisted element (Chrome's button-label text) and anything the record holds stay silent. A refusal #296 or G already
  made keeps its reason.
- The recorded node as found now, or an element holding it, is not new (#296's re-created control, and a wrapper
  re-created around it).
- The refusal is screenChangedSinceScreenshot with its own sentence: a new element, such as a suggestion list or
  popup, has appeared over the recorded element; take a new screenshot or press Escape before clicking. The meta's
  stalePoint carries reason newElementOverPoint and newElementReads.
NewElementGuardTests (7); 1,063 engine tests pass, 1 skipped as before.

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

testTheScreenshotKeepsItsRecordedElements, as #316's window list is: it kills the one mutation of mutate-330.py that
the guard's suite could reach but did not. 20 of the script's 24 mutations failed a test before; now 21, the three
left only a live click reaches (the observation not keeping the elements, the guard's and the recheck's call not
passing them).

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ent refusal and its limits, plugin 0.27.16 (refs #330)

The entry records the spike's findings and candidates, rule dL as built (the record's elements, the chain from G's
walk, "every child recorded", "listed"), what the build settled (the node as found now and what holds it are not new;
a refusal keeps its reason; every kept reason judged when G walked; newElementReads), the refusal, the cost, the
limits, and the merge gate of rulings 11bec0ed and 31a62775. #316's item 8 notes the amendment; the Interfaces'
stalePoint reasons gain #316's two and newElementOverPoint, and its fields #316's costs and newElementReads.
agent-cursor.md's stale-point paragraph now says the guard refuses a web page's new element over the point, carries
the ruling's limit text as approved and Chrome's <datalist> popup passing a click through; the docs test, repl-parity's
docs oracle, PROVENANCE.md and the surface inventory's Table 3 addition (2026-11-08, #330) carry it.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…w, nor counts a failed AXChildren read as complete (refs #330)

The review of 364e017..51ce413, two P2s:
- A hit #305 keeps as a recorded control (recordedHit), its own handle or one re-created in place, now counts as a
  recorded node as found now, beside the node at the point: dL is silent on it and on anything holding it.
  newElementOverPoint takes the list of found nodes. testARecordedHitReCreatedInPlaceIsNotNew is the reviewer's
  repro (#305's code view in a web area, the textarea re-created at its role, frame and label), with a re-created
  wrapper too.
- ElementData.childrenRead says whether AXChildren was read (an error slot decodes as no children), the walk carries
  it into the record (ScreenshotNodeRead.childrenRead, both emit sites), and screenshotChildrenRecorded never counts
  an element whose read failed as complete. testSilentWhenTheParentsChildrenWereNotRead (a button whose children read
  failed at the observation, its label listed at the click) and testTheWalkRecordsAFailedChildrenRead (over
  WalkTests' fake tree; FakeTree.childrenUnread).
NewElementGuardTests 11; 1,067 engine tests pass, 1 skipped as before.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…#330's entry records the review's fixes and the acceptance cd365f0e (refs #330)

testTheGuardsRecordOnlyReadsCarryAFailedChildrenRead (VisibleFirstTests, over the width-rule list now built by
omittedList) kills the one review mutation the first fix's tests left: the walk's record-only emit site dropping
childrenRead. mutate-330.py: 29 mutations, 26 fail a test, the 3 live-only survive. The Decision Log's #330 entry notes
the design session's acceptance of the found-node narrowing (cd365f0e), its extension to a recordedHit, the failed
AXChildren read, the cost on a recordedHit, and the counts: 1,068 engine tests pass, 1 skipped as before.

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

Sminos-Session: cursor235#b93055dd (cua on macbook)
…he version waits for the merge turn (refs #330)

Sminos-Session: cursor235#b93055dd (cua on macbook)
… relabelled, its label's words compared with numbers set aside (refs #298)

The design session's ruling 31a62775 on #298's findings. The record keeps each node's subrole and an AXStaticText's
value. When the node at the point is found by its own handle and its frame read now holds the point, the guard refuses
with reason `relabelled` if both labels are non-empty and their words differ: the lowercased letter runs, with every
number and the words after it up to the next punctuation mark set aside (the spike's `besideNumbers` rule, ported as
measured). The window, the web area and Chrome's tab (subrole AXTabButton) are not compared. #296's re-created match
now also requires an AXStaticText's value to have the same words when neither side has a title or description; titles
and descriptions keep exact equality. The refusal names the old label and the new one and asks for a new screenshot.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…el changes it misses; #298's Decision Log entry (refs #298)

agent-cursor.md's stale-point paragraph now says a click or drag is refused when what the screenshot showed at the point
has been relabelled, and that the check cannot see a label that changed only in its numbers or a toggle switched with
its label unchanged (the ruling's limits 1 and 5). The docs test, parity's docs oracle, PROVENANCE.md and the surface
inventory's Table 3 addition (2026-11-09, #298) carry it. The native engine spec gains the #298 Decision Log entry (the
findings, the ruling, the build's gaps, the cost, limits 1-5 with limit 4 as ruling (b) changed it, the merge gate),
notes #296's limits (ii) and (v) as closed by it, and lists the `relabelled` reason in the meta's interface.

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

Two lines of StalePoint.swift reflowed to the file's width (no change in behavior), and #298's entry states what the
mutation run found: 37 of 39 mutants fail a test, and the two survivors are by design (an equivalent mutant and the
live-only value read).

Sminos-Session: cursor235#b93055dd (cua on macbook)
… a relabel, while a link or chip there still is (refs #298)

The design session's ruling 1ea561bc:553, and the review of 7f6eb3d..b2f00ad (P2 1). An AXStaticText, or a text run
inside one, whose nearest editable ancestor is the one recorded for it is exempt from rule `relabelled`, on its own
handle and on the re-created match (where it is matched without its value, its title and description still
compared). The editable ancestor is the text's AXEditableAncestor where exposed, else its nearest AXTextArea or
contenteditable group. The walk reads AXEditableAncestor in its batch, and the record keeps it for each AXStaticText.
Anything actionable between the text and the region (an interactive role, or AXPress: a link, a button, a mention or
chip) keeps the text judged, and so does a text whose editable ancestor now differs from the recorded one. #298's
Decision Log entry states the exemption and its ruling.

Sminos-Session: cursor235#b93055dd (cua on macbook)
… one, at the observation or now (refs #298)

The review of 7f6eb3d..b2f00ad (P2 2). The live seam's attribute read answers nil both for an attribute the element
lacks and for a read that failed, and the label fell through to the next source on either: a button titled "Save" and
described "Save changes" whose title read failed at the click compared its description with the recorded title and
refused, and the inverse when the title failed at the observation. The walk's batch now keeps which attributes failed
with an error other than their absence (failedSlot, ElementData.unreadable), the record keeps that for the label's
attributes, and the click reads each label attribute with its error. The label falls past an absent or empty attribute
only; where it would depend on an unreadable higher-priority one, on either side, the rule keeps the point.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…escription is still refused; the Decision Log names the mutation result (refs #298)

The extended mutation run found the re-created path's exemption untested on its condition that the title and
description still agree; a test now pins it. #298's entry states the run: 65 of 72 mutants fail a test, and seven
survive by design (two equivalent, five reached only by a live click).

Sminos-Session: cursor235#b93055dd (cua on macbook)
…cestor names, never the element answering it (refs #298)

The review of b2f00ad..25b23fb (P2 1). Where a text answered no AXEditableAncestor, the record and the click took
the nearest ancestor answering one as the region. A link answering the editor was then recorded as the region, and
its relabelled text was exempted, because the walk stopped at the link before checking it. A text whose own read
failed on one side only resolved to its paragraph there, so typed text refused. Both sides now resolve to the region
the attribute names (`stalePointRegion`), or an AXTextArea itself, so an actionable wrapper stays on the checked path.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ion Log, plugin 0.27.23 (refs #330)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ons cannot be read withholds the edited-text exemption (refs #298)

The review of b2f00ad..25b23fb (P2 2). `actionNames(of:)` answers an empty list when AXUIElementCopyActionNames fails,
so a wrapper whose actions could not be read counted as inert and its text was exempted. The live seam now reads
`establishedActionNames` (nil on failure, an empty list for none), and an element between the text and the region
whose role or action names cannot be read keeps the text judged. An empty list read is inert.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…d; the Decision Log names the mutation result (refs #298)

The extended mutation run found the record's use of a text's own AXEditableAncestor untested where no ancestor names
the region; a case now pins it. #298's entry states the run: 70 of 77 mutants fail a test, and seven survive by
design (one equivalent, six reached only by a live click).

Sminos-Session: cursor235#b93055dd (cua on macbook)
…310 and #341) into fix/298-relabelled (refs #298)

#330's branch moved to 494857c and brought main's #310 and #341. The only conflict was the Decision Log's tail, where
both sides had appended entries. All are kept: #310's and #341's (2026-11-08), then #298's (2026-11-09). The plugin
version is #330's 0.27.23; #298's bump waits for the merge turn.

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

main's tree is #330's final head e46319b, squash-merged, which this branch held up to 494857c. Every file #330
touched conflicted with that history. Each was resolved to this branch's side, plus #330's last delta
(494857c..e46319b: its Decision Log entry and its evidence README). The merged tree differs from main only by
#298's own changes.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…298's entry carries the post-merge test count (refs #298)

The document the server serves changed (agent-cursor.md's stale-point paragraph), so the plugin goes from #330's
0.27.23 to 0.27.24 in plugin.json and marketplace.json. #298's Decision Log entry now names the version and the
engine's 1,127 tests after the merge of main.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…es a text's region from text-entry roles, and the click reads it live (refs #298)

The design session's ruling 1ea561bc:565 on #298's walk cost: the hosted gate measured walk p50 rising from 174 to
385 ms in Firefox and from 177 to 313 ms in Finder with AXEditableAncestor in the batch. That attribute is out of
`observedAttributes` and ElementData. The record now takes an AXStaticText's region from its nearest recorded ancestor
of an editable text role (AXTextArea, AXTextField). The click alone reads AXEditableAncestor, and only where the value
comparison would refuse: the text's attribute must name that region, else the region its nearest parent names. What
the review settled is kept: a link or chip that answers the editor stays on the checked path, a failed role or action
read never grants the exemption, and a text whose own read fails still reaches the region through its paragraph. A
contenteditable group that the browsers expose as a plain group is no longer told apart from any group, so its text
stays judged.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…s AXEditableAncestor at the click; linkmono refuses as nodeGone (refs #298)

#298's Decision Log entry, item 7, now states ruling 1ea561bc:565: the measured walk cost, the record deriving a text's
region from text-entry roles, the live read at the click, the plain-group limit, and the cost. The ruling's lazy
per-record fallback was not needed. A new item 9 records that linkmono (Save -> Send, same width, re-created) refuses
as `nodeGone` on the branch where main keeps it: the extended re-created match rejects the new text's words, which is
the safe side. The merge gate now asks for the walk's cost back at main's.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…d's stays judged; the Decision Log names the mutation result (refs #298)

The updated mutation run (ruling 1ea561bc:565) found the live check of a parent's AXEditableAncestor untested where it
names another region than the one the record derived by role. A case now pins it. #298's entry states the run: 67 of
74 mutants fail a test, and seven survive by design (one equivalent, six reached only by a live click).

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

docs/evidence/2026-11-10-relabelled/README.md records the spike (probe/298-measure and its three runs), the refusals
gate (run 42732128619: 36 expected relabelled refusals, 0 on kept or shared cells), the editor gate (run 42749519072:
the link inside the edited region refuses in 3 of 3 browsers, 0 refusals on the 9 typed-editor cells, every editor
an AXTextArea), the paired cost (run 42749562318: walk p50 within -2.6% to +1.2% of main), and the limits. #298's
Decision Log entry gains a "Proven live" section with the same results and the plain-AXGroup limit the design
session asked for (1ea561bc:569).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 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-10T04:50:36.596618Z 67230b8 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 9020bb1 into main Nov 10, 2026
5 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

Development

Successfully merging this pull request may close these issues.

Engine: a control relabelled in place (same handle, Save to Delete) passes the stale-point guard

1 participant