Repository navigation
Description
Problem
On the paste route, type_text pastes each line, then posts the Return before the next line. Whether that Return waits for the read-back's checkpoint depends on the paste's own effect check, not on the read-back. The effect check classifies the focused field again, but nothing compares that classification with the read-back's.
If the field becomes a password field while a line is pasted, and the effect batch shows the count moved by the pasted length, the line counts as "seen":
- The Return goes out across the transition without a checkpoint.
- The next line is pasted into what is now a password field.
- If the field changes back before the final poll, the request can even confirm.
#587/#590 (ruling 1250) made R1 hold at every classification point in type_text's read-back. This transport-side reading sits outside it.
Where (branch fix/587-590-typereadback @ 4b07ce0)
- The effect reading classifies:
native/engine/Sources/Engine/Paste.swift:1005(focusedEffectReading) reads one batch,classifyingAttributesplus range and count. At:1010it setsreading.secure = valueReadClosed(read), but only so the count can judge a password field. Nothing compares it with the field the read-back snapshotted. - A password field's line counts as seen when its count moves by the paste:
Paste.swift:139–143(pasteEffectSeen). If either reading issecureand both counts are known, a count that moved by exactly the paste, less the replaced selection, counts as seen. So a field that turned secure, and whose count moved by the line, counts as seen. - A seen line skips the checkpoint before the next Return:
Paste.swift:645–647(confirmed = seen == .notification || seen == .reading;lastSeen = confirmed). Then:593:if case .returnKey = part, lastSeen {} else { try beforePart?(index) }. WithlastSeentrue,beforePart, the read-back's checkpoint and so its R1 classification, is skipped for that Return, and the Return is posted.
The same on main (0ef5af1)
git show origin/main:native/engine/Sources/Engine/Paste.swift:
:141: the samepasteEffectSeensecure-count rule;:593: the sameif case .returnKey = part, lastSeen {} else { try beforePart?(index) };:647:lastSeen = confirmed;:1000/:1005:focusedEffectReadingwithreading.secure = valueReadClosed(read).
The branch did not introduce this. #587 only moved the read-back's own classification onto R1, and the effect reading was never part of the read-back.
The transition that triggers it
- A multiline type_text on the paste route (an input method, or a background app whose source is unknown), into an open text field.
- Line 1 is pasted. Before the effect batch reads it, the field becomes a password field: AXTextField's subrole becomes AXSecureTextField, or the role becomes AXSecureTextField (a page's show-password toggle, or the page swapping the field).
- The effect batch reads
securewith the count moved by line 1's length. The line counts as seen,lastSeenis true, and the Return goes out without the checkpoint. - Line 2 is pasted into the password field.
- If the field turns back to text before the final poll, the final poll can read the expected value and confirm.
Done when
- No line is confirmed, and no Return is posted, across a classification change. The paste route's effect reading of the field is held to the read-back's baseline by R1 (
readbackClassify). A seen line whose reading differs from the baseline runs the checkpoint (or ends the read-back with R1's reason) instead of skipping it. - A test: a multiline typed paste whose effect batch sees a classification change (open→secure by subrole, and by role) posts no Return after that line and answers R1's reason, with ⌘V and Return counts asserted.
- Standalone paste (the
pastemethod, which has no read-back) is unchanged. Its effect rule, the secure-count rule included, stays Fix Chrome background paste clipboard-read timeouts in composing@textedit rows #187's and macOS engine: observation never reads a secure field's value, length or selection (protection is the AX provider's today) #405's, with its existing tests passing unchanged.
Board
Bug, P2. Blocks #506. Parent #117. Relates to #587.
Sminos-Session: cursor235#b93055dd (cua on macbook)
Activity
SSFSKIM commentedon Nov 28, 2026
[board] in-progress: cursor235 taking under ruling 1263, after #602; stacked on #607
macOS engine: R1 holds at type_text's paste transport effect reading …
macOS engine: one hold for type_text's paste transport, classified at…
Merge origin/main (96d71cf: #601, #607, the Chrome 157 pin) into fix/…
macOS engine: R3, a post gate immediately before every ⌘V and Return …
Plugin 0.30.5: type_text's paste route gates every ⌘V and Return (refs …
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…
engine 0.2.4: the paste route's post gate and secure latch (refs #600)
SSFSKIM commentedon Nov 28, 2026
[board] in-review: PR #611; review converged round 5
macOS engine: type_text's paste route gates every ⌘V and Return on th…
SSFSKIM commentedon Nov 28, 2026
[board] done: Landed via PR #611 (cua 0.30.5, engine 0.2.4); proven in full split C 46165236186
SSFSKIM commentedon Nov 28, 2026
[board] done: merged in #611