Repository navigation
Description
Problem
When type_text finds no focused element to read back, cua's macOS engine still posts the keys to the app. It then throws typeUnconfirmed with reason noFocusedElement: "The text was typed, but no focused field could be found to read back, so it is not confirmed…". The vendor's engine answers ok in the same case. This is a declared departure (#587, ruling 1247): cua won't vouch for typing it can't place.
The vendor's behaviour (from the pinned helper's disassembly)
ApplicationUIElement.targetForKeyboardEvent()at 0x1006f645c readsfocusedUIElementand only nil-checks it (cbz x0at 0x1006f64b4).- The nil path at 0x1006f65cc returns
{pid: app pid, element: nil}without throwing. performKeyboardActionposts to that target without reading the element, and the vendor has no read-back. So it answers ok.- Sources:
R/F-helper-logic.md§5.7;~/.local/share/cua-m5-pilot/skyre/textsyms.txt:43044;dis.txtlines 1822643–1822800.
cua's behaviour
- cua posts to the same pid. With no focused element,
keyboardTargetfalls back to the app's. - The read-back's lookup tries three sources in turn: the application's
AXFocusedUIElement, the Safari marker route, and the walk of the primary window. - When none claims a field, it answers
typeUnconfirmed(noFocusedElement) after the keys are posted. - Under a pending selectText selection, it answers
selectionChangedbefore any key instead (ruling 1247, e).
Evidence that the text does land
docs/evidence/2026-11-17-type-readback/README.md L108–118: in background Safari before the marker route, 20 of 20 plain and 20 of 20 secret cells answered noFocusedElement, yet "The final text was right in all 80 cells". On the large-page limit cell, noFocusedElement came back 20 of 20 with the final text right 20 of 20. The safari-marker-route evidence (main's baseline) shows the same: noFocusedElement answers with the DOM exact.
Why we didn't certify absence
Two review rounds on #587 (e54eab4..106d201, then 106d201..d51ae68) showed that "no field" can't be told apart from "a field we couldn't find":
- The walk answers the same nil for:
- a completed search;
- a failed read;
- several focused fields;
- an exhausted node, depth or time bound;
- a password field it found before a later failure.
- The marker route's no-claims mix real absence with unverified claims, including password fields.
- The application's own "no focused element" can't be trusted. Background Safari answers that way over a focused field (run 43752829833).
An ok-with-note built on a three-way lookup outcome still left cases where a real field, possibly a password field, would be reported as absent. Ruling 1247 dropped it.
What would reopen it
- A matrix cell that compares the two engines with no focused element and shows the model harmed by cua's error (for example, a retry that duplicates text).
- A user report of the same.
Either one would justify designing a certified absence (a lookup whose "none" has no indeterminate cases) and answering ok with a note.
Board
Enhancement, P3. Parent #117. Relates to #587.
Sminos-Session: cursor235#b93055dd (cua on macbook)
Activity
The report's known capability differences gain #597 (P3, deferred; ru…
Ruling 1248 enters the Decision Log: a 7-cell proof run on the fixed …
macOS engine: the post gate holds "no field" too: a password field ap…
macOS engine: the latch at the snapshot's exit, the gate reads fieldF…
macOS engine: one secure latch for the whole paste route, fed by ever…
macOS engine: type_text's paste route gates every ⌘V and Return on th…