Skip to content

macOS engine: type_text's paste route gates every ⌘V and Return on the field's classification (#600) - #611

Merged
SSFSKIM merged 35 commits into
mainfrom
fix/600-paste-transport
Nov 28, 2026
Merged

SSFSKIM merged 35 commits into
mainfrom
fix/600-paste-transport

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Closes #600.

#601 and #607 have merged. This branch merges origin/main (96d71cf), bumps the plugin to 0.30.5 and the engine to 0.2.4 (7147de8). Review range: 0a65832de..edfac2f3b (the main merge is 7976269).

What changes

On type_text's paste route (an input method, or a background app whose source is unknown), each line is pasted with ⌘V and each newline is a Return. Before this change, nothing held the field the read-back snapshotted between posts:

So a field that turned into a password field mid-paste received the Return and then the next line, and could even confirm.

R3: the post gate (ruling 1273)

Two review rounds showed that holding the transport at its reading points kept missing new text shapes. Safety now rests on the posts themselves.

  • One posting function. On type_text's paste route, every ⌘V and every Return goes through runPaste's one posting function (posting, Paste.swift:589). transport.gate runs inside the delivery, immediately before the press's events, with nothing posted in between (:599). A gate that stops posts nothing, and its error is raised once the delivery returns.
  • The gate (TypeReadback.transportGate, TypeReadback.swift:1049) makes a classification-only read of the field the snapshot classified, its role and subrole, and holds it to the baseline through readbackClassify, R1's function.
    • When the snapshot found the field as the application's focus, the gate also reads that focus (:1061). It must still be the field; another element is fieldChanged.
    • When the walk or the marker route found the field, the saved handle must still read and classify the same.
    • It reads over the paste's prepared application element (PasteTarget.application, its 1 s messaging timeout), and so do the live effect samples.
  • It fails closed. A read it cannot complete stops the paste as fieldUnreadable: an AX error, a timeout, a destroyed element, a focus naming no element, or a subrole that cannot be read, even on a password field whose read-back would presume it secure. Any difference stops it with R1's reason (becameSecure, noLongerSecure, fieldChanged), before the post. A check is never skipped.
  • For walk- and marker-found fields, the gate also reads the field's own AXFocused (fieldFocused). A field still present and open but no longer focused (the focus moved to a password field) is fieldChanged; an unknown answer is fieldUnreadable (ruling 1275).
  • The deadline is checked again inside the delivery after a gate that passed, so a slow gate read never posts after expiry.
  • A request whose lookup found no element at all (noFocusedElement, with no walk or marker claim) holds "no field" as its baseline (rulings 1274 and 1275). The one change it can tell is a password field appearing.

The secure latch, the paste route's one rule (ruling 1276)

Any explicit secure observation latches becameSecure, and nothing more posts: AXSecureTextField by role, or by subrole, from any sample or from the gate's own reads.

  • The samples are a line's effect baseline, its wait, a Return's settle and a notification's field hold, of any element.
  • The answer is stoppedBeforeKey, or "Nothing was typed" plus beforeInput when nothing was posted.
  • It applies where the field held is not a password field, or where no field is held.
  • An inconclusive reading latches nothing: a failed read, no element, or an answer that is not secure. Where no field is held, the paste then posts under macOS engine: type_text that finds no focused element answers typeUnconfirmed where the vendor answers ok (declared limit) #597; where one is held, the field's own classification decides.
  • Role and subrole are read and checked independently everywhere, so a failed role read never skips the subrole.
  • The latch lives in one function, TypeReadback.transportObserve (TypeReadback.swift:1031). Every sample and every gate read feeds it:
    • the field hold, used for notifications and attribution (:1045);
    • every effect sample naming an element (:1055);
    • the no-field gate's focused element (:1097);
    • the held-field gate's role and subrole (:1122).
  • transportStop (:1144) consults it at the gate before every ⌘V and Return, and after every wait and settle.

The latch (ruling 1275)

Once the lookup found an element (the application's focus, a walk or a marker claim), the snapshot's R1 refusal of it is terminal, on both the keyed and the paste route:

  • a transition (fieldChanged, becameSecure, noLongerSecure);
  • a read of it that failed (roleUnreadable, fieldUnreadable);
  • a claim the marker route closed.

It is decided in one place, the snapshot's exit (readbackSnapshot, TypeReadback.swift:684 and :699), the same place as R2's selection gate. Nothing is typed or pasted, and the answer is "Nothing was typed" with R1's reason, or the failed read, plus beforeInput. A password field's answer keeps its remedy, with no observation advised. Only a lookup that found no element at all types on (#597).

The keyed route's contract change. A snapshot R1 refusal used to type and then answer typeUnconfirmed; it now types nothing. Every such snapshot outcome was already an error (finish throws for every refused plan), so no former success becomes a refusal. The outcomes that used to type and now don't:

  • fieldChanged (a claim read as another role; a change the wait, the settle or a retry saw);
  • becameSecure, noLongerSecure;
  • roleUnreadable, fieldUnreadable after an element was found;
  • the marker route's closed claims (secure, roleUnreadable, fieldUnreadable).

All of them were typeUnconfirmed before.

For the answer, not for safety: every reading of the effect watch is still classified at the reading (transportHold, :1011), so a line or a Return the watch saw change is not counted.

  • After a line's wait and a Return's settle, stop raises that change before the line counts (confirmed, entered) and before pasteUnconfirmed or returnUnconfirmed, withholding the next Return.
  • A notification, which reads nothing, has the field classified first.
  • The stops after a line's baseline and a Return's baseline were redundant with the gate that follows each of them, and are deleted.

Standalone paste is unchanged. The paste method has no read-back and no gate. Its reading is #187's effectReading (now effectSample(…).reading, the same reads), and #187's and #405's effect rule, the secure-count rule included, stays as it was.

Verification

  • Swift engine suite: 1842 tests, 2 skipped (main's existing two), 0 failures. New tests (PasteActivationTests), over generated text shapes: "\nab", "ab\n", "ab\n\n", "a\n\nb", "ab\r\ncd", "ab\n\ncd" (an empty line), "ab" (one line), "ab\ncd". Each runs in a text area and in a single-line field, found by the application's focus, the walk or the marker route: 48 shapes.
    • The structure, by a recording fake: testEveryPostOfThePasteRouteIsImmediatelyPrecededByAGateThatCompared.

      • The trace logs every gate (and whether it compared), and the harness logs every keyboard event posted.
      • Over all 48 shapes it asserts that every press's events lie after a gate that compared, with exactly one press per gate and nothing posted before the first gate.
      • It also asserts that every classifying read of the transport (the effect's sample, the application's focus, the field's role and subrole outside the read-back's own points) runs inside a hold or the gate.
    • The table: testThePostGateStopsEveryTransitionBeforeItsEvent, over the 48 shapes × every gate position (each shape's unchanged run lists its gates) × 9 transitions:

      • a role change (text → text), text → non-text, open → secure by role, open → secure by subrole, a subrole change while open;
      • the role unreadable, the subrole unreadable;
      • the application's focus on another element, the application's focus naming no element.

      Expected counts come from the gate position itself: the ⌘Vs and Returns posted before it. Each run also asserts R1's reason (or fieldUnreadable), the pasteboard restored, stoppedBeforeKey for a withheld Return, and beforeInput and "Nothing was typed" only when nothing was posted. For a walk or marker lookup, the two focus transitions go on unchanged. Size: 118 gate positions × 11 transitions = 1298 runs; the structural test checks 118 posts over the 48 shapes.

    • No field (ruling 1274): testTheNoFieldGateStopsOnlyAPasswordFieldAppearing. The same 16 shapes (8 texts × the two field kinds) are run with no focused element found, across every gate position: 44 positions × 5 transitions = 220 runs.

      • A password field appearing, by role and by subrole, stops at that gate, with the exact counts before it.
      • A plain field appearing, or the focus read failing, posts everything as before.

      The structural test also covers these lookups. Every press follows a no-field gate, whose focus read runs inside the gate. That makes 162 posts over 96 shapes.

    • The secure latch (ruling 1276): testAnExplicitSecureSampleLatchesWhateverTheGateReadsAfter. Every effect sample point of every shape that types (the three field lookups and no focused element) is run × a password field by role, and by subrole, sampled there, with the application reporting no focus at the gate from then on: 4408 runs.

      • Each run asserts becameSecure, exactly the ⌘Vs and Returns posted at the sample, and beforeInput and "Nothing was typed" only when nothing was posted.
      • Both tables also gain a gate row with the role read failing and the subrole secure, answering becameSecure: the R3 table now has 11 transitions, and the no-field table 5.
      • Mutation checks: dropping the samples' feed fails 4990 assertions; reading the subrole only after a role read succeeds fails the no-field table 138 times.
    • The latch (ruling 1275):

      • TypeReadbackTests.testTheLatchTypesNothingAfterASnapshotR1Refusal (keyed): a walk's claim read as another role, a claim whose role re-read fails, and the stable wait's change. Each gives 0 keys, beforeInput and the exact sentence. No focused element still types.
      • testTheLatchHoldsAChangeThatRevertedBeforeTheFirstPaste (paste): a retry's re-classification sees secure, then it reverts. Nothing is pasted, and the pasteboard is untouched.
      • testTheLatchPastesNothingAfterASnapshotR1Refusal: a closed claim; a claim whose role re-read fails.
      • The structural test now covers those lookups too: nothing posted, no gate.
      • The R1 table (testEveryClassificationPointHoldsTheFieldToItsBaseline) asserts 0 keys and "Nothing was typed" for every snapshot-phase R1 refusal.
    • Focus moved off a still-open field (P1-3): a transition in the R3 table (fieldChanged for all three lookups). In the structural test, a run per shape stops at its last gate with no press after it, through the gate's application-focus read (focus) or its fieldFocused read (walk, marker).

    • testAnEffectSampleOfAnotherElementCountsWhateverItsRole: identity before the role.

    • testAGateThatOutlastsTheDeadlinePostsNothing.

    • testTheGateFailsClosedOnAPasswordFieldsUnreadableSubrole now asserts the exact sentence: the failed read and the password field's remedy.

    • testATransitionAReadingSawStopsBeforeTheNextPost: for the answer, a change any effect reading saw stops no later than the next post, with the counts at that reading.

    • testTheGateFailsClosedOnAPasswordFieldsUnreadableSubrole.

    • testAChangeTheSettleSawWithholdsTheNextReturn: "a\n\nb", stoppedBeforeKey.

    • testAStopBeforeAnythingWasPostedSaysNothingWasTyped: the exact sentences.

    • testATransitionWithAnUnmovedCountIsR1sReason: the field takes nothing from the first ⌘V on, and the wait's first reading sees it turn secure. The answer is R1's reason, not pasteUnconfirmed, nothing is entered, and the Return is withheld.

    • testStandalonePasteKeepsItsEffectRule.

    • Updated: PasteReadbackTests.testAPasswordFieldIsConfirmedByItsLengthAndNeverRead. The live samples now go through the read-back's AX layer, so its stub password app finally exposes the effect channel it always had live. A paste one character short is then pasteUnconfirmed by macOS engine: observation never reads a secure field's value, length or selection (protection is the AX provider's today) #405's count rule, as it is live, where the stub used to answer lengthMismatch from the read-back's poll for want of a channel.

  • Mutation checks (each reverted):
    • removing the gate call fails the structural test and the table 543 times;
    • removing the gate's application-focus comparison fails it 139 times;
    • removing the gate's fail-closed subrole check fails the password-field test.
  • Standalone paste's existing tests pass with no edits:
    • SecureFieldTests: testAPasswordFieldsPasteReadingStaysInTheEngine, testAPasswordFieldsPasteIsJudgedByItsNumbersAlone, testAPasswordFieldsPasteNeedsANumberItRead;
    • NullClassifyingSlotTests, NeverSecureRoleTests and PasteOperationTests.
  • Node: services-sky, services-engine-service and doctor-engine, 105/105.
  • ci-gate: GREEN on edfac2f (run https://github.com/SSFSKIM/cua/actions/runs/46163539673): the five gates its plan ran (plugin, engine-swift, engine-swift-xcode27, test-1, test-2). Earlier heads: 241e7df GREEN (46161308523), 577dde1 GREEN (46158999326).
  • Nothing GUI or live AX ran on the MacBook.
  • Live proof: it goes with the flip's full split C on feat/117-m5, which carries this branch (ruling 1263). No separate proof run is planned: the paste transport has no matrix cell of its own that differs from C's.

Reviews

  • reviewer-high round 1 (0a65832..5e199e8): incorrect. Fixed under ruling 1272 in 5e199e8..ccaa4e7: the one reading hold, P1-1, P1-2, P2-3, P2-4 and P2-5.
  • reviewer-high round 2 (5e199e8..ccaa4e7): incorrect, with 3 P1s, each a post across a detectable change. Ruling 1273 moved the guard to the posts (R3), in ccaa4e7..577dde1 (7976269 merges main; 8e202af is R3; 577dde1 bumps the plugin to 0.30.5):
    • (a) A snapshot from the application's focus, and the page swaps the field for a password field. The gate reads the application's focus, finds another element, and answers fieldChanged before the Return.
    • (b) A sample naming no element. The gate never relies on the sample: for a focus snapshot, a focus naming no element is fieldUnreadable, and for every snapshot the field's own handle is read.
    • (c) "ab\n\n" in a text area. The second Return has its own gate.
    • The P2s:
      • the prepared application element is used for the samples and the gate;
      • "a\n\nb" passes returnNext, so a second Return the settle withheld is stoppedBeforeKey;
      • the unmoved-count test is fixed: the field ignores input from the first ⌘V on, the classification changes at hold 2, and the count stays unchanged.
  • reviewer-high round 3 (7976269..577dde1): incorrect, with 3 P1s. Under ruling 1275, which folds in 1274's narrowing, fixed in 577dde1..241e7df (d476d13 is 1274's no-field gate; 241e7df is 1275):
    • P1-1, P1-2 → the latch. An R1 refusal at the snapshot is terminal on both routes, so nothing is posted after R1 saw a change, even if the field reverts.
    • P1-3 → the gate reads fieldFocused for walk- and marker-found fields.
    • The P2s:
      • identity before the role in the effect hold;
      • the deadline checked again after a gate that passed;
      • the password field's exact pre-input sentence.
    • The no-field exemption is narrowed to a lookup that found no element at all.
  • reviewer-high round 4 (577dde1..241e7df): it confirmed round 3's P1s closed and the keyed-route claim, and found 1 P1 and 1 P2 in the no-field path. Under ruling 1276, both are fixed in 241e7df..edfac2f by the one secure latch:
    • P1: an explicit secure sample after a no-field snapshot was dropped, so the paste posted when the app reported no focus at the gate.
    • P2: the no-field gate skipped the subrole read when the role read failed.
  • reviewer-high round 5 (241e7df..edfac2f, bounded): correct, no material findings. It judged the latch's stop sound when a walk-found open field conflicts with the application's explicitly focused password field: the application's focus decides where keys go. Review has converged.

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

…ith a note; a failed read is read again (refs #587)

#587 (ruling 1219): a focused element that is not a text field (Finder's type-select in a
list or outline) threw typeUnconfirmed (notTextField) after its keys landed; the vendor
answers ok. Both routes now answer success with a note that the text could not be read back
and the app should be observed before relying on it or typing it again; the record keeps
confirmed: false and the reason. noFocusedElement takes the same contract: the vendor's
targetForKeyboardEvent answers the app's pid when focusedUIElement is nil, with no error,
and posts without reading the element (F §5.7, the pinned helper's 0x1006f645c). A text
field's read-back, the password reasons and selectionChanged are unchanged.

#590 (ruling 1225): a role, value or range read at the snapshot (settle and wait included),
and a role or subrole read in a poll, that answers nothing is read again up to 2 times, 15 ms
apart, while its phase has time (the request's time left less one messaging timeout; the
poll's budget). Only a failed read is retried; a mismatch never becomes ok. On an unreadable
reason the record carries readFailure {phase, read, axError, retries, msSinceLastKey, role,
subrole}, never a value; concealed and password records drop the counts and time.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ilure rides as cua/typeReadback (refs #587)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…try, the record's readFailure, the unretried focus check (refs #590)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…failed reads are retried (refs #587)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…nished with no field; a retry never reads past its first try (refs #587)

Ruling 1244 on the review of e54eab4..106d201, with ruling 1242's narrowing.
- P1-1: a concealed request with no field stays typeUnconfirmed and its remedy never advises a
  screenshot or getAXState(), whatever the search found.
- P1-2: the lookup has three outcomes: a field, .noField (the walk finished with none, and the
  marker route, when it ran, reached the web area), or nil, indeterminate, which throws as
  before. The walk answers ReadbackWalkOutcome; the app's own answer of no focus is never
  enough (background Safari answers so over a focused field).
- P1-3: a value or range retry, in the snapshot and its settle, runs only after the role and
  subrole are read again and still classify the field.
- P1-4: a poll's role read naming AXSecureTextField or another role ends the check whatever its
  subrole read answers.
- P2-5: a field the lookup took for a password field is classified by one role read, never
  retried.
- P2-6: no field under select_text's range is selectionChanged, nothing typed or pasted.
- P2-7: the keyed route's retries and polls are bounded by the request's deadline.
- P2-8: readFailure keeps the role and subrole last read successfully.

Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
…the invariants and the record (refs #590)

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

The plugin manifests take main's descriptions and 0.30.0; the next commit bumps to 0.30.1.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ailed reads are retried (refs #587)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…rows as before; a secret's answers never advise observing (refs #587)

Ruling 1247 on the review of 106d201..d51ae68.
- noFocusedElement throws typeUnconfirmed exactly as before #587 (a declared limit): .noField,
  the marker's .noField and ReadbackWalkOutcome are removed, the walk and marker route answer
  as before except as below.
- c: a field the walk or marker found by a text-entry role (ReadbackFound.field's role) that
  the snapshot reads as another role answers fieldChanged, never notTextField.
- b: a password field the marker classified but whose focus or place under the web area it
  cannot show closes as a password field's (fieldUnreadable, secure), whatever the walk finds.
- d: a concealed request's typeUnconfirmed, every reason, ends with a remedy that names no
  observation (readbackConcealedRemedy, or readbackConcealedMayShowRemedy).
- e: under select_text's range the nil lookup (and a closed password claim) answers
  selectionChanged before any key or ⌘V.
- h: after a retry's re-classification, the retried read starts only while the bound allows.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…g the app (refs #587)

Ruling 1247 (d). secretMayShow classifies 'passwordField' (as before) or 'unplaced' (notTextField,
noFocusedElement, fieldChanged and every other reason posted without confirmation); every sky
failure that may have entered part of the secret carries a warning of that kind, worded without
a screenshot or getAXState; a userChanged intervention once entered asks the user to check where
it went instead of re-querying. The test runs every branch after the first key.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ment a declared limit, the secret rule (refs #590)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…t's range comes before it (refs #587)

Ruling 1249 on the review of ef383ad..75481fd.
- (1) The role the walk or the marker route found a field by is compared with the snapshot's
  before anything else is read: a password field's role or subrole answers becameSecure, any
  other difference fieldChanged; no value, range or length is read. A field the lookup took for
  a password field keeps its own check (noLongerSecure); the application's focus is not compared.
- (2) Under a pending select_text range, any outcome that cannot hold it (a changed role, a
  non-text or secure non-field element, the nil lookup, a closed claim) answers selectionChanged
  before any key or ⌘V.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…till advise get_app_state after a secret's first key (refs #587)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ion gate (refs #587)

Ruling 1250 on the review of 75481fd..c96a7cc, replacing the case-by-case guards.
- R1: a field's classification is ReadbackIdentity (role, subrole if read, open|secure). The
  lookup's is the baseline when it classified the field (the walk's role, the marker's role and
  subrole), else the snapshot's first read. Every later classification (the snapshot's first
  read, #359's wait, the settle, poll and checkpoint, every retry's re-classification, each
  length batch) goes through readbackClassify alone; any difference ends the read-back:
  becameSecure, noLongerSecure, else fieldChanged. Only components the baseline read are
  compared; the walk's first subrole is adopted.
- R2: under a pending select_text range, readbackSnapshot lets only a verified-range .expect
  through; every other answer is selectionChanged there, before any key or ⌘V.
- Deleted: wave 3's already-classified skip and foundRole comparison, the per-path selection
  checks of waves 2 and 3, fieldClosed's own role branches, readbackFieldClosed, readbackLength's
  own classification checks, and ReadbackFound.field's password and role (now identity).
- The proof: a table of 16 classification points x their transitions x selection pending (196
  keyed runs; 49 on the paste route), asserting outcome, keys and ⌘V; round 4's three cases
  by name.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…R1; AXGroup's unread subrole is open at the final batch (refs #587)

Ruling 1254 on the review of c96a7cc..4b07ce0.
- P1-1: stillFocused now answers ReadbackRefocus, the focus and the role the walk read of the
  field it found again; that role goes through readbackClassify (a role-only reading), so a
  field that turned AXSecureTextField or another role between the last value read and the check
  ends the read-back, and a checkpointed Return is not posted. Two table rows.
- P2-2: the concealed final batch's failed-subrole exception applies only where the role leaves
  security open: not AXSecureTextField, not neverSecureRoles (#525). AXGroup with an unread
  subrole answers noLongerSecure again; AXGroup still secure by a read subrole, fieldChanged.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…oes down the length path (refs #587)

Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
…d (refs #602)

The input meta gains `beforeInput: true`, sent only where the engine knows the
request stopped before any key, ⌘V or Return, or value write went out: keyText
before its first key (a stop there is userIntervened as one between keys is),
the keyed read-back's selection gate, runPaste before its first post,
pasteOperation before runPaste, setElementValue before the write, each of
type_text, paste and set_value before its stretch begins, and the request's
prologue. Ruling 1260: never inferred from a null startedAt.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…t record; plugin 0.30.3 (refs #602)

secretUnentered replaces the startedAt === null inference for every error:
the record, and no input or value effect in an interruption account when one
is present. startedAt null alone, an unparsed meta and the vendor's or an
older engine's reply answer "may have been entered", with no advice to
observe the app (ruling 1247 (d), whose sweep gains the new cases).

Sminos-Session: cursor235#b93055dd (cua on macbook)
…startedAt (refs #602)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…nput (refs #602)

The deadline still answers first; an input method's refusal there now carries
the input meta with `beforeInput: true`, since nothing was dispatched (review
of 0c39038..d87702f, P2-5; ruling 1268).

Sminos-Session: cursor235#b93055dd (cua on macbook)
…cord, a known phase and preparation-only effects (refs #602)

Ruling 1268, the review of 0c39038..d87702f: still interacting (P1-1) and
concealedInputUnavailable (P1-2) rest on the record like every other branch,
an interruption account counts only with a recognized phase and effects from
the engine's preparation-only list (P1-3), and the record is read only when
CUA_SKY_SERVICE names cua's own engine service (P2-4). Everything else is
"may have been entered", with no observe or retry advice.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…different targets (refs #602)

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

On type_text's paste route every effect reading (a line's baseline, its effect wait, a Return's
settle) hands the role and subrole its batch read to the read-back (focusedEffectReading's
classified, PasteTyping.saw, TypeReadback.transportSaw). Where the snapshot found the field as
the application's focus the reading is the field's and goes through readbackClassify against
the baseline; where it was found by the walk or the marker route, a classified reading makes the
next hold classify the field itself. runPaste holds (PasteTyping.holds, transportHolds) before
every ⌘V and Return, whatever lastSeen says, and after the last line: a transition ends the
read-back with R1's reason, no further ⌘V or Return. #602's beforeInput only when nothing was
posted. Standalone paste never takes the classified reading; its effect rule is unchanged.

Tests: a table of 98 runs (text area and single-line field x the reading a transition is first
seen at x 7 transitions x focus or walk), asserting outcome, exact ⌘V and Return counts and
beforeInput; standalone paste's effect rule kept.

Sminos-Session: cursor235#b93055dd (cua on macbook)
… every reading, a stop after each (refs #600)

Ruling 1272 on the review of 0a65832..5e199e8.
- The hold: on type_text's paste route the effect watch reads only through
  TypeReadback.transportHold, which takes the transport's one classifying read
  (ReadbackReads.effect: effectSample, #187's reads plus the batch's role, subrole and the
  element it read) and classifies it at the reading: a sample of the field through
  readbackClassify, any other the field's own role and subrole there and then (P2-3). A
  notification reads nothing: the hold classifies the field before it is relied on (P1-2).
- The stop: runPaste stops after every reading (a line's baseline, its wait, a Return's
  baseline (P1-1), its settle), before the line or Return counts, before a timeout's generic
  error (P2-4), the next Return withheld. Before anything was posted the answer says nothing
  was typed, R1's reason kept, beforeInput (P2-5).
- Standalone paste keeps #187's effectReading (now effectSample's reading, the same reads).
- Tests: a recording fake (ReadbackTrace) asserting every classifying read of the transport
  runs inside the hold and no post goes out unheld; a table generated from each scenario's
  holds x the R1 transitions (25 reading points, 6 scenarios), with exact ⌘V and Return counts.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…600-paste-transport (refs #600)

#601 and #607 were squash-merged: in every conflicted engine file main's content is this branch's
base (0a65832), so each resolves to this branch's side. The plugin manifests take main's 0.30.4;
the next commit bumps to 0.30.5.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…of type_text's paste (refs #600)

Ruling 1273 on the review of 5e199e8..ccaa4e7: the guard moves to the posts.
- runPaste's one posting function runs transport.gate inside the delivery, immediately before
  the press's events (TypeReadback.transportGate): a classification-only read of the field the
  snapshot classified (role, subrole) held to the baseline by readbackClassify, and for an
  application-focus snapshot the application's focus, which must still be the field. Fails
  closed: any read it cannot complete is fieldUnreadable; any difference R1's reason; before the
  post; stoppedBeforeKey, the pre-input sentence and beforeInput kept.
- Live samples and gate reads use the paste's prepared application element through the
  read-back's AX layer. The reading-point stops before a line's and a Return's post are
  deleted (the gate follows each); the stops after a wait and a settle stay for the answer,
  the settle's passing returnNext.
- Tests: a recording fake over 48 generated shapes (8 texts x text area and single-line field
  x focus, walk, marker): every press immediately after a gate that compared (118 posts); a
  table of every gate position x 9 transitions (1062 runs) with counts from the gate position;
  the password field's unreadable subrole; the unmoved-count test fixed.

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

Sminos-Session: cursor235#b93055dd (cua on macbook)
…pearing stops the paste (refs #600)

Ruling 1274. A request whose snapshot classified no field (no focused element found, an unreadable
role, a closed claim) holds "no field" as its baseline: before each ⌘V and Return, through the same
posting function, the gate reads the prepared application's focus once and classifies what it
names; AXSecureTextField by role or by subrole stops the paste becameSecure (stoppedBeforeKey, or
"Nothing was typed" and beforeInput). Any other answer posts as before, a failed read included:
#597's declared exemption, with no baseline to fail closed against.

Tests: the structural test over the no-field lookups too (96 shapes, 250 posts, each after a gate,
the no-field gate's focus read inside it); a table of the no-field shapes x every gate position x
4 transitions (528 runs) with exact counts.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ocused, and the narrowed no-field exemption (refs #600)

Ruling 1275 on round 3's review of 7976269..577dde1.
- The latch (readbackSnapshot, beside R2's gate): once the lookup found an element, the
  snapshot's R1 refusal of it is terminal on both routes, nothing typed or pasted:
  fieldChanged, becameSecure, noLongerSecure, roleUnreadable, fieldUnreadable, and every
  closed marker claim. The answer is "Nothing was typed" with R1's reason or the failed read
  and beforeInput; a password field's keeps its remedy. On the keyed route every such outcome
  already answered typeUnconfirmed: no former success becomes a refusal.
- The gate reads a walk- or marker-found field's own AXFocused (fieldFocused): a field still
  open but no longer focused is fieldChanged, unknown fieldUnreadable. The deadline is checked
  again inside the delivery after a gate that passed.
- The effect hold checks identity before the role for a focus snapshot.
- The no-field gate (1274) applies only where no element was found at all: #597's exemption.
- Tests: the latch on both routes (a claim read as another role, a failed role re-read, the
  stable wait's change, a retry's change that reverted, closed claims); the focus moved off a
  still-open field in the R3 table (1180 runs) and the structural test; identity first; the
  deadline after a slow gate; the exact password-field sentence.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…y sample and gate read (refs #600)

Ruling 1276 on round 4's review of 577dde1..241e7df. TypeReadback.transportObserve is the
paste route's one rule: any explicit secure observation (AXSecureTextField by role or by subrole),
of any element, from any sample (a line's effect baseline and wait, a Return's settle, the field
hold) or the gate's own reads, latches becameSecure where the field held is not a password field
or none is held, and transportStop posts nothing more. Role and subrole are read and checked
independently everywhere: a failed role read never skips the subrole. An inconclusive reading
latches nothing (#597 where no field is held).

Tests: every effect sample point of every typing shape x a password field by role and by subrole,
the application reporting no focus at the gate after (4408 runs, exact counts); gate rows with the
role read failing and a secure subrole in the R3 and no-field tables.

Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T16:23:56.969604Z 7147de8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

SSFSKIM added a commit that referenced this pull request Nov 28, 2026
… post gate and secure latch) into feat/117-m5; engineVersion 0.3.3 over both sides (refs #506)

Feat already carried main 96d71cf, #611's own base, so the new part is #611's 11 files. The merge has two merge
bases, 96d71cf and 0c39038, and the virtual base git built from them made conflicts in files #611 does not
change. They were resolved as follows:
- src/services/secret-input.mjs, src/services/sky.mjs, test/services-sky.test.mjs: feat's side, byte for byte.
  #611 does not change them against 96d71cf.
- .claude-plugin/plugin.json, marketplace.json: #611's side, plugin 0.30.5.
- native/engine/Sources/Engine/Version.swift: 0.3.3, above feat's 0.3.2 and #611's 0.2.4.
Paste.swift, TypeReadback.swift and #611's five test files are byte-identical to 7147de8. Methods.swift
auto-merged: feat's 25 lines and #611's 5. Against feat, the tree differs only in #611's files.

Sminos-Session: cursor235#b93055dd (cua on macbook)
@SSFSKIM
SSFSKIM merged commit a847150 into main Nov 28, 2026
8 checks passed
@SSFSKIM
SSFSKIM deleted the fix/600-paste-transport branch November 28, 2026 18:40
SSFSKIM added a commit that referenced this pull request Nov 28, 2026
… tree on Linux) into feat/117-m5 before the next full sitting C; feat's macOS engine side, 0.31.0's manifests (refs #506)

Merge base 96d71cf. Main also carries a847150, the squash of #611, whose branch 7147de8 feat merged
earlier. Against feat, the merged tree changes exactly #613's 164 files. 158 of them are byte-identical to
bf594e1. The other six auto-merged with feat's own changes: README.md, src/services/sky.mjs (#613's part is
Linux-gated), tech-debt-tracker.md, test/repl-parity/selection-oracle.test.mjs, test/runtime-launch.test.mjs and
test/services-sky-linux-policy.test.mjs.

Conflicts and how they were resolved:
- native/engine/Sources/Engine/Version.swift: feat's 0.3.3, over main's 0.2.4 from #611's squash. It is a version
  line, not code. Methods.swift, Paste.swift and TypeReadback.swift are unchanged against feat.
- .claude-plugin/plugin.json and marketplace.json: main's 0.31.0. The plugin's next version is left to the flip PR.

Sminos-Session: cursor235#b93055dd (cua on macbook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant