Repository navigation
macOS engine: type_text into a password field confirms by its length, never its characters (#414) - #424
Merged
Conversation
…bKit's text marker, never inspecting it (refs #395) Background Safari names no focused element, and #354's walk gives up past 200 nodes, so on a real-size page type_text answered noFocusedElement. In Safari only (the bundle identifier of the process read), once the application's AXFocusedUIElement answers none, the read-back now takes WebKit's route before the walk: the primary window's first AXWebArea (the walk's bounds), its AXSelectedTextMarkerRange, that range's start marker straight into AXUIElementForTextMarker on the web area, then at most four AXParent hops to the field. The walk still runs when the route claims nothing. Under ruling 1ea561bc:824: the marker lives only in readbackMarkedElement and is released there; nothing reads its bytes or length, the end marker is never resolved, and no other parameterized attribute is asked. Every element on the way is classified (role and subrole in one batch, #405's valueClassification) before anything else is read of it; a closed one ends the lookup with main's reason (secure, or roleUnreadable) and nothing more read. A field is claimed only when it is the app's, reads AXFocused true and its parents reach that web area. After typing, and at a checkpoint, a field the route found is asked itself (AXFocused true on the same handle): no marker call follows delivered text, and the reads do not depend on a secret. ReadbackAX carries every Accessibility call of the live reads, so the tests run the live composition over a stub Safari whose web area answers a real AXTextMarkerRange with a known offset in its bytes. Sminos-Session: cursor235#b93055dd (cua on macbook)
…range (refs #395) The stub web area now answers its range beside an error too, so the range read's error check is exercised rather than covered by the stub. Sminos-Session: cursor235#b93055dd (cua on macbook)
…xt's field (refs #395) Sminos-Session: cursor235#b93055dd (cua on macbook)
… to find the field (refs #395) agent-cursor.md's typing paragraph loses its sentence on background Safari's large page answering no focused field: the text-marker route now finds that field. The docs oracle and the core-documentation test carry the paragraph byte for byte; PROVENANCE.md and the surface inventory's "Table 3 amendment (2026-11-18, #395, ruling 1ea561bc:824)" record it. Sminos-Session: cursor235#b93055dd (cua on macbook)
…d the marker tests fail rather than crash (refs #395) The mutation check found the failed-children guard of the web area's search survived: its only case had no other web area to find. A web area after the element whose children failed now must not be taken. The closed-field and post-input tests unwrap their log positions with a failure instead of a trap. Sminos-Session: cursor235#b93055dd (cua on macbook)
…rker route (refs #395) The entry records ruling 1ea561bc:824's conditions as built, the probe's facts (runs 44296356927 and 44297805982: a 28-byte marker holding the caret as an LE32 word, a password field's included), the choices the ruling left (the route before the walk, the web area under the walk's bounds, four hops to the field, the field focused and under that web area, the field's own AXFocused after typing, Safari by bundle identifier), what is noted and not measured, and the proof with its mutation check. #354's limit 11 points to it. The log is appended oldest first, as this spec's always has been. Sminos-Session: cursor235#b93055dd (cua on macbook)
… runs only on an absent focus answer (refs #395) The high review's findings, as the design ruled: - The web area is checked to be the app's and classified, open as an AXWebArea, before its marker is read; otherwise no claim, and the walk runs. It is not the field, so a closed classification is no refusal. - Each ancestor the claim's scope climb passes is checked to be the app's before it is compared or climbed. - readbackFocusedField takes the application's AXFocusedUIElement as a ReadbackWalkRead: an absent answer (noValue, attributeUnsupported) goes to the primary window, the marker, then the walk; a failed read (another error, or a reply that is not an element) to the walk alone, as on main (ruling 1ea561bc:824). - The marker tests skip, rather than trap, where HIServices' private constructors or the engine's marker symbols do not resolve; the odd-reply test unwraps the symbols with XCTUnwrap. New tests: the web area another process's, unreadable or classified otherwise (five cases, no marker call); a failed or wrong-typed application focus read (no marker call, the walk confirms a small page; attributeUnsupported takes the route); an ancestor another process's. The lookup-order test now shows the web area's classification before its marker read. Each new guard, removed or weakened (six mutations), fails a test. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ecks and the absent-only route (refs #395) Item 2 (c): the web area is checked to be the app's and classified (AXWebArea, open) before its marker is read; each ancestor of the scope climb is checked to be the app's. Item 2 (e) and item 3: the route runs only on an absent answer (noValue or attributeUnsupported); a failed application focus read goes to the walk alone. Item 5: 14 test functions, the new cases, the skip without the constructors, and the six new mutations caught. Sminos-Session: cursor235#b93055dd (cua on macbook)
…pp's own elements (refs #395) The re-review's findings: - [P2] `readbackWebArea` takes an ownership predicate, and `readbackMarkedField` passes `marker.owned`. An element another process serves, the window included, is skipped: its role is not read, it is never the web area and its children are never followed, so a foreign provider cannot pick the page whose marker is read. The probe's `tree()` visited only owned elements. #354's walk is unchanged. The separate ownership check on the web area after the search is dropped, since the search now checks it. - [P3] The tests that showed the fallback walk ran by its reaching node 1000, which the live walk's wall-clock 40 ms bound could stop on a slow runner, now count the window's AXChildren reads instead. The web area's search and the walk each read them first: two after the route claims nothing, one when a failed focus read skips the route. New cases: in the generic search, a foreign group between the window and a web area (not found, the group unread), a foreign sibling that reads as a web area (skipped, the search goes on) and a foreign window (nothing read); in the stub, a web area under another process's group (no marker call, noFocusedElement). Removing the search's ownership guard fails both. Sminos-Session: cursor235#b93055dd (cua on macbook)
…app's own elements (refs #395) Item 3: the web area is the first AXWebArea among the app's own elements, another process's (the window included) skipped unread, as the probe's `tree()` visited only the app's. Item 5: the web area under another process's group, six cases, and the search's ownership among the mutations caught. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ches (refs #395) Sminos-Session: cursor235#b93055dd (cua on macbook)
…ari's text-marker route (refs #395) Sminos-Session: cursor235#b93055dd (cua on macbook)
…#414) Sminos-Session: cursor235#b93055dd (cua on macbook)
… never its value (refs #414) Rulings 1ea561bc:826 (808's paste rule applied to type_text), 833 (the success names its strength and says what it proves) and 839 (no count: the caret alone from an empty selection). A field #405's classification finds secure, with a field's role, is read after its role and subrole only through one batch of role, subrole, selected range and character count, classified from that same reply. It confirms when the count is the start's less the selection plus the typed UTF-16 units and, whenever the range was read, the caret sits right after the text in the same reply. The record carries secure:true and confirmation:"length", the success a fixed note; a failure a reason alone (lengthUnreadable, selectionUnreadable, lengthMismatch, caretMismatch, noLongerSecure). Safari's marker route claims a password field as it claims a text field. Sminos-Session: cursor235#b93055dd (cua on macbook)
…unreadable, tested (refs #414) Sminos-Session: cursor235#b93055dd (cua on macbook)
… is all it proves (refs #414) agent-cursor.md's typing paragraph, its oracle and core-documentation copies, the surface inventory's amendment, and the README's secrets paragraph: a password field succeeds once it has taken exactly as many characters as were typed; a length cannot tell the right characters from others; when it fails; Firefox naming its page as focused. Sminos-Session: cursor235#b93055dd (cua on macbook)
…units, a Return's one CR included (refs #414) Sminos-Session: cursor235#b93055dd (cua on macbook)
…t success rides as a length note (refs #414) Sminos-Session: cursor235#b93055dd (cua on macbook)
…keeps the lookup's password finding, and never traps (refs #414) Review of 517ab54..bdfbcfb: a concealed caret elsewhere answers lengthMismatch; the marker route's and the walk's password finding is held at the snapshot (noLongerSecure); noLongerSecure advises against observing a shown secret; a select_text baseline at a password field types nothing; a failed snapshot count is refused before the settle; a count or caret past Int32.max, or a float count, is unreadable; confirmation "length" and the note only after a length check; the leak test fixes the posting's real times before its scan. Sminos-Session: cursor235#b93055dd (cua on macbook)
…own as text is not observed, and selectText then typeText into one types nothing (refs #414) Sminos-Session: cursor235#b93055dd (cua on macbook)
…on only once one ran (refs #414) Sminos-Session: cursor235#b93055dd (cua on macbook)
…sword field's record (refs #414) Sminos-Session: cursor235#b93055dd (cua on macbook)
…view's fixes and the mutation results (refs #414) Sminos-Session: cursor235#b93055dd (cua on macbook)
…ilure warns when the field may show it (refs #414) Sminos-Session: cursor235#b93055dd (cua on macbook)
…as held for 50 ms, so an app still taking its keys cannot pass through it (refs #414) The hosted qualification's AppKit fixture: an extra character at the caret before the first key, and a poll that read the field with its last key not yet taken, matched the expected length and caret. One 5 ms poll within the 1 s budget; a match confirms once the same reply holds for typeReadbackLengthDwellMs (ruling 1ea561bc:842). A literal request ends at a change or a read past the text; a concealed one never confirms after a change and always polls to the budget, so its failure's time never depends on the secret. Sminos-Session: cursor235#b93055dd (cua on macbook)
…within about a second (refs #414) Sminos-Session: cursor235#b93055dd (cua on macbook)
…ch confirms only by a read within it; an unavailable caret is no overshoot (refs #414) Review of f35a42b..cbce12e, R3-2, R3-3, R3-4 and R3-5 (a field that collapses a selection as long as the secret, inserting nothing, confirms: the documented limit of a length). Sminos-Session: cursor235#b93055dd (cua on macbook)
…'s coinciding-insertion limit narrowed (refs #414) Sminos-Session: cursor235#b93055dd (cua on macbook)
… it confirms, sized from the hosted qualification's drains (refs #414) Ruling 1ea561bc:842: one constant, three times the slowest measured drain (AppKit's worst post-to-edit lag, 59.9 ms); a field takes the text within 820 ms. Tests derive the window from the constant; the docs sentence and the Decision Log follow. Sminos-Session: cursor235#b93055dd (cua on macbook)
…oncealed failure after posting answers at one deadline (refs #414) Ruling 1ea561bc:842: the dwell is three times AppKit's gap p99 of 72.6 ms (n=269); a field takes the text within 780 ms. The review of cbce12e..1f69470: every concealed failure into a password field after posting, a snapshot refusal included, answers at the post-typing boundary + the budget + typeReadbackFocusReadCapMs, waited against the clock; a held match whose focus read fails reads as a lost match with one focus read more; a read that returns after the budget cannot confirm. A concealed success still ends early. Sminos-Session: cursor235#b93055dd (cua on macbook)
…post + 1100 ms by construction, its reason from the final batch and focus read alone (refs #414) The review of 1f69470..f217f06: one origin, the last key event's post (where endedAt is stamped); the cutoff C and the deadline D computed from it once; every AX call of the read-back bounded by the time left to its limit with a 50 ms floor; a concealed failure's reason a function of the final length batch and the final focus read only; the reply waited for until D on the monotonic clock, a late one flagged lateReply; a success's confirming read finished by C. A seeded property test (0x414_F217, 2000 cases) randomizes read and post costs, field behaviour and secret length. The drain allowance is 730 ms. Sminos-Session: cursor235#b93055dd (cua on macbook)
…d slots, and a focus read that cannot answer is unknown, never a moved focus (refs #414) The review of f217f06..4517236 and the hosted qualification on 4517236 (78 of 150 concealed controls fieldChanged, 0 of 75 literal): the bound refused the concealed final focus read once a slow last batch left under the 50 ms floor, and a refused read was taken as a moved focus. Now the final batch starts at C - floor and the final focus read at C with its own 100 ms; the floor only schedules; focus is focused, moved or unknown, unknown barring success and leaving the reason to the final batch; noLongerSecure outranks a moved focus; lateReply is decided after the padding with a 10 ms tolerance. The property test runs two secrets over one field timeline. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ms timeout in fixed slots, with no shrinking bound (refs #414) Live on 2e011db: fieldUnreadable on 62 of 150 concealed controls and lateReply on 138 of 155. The final batch's timeout was shrunk to the time left and timed out on background apps; a timed-out request still occupies the app, so the final focus read queued behind it and ran past D. Now every read keeps typeReadbackMessagingTimeout; regular reads start by C - 200 ms, the final batch at C - 100, the final focus read at C, D = C + 100; a field takes the text within 680 ms. A second seeded property run (0x414_F218, 2000 cases) uses live read costs. Sminos-Session: cursor235#b93055dd (cua on macbook)
…n Log, and a test flake (refs #414) The final pin 405b63b passed every behavioural gate on five hosted lanes (run 44386516599): 100/100 positives, 0/150 false adds, 0/150 fieldUnreadable and fieldChanged, reason parity, privacy 0, both seeded properties. lateReply was on 137/155 failures; reply time reaches only _meta, so it stays informational, and #423 takes it up. 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 was referenced Nov 18, 2026
…en two sampled reads, and a failure answers when it is known (refs #414) Ruling 1ea561bc:851 on the review of 4a005a8..a1939d2 drops the fixed-deadline, fixed-slot schedule: no D, no padding sleep, no lateReply, no final batch or focus read in a reserved slot. One poll serves literal and concealed requests; a batch starts only while a messaging timeout is left of the budget, and a match confirms only on a hold whose start and end are both sampled reads 220 ms apart, its focus check one AX call completed inside the budget. The allowance stays 680 ms (1000 - 100 - 220); the docs add that a failure's time can depend on the text typed (#423). - P1-1, P1-3: fixed by the rule change; no unsampled slot, and a success's focus check must complete by the cutoff. - P1-2: a password field's focus check is one call, by how the snapshot found the field (AXFocusedUIElement again, or the field's own AXFocused for the walk's and the marker route's); ReadbackLookup gains .walk. - P1-4: the concealed reason order is noLongerSecure, fieldUnreadable, a moved focus, the rest; a password field's fieldUnreadable takes the may-show remedy natively and in the wrapper's secretMayShow. - P2: a failed marker focus read is unknown; the literal overrun test reaches its overrun and asserts the cost was incurred. - P3: the property runs' stubs no longer retain themselves. Sminos-Session: cursor235#b93055dd (cua on macbook)
… and focus read alone, and a hold check only gates success (refs #414) The review of a1939d2..e8e2702: - 1 (P1): a concealed request's hold check that finds the focus moved, unknown or late never ends the poll or sets the reason; whether a hold comes at all can depend on the secret. A literal request still answers fieldChanged at once. - 2 (P1): a concealed request that ends without success always reads one final length batch, outside the start limit, then (unless it closed noLongerSecure or fieldUnreadable) one focus read; those two alone decide the reason. Nothing seen mid-poll is latched. - 3 (P1): an overshoot taints a concealed poll, as a changed reply does. - 4 (P1): a password field's roleUnreadable (classified by the lookup, its role then unreadable) takes the may-show remedy natively and in secretMayShow. - 5 (P2): a literal poll that took no batch answers fieldUnreadable; so does a concealed reason with no batch. - 6 (P2): a batch's own start judges both the start limit and the hold. Sminos-Session: cursor235#b93055dd (cua on macbook)
…d, and a subrole it cannot read is no secure field (refs #414) The review of e8e2702..3b67bf4: - 1: a concealed request's final batch no longer presumes a field secure on a failed subrole alone (a role other than AXSecureTextField): it answers fieldUnreadable, with the may-show remedy, so a field seen visible mid-poll keeps its warning. Regular poll batches still presume secure and go on. - 2: a concealed failure makes its one focus read first, then the final batch, so the classifying read is the last before the reply; the reason order stays. - 3 (ruling 856, a residual): hold checks in a field whose state matches one secret's length can change that secret's failure reason, revealing nothing the outcome does not. The docs' limit sentence now covers the reason as well as the timing, byte-identical in all four copies (#423). Sminos-Session: cursor235#b93055dd (cua on macbook)
… and the concealed reason's read order is stated apart from its precedence (refs #414) The review of 3b67bf4..8bc291f, docs and comments only: - P2: the limit sentence drops its qualifier, byte-identical in all four copies: "When it fails, how long it took can depend on the text typed, a `{{secret:…}}` included, and so can its reason." A field that unmasks on a timer can give a short and a long secret different reasons through posting time alone; the Decision Log's Wave 11 residual names that form beside the hold-check one (#423), and a test documents it. - P3: readbackConcealedReason's comment, and the one at the final batch, say the focus read comes first and the final batch last, and that noLongerSecure and fieldUnreadable win over a moved focus without skipping its read. Sminos-Session: cursor235#b93055dd (cua on macbook)
…851 (refs #414) Run 44423869307: all five lanes green. 100/100 positives, 0/150 false adds, 75/75 drops refused, no fieldUnreadable or fieldChanged on exact controls, reason parity, privacy 0. The design history gains waves 9-11, and the reply time limit points at #423 as re-scoped. Sminos-Session: cursor235#b93055dd (cua on macbook)
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
Today:
type_textinto a password field types the text, then answers unconfirmedsecure. It reads nothing back, so an agent can't tell a delivered password from a dropped key.Now: the engine confirms a password field by its length, under ruling 1ea561bc:808. It never reads a character.
How it confirms:
NSSecureTextFieldhas no count, so it confirms by the caret moving from an empty selection to right after the text (ruling 839).confirmation:"length"and a fixed note: "Typed into a password field, confirmed by its length only: …" (ruling 833). The reply never carries a count, length, range or value.The hold (rulings 842 and 851).
typeReadbackLengthDwellMs= 220 ms apart, agree within the 1 s budget, followed by one focus call that answers "focused" in budget.Concealed failures (
{{secret:…}}).noLongerSecure, thenfieldUnreadable, then a moved focus (fieldChanged), then the rest.noLongerSecure, and with a secure field'sfieldUnreadableorroleUnreadable. Natively it replaces thegetAXState()advice, and the secret wrapper adds its fixed sentence (secretMayShow).caretMismatch.{{secret:…}}included, and so can its reason."Files:
native/engine/Sources/Engine/TypeReadback.swift: the poll, the hold, and the concealed ending.TypeReadbackLength.swift(new): the length and caret rules, the reason order, and the note.TypeReadbackMarker.swift: macOS engine: background Safari on a large page can't find the focused field for type_text's read-back (text-marker route) #395's Safari route reaches password fields, and a failed focus read is unknown.Input.swift: the success note in the reply.AX.swift: small changes.src/services/sky.mjs: the note reaches the tool result's text.src/services/secret-input.mjsandsrc/services/engine/service.mjs: the may-show sentence.Docs:
agent-cursor.md, with its oracle and core-documentation copies;tech-debt-tracker.md: a hosted test flake seen on this branch.Plugin 0.28.16 (ruling 840).
Evidence
Hosted macOS only: kit
probe/414-qual, workflow422774845. docs/evidence/2026-11-18-secure-type-confirm/README.md has the detail.The final pin
8bc291f1was run against main517ab543in run 44423869307. It covered CfT 157, Electron 44 (default and MAWS-parity), Safari 27.2 (a 1,600-node page, background) and AppKit (frontmost). The PR head adds only docs and comments.secure)fieldUnreadable/fieldChangedon exact controls0x414F217, and0x414F218with live read costs)Earlier runs:
1f69470e(run 44356891906). 290 of 300 ASCII positives were length-confirmed and all 300 were exact: AppKit's 10 selections answeredlengthUnreadable. 0/100 adds were confirmed, and 50/50 drops refused. The CfT and Safari schedule audit passed 10/10 pairs each, with no AXValue, AXValueDescription, AXSelectedText or parameterized read on the password element.lateReplywas set on 137/155 failures.ci-gate(plugin, test, engine-swift) on84562002: GREEN, run 44424846617. This head adds only the evidence file.Limits
secure textfrom then on.fieldUnreadable.notTextField: macOS engine: background Firefox reports the previously focused field as focused, so type_text reads back the wrong field #419.startedAt/endedAt) is only in_meta(cua/actionInterval).Review
Rulings 1ea561bc: 808, 822, 826, 833, 839, 840, 842, 850, 851, 855, 856.
Closes #414
Sminos-Session: cursor235#b93055dd (cua on macbook)