Repository navigation
Store the target's password verdict as one TargetSecurity value - #418
Merged
Merged
Conversation
FocusedFieldContext carried isSecure and securityUnknown, and TranscriptionContext carried targetIsSecure and targetSecurityUnknown: two independent Bools for what is really a three-way verdict, so "secure and unknown" was representable and PressContext.targetSecurity had to re-derive .secure/.unknown/.ordinary from them with a precedence rule of its own. Both types now hold a single TargetSecurity (FocusedFieldContext.security, TranscriptionContext.targetSecurity), defaulting to .ordinary where the flags defaulted to false. FocusCapture reports .secure/.ordinary and .unreachable is .unknown; the iPhone maps the keyboard's isSecure flag (its wire shape unchanged) to .secure/.ordinary; the press path passes the verdict through. PressContext keeps only its own rule: a read that has not settled is .unknown, a settled one is its context's verdict, and a settled empty snapshot is .ordinary. isEmpty keeps any verdict other than .ordinary, and the developer-mode log still withholds only a .secure transcript. Neither type is Codable, so nothing encoded changes. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1Vp9Andd7LBEDhGKeC
2 of 3 tasks
Collaborator
Author
|
The Every other job passed. The same error hit Generated by Claude Code |
2 of 3 tasks
alexkroman
pushed a commit
that referenced
this pull request
Nov 25, 2026
One conflict, in DictationSession+Pipeline.swift: #418 renamed the password verdict to one targetSecurity value in two comments this PR had rewritten around the press it now threads through. Kept this PR's change with #418's names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1Vp9Andd7LBEDhGKeC
alexkroman
pushed a commit
that referenced
this pull request
Nov 25, 2026
No content conflicts: #398 moved AssemblyAIAccount.swift into BlurtAssemblyAI, and git carried this PR's comment at the early return along with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1Vp9Andd7LBEDhGKeC
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.
What & why
FocusedFieldContexthad two separate Bools for the press target's password-field verdict (isSecure,securityUnknown), and so didTranscriptionContext(targetIsSecure,targetSecurityUnknown). The verdict really has three states. Two Bools let a value be "secure and unknown" at once, soPressContext.targetSecurityhad to turn them back into.secure/.unknown/.ordinarywith a precedence rule of its own.Both types now hold one
TargetSecurity:FocusedFieldContext.securityandTranscriptionContext.targetSecurityboth default to.ordinary, where the Bools defaulted tofalse.FocusCapturereports.secureor.ordinary, andFocusedFieldContext.unreachableis.unknown.KeyboardCommand.isSecureto.secure/.ordinary. That field's wire shape is unchanged.DictationSession+Presspasses the verdict through unchanged.PressContext.targetSecuritykeeps only its own rule: a read that hasn't settled is.unknown; a settled read gives the stored context's verdict, or.ordinaryif the stored context is nil.TranscriptionContext.isEmptycounts any verdict other than.ordinary, so a secure or unknown snapshot still isn't collapsed to nil..securetranscript (== .secure).Neither type is
Codableor sent to the App Group, so nothing encoded changes. The doc comments and thecleanup-revieweragent's guardrail text are updated: it now namestargetSecurityand says it is a three-way verdict that must not be deleted as unused. The information the guardrail protects (never remember a password) is unchanged; only its representation is.Trade-off: the type can no longer state "secure and unknown". The old code let
.securewin in that case, and nothing ever produced it. Call sites now write.secure/.ordinaryinstead oftrue/false, and the iPhone's wire Bool is mapped at the edge instead of being passed straight through.Behaviour change: none.
How it was tested
Written in a Linux sandbox with no Swift toolchain:
scripts/check.sh --portablepasses, pluscheck-swift-size.shandcheck-test-clock.shon the changed files. CI on macOS verifies the build,swift test, the iPhone build and tests, swiftlint, swift-format and periphery.Updated the engine tests that built or read the old fields (
DictationSessionContextTests,DictationSessionUnknownSecurityTests,DictationLogEntryTests,CancelledPasteLogTests), and added an assertion that an.ordinarycontext with no other content is empty.scripts/check.shpasses (or CI will, if I'm not on a Mac)I read AGENTS.md and this doesn't reintroduce anything
deliberately removed
Docs updated if behavior changed
Generated by Claude Code