Repository navigation
macOS engine: an inputSourceChanged stop states no count it can't stand behind (#616) - #619
Merged
Merged
Conversation
… reads back, else a range (refs #616) Ruling 1291. The count came from the units whose every event had gone out when the source check before an event saw the switch: a unit whose key down (which carries its text) went out before that check is in the field but not in the count, and keys posted before the check can still land after it. Now the source check throws InputSourceChange, and keyText answers it: - the field read back by the read-back's own machinery (TypeReadback.countAtStop: R1's readbackClassify, readbackPoll with ReadbackRetry, the focus check, a password field's length batch, never its value), a reading counting only once it held for the quiet window: "after 70 of 1079 characters were entered, as the field reads back"; - unread with a unit part-way: "after between 67 and 70 of 1079 characters were entered; the field could not be read back, so read it before continuing", meta enteredRange {low, high} and no entered; - unread with no unit part-way: the posted count, with the same remedy; - a concealed request: no count, no range, no read-back after the stop, and no advice to observe the app once anything may have gone in (ruling 1247, d). Sminos-Session: cursor235#b93055dd (cua on macbook)
…may have been entered" (refs #616) The engine service carries an inputSourceChanged stop's range as cua/enteredRange ({low, high}), reset with every call like cua/entered. The secret wrapper withholds the engine's sentence and never tells a count; its own sentence after a key may have posted said "it may have been partly entered", fewer than may have been when the stop came after the last key (the final source check). It now says "some or all of it may have been entered", on every failure after substitution. "Nothing was entered" still rests on the engine's beforeInput record alone, and no sentence once entry is possible advises observing the app (ruling 1247, d). Sminos-Session: cursor235#b93055dd (cua on macbook)
…it brackets (refs #616) The inputSourceChanged pattern takes the range's form ("after between <low> and <high> of <n> characters"); the lane keeps cua/enteredRange; a row answered with a range passes when the field holds exactly the text's first <length> units with <length> inside it (outcome.inRange), and the offline re-judge reads the same. Sminos-Session: cursor235#b93055dd (cua on macbook)
…stop's meta (refs #616) Sminos-Session: cursor235#b93055dd (cua on macbook)
…rvention sentences remain (refs #616) Sminos-Session: cursor235#b93055dd (cua on macbook)
…d reads everything posted (refs #616) Rulings 1294 and 1295, on the review of bf594e1..68165aa. - P1-1: the range's low end is the last prefix the field was confirmed to hold (the stop poll's last such reading, else the last checkpoint's, else 0), never the units sent whole; exact 0 only for a stop before any key down went out. - P1-2: a reading below what was posted is not settled however long it holds; the poll goes to the 1 s budget and then answers the range, with no place to resume from. Exact only when the field reads equal to everything posted (or more) for the quiet window, or its confirmed prefix already reaches what was posted. The length poll takes the same rule. - P2: where the caret must tell (a value that is the snapshot's own, an ending Return's placeholder line), only a value read after the caret read, still the same, counts. - P2: "x\n\n" with the caret at 2 after a stop past the first Return of "x\n\ny" is one Return, not two. - P2: a prefix ending inside a Unicode-string event's run maps to the request's units. - 1294 (2): a count above what was posted is accepted and marked readbackAbovePosted on the record. Range sentence: "...after between 67 and 70 of 1079 characters were entered; read the field before continuing." Sminos-Session: cursor235#b93055dd (cua on macbook)
…tures take the range's wording (refs #616) Sminos-Session: cursor235#b93055dd (cua on macbook)
…ge, and tallies range answers (refs #616) The sentence's count, or its range endpoints and total, must agree with cua/entered or cua/enteredRange and with the field's length, the field holding exactly that prefix, in the live judge and the offline re-judge (midSwitchAnswer). The section's midSwitchAnswers counts exact and range answers per engine and names every range on a readable field (every mid-switch field is one) for design (ruling 1294, 3). Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
…it may have been entered" (refs #616) The merge of main (b3b778e, #617) kept engineRecordTrusted: "nothing was entered" still needs the beforeInput record from a trusted engine, macOS's or Linux's. Every other failure after substitution, on either platform, now says "some or all of it may have been entered"; #617's Linux record test and its sky case assert that wording. Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
…against the posted prefix (refs #616) Ruling 1297, on the review of 68165aa..ad6c9c4 (an unsettled reading promoted to an exact count, and four rules the ordinary read-back already keeps). The stop's own poll is deleted: stopOffset, stopByValue and stopByLength with their dwell, caret, placeholder and Unicode-run rules. TypeReadback.countAtStop now runs confirm, the poll a finished type_text ends with, through the units posted, its budget from now: - confirmed, and no key that can leave the field posted: exact at the posted count; - otherwise the range, no resume offset: low the last checkpoint that read back (else 0), high the larger of what was posted and the furthest one classified reading of the field can stand for (its length beyond what the snapshot kept, mapped to the largest request offset putting no more in, a Unicode run unit for unit, capped at the whole request); - a reading past what was posted marks readbackAbovePosted on the record. Sminos-Session: cursor235#b93055dd (cua on macbook)
… total (refs #616) Sminos-Session: cursor235#b93055dd (cua on macbook)
… the ordinary read-back (refs #616) Sminos-Session: cursor235#b93055dd (cua on macbook)
…, only the least cua confirmed (refs #616) Ruling 1298, on the review of ad0630c..b15c556 (six of seven findings from the fallback read after confirm failed). - The fallback read is deleted: stopReading, stopReach, stopInserted. - Only an exact read-back carries a count and "type the rest from there" (P1-1); any other stop is unconfirmed, meta enteredRange {low, high: total}, no entered. Low: the last checkpoint that read back, unless confirm's own readings at the stop contradict it (a plain field's first difference inside the checkpoint's text, recorded as mismatchAt; a password field's length or caret mismatch), else 0. - "The input source changed part-way, so cua could not confirm how much was entered: at least 2 of 5 characters; read the field before continuing.", or without the "at least" when nothing is confirmed. - P1-3: a posted prefix ending in a Return is exact only with the caret read after it (a password field: only where its snapshot read a range). Stop-only; ordinary confirm's placeholder handling is unchanged. - readbackAbovePosted marks confirm's own readings of more than was posted (a longer value mismatch; a length poll's overshoot, recorded as lengthOvershot). Sminos-Session: cursor235#b93055dd (cua on macbook)
…l}, 0 <= low < total (refs #616) Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
…umber (refs #616) Ruling 1299, on the review of b15c556..9dd0e30 (every finding a positive claim on an unconfirmed stop). - Exact only when ordinary confirm confirms the posted prefix and that prefix holds no key that can leave the field and does not end in a Return; a password field the same, on the length path's confirm. Such a prefix is not read back at all. - Every other stop: "The input source changed part-way, so cua could not confirm how much was entered; read the field before continuing.", meta enteredRange {0, total}, no entered. - Deleted: stopCaretAfterReturn, stopContradicts and the checkpoint low end (confirmed, confirmedUnits), the "at least" sentence, mismatchAt and ReadbackExcerpt.firstDifference. - readbackAbovePosted marks any reading confirm took that showed more than was posted, on every exit, the length poll's held match left for more included (readbackLengthPast); a diagnostic from reads confirm already makes, deciding nothing. Sminos-Session: cursor235#b93055dd (cua on macbook)
…} (refs #616) Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
…umber (refs #616) Ruling 1299's pre-decided fallback, on the review of 9dd0e30..479030f, which reproduced a wrong exact count (a field expanding "a" to "ab" before taking "b": one stale read equal to the posted prefix confirmed 2 with 3 in the field; a password field that ignored the input confirmed by length and caret). - Every stop after a text-bearing key down reads nothing: "The input source changed part-way, so cua could not confirm how much was entered; read the field before continuing.", meta enteredRange {0, total}, no entered. Before any key down: "after 0 of N", entered 0. Concealed requests as before. - Deleted: countAtStop and the stop's confirm, the countStop plumbing, the exact sentence, readbackAbovePosted and its two setters in confirm, readbackLengthPast, and every test of the exact form. TypeReadback.swift and TypeReadbackLength.swift are byte-equal to main's. Sminos-Session: cursor235#b93055dd (cua on macbook)
… with beforeInput (refs #616) Ruling 1300. The service carries cua/beforeInput. After a key down the cell passes on no number with cua/enteredRange {0, total} and the field a prefix of the text; before any, on "after 0 of N" with cua/entered 0, cua/beforeInput and the field unchanged; any other number fails it, in the live judge and the offline re-judge. The hosted 67-against-70 case answers no number. 1294 (3)'s per-engine tally and rangeOnReadable are withdrawn. Sminos-Session: cursor235#b93055dd (cua on macbook)
…s gone out (refs #616) 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. |
SSFSKIM
enabled auto-merge (squash)
November 29, 2026 16:01
SSFSKIM
added a commit
that referenced
this pull request
Nov 29, 2026
…(cua 0.31.2) (refs #506) Versions: engineVersion 0.3.4, above feat's 0.3.3 and main's 0.2.5. The plugin is main's 0.31.2. Resolved by hand: - Input.swift: InputMeta keeps feat's concealedRefusal and main's enteredRange, and the wire sends both. keyText's doc and loop are #616's (downPosted; no number once a key down has gone out). The file differs from main only by feat's own M5 changes. TypeReadback.swift and TypeReadbackLength.swift equal main's. - InterventionTests.swift: feat's #186 every-boundary test (8198c50) asserted the withdrawn count at the key down, and it threw a plain EngineError, which #616's keyText answers as a generic error. It is rewritten to #616's rule at every event boundary: 0 and no range before any key down; otherwise no entered, the range the whole text, and the unconfirmed sentence. - secret-input.mjs and sky.mjs: #616's "some or all of it may have been entered" wording everywhere, feat's #212 account sentences included. droppedCharacter now reads "cua never types part of a secret or pastes it". No "partly" remains in src/services. #617's engineRecordTrusted is kept beside feat's concealedRefusal sentence. - The matrix: unicode-run.mjs and unicode-plan.mjs judge midSwitch with #616's midSwitchAnswer (none, zero or count; a count always fails). Feat's judgeMidSwitch is removed. lane.mjs's engine meta adds enteredRange and beforeInput. - Tests: services-sky.test.mjs and services-engine-service.test.mjs keep both sides, and feat's "partly" expectations take the new wording. unicode-run.test.mjs is main's. - The design spec's Text paragraph is feat's, with #616's three edits and the droppedCharacter wording. The wave-1 spec's #186 oracle line names midSwitchAnswer. - tech-debt-tracker.md keeps both sides, and drops feat's lastJudgedOf entry, which 275f3bc and ca52dbc fixed. 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.
Closes #616.
When the input source changed mid-way through a keyed type_text, the macOS engine stopped with
inputSourceChangedand reported a count of characters entered. That count came from what had been posted, not from the field. A unit whose key down (which carries its text) went out before the check that saw the switch was in the field but not in the count, and keys posted before that check can land after it. In the hosted run the engine answered 67 while TextEdit held 70.Review also showed that reading the field back can't settle the count reliably. A stale read can equal the posted prefix while the field holds more; for example, a field that expands "a" to "ab" before taking the next "b". A password field that ignored the input still confirmed by its length and caret. So the stop now states no number.
What changes (rulings 1291, 1299, 1300):
enteredRange: {low: 0, high: total}replacesentered.entered: 0, plusbeforeInput: truewhen no event at all went out.sky.mjsrenders this sentence for sky_linux, andbrowser.mjsrenders it on every platform. #604: a failed secret on Linux says "nothing was entered" when the verified engine shows none went out (cua 0.31.1, linux-engine 0.4.8) #617's trust gate is kept: "nothing was entered" still requires the beforeInput record from a trusted engine, macOS or Linux.cua/enteredRangeandcua/beforeInput.{0, total}and the field holding a prefix of the text;beforeInputand the field unchanged;Withdrawn during review:
countAtStopand the exact form ("as the field reads back; type the rest from there"), 1294 (2)'sreadbackAbovePosteddiagnostic, and 1294 (3)'s per-enginerangeOnReadabletally.Ordinary confirm is unchanged.
git diff origin/main -- native/engine/Sources/Engine/TypeReadback.swift native/engine/Sources/Engine/TypeReadbackLength.swiftis empty: both files are byte-equal to main's, so nothing of #616 remains in them. #618 tracks a separate, pre-existing ambiguity in ordinary confirm's placeholder-line handling.Meta compatibility:
enteredkeeps its shape. On an inputSourceChanged stop it is present only as 0, before any key down.enteredRangeandcua/beforeInputare new.Versions: engine 0.2.5, plugin 0.31.2 (main is 0.31.1 after #617; the final number is set at merge).
Tests:
swift test: 1848 passed, 2 skipped. InputSourceStopTests (6) covers the hosted case, every stop after a key down (late, lost, over-delivered, ending in a Return or a Tab, the whole text, a unit boundary), a password field, stops before any key down, keyText alone, and concealed requests. None of these reads the field after the stop.Sminos-Session: cursor235#b93055dd (cua on macbook)