Skip to content

macOS engine: type_text's paste route posts a Return across a classification change its effect reading saw #600

Done

Description

@SSFSKIM

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, classifyingAttributes plus range and count. At :1010 it sets reading.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 is secure and 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) }. With lastSeen true, 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 same pasteEffectSeen secure-count rule;
  • :593: the same if case .returnKey = part, lastSeen {} else { try beforePart?(index) };
  • :647: lastSeen = confirmed;
  • :1000/:1005: focusedEffectReading with reading.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

  1. A multiline type_text on the paste route (an input method, or a background app whose source is unknown), into an open text field.
  2. 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).
  3. The effect batch reads secure with the count moved by line 1's length. The line counts as seen, lastSeen is true, and the Return goes out without the checkpoint.
  4. Line 2 is pasted into the password field.
  5. If the field turns back to text before the final poll, the final poll can read the expected value and confirm.

Done when

Board

Bug, P2. Blocks #506. Parent #117. Relates to #587.

Sminos-Session: cursor235#b93055dd (cua on macbook)

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P2
    on Nov 28, 2026
  2. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 28, 2026
  3. SSFSKIM commented on Nov 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: cursor235 taking under ruling 1263, after #602; stacked on #607

  4. added
    status:in-review
    and removed
    status:in-progress
    on Nov 28, 2026
  5. SSFSKIM commented on Nov 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: PR #611; review converged round 5

  6. removed
    status:in-review
    on Nov 28, 2026
  7. SSFSKIM commented on Nov 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: Landed via PR #611 (cua 0.30.5, engine 0.2.4); proven in full split C 46165236186

  8. SSFSKIM commented on Nov 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: merged in #611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions