Repository navigation
Description
Problem
In background Safari, keypress("cmd+a") followed at once by type_text can leave the field with the wrong text, and both calls answer success. The select-all's effect lands after the first typed character, so that character is inserted and then replaced.
Measured on main 3c66931, run https://github.com/SSFSKIM/cua/actions/runs/42747547376 (kit probe/330-measure c40a482, the case "Safari textarea, cmd+a then immediate type"; 1 sample):
-
Requested:
New typed sentence goes here.type_textreturned success with entered=29. -
The field:
ew typed sentence goes here., at +12, +265, +1014 and +3015 ms after the call returned. The field was focused in every sample. -
The trace (ms, with their shared prefix dropped):
- the click returns at 819, and focusin fires at 823;
- the cmd+a RPC has returned by 834, when
type_textstarts; - the cmd+a keydown reaches the page at 842;
Nis input at 844, and the field readsOldN draft sentence goes here., so select-all hasn't applied yet;- at 876,
ereplaces the whole field, because the select-all is now in effect; - the rest follows, giving
ew typed sentence goes here..
All 29 input events, the N's included, were observed. The key isn't dropped: the calls are delivered out of order, because the key equivalent's effect trails the next call's text input.
-
Same probe, other cases: 35 of 36 cases contained the full sentence by 3,000 ms. 13 were partial right after the call and complete by 250 ms, which is late delivery, not loss. Every no-cmd+a case, with or without a 500 ms pause, completed 9 of 9, as did the paced cases.
Evidence on the MacBook: ~/.local/share/probe-330/run-42747547376/typing-facts.json, typing-summary.txt and safari-textarea-order.json, the full event trace.
Why it matters
Select-all, then type, is how a model replaces a field's text. Here the result is silently wrong text (the first character lost), and both calls answer success.
Intent
A key call's effect is delivered, in order, before the next call to the same app proceeds. Measure first:
- The rate: repeat the case at least 20 times in Safari, Chrome and Firefox, in textareas, inputs and contenteditables, with other key equivalents too (cmd+a, cmd+z, cmd+x).
- Where the delay lives: WebKit handles a key equivalent through its UI process and the responder chain, while text input goes to the web content process. That's a guess to test.
Candidate directions:
- After a modifier key equivalent, confirm its effect before answering, for example by reading AXSelectedTextRange after cmd+a.
- An ordering barrier between calls to the same pid.
type_textwaiting until the previous key call's events have been consumed.
Constraints
- A false success on the input path (design session ruling 1ea561bc:565: P1, at the front of lane 1 after Engine: a control relabelled in place (same handle, Save to Delete) passes the stale-point guard #298).
- No answer of success for content that's measurably wrong.
- The vendor runtime stays unmodified.
- Spawned by Engine: a control relabelled in place (same handle, Save to Delete) passes the stale-point guard #298's gate. No parent; not blocked.
Success criteria
- cmd+a then immediate
type_textgives the requested text in at least 20 of 20 runs per browser and editor. - The other key equivalents, measured, behave the same.
- No regression in typing time beyond what the barrier costs, which is stated.
Activity
SSFSKIM commentedon Nov 10, 2026
Ruling (design session 1ea561bc, 567)
type_text, and other key equivalents), across browsers and editors.type_textreturned. Measure whether an observation taken right then (getState,getScreenshot) shows the partial text, since that's how a model gets misled.Sminos-Session: cursor235#b93055dd (cua on macbook)
Probe #354: calibrate effects, repair observations, run twenty repeti…
Probe #354: isolate key ordering from click effects and resume coverage
Probe #354: preserve non-delivering controls and use foreground refer…
Probe #354: use an uncapitalizable native undo control marker
Probe #354: smoke application acknowledgements and exact text readback
Probe #354: bind Firefox fixture commands to the visible document
Probe #354: recheck readback privacy and keep password cells foreground
Probe #354: replay two CE500 outliers with period substitution off
Probe #354: measure fences and exact readback across all browser editors
Probe #354: distinguish macro intent from exact-readback predicates i…
SSFSKIM commentedon Nov 10, 2026
#354 measured: no tested signal fences key delivery; an exact read-back of
type_textis viableMeasurement only. Nothing is built; the proposal goes to the design session first.
The setup:
probe/354-measure, head eb28ae3; the full follow-up ran 56baa17.1. Wrong final text after a key then
type_text(out of 20, the browser behind a cover)enteredcounts the posted units.error:null, and the caret stayed at [29,0]. A foreground reference moves it to [28,0] and [24,0]. A separate defect.2. Partial text seen by the model
type_textreturned, the DOM or AX was incomplete in 200/240 (Safari), 160/240 (Chrome) and 160/240 (Firefox) trials. It completed within p50 9–10 ms and p95 20–45 ms, max 167 ms.3. Fence candidates, all falsified as a general fence
4. An exact read-back of
type_textworksHow it works:
With the key settled independently: 720 trials, 719 confirmed, and 1 honest refusal on a Firefox role read. 0 wrong values were accepted.
The cost of the snapshot and poll, p50/p95: Safari 26.0/57.2 ms, Chrome 28.4/47.8 ms, Firefox 33.4/53.4 ms. A mismatch costs about 1 s.
Fields it can't read: 120 password or concealed trials and 60 canvas trials all answered unconfirmed, with 0 leaks. Secure values are never queried.
What to change in production: Chrome's canvas exposes an empty AX value that isn't its text, so reject non-text roles rather than treating any string value as readable.
5. #357
Covered on its own ticket. The partial observation is proven, and stale-tree causality is provisional.
Runs:
The tables are in
~/.local/share/probe-354/on the MacBook:primary-owned/rates.tsv,run-42815192390/tables.tsvandfence-summary.json.49 remaining items
SSFSKIM commentedon Nov 17, 2026
[board] in-review: PR #396 opened (7082165, ci-gate GREEN)
macOS engine: type_text reads the field back and answers typeUnconfir…
SSFSKIM commentedon Nov 17, 2026
[board] done: Landed via PR #396 (cua 0.28.4)
Merge origin/main (cde920f, #354) into fix/360-firefox-nav-focus (refs …
Merge origin/main (4a3e26e: #360 / 0.28.5, #354 / 0.28.4) into fix/36…
Merge origin/main (15acf09: #366, #360, #354) into fix/367-offscreen-…
macOS engine: type_text checks select_text's range on its final start…
Probe #359: preserve spike and qualification evidence for review [ski…
macOS engine: AX text actions wait for a foreground click to land, an…
macOS engine: the marker route's web area is searched for among the a…
macOS engine: background Safari finds type_text's focused field by We…
macOS engine: type_text into a password field confirms by its length,…
macOS engine: type_text's paste route confirms by exact read-back, ke…