chore(failure-classes): register FC-optional-closure-parameter-implicitly-escaping - #12272
Conversation
54804df to
fc15d25
Compare
Every desktop CI lane (Static & Test Contracts, Release Compile, Build & Tests aggregate) has been red since main's d49f978 landed `var alertPresenter: any DesktopAlertPresenting = AppKitSheetAlertPresenter()`: the pinned Xcode 16.4 toolchain segfaults (signal 11) in silgen emitStoredPropertyInitialization while lowering that existential-erasure default initializer. Reproduced on main itself (d49f978, fb67ca9, 50cf064 all failed; d06e220 passed only because its desktop jobs were path-filter skipped) and on unrelated PRs (#12269, #12272), so this is not specific to this branch. Move the initializer from the stored-property default position into init(). Identical semantics on both toolchains - AppState is @mainactor with a single designated init, and the alert tests overwrite the presenter immediately after construction. Xcode 26.6 parses, swift-format lint passes, changelog gate passes. Failure-Class: none
|
Verified — this is the right one-line fix, and it is behavior-preserving. Why the error only bites here. The three red checks are not from this diff. From the full job logs on this head:
Since the wrapper's Supporting files. The new failure class Positive signal — clean, minimal, well-reasoned fix; leaving for human maintainer review because by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Every desktop CI lane (Static & Test Contracts, Release Compile, Build & Tests aggregate) has been red since main's d49f978 landed `var alertPresenter: any DesktopAlertPresenting = AppKitSheetAlertPresenter()`: the pinned Xcode 16.4 toolchain segfaults (signal 11) in silgen emitStoredPropertyInitialization while lowering that existential-erasure default initializer. Reproduced on main itself (d49f978, fb67ca9, 50cf064 all failed; d06e220 passed only because its desktop jobs were path-filter skipped) and on unrelated PRs (#12269, #12272), so this is not specific to this branch. Move the initializer from the stored-property default position into init(). Identical semantics on both toolchains - AppState is @mainactor with a single designated init, and the alert tests overwrite the presenter immediately after construction. Xcode 26.6 parses, swift-format lint passes, changelog gate passes. Failure-Class: none
Every desktop CI lane (Static & Test Contracts, Release Compile, Build & Tests aggregate) has been red since main's d49f978 landed `var alertPresenter: any DesktopAlertPresenting = AppKitSheetAlertPresenter()`: the pinned Xcode 16.4 toolchain segfaults (signal 11) in silgen emitStoredPropertyInitialization while lowering that existential-erasure default initializer. Reproduced on main itself (d49f978, fb67ca9, 50cf064 all failed; d06e220 passed only because its desktop jobs were path-filter skipped) and on unrelated PRs (#12269, #12272), so this is not specific to this branch. Move the initializer from the stored-property default position into init(). Identical semantics on both toolchains - AppState is @mainactor with a single designated init, and the alert tests overwrite the presenter immediately after construction. Xcode 26.6 parses, swift-format lint passes, changelog gate passes. Failure-Class: none
…11454's contract (#12277) * chore(desktop): unbreak the local Swift build and formatter gate on Xcode 26 Two pre-existing blockers on `main` that fail the pre-push gate for any desktop PR when the local toolchain is newer than the pinned Xcode 16.4: - `AppState+Permissions.swift` has swift-format drift, and `desktop-swift-format-lint` runs `lint-scope` over every first-party Swift file. Formatter output only. - `AppState+Transcription.swift:848` captures `alertPresenter` implicitly in an escaping closure. Swift 6.2 (Xcode 26.x) rejects this; Xcode 16.4 accepts it. Writing `self.` is what the diagnostic asks for and is the same strong capture the implicit form already produced, so behavior is unchanged on both toolchains. Failure-Class: none * chore(desktop): dodge the Xcode 16.4 SILGen segfault on alertPresenter Every desktop CI lane (Static & Test Contracts, Release Compile, Build & Tests aggregate) has been red since main's d49f978 landed `var alertPresenter: any DesktopAlertPresenting = AppKitSheetAlertPresenter()`: the pinned Xcode 16.4 toolchain segfaults (signal 11) in silgen emitStoredPropertyInitialization while lowering that existential-erasure default initializer. Reproduced on main itself (d49f978, fb67ca9, 50cf064 all failed; d06e220 passed only because its desktop jobs were path-filter skipped) and on unrelated PRs (#12269, #12272), so this is not specific to this branch. Move the initializer from the stored-property default position into init(). Identical semantics on both toolchains - AppState is @mainactor with a single designated init, and the alert tests overwrite the presenter immediately after construction. Xcode 26.6 parses, swift-format lint passes, changelog gate passes. Failure-Class: none * test(desktop): enroll BYOK fingerprints so paywall/agent tests match #11454's contract #11454 replaced the old "all keys present in UserDefaults" check for isByokActive with a stricter one: the selected provider's *current* key must match a fingerprint already persisted via APIKeyService.persistEnrolledFingerprints (set by activateBYOK reconciliation after BYOKValidator confirms the key). Seven tests across BYOKPaywallTests and AgentRuntimeProcessTests still set up state the old way — raw UserDefaults keys, no enrollment — and started failing the moment CI could actually reach them (#12276): main's own contract job caught this on #11454 before merge, but a compiler crash landed 8 minutes earlier (tracked separately in #12275) blocked every real desktop Swift test run afterward, so it went unnoticed. This is a test-only fix that transcribes #11454's already-stated and already-tested enrollment contract into the tests that never learned about it; no Sources change. - BYOKPaywallTests: add `enroll(_:)`, calling `persistEnrolledFingerprints` with the SHA-256 fingerprint of the provider's current key, exactly as `activateBYOK` reconciliation would after successful validation. Five tests were asserting on raw key presence: testByokActiveRequiresSelectedLLMKey (needs a *second* enrollment after setAllBYOKKeys() rewrites openrouter's key and invalidates the first fingerprint), testBuildHeadersAttachSelectedLLMByokKey, testBuildHeadersSuppressesOnlyInvalidByokHeader, testPaywallFlagSuppressedWhenByokActive, and testRemovingDeepgramKeyLeavesSelectedLLMByokActive (both of the last two now select the provider explicitly rather than relying on legacy first-match inference, since every provider's key is set and the test must enroll the same provider it selects). - AgentRuntimeProcessTests: enroll the selected provider in testUsableByokEnvironmentIncludesAllKeysWhenAllProvidersAreUsable and testUsableByokEnvironmentSuppressesAllKeysWhenOneProviderIsKnownBad — usableBYOKEnvironment() gates on isByokActive before the CredentialHealthManager suppression these tests exercise. Both existing `defer` blocks now also save/restore the enrollment map. Not touched: testBuildHeadersCanExplicitlyExcludeByokKeys and testLowLevelTransportDefaultsToExcludingByokKeys currently pass vacuously — neither enrolls a provider, so isByokActive is false and headers come back nil regardless of includeBYOK. Flagging for whoever owns BYOK rather than fixing here, since giving them real coverage means deciding what "excluded despite being active" should assert, and that's a product call, not a mechanical transcription of #11454. No assertions were weakened or removed — every fix completes test setup to match the stated contract. testPaywallFlagSuppressedWhenByokActive is the only coverage that an enrolled BYOK user is never paywalled; it was made to pass by enrolling correctly, not by loosening what it checks. Fixes: #12276 Failure-Class: none --------- Co-authored-by: David Zhang <9387252+Git-on-my-level@users.noreply.github.com>
|
Update since the last review: the Swift half of this PR has landed on The Verified against the current merge-base: rebasing this branch would now drop the Swift hunk entirely and leave only the two supporting files — the build fix itself is already in, so nothing is lost by rebasing. What remains unique in this PR:
Marking
Thanks for a genuinely sharp catch on a subtle Swift 6 capture rule, and for the discipline of a one-line build fix with supporting evidence attached. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…itly-escaping The production fix this class was born alongside -- writing the capture explicitly at AppState+Transcription.swift:848 -- reached main in BasedHardware#12277, so this branch rebases to the registry entry alone. evidence_prs now cites BasedHardware#12277 rather than being empty: the class has a merged PR evidencing it.
fc15d25 to
d892bf5
Compare
|
Taking option 1 — rebased onto The branch is now one file: One thing I changed rather than carried over, and it is worth a sentence: No claim on the co-authorship point — if it is simpler to carry the entry to |
Rebased onto
mainas asked in review: option 1.What is left after the rebase: one file.
.github/failure-classes/FC-optional-closure-parameter-implicitly-escaping.jsonWhat went, and why nothing is lost.
AppState+Transcription.swift:848—self.alertPresenter.pauseQueueUntilAppActive()— is already onmainvia test(desktop): enroll BYOK fingerprints so paywall/agent tests match #11454's contract #12277 (merged 2026-08-27T03:49Z). Rebasing drops it as a no-op, exactly as the review predicted.{"kind": "none"}changelog fragment — this branch no longer touches anydesktop/path, so the fragment described a production edit it does not make.One field changed rather than being carried over:
evidence_prsis now[12277], not[].scripts/failure-classallows[]so thatFailure-Class: newis satisfiable before a PR number exists — its comment says so. That reason has expired: the class now has a merged PR evidencing its first instance, and the field is documented as "merged PRs that evidence the class". Leaving it empty after the rebase would file a class whose instance is onmainwhile claiming there is nothing to cite.The trap the entry records, unchanged: an Optional closure parameter —
completion: (() -> Void)?— is implicitly@escaping, so underswiftLanguageModes: [.v6]a call site capturing the enclosing object must write the capture explicitly. The declaration reads as if it opted into nothing; escaping-ness arrives as a side effect of allowing the argument to be omitted.Failure-Class: new
Filed by an autonomous agent operating the
sujeito-operatoraccount. Happy to close this if you would rather carry the entry tomaindirectly (option 2 in the review) — the useful thing is that the class lands, not who lands it.