Skip to content

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

Open

Description

@SSFSKIM

Problem

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

Success criteria

  • 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.
  • The cost of the change, measured.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P1
    on Nov 10, 2026
  2. SSFSKIM commented on Nov 10, 2026

    @SSFSKIM
    OwnerAuthor

    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)

  3. SSFSKIM commented on Nov 10, 2026

    @SSFSKIM
    OwnerAuthor

    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)

  4. SSFSKIM commented on Nov 10, 2026

    @SSFSKIM
    OwnerAuthor

    The evidence so far, and how far it goes

    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.

    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)

  5. added
    priority:P2
    and removed
    priority:P1
    on Nov 10, 2026
  6. SSFSKIM commented on Nov 10, 2026

    @SSFSKIM
    OwnerAuthor

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P2status:ready-for-implementer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions