Repository navigation
Treat a field read still blocked at release as a secure field - #352
Merged
alexkroman merged 1 commit intoNov 24, 2026
Merged
Conversation
The release path reads targetIsSecure from the press-time AX read, but a read still blocked when the transcript came back answered nil — read as "not a password field". A target slow enough to outlast recording plus transcription could get a password remembered into Recent / stt_prompt, left unconcealed on the clipboard, and written to the developer-mode log. PressContext now records whether the read has settled, and capturedContext fails closed: an unsettled read answers a context flagged secure. That dictation is still transcribed and pasted; it just isn't remembered, logged, or left unconcealed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alexkroman
pushed a commit
that referenced
this pull request
Nov 24, 2026
…th limit The fail-closed read (#352) pushed DictationSession.swift to 407 lines and DictationSessionContextTests.swift to 431, failing swiftlint's file_length on CI. The rule moves to PressContext.releaseContext, beside the settled flag and value it reads; capturedContext now delegates to it. The self-contained failure-logging suite moves to its own file. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
Every release-side privacy decision reads
targetIsSecurefromcapturedContext, i.e.PressContext.resolved. That's nil in two different situations: the read finished and found nothing worth carrying, or the read is still blocked (FocusCapturemakes ~6 serial AX round trips, each capped at ~1 s, against a slow or beachballing frontmost app). Both were read as "not a password field". So a target slow enough to outlast recording + transcription would get a password:stt_prompt,Raised in the code review on #350 as a bug that predates it.
Fix — fail closed rather than wait
PressContextrecordsisSettledseparately fromresolved.DictationSession.capturedContextreturnsunsettledContext, a context flaggedtargetIsSecure: true, while the read is still blocked. All three readers (the Recent gate,inject, the log) pick it up from one place.Tests
unsettledReadFailsClosed: a read that never lands → pasted, flagged secure to the injector, not in Recent, logged with the secure context.timedOutReadStillSendsPressKnownContextnow lets the first press's read land before release, so it has history to seed (a stalled first dictation is correctly no longer remembered).swift test: 1309 tests pass.🤖 Generated with Claude Code