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
Engine: getState right after an action can return a reused tree older than the page (a field half typed after type_text answered success) #357
getState can return a tree older than the page. After type_text answered success, the next observation showed the field half typed, though the page had already finished.
It was measured in #354's spike (kit probe/354-measure, the Chrome for Testing input cell with alt+Left key effect; evidence ~/.local/share/probe-354/primary/summary.json on the MacBook):
The page: the DOM held the complete requested text 69 ms after type_text returned.
The observation: the model's first observation, getState, returned about 620 ms after that, but the field's AXValue in it read only ...New typed sen.. Its deferred settle reused the earlier tree instead of re-reading.
The follow-up: a getScreenshot taken after it showed the full text in its tree.
The model therefore sees a state older than both the page and the action it was just told succeeded, and may retype or act on stale content.
Intent
An observation taken after an action never returns a tree from before that action's effect.
Find where the deferred settle reuses the tree, and on what condition.
Measure how often getState right after type_text (and after keypress or a click) shows a value that differs from the DOM settled by that time, per browser.
Then make the settle re-read whatever changed, or invalidate a reused tree once an input action has been posted since it was read.
Constraints
Priority P1: this state was shown after an action answered success. The design session's rule (1ea561bc:576) makes that P1; if the measured rate shows it can only show mid-action text that settles by itself, the session may lower it.
On the spike's cells, getState right after type_text shows the field's settled value, matching the DOM at the observation, in at least 20 of 20 trials per browser.
Where the reuse happens (from #354's spike, source read)
The observation after an action reuses the last uncapped busy-walk's tree. afterAction keeps that walk's ElementSource, and Skyshot.swift lines 307–314 reuse it when three things hold:
the window is the same;
the accessibility enablement generation is unchanged;
no incompatible web-area wait is pending (Settle.swift lines 220–221).
Nothing in that predicate checks whether the text is fresh or whether the input has finished. So a getState after type_text can hand back the tree the walk read while the text was still arriving.
This cell's observed rate comes with #354's spike report. #354's fence is not assumed to fix this.
Sminos-Session: cursor235#b93055dd (cua on macbook)
A correction: the pixels were partial too, so the cause isn't settled
The screenshot in the same first observation also shows only ...New type., while its tree reads ...New typed sen.. The DOM was full by +69 ms, and the call returned at +624 ms. The next screenshot, taken between +624 and +710 ms, shows the full text.
So the model really could see partial text, in the pixels and in the tree alike.
screenshotContentCached caches SCShareableContent and the window's metadata (Screenshot.swift lines 37–59), not pixel frames. The tree reuse above has a predicate that is unsafe for freshness, but this one trace doesn't prove that the reuse is the only cause, rather than the app's own accessibility and paint lagging behind its DOM. Turning reuse off alone is unproven as a fix.
A fix needs to show both the tree and the pixels settled on the cells measured. One example: waiting until the field's value and the frame agree with what was typed, or with the action's expected result, before answering. Measuring that comes first.
Sminos-Session: cursor235#b93055dd (cua on macbook)
Established: text a model could see stayed partial after type_text answered success. The first observation's tree and its screenshot were both checked directly. It happened in 1 of 20 trials of that cell.
Not yet established: that the stale tree caused it.
The tree reuse predicate and its source are as described above.
Pending: a document-owned harness, built for #354's fence follow-up, will attribute any repeat. Until then, this ticket is provisional on the cause, and its success criteria stay as written.
Sminos-Session: cursor235#b93055dd (cua on macbook)
Priority P1 -> P2 (design session, 2026-11-10): #354's spike measured it at 1/20 in its cell and 1 of 4,329 Chrome observations, with the cause provisional. It keeps its trace; the cause is found when its turn comes in lane 1.
Activity
SSFSKIM commentedon Nov 10, 2026
Where the reuse happens (from #354's spike, source read)
The observation after an action reuses the last uncapped busy-walk's tree.
afterActionkeeps that walk'sElementSource, andSkyshot.swiftlines 307–314 reuse it when three things hold:Settle.swiftlines 220–221).Nothing in that predicate checks whether the text is fresh or whether the input has finished. So a
getStateaftertype_textcan hand back the tree the walk read while the text was still arriving.This cell's observed rate comes with #354's spike report. #354's fence is not assumed to fix this.
Sminos-Session: cursor235#b93055dd (cua on macbook)
SSFSKIM commentedon Nov 10, 2026
A correction: the pixels were partial too, so the cause isn't settled
The screenshot in the same first observation also shows only
...New type., while its tree reads...New typed sen.. The DOM was full by +69 ms, and the call returned at +624 ms. The next screenshot, taken between +624 and +710 ms, shows the full text.So the model really could see partial text, in the pixels and in the tree alike.
screenshotContentCachedcaches SCShareableContent and the window's metadata (Screenshot.swiftlines 37–59), not pixel frames. The tree reuse above has a predicate that is unsafe for freshness, but this one trace doesn't prove that the reuse is the only cause, rather than the app's own accessibility and paint lagging behind its DOM. Turning reuse off alone is unproven as a fix.A fix needs to show both the tree and the pixels settled on the cells measured. One example: waiting until the field's value and the frame agree with what was typed, or with the action's expected result, before answering. Measuring that comes first.
Sminos-Session: cursor235#b93055dd (cua on macbook)
SSFSKIM commentedon Nov 10, 2026
The evidence so far, and how far it goes
Established: text a model could see stayed partial after
type_textanswered success. The first observation's tree and its screenshot were both checked directly. It happened in 1 of 20 trials of that cell.Not yet established: that the stale tree caused it.
Pending: a document-owned harness, built for #354's fence follow-up, will attribute any repeat. Until then, this ticket is provisional on the cause, and its success criteria stay as written.
Sminos-Session: cursor235#b93055dd (cua on macbook)
SSFSKIM commentedon Nov 10, 2026
Priority P1 -> P2 (design session, 2026-11-10): #354's spike measured it at 1/20 in its cell and 1 of 4,329 Chrome observations, with the cause provisional. It keeps its trace; the cause is found when its turn comes in lane 1.