Repository navigation
macOS engine: type_text reads the field back and answers typeUnconfirmed unless it holds the typed text (#354) - #396
Merged
Merged
Conversation
… reads its text, else typeUnconfirmed (refs #354) The design session's ruling 1ea561bc:585 on #354's measurement, the spike's reader (probe/354-measure eb28ae3, scripts/probe-354-fences/logic.swift and fence.swift) ported with the ruling's guards (TypeReadback.swift): - Before the first event, the focused field is snapshotted: a concealed request reads nothing, not even focus; otherwise focus, role and subrole, then value and selected range (UTF-16) only for a text-entry role (AXTextField, AXTextArea, AXComboBox) that is not secure. A non-text role with a string value (Chrome's canvas) is unconfirmed. - Expected: the before-value with the selected range replaced by the typed text. After the last event the same field is polled every 5 ms for at most 1 s (named constants, the spike's) until its value equals it, role and subrole read again before every value read; equal and still the app's focused element is success with typeReadback.confirmed. - Anything else is typeUnconfirmed, never retried. Only a mismatch on a field that stayed readable carries values: the expected and actual text within 100 UTF-16 units either side of the first difference, never splitting a surrogate pair, and both lengths. Secure, concealed, non-text, unreadable, a field that turned secure or changed identity, and a read at Chromium's 10,000 AXValue cap (in UTF-8 bytes or UTF-16 units, #350) carry none. - A Return or Tab (any keyed control character) is a checkpoint: the text since the last one must read back before the key is posted, so a Return never submits text that went in wrong; keys ending the text are reported keysUnconfirmed. - press_key is unchanged and answers once posted; its meta now says keyEffect "unconfirmed". The service carries cua/typeReadback and cua/keyEffect. The native matrix's Finder type-select rows keep cua's typeUnconfirmed for an element that is not a text field as their expected difference (typeIntoList). TypeReadbackTests (24); 1,151 engine tests pass, 1 skipped as before.
…, as every concealed keyed request now ends with it (refs #354) Concealed text is never read back (ruling 1ea561bc:585), so every substituted type_text that keyed answers typeUnconfirmed; without the name in ADMITTED_ERROR_NAMES the model read "failed (failed)". The runtime's sentence stays withheld. services-sky.test.mjs: the name repeated, "may have been partly entered", no value.
…e-354.py found (refs #354) A range outside the value refused at the snapshot, its key still sent; an expected value at the cap never polled; the guard before a key read after the checkpoint's wait (testTheGuardBeforeAKeyRunsAfterTheCheckpointsWait). 48 of the script's 52 mutations now fail a test; the four left are reached only by a live type_text (the engine's call into the read-back, the live value, subrole-error and identity reads). TypeReadbackTests (25); 1,152 engine tests pass, 1 skipped as before.
… paragraph: typeUnconfirmed and its remedy (refs #354) The entry records the measurement, the rule as built (snapshot, expected, poll, answers), what the build settled (keys in the text as checkpoints, the cap in UTF-8 bytes or UTF-16 units, the excerpt at the first difference, the value-free meta, the wrapper's admission of the name, the paste route left out), the sentences, press_key's keyEffect, the cost, the limits, parity's expected difference, the offline proof and the merge gate of ruling 1ea561bc:585, with the divergence from the vendor, which answers once its events are posted. The Interfaces gain typeUnconfirmed, typeReadback and keyEffect. agent-cursor.md gains a sixth paragraph: what typeText confirms; typeUnconfirmed may mean some text went in, and the remedy is to observe, then setValue; the fields it cannot read back; the OS's substitutions answering unconfirmed, never a silent success; keys in the text; setValue, or selectText then typeText, rather than a select-all key, since pressKey does not confirm an editing key's effect. The docs test, repl-parity's docs oracle, PROVENANCE.md and the surface inventory's Table 3 addition (2026-11-10, #354) carry it; the README says a keyed typeText of a secret ends typeUnconfirmed. The plugin version is left for the merge turn.
…nly, in zeroed buffers, a mismatch saying nothing of the secret (refs #354) The design session's ruling 1ea561bc:589, call 1. A concealed type_text is snapshotted as any other (a secure field is still never read): the expected value is built as UTF-16 units in a buffer the read-back owns, each read copied straight from its CFString into another (liveReadbackValueUnits), both zeroed with memset_s after use. Equal is success; a mismatch is typeUnconfirmed reason concealedMismatch, its sentence saying only that the field does not match what was typed: no excerpt, no values, no lengths, since a length tells the secret's. The CFString the app's reply was decoded into is released, not overwritten (immutable, the process's own). TypeReadbackTests (28): a concealed equal confirms; a mismatching secret's reply, meta and reads carry none of its characters and no length; a secure field is never read; the buffers zeroed and their UTF-8 length counted without a String. 1,155 engine tests pass, 1 skipped as before.
…read at the cap, equal or not (refs #354) The review of 9020bb1..dad5636, P2: the poll accepted a match before checking the actual value for truncation, and Swift's == takes canonically equivalent strings of different lengths for equal (the reviewer's probe: 4,999 composed é against 4,999 decomposed). Now each read is checked for the cap first, and a read that may be cut is a difference, never equal; equality is of UTF-16 code units (a concealed request's buffers already were). testACanonicallyEquivalentValueIsNotEqual (café typed, decomposed stored: valueMismatch, 4 against 5 units; concealedMismatch when concealed) and testAReadAtTheCapIsNeverAcceptedEvenWhenItWouldCompareEqual (5,001 units typed, 10,000 stored decomposed: possiblyTruncated); both answered success before. 1,157 engine tests pass, 1 skipped as before.
…y once the caret moves past it (refs #354) The review of 9020bb1..dad5636, P1: when the selection already held the typed text the expected value was the snapshot's own, so the first poll confirmed the old value before any event was consumed, #354's race itself (a late select-all could still rewrite it), and a checkpoint could release its Return as early. Now, where the expected value equals the snapshot's in code units, a read counts as equal only when the selected range also reads the caret past the insertion, {location + inserted length, 0}, which differs from the snapshot's non-empty selection; without it within the budget the answer is typeUnconfirmed, reason unchanged, no values. The same at every checkpoint, plain or concealed. testTypingOverTheSameTextNeedsTheCaretToMove (unconsumed: unchanged after the whole window; consumed: confirmed, the range at {5, 0}; concealed too) and testACheckpointOverTheSameTextNeedsTheCaretToMove (the Return never posted); both answered success before. 1,159 engine tests pass, 1 skipped as before.
…aracter; only a key that can leave or submit is unconfirmed (refs #354) The design session's ruling 1ea561bc:589, call 2. In an AXTextArea (how a text area and a contenteditable read), unless its subrole is one the cells show does not read a Return back (typeReadbackReturnUnreadSubroles, empty until a cell shows one), a Return is "\n" in the expected value and verified by the read-back, with no checkpoint. A key that can leave the field or submit it (a Return in a single-line field, a Tab anywhere, any other keyed control character) keeps the checkpoint before it, adds nothing to the expected value, and is counted keysUnconfirmed wherever it falls, not only at the end; text after it is expected in the same field, so focus that moved with a Tab answers fieldChanged. TypeReadbackTests (34): a text area's lines and a trailing Return read back, a dropped one a mismatch; a single-line field's and a combo box's trailing Return confirmed before it is posted, a wrong text never submitted, text after the Return expected without it; a Tab checked in a text area and moving focus answered fieldChanged; the exclusion set; keys alone. 1,161 engine tests pass, 1 skipped as before.
…cut read and a buffer's two-byte count, as mutate-354.py found (refs #354) The extended script (72 mutations, for ruling 1ea561bc:589 and the review's two findings) left four reachable survivors: a range outside the value now refused before a Tab (a Return in a text area no longer checkpoints); a concealed Return in a text area read back as a newline; a concealed read at the cap never compared; the UTF-8 count of two-byte units. 65 of 72 now fail a test; the seven left are two unobservable (the zeroing of the read and expected buffers; readbackZero itself is tested) and five reached only by a live type_text. TypeReadbackTests (34); 1,161 engine tests pass, 1 skipped as before.
…aph and #354's entry; the paste route a stated limit, #361 (refs #354) Call 3 of the design session's ruling 1ea561bc:589, and the documents of calls 1 and 2 and of the review's two fixes. agent-cursor.md's typing paragraph: a {{secret:...}} mismatch says only that the field does not match, so concealed text leaves the fields that cannot be read back; typing into an element that is not a text field (Finder's type-to-select) answers typeUnconfirmed once the keys are sent, checked by observing the selection; a Return in a multi-line field is checked like any character, a Tab or a single-line field's Return is pressed after the text before it reads back, its effect unconfirmed; the paste route of a non-Latin input source stays outside the read-back. The docs test, repl-parity's docs oracle, PROVENANCE.md and the surface inventory's Table 3 amendment (2026-11-10, #354, ruling 1ea561bc:589) carry it; the README's secret note and the wrapper's comment and test sentence follow. The Decision Log entry gains item 10 (the three calls and the review's P1 and P2, with #361 for the paste route), its earlier items, limits, proof (TypeReadbackTests 34, 1,161 engine tests, 65 of 72 mutations) and merge gate amended to match; the Interfaces' typeUnconfirmed and typeReadback reasons too.
…reads or poll time, its unconfirmed keys a flag (refs #354) The review of dad5636..af1860e, P2: for a {{secret:…}}, cua/typeReadback's keysUnconfirmed and checkpoints told how many control characters and segments the secret holds, and a secret of leaving keys alone its exact length; the reads and poll time of each checkpoint's poll tell the segments too. A concealed record now carries confirmed, concealed: true, snapshotMs (taken before any input), the reason, and keysUnconfirmed and stoppedBeforeKey as flags only. testAConcealedRecordCountsNoKeysNorSegments: one Return and three, alone and between text, in a single-line field and a text area, give identical meta; a plain request keeps its counts. 1,162 engine tests pass, 1 skipped as before.
…oved confirms, never one read before it (refs #354) The review of dad5636..af1860e, P1: the reader judged the caret after a value read, so a stale value read before a newer caret confirmed what the app had already changed (the reviewer's repro: "a" typed over a selected "a" stored as "A", the caret at {1, 0}, the first read still "a"; confirmed with no sleep, plain and concealed). Now, where the expected value is the snapshot's own, the equal read that first sees the caret past the insertion only marks it seen, and only a later equal read, taken after that caret read with its role and subrole read again, counts; on both paths and at every checkpoint. testAStaleValueReadBeforeTheCaretNeverConfirms: the repro unconfirmed plain (valueMismatch) and concealed (concealedMismatch); a kept text confirmed on the read after the caret; a checkpoint never releasing its Return. All four answered success before. 1,163 engine tests pass, 1 skipped as before.
…ed record's shape, and the proof's new counts (refs #354) Item 10 gains 7 (only a value read after the caret counts) and 8 (a concealed record counts nothing); the Interfaces give a concealed typeReadback's shape; the proof: TypeReadbackTests 36, 1,163 engine tests, 69 of 76 mutations failing a test, the seven left two unobservable and five live only.
… type_text is read back once, after its last unit (refs #354) The review of af1860e..a8e5587, P2, and the design session's ruling 1ea561bc:593: each checkpoint is a confirmation wait, so a concealed abc\n\n took one and a\nb\nc three, and the reply's time (cua/serviceMs, cua/engineMs, latency) told how the secret's text is segmented. Checkpoints now come only from keys in the caller's own text; the wrapper expands a secret only as the whole text of a type_text, so a concealed request is all secret: its keys are posted with the rest of it, flagged keysUnconfirmed, and it is read back exactly once, after the last unit. What remains is the per-character posting time, as on main. testASecretsKeysMakeNoCheckpointSoItsSegmentsSetNoWaits (a\nb\nc and abc\n\n: one wait each, the same sleeps and meta; a wrong secret answered after its Return) and testALeavingKeyInTheCallersTextAfterASecretStillCheckpoints. 1,165 engine tests pass, 1 skipped as before.
mutate-354.py's new mutant (a concealed request read back only when it typed text) survived: a secret of keys alone would skip the one wait every other secret takes. testASecretsKeysMakeNoCheckpointSoItsSegmentsSetNoWaits now asserts one wait for it. 1,165 engine tests pass, 1 skipped as before.
… as on main, in #354's entry and the typing paragraph (refs #354) The design session's ruling 1ea561bc:593 on the review of af1860e..a8e5587, P2. Decision Log item 10.9 records the rule (checkpoints only from keys in the caller's own text; a secret, the whole text of its type_text, read back once after its last unit, keysUnconfirmed a flag) and, consistent with cua's secret documents, that the read-back aims to add no channel of its own, not to promise there is none; limit 8 states the reply time's dependence on the secret's length, by the per-character posting time as on main, and that a secret's own Return is not checked before it. The typing paragraph's key sentence says a key inside a {{secret:…}} is sent with the rest and the secret checked once at its end; the docs test, repl-parity's docs oracle, PROVENANCE.md and the surface inventory's Table 3 amendment (ruling 1ea561bc:593) carry it. The proof: TypeReadbackTests 38, 1,165 engine tests, 71 of 78 mutations.
…d a read after it always required, so it is no equality oracle (refs #354) The review of a8e5587..8f465bf, P2: the extra caret read, poll and value read ran only when the expected value equalled the snapshot's, so a concealed abc typed over a selected abc cost 5 ms against 0 ms for xyz, and a caller could test a secret against a selection it chose. Now every concealed confirmation requires the caret past the insertion, {location + typed length, 0}, then an equal value read taken after it, whether or not the secret equals what it replaced; plain input keeps its path. The unchanged sentence no longer says the selection held the same text: "nothing shows the field took the text: it reads as expected, but its caret did not move past the text". testEveryConcealedConfirmationTakesTheSameSchedule: abc and xyz over a selected abc take the same reads in the same order, the same sleeps and identical meta; a secret whose caret never moves answers unconfirmed. 1,166 engine tests pass, 1 skipped as before.
…xtra-read limit (refs #354) Item 10.10: every concealed confirmation requires the caret past the insertion and a value read after it, whatever the secret replaced, so its reads and waits do not tell whether it equals a chosen selection (the review of a8e5587..8f465bf, P2). Limit 8 no longer names the extra read over the same text, and states that a concealed request in an app that does not move its reported caret answers unconfirmed; the unchanged sentence as it now reads. The proof: TypeReadbackTests 39, 1,166 engine tests, 73 of 80 mutations.
…dow when an inactive app answers none (refs #354) #354's A/B (run 43752829833): background Safari answered no application-level AXFocusedUIElement for its focused input in 120 of 120 cells that took no route 3 hold first (every secret cell, keys still landing 20 of 20), and found it in all 664 cells whose ⌘ key had just taken one. Any plain type_text into a background app with no hold would fail the same way. Approved by the design session's ruling 1ea561bc:737: when the application answers none, the read-back asks its primary window (AXFocusedWindow, else AXMainWindow) for its AXFocusedUIElement, where the posted keys go; the guards (secure, text role, identity) are unchanged, and the identity check uses the same lookup. Unverified live until the next hosted run; a route 3 hold for the read-back goes to the design session first. readbackFocusedField, tested by testTheFocusedFieldFallsBackToThePrimaryWindowsWhenTheApplicationAnswersNone. 1,167 engine tests pass, 1 skipped as before. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ret at its start; Gecko's contenteditable Return is a key (refs #354) The design session's ruling 1ea561bc:737 on #354's A/B (run 43752829833): Safari's contenteditable reads an ending Return as "\n\n", its empty last line's placeholder, in 20 of 20, while a Return between lines reads back exactly; its subrole is none, as its text area's and Chromium's are. Return stays text in multi-line fields (ruling 589). In a field that takes a Return as text, when the typed text ends in a Return and nothing of the field follows the insertion, a read of the expected value and exactly one more "\n" confirms only when AXSelectedTextRange reads {expected length, 0}, the placeholder line's start, then a fresh read after that caret read; a Return typed twice in a text area reads the same value with its caret one further on, and answers valueMismatch. An unreadable caret is accepted, the ruling's stated residual (placeholderCaretUnread in the meta). A secret's ending Return takes the same acceptance on the caret every concealed confirmation already reads, so it adds no read and no wait, and an unreadable caret never confirms a secret. Gecko's contenteditable (AXApplicationGroup) joins typeReadbackReturnUnreadSubroles: its Return is a key. testAnEndingReturnsPlaceholderLineConfirmsOnlyWithTheCaretAtItsStart (the contenteditable confirmed, the doubled Return refused, the unreadable caret accepted; not mid-field, not without an ending Return; a secret confirmed and a doubled one refused), testASecretsPlaceholderLineTakesTheSameSchedule, and the exclusion set with a Gecko case. 1,169 engine tests pass, 1 skipped as before. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ad, as mutate-354.py found (refs #354) Three reachable mutants survived the extended script: the placeholder accepted with no ending Return typed, with the field's own text after the insertion, and on the read that first saw the caret. The test now types without an ending Return with the caret where a placeholder line's start would be, types mid-field with a line added at the value's end, and reads a stale value equal to expected + "\n" before the caret, whose fresh read shows the field's real text. 89 of 97 mutations fail a test; the eight left are two unobservable buffer zeroings and six reached only by a live type_text. 1,169 engine tests pass, 1 skipped as before. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ecko's Return in #354's entry and the typing paragraph (refs #354) The design session's ruling 1ea561bc:737 on the hosted A/B (run 43752829833). Decision Log items 10.11 (a background app with no hold answers no application-level focus; the primary window is asked, to be verified on the next hosted run) and 10.12 (an ending Return's placeholder line confirmed on the caret, its stated residual, a secret's on the same schedule, Gecko's contenteditable in typeReadbackReturnUnreadSubroles); limit 5 and item 10.2 amended; the proof: TypeReadbackTests 42, 1,169 engine tests, 89 of 97 mutations. The typing paragraph says that for an app in the background naming no focused field the front window's is read, that Firefox's editable regions treat a Return as a Tab, and that a doubled ending Return may read as confirmed in a multi-line field where the caret cannot be read; the docs test, repl-parity's docs oracle, PROVENANCE.md and the surface inventory's Table 3 amendment (ruling 1ea561bc:737) carry it. Sminos-Session: cursor235#b93055dd (cua on macbook)
…et's late doubled Return is never its placeholder line (refs #354) The review of bd63a0c..5582db9 (P1): the caret seen with one accepted value confirmed whichever accepted value a later read showed. A secret "x" and Return read "x\n" with its caret at {2,0}; a late second Return made it "x\n\n" at {3,0}, and that read confirmed as the placeholder line. The caret evidence is now tied to the value it was read with (ReadbackCandidate): only a later read of that same value confirms with it, and any other read drops it, so the next accepted value has its caret read again. Concealed and plain alike; the concealed schedule still follows only what the field shows. Tests: testTheCaretConfirmsOnlyTheValueItWasReadWith, testAReadOfAnotherValueDropsTheCaretEvidence. Sminos-Session: cursor235#b93055dd (cua on macbook)
…eads unconfirmed over the right text (refs #354) Decision Log items 10.13 (the review of bd63a0c..5582db9, P1: the caret confirms only the value it was read with) and 10.14 (ruling 1ea561bc:738: typeUnconfirmed right after an editing key may answer a field holding the right text, since the snapshot can precede the key's effect; 65 of 296 race unconfirmeds held it; observe the field; follow-up #386), limit 9, and the proof: TypeReadbackTests 44, 1,171 engine tests, 93 of 101 mutations. The typing paragraph gains the race sentence; the docs test, repl-parity's docs oracle, PROVENANCE.md and the surface inventory's Table 3 amendment (ruling 1ea561bc:738) carry it. Sminos-Session: cursor235#b93055dd (cua on macbook)
…wo reads agree (refs #354) The design session's ruling 1ea561bc:754 on run 44001080688: 0 wrong successes in 1,269, but Firefox's race cells answered unconfirmed 170 of 240 times over the right final text, the key's effect landing between the snapshot and the typing. press_key now records its last post per app pid (RecentKeyPosts); a keyed type_text within 1,000 ms of one settles its snapshot (readbackSettle, TypeReadbackSettle.swift): the field's role and subrole checked as the poll checks them, its value and selected range read every 15 ms until a read agrees with the one before, for at most 100 ms (six reads), the snapshot the last read with the snapshot's checks applied. Otherwise the snapshot is taken at once, as before. Typing still follows the snapshot, so a later snapshot cannot make a success false. The settle runs before any secret is typed, after the secure check, and a concealed record counts none of it. The plain meta carries settleReads and settleCapped. The poll and the settle share readbackFieldClosed. Sminos-Session: cursor235#b93055dd (cua on macbook)
…aragraph (refs #354) Decision Log item 10.15 (ruling 1ea561bc:754: when, how, the constants, the safety and secrets arguments, what is tracked), limit 9 narrowed to what remains for #386 (an effect past the settle, one that pauses, keys it does not track), the typeReadback meta's settle and placeholder fields, and the proof: TypeReadbackTests 51, 1,178 engine tests, 114 of 124 mutations. The typing paragraph's race sentence now says type_text waits for the field to hold still after a recent pressKey; the docs test, repl-parity's docs oracle, PROVENANCE.md and the surface inventory's Table 3 amendment (ruling 1ea561bc:754) carry it. Sminos-Session: cursor235#b93055dd (cua on macbook)
…nded walk of its window (refs #354) The design session's ruling 1ea561bc:761 on the diagnostic run 44022892172 (Safari 27.2, 10 reps): with no key first, the application's AXFocusedUIElement answered no value, the windows' focus attributes were unsupported and the web area's answered no value, so the window fallback never answered; a walk of the window for the element reading AXFocused true found the field 10 of 10. readbackFocusedByWalk replaces the fallback: the primary window walked breadth first, AXFocused read of each element and its role only when focused, claiming the one element with a text-entry role (or AXSecureTextField, which the snapshot refuses unread) only when the walk finished within 200 nodes and 40 ms; zero, several or a walk cut short claim nothing. Children read to depth 12, never of the claimed field. A focused web area (Safari's, after a key press) is walked through, neither claimed nor counted. Only AX attributes are read. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ecret limit, in #354's entry and the typing paragraph (refs #354) Decision Log item 10.16 (ruling 1ea561bc:761: the diagnostic's facts, why the window fallback was dropped, the walk's rule and bounds, the focused web area, and the gap the walk leaves where the text-marker route would not), item 10.11 marked superseded, limit 10 (background Firefox's AXSelectedTextRange never moves after typing, 0 of 2,425 reads, so a secret typed there answers typeUnconfirmed though it went in; #394), and the proof: TypeReadbackTests 54, 1,181 engine tests, 127 of 139 mutations. The typing paragraph says the read-back looks through a background app's front window for the one text field that reads as focused, and states the Firefox secret limit; the docs test, repl-parity's docs oracle, PROVENANCE.md and the surface inventory's Table 3 amendment (ruling 1ea561bc:761) carry it. Sminos-Session: cursor235#b93055dd (cua on macbook)
…eaf, a cut subtree or a failed read no claim (refs #354) The review of 1bac401..45e5a5e (reviewer-high, three findings): - P1: a subtree cut at the depth bound was dropped while the walk still claimed, so a field near the top and another past the bound claimed the first. An element at the depth bound with children now leaves the walk unfinished. - P2: only a focused field was a leaf, so after a concealed request moved focus on, the identity check's walk read the text elements under the field it left. Every text-entry element is now a leaf, focused or not: the walk reads each element's role, a text-entry element's AXFocused and never its children, any other element's children. - P2: the live reads turned a failed read into an absence. ReadbackWalkRead keeps value, absent (noValue, attributeUnsupported) and failed (any other error, a value of the wrong type); a failed read leaves the walk unfinished, and an unfinished walk claims nothing. readbackWalkRead is the pure mapping, tested. Sminos-Session: cursor235#b93055dd (cua on macbook)
Decision Log item 10.16 now states the walk as built after the review of 1bac401..45e5a5e: every text-entry element a leaf, focused or not; a subtree cut at the depth bound, or a failed read, leaving the walk unfinished and claiming nothing; and the three findings. The proof: TypeReadbackTests 57, 1,184 engine tests, 134 of 146 mutations. Sminos-Session: cursor235#b93055dd (cua on macbook)
Main brings #374's Show Menu confirmation, #382's scroll, #368, #381 and #171 M4. Conflicts resolved by keeping both sides: Input.swift's meta (typeReadback, keyEffect and menu), the engine service's per-call and optional meta keys and its header, the service test (#354's and #374's tests both), the spec's errors list (menuUnconfirmed and typeUnconfirmed), the surface inventory's Table 3 sections (#354's, then #374's), PROVENANCE.md's agent-cursor row (#374's fourth-paragraph sentence and #354's sixth paragraph), and repl-parity's docs oracle, rebuilt from main's fourth and fifth paragraphs and #354's sixth so it equals agent-cursor.md byte for byte. Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
…back's evidence (refs #354) Ruling 1ea561bc:765 on the final run 44031200818 (2,980 of 2,980 valid, 3141f17 against a7529ee). Limit 11 in #354's entry: in background Safari on a large page the walk reaches its bounds and type_text answers noFocusedElement, no confirmation and never a wrong one (1,600 accessibility children: 20 of 20 cut at 200 elements, 0 claimed, the final text right in 20 of 20); the text-marker route is #395. The typing paragraph says so; the docs test, repl-parity's docs oracle, PROVENANCE.md and the surface inventory's Table 3 amendment (ruling 1ea561bc:765) carry it. The merge gate is recorded met. docs/evidence/2026-11-17-type-readback/README.md links the five runs and states the safety (0 wrong successes, 0 privacy failures in every run), the race and clean cells before and after, the settle's cost and scope, Safari's no-key cells and the measured limits. Sminos-Session: cursor235#b93055dd (cua on macbook)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
On macOS,
type_textanswered ok once its keys were sent, whatever the field ended up holding. Main answered success over wrong text 284 times in the primary A/B (run 43752829833) and 111 times in the follow-up (run 44001080688).Now it reads the focused field back, and succeeds only once the field holds what it held before with its selection replaced by the typed text (an equality poll with a 1 s budget). Otherwise it answers
typeUnconfirmed: the text was sent, but the field doesn't read as expected. The agent is told to observe the field and correct it withsetValue, never to retype.{{secret:…}}) are checked for equality only, on a single concealed schedule: the caret, then a fresh read. Neither the reply, the meta nor the logs carry the secret's bytes, and whether a call confirms doesn't depend on the secret's content.type_textwithin 1 s of apress_keyto the same app first re-reads the field every 15 ms until two reads agree (at most 100 ms), then takes its snapshot. This stops an editing key that lands late (super+a, super+z, super+v) from racing the typing. With no recent key to that app, there is no settle.The full rule, with every decision and its ruling, is in the native engine spec's Decision Log (#354 entry, items 10.1–10.16). The agent-facing text is the typing paragraph of
docs/cua-api/agent-cursor.md.Evidence
Final hosted run 44031200818: 2,980/2,980 valid; Safari 27.2, Chrome for Testing 156, Firefox 159; the branch a7529ee against 3141f17 (the read-back without the settle and the walk). Full tables are in docs/evidence/2026-11-17-type-readback/README.md.
Race calls fall from ~1,230 to ~350 ms p50. Clean cells: 720/720 confirmed on both arms.
Limits
typeUnconfirmedeven when it went in, because the caret is required for a concealed confirmation (ruling 761). 0 of 2,425 caret reads matched in run 44022876278.noFocusedElement), with the final text correct 20/20. The text-marker route found the field 20/20, and gets its own privacy design and run in macOS engine: background Safari on a large page can't find the focused field for type_text's read-back (text-marker route) #395 (ruling 765).typeUnconfirmedover the right text: 16 of 720 race calls in the final run. The agent observes the field, as for anytypeUnconfirmed.typeUnconfirmed, never a silent success. Non-Latin input sources paste, and aren't read back.Verification
swift test(native/engine), after merging main c7eee72: 1,212 tests, 0 failures, 1 skipped. Node tests: docs-oracle, core-documentation and inventory pass.Plugin 0.28.4.
Closes #354
Refs #386
Sminos-Session: cursor235#b93055dd (cua on macbook)