Skip to content

macOS engine: a field whose placeholder changes is still the same element on its own handle (#398) - #430

Merged
SSFSKIM merged 4 commits into
mainfrom
fix/398-placeholder-identity
Nov 19, 2026
Merged

SSFSKIM merged 4 commits into
mainfrom
fix/398-placeholder-identity

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 19, 2026

Copy link
Copy Markdown
Owner

What changes

Today: the macOS engine's ElementIdentity compares a field's placeholder strictly. So when a field's placeholder changes, the engine treats it as a different element. Placeholders change on focus, on input, with a mode, and when Chromium switches to complete accessibility mode (#366). On hosted macOS this caused set_value's post-write check to answer valueUnconfirmed ("could not be found again") while the value was already in the field. It happened 10/10 on Chrome for Testing, Safari and Electron for a hint that clears on focus or switches on input.

Now: a placeholder difference no longer counts when the engine re-reads the same handle (Lineage.resolve), in every refetch mode, including set_value's post-write re-check.

When the handle is gone, everything stays exactly as on main, placeholder included: the stale-handle walk, the observed-tree count and keepRecreated. The hosted census found fields that differ only by their placeholder, usually with alike parents too:

  • in Chrome for Testing and Safari: sign-up and log-in forms, and MUI's demos;
  • in AppKit: Contacts' new card, 20 pairs.

So once the handle is gone, the placeholder is evidence of which field this was.

A match that holds only because the placeholder is ignored renews nothing. The stored entry keeps the observation's identity: its value, the value-unread flag, the placeholder and the actions. Only the action gets the live data. Without this, a later walk would see a weaker identity and could adopt another field.

Files:

Plugin 0.28.18 (ruling 1ea561bc:868).

Evidence

The kit is probe/398-qual, workflow 423477668, README scripts/probe-398/README.md at a67f0307. Run 44480787749 compared main 44de3527 against fix 3c99e098, 20 trials per cell per head, interleaved, in the background, with 760/760 valid rows per lane on Chrome for Testing, Safari, Electron and AppKit.

Gate Result
Same-handle cells (focus-clear, rotate, input-switch, search hint; click then set_value, click then type_text, type_text then set_value) Fix exact success on 960/960. Main refused 484 of those pairs with valueUnconfirmed, each with the value in the field.
Stale-handle cells (twin removed, twin recreated with another placeholder, single field recreated with another placeholder, twin recreated alike) Fix answers as main on 320/320 paired rows. 0 wrong-field adoptions and 0 wrong successes on either head.
Unchanging control 60/60 on both heads, every lane

The Chromium jobs show red only because of a kit gate. It required re-finding an identically recreated twin, which main never does on Chromium, and the fix answers as main there. The gate was corrected without a rerun.

The census came first, in run 44473534613.

ci-gate (plugin, test, engine-swift) on 76658e45: GREEN, run 44490307713.

Limits

  • Chromium's stale walk: on Chromium, neither head re-finds even an identically recreated field, for a reason other than the placeholder. So the stale cells there can't tell a strict walk from a loose one. Safari and AppKit can, and there the fix matches main.
  • AppKit hints: AppKit's focus and search hints never reached the engine's view of the field, so 5 of its 12 changing cells were exercised.
  • A field's value still counts. After type_text changes a field's value, a later click on its token can answer elementNoLongerValid once the tree has changed. That is unchanged.
  • Placeholder swaps: if a remaining field shows exactly a removed field's old placeholder, a stale token can still resolve to it, as on main.

Review

  • Round 1: a reviewer-high on the first design, which also relaxed the placeholder in the stale walk, found four wrong-field adoptions (3 P1, 1 P2), each reproduced in a fake tree. The walk relaxation was dropped, and all four sequences are now tests that must refuse.
  • Round 2: a reviewer-medium on the narrowed design found one P2. A placeholder-only match renewed the entry and lost the observed value, so a later walk could adopt a sibling. It was fixed in 3c99e098 by renewing nothing, with that sequence as a test.
  • The 3c99e098 diff was checked by my own reading. The hosted run above is on that head, and this PR's head adds only the evidence file.

Closes #398

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

…r element; the re-fetch's walk uses it only to break a tie (refs #398)

The same handle matches on everything but the placeholder, and .ifNeeded keeps the
placeholder it reads now. The walk keeps the candidates alike on everything else:
the stored handle wins; one alone is adopted only when the observation also held one
alone; otherwise only the one with the stored placeholder; several undecided are
ambiguous. Every other attribute still counts. Plugin 0.28.18.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ored handle; a gone handle is matched strictly as on main (refs #398)

The review of main..4630985 found the walk's placeholder tie-break adopted another
handle in four sequences main refused. The walk, the observed count and the rest stay
main's, placeholder included, against the observation's identity; the same handle's
re-read alone ignores the placeholder, and its identity keeps the observation's.
The four sequences are tests, each refused.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…hing, so a later walk sees only the observation (refs #398)

The review of main..8ed0e07 found set_value's renewal stored a value-unread identity;
after the handle went, a click's walk adopted a sibling showing the old placeholder with
another value, which main refuses. A placeholder-only match now leaves the stored entry
exactly as observed and hands the action the live identity and actions; a strict match
renews as on main. The sequence is a test that refuses.

Sminos-Session: cursor235#b93055dd (cua on macbook)
Main refused a field whose placeholder changed, after set_value, on 484 of
960 same-handle pairs; the fix succeeded on all 960 with the field exact,
and answered as main on every stale-handle row (run 44480787749).
Placeholder-only collisions on public pages and Contacts support keeping
the stale-handle walk strict (run 44473534613).

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

chatgpt-codex-connector Bot commented Nov 19, 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-19T09:12:53.246280Z 76658e4 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 enabled auto-merge (squash) November 19, 2026 09:13
@SSFSKIM
SSFSKIM merged commit 1e56ca4 into main Nov 19, 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

Development

Successfully merging this pull request may close these issues.

Engine: element identity compares the placeholder, so a field whose placeholder changes reads as a different element

1 participant