Repository navigation
Never let a password field's dictation linger on the clipboard or in Recent (#348, #349) - #378
Merged
Merged
Conversation
…Recent (#348, #349) Mac (#348): the session knew a dictation went into a password field (targetIsSecure) and kept it out of Recent, but the injector never learned it. A paste that degraded to the quiet "Copied" left the secret as an ordinary, unmarked clipboard string, which Maccy/Raycast/Alfred archive. InjectorProtocol.insert now takes `secure`; for a secure paste every SystemClipboard write carries ConcealedType + TransientType, is kept off Universal Clipboard (currentHostOnly), and a leave-behind is cleared after 90 s unless something newer was copied. iPhone (#349): the keyboard never read whether its field was a password field, so every iOS dictation had targetIsSecure == false and the engine's refuse-to-remember gate never fired. A press now checks isSecureTextEntry and a .password/.newPassword content type, withholds the field's text, and sends isSecure; the coordinator passes it into FocusedFieldContext. The relay's clipboard fallback for a secure result is local-only and expires after 90 s. Fixes #348 Fixes #349 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…copy Fixes #341. - ⌘V and ⌘C were posted on hardcoded kVK_ANSI_V/kVK_ANSI_C. macOS matches a ⌘ shortcut by character, so on Dvorak every paste was ⌘K (and the restore then took the words back), and on Turkish-F the read-aloud copy fallback pasted. Both are now resolved on the current ASCII-capable layout with ⌘ held (KeyboardLayout, moved to Injection/), falling back to the US key. Voice-command chords read the layout with ⌘ held too when they hold it. - KeyInjector (write, ⌘V, settle, restore) and SelectionCopy (snapshot, ⌘C, poll, restore) now take turns on the pasteboard through a FIFO PasteboardLock, so a copy can't keep a settling paste's transcript as the user's clipboard and a paste's restore can't land under a copy's poll. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1VN3Xe9T3rmTwrjDLC
Making postPaste async put a main-actor layout read between the final Task.checkCancellation() and the ⌘V, so a cancel landing there no longer stopped the paste. The key is now read through its own seam (resolvePasteKey) ahead of the gate, and postPaste is synchronous again, taking the key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1VN3Xe9T3rmTwrjDLC
… relay copy test Keeps KeyInjectorInsertTests under the type-body-length limit, folds the secure relay case into the existing clipboard-fallback test as an argument (jscpd), and drops an implicitly unwrapped optional from FakeProxy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # Sources/BlurtEngine/Injection/KeyInjector.swift # Sources/BlurtEngine/Injection/SystemClipboard.swift
Matches KeyInjector.insert's default, so a test calling the relay directly describes an ordinary field without restating it (and #361's new relay test keeps compiling once this lands). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # Sources/BlurtEngine/Injection/KeyInjector.swift # Sources/BlurtEngine/Injection/SystemClipboard.swift
alexkroman
enabled auto-merge
November 25, 2026 00:31
# Conflicts: # App/BlurtiOS/BlurtiOS/Sources/DictationCoordinator+Commands.swift # App/BlurtiOS/BlurtiOSCore/KeyboardModel+Handshake.swift # App/BlurtiOS/BlurtiOSCore/SharedState.swift # App/BlurtiOS/BlurtiOSTests/DictationCoordinatorTests+Dictation.swift # App/BlurtiOS/BlurtiOSTests/DictationCoordinatorTests.swift # App/BlurtiOS/BlurtiOSTests/ProtocolTests.swift
alexkroman
pushed a commit
that referenced
this pull request
Nov 25, 2026
#378 adds its own test at the same spot; apart, the two merge in either order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#377 added a clipboard test calling writeAndPrepareRestore without the concealed: argument this PR adds, and with its own copy of the ConcealedType constant (now SystemClipboard's). The concealed-write and password-field-press tests move into same-file extensions, so the combined SystemClipboardTests and KeyboardModelGateTests bodies stay within type_body_length. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#365 and this PR each grow the file; together they reached 401. One comment reflowed (within the 120-column limit), no code change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-merge-queue
Bot
removed this pull request from the merge queue due to invalid changes in the merge commit
Nov 25, 2026
alexkroman
enabled auto-merge
November 25, 2026 01:44
alexkroman
pushed a commit
that referenced
this pull request
Nov 25, 2026
With main, the suite's struct body reached 253 lines (type_body_length 250). The suite already splits by topic (+Latch, +Undo); the stepped retry and deadline get their own file, which keeps this PR clear of the gate tests #378 also moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 3 tasks
alexkroman
pushed a commit
that referenced
this pull request
Nov 25, 2026
… CI run Recent multi-commit PRs (#410, #413, #414, #416, #420, #422, #423, #425, #426) mostly spent their extra ~37-minute runs on things nothing caught before CI: - scripts/check-swift-lint-lite.sh: a toolchain-free text match for the opt-in SwiftLint/swift-format rules it can see (modifier_order, no_empty_block, NoBlockComments, swift-format's `catch where`). Run by check.sh (so --portable and --lint-only) and the swift-budgets edit hook; would have flagged the pre-fix files of #414, #422 and #425. - .claude/hooks/push-gate.sh: a PreToolUse hook that runs `check.sh --portable` (~20 s) before any `git push` and blocks a red one — jscpd clones (#420, #422) and post-merge size overruns (#363, #378) were pushes that skipped the documented portable run. - AGENTS.md / CLAUDE.md: a "Rules only CI catches" list for the rest (variable_shadowing, one_declaration_per_file, type_contents_order, multiline_function_chains, MemberImportVisibility, one argument per line), and the new hook and script in the hooks table and permissions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1UDUZXyuF6g7GUmmNu
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.
Fixes #348. Fixes #349.
Both issues are the same promise ("anything dictated into a password field is never kept"), broken on two different paths.
#348 (Mac): a quiet "Copied" left the password as an ordinary clipboard string
The session knew the target was secure (
targetIsSecure) and kept it out of Recent, but the injector never learned it. When the paste degraded (noEditableTarget,targetAppLost, or the keystroke couldn't be built),KeyInjectorcalled the unmarkedclipboard.write, and Maccy/Raycast/Alfred archived the secret.InjectorProtocol.insertgainssecure:. The session passescapturedContext?.targetIsSecure == true;replaceSelection,typeText, andinsertAtFocuspassfalse.ClipboardAccess.write/writeAndPrepareRestoretakeconcealed:. For a secure paste,SystemClipboard:org.nspasteboard.ConcealedType+TransientType;prepareForNewContents(with: .currentHostOnly));concealedLifetime(90 s), unless something newer was copied (change-count guard).#349 (iPhone):
isSecurewas never set, so every iOS dictation entered Recent /stt_promptisSecureTextEntryand a.password/.newPasswordtextContentType. iOS gives true secure-entry fields to the system keyboard, so the content type is the case a third-party keyboard actually sees.priorText/selectedTextand sets the newKeyboardCommand.isSecure. The coordinator passes it intoFocusedFieldContext(isSecure:), so the engine's existing gate fires.KeyboardRelayInjector's clipboard fallback for a secure result usesUIPasteboard.setItems(_:options:)with.localOnlyand a 90 s.expirationDate.Tests
KeyInjectorSecureTests(all three degraded paths leave concealed words; the secure paste is concealed until restored).SystemClipboardTestscovers the markers, the unconcealed restore, and the expiry's change-count guard.DictationSessionContextTestsasserts the session forwardssecure(including the late-context-read case).isSecure == true;securevalues.swift testsuites green;scripts/ios-test.shgreen, 368 tests,BlurtiOSCorecoverage 96.11%.Docs: README Privacy and the engine README's
InjectorProtocolsection are updated.🤖 Generated with Claude Code