Repository navigation
provider: App Attest keeps working after a self-update (refresh LaunchServices) - #1765
Merged
Merged
Conversation
Report 6024: after updating to 0.10.7 an M5 Ultra answered every App Attest ready with is_supported_false for 70 minutes, in the GUI session, across 0.10.7's automatic restart and five manual restarts, then recovered inside a running process. DeviceCheck also reads macOS LaunchServices' record of the running app, and the update swaps Darkbloom.app in place without refreshing it. These tests fail on dev: - AppleAppAttestService re-registers the running bundle once per process on an unsupported answer and asks Apple again (no seam exists yet); - SelfUpdater registers the installed app with LaunchServices after a commit, and not after a refused one (no seam exists yet); - doctor stops sending a provider that already runs in the GUI session to Screen Sharing and a restart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The self-update swaps Darkbloom.app in place (renameatx_np RENAME_SWAP) and never tells macOS LaunchServices. DeviceCheck also reads LaunchServices' record of the running app (our native qualification harness registers its candidate with lsregister -f for this reason), so isSupported stays false in every process until LaunchServices re-registers the bundle. Fleet data: 12-15% of updating macOS 27 Macs at the 0.10.6 and 0.10.7 rollouts, cleared after minutes to hours. 0.10.7's automatic restart recovered 1 of 117 such Macs, and 52 Macs without the MDM profile sat at trust_floor (report 6024). - AppleAppAttestService.checkAvailability: the first unsupported answer in a process re-registers the running bundle (LSRegisterURL, as lsregister -f) and asks Apple again, so the exchange that meets a stale record succeeds. This covers the first update to this version, which the old updater runs. - SelfUpdater.commitStagedBundle registers the installed app right after the swap, on the signature-verified path only; tests inject an observer and never write the machine's LaunchServices database. - doctor: is_supported_false inside the GUI session no longer advises Screen Sharing and a restart; it names the self-update cause and the lsregister command. Background and unknown sessions keep the old advice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Behavior-preserving cleanup of the LaunchServices refresh. - AppAttestSupportProbe becomes AppAttestSupport (file renamed). It also writes LaunchServices, so "probe" read as read-only, and it was easy to confuse with ProviderLoop.appAttestSupportProbe, the unsupported-restart monitor's live isSupported read, which deliberately never re-registers. - Drop its hand-written init; the synthesized memberwise init is the same internal init. Its closures are let. - refreshRegistration returns Void. Nothing read the OSStatus: asking Apple again is the check. LaunchServicesRegistration.refresh still returns it. - The registrationRefreshed comment says what holds: once per service, and a provider process keeps one service. - troubleshooting.md no longer gives a bare `lsregister -f` (lsregister is not on PATH); it points at the full command doctor prints, and drops a duplicated link. attestation.md drops a changelog-style "now" and says the manual command changes no Darkbloom file or key. The app-attest-shadow.md row cites each claim's own code. - The changelog fragment is in plain operator words; same facts and numbers. Unchanged: the support check order, once-per-process refresh, updater registration on the signature-verified path only, doctor advice outside the GUI session, the unsupported-restart policy, and every test assertion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
8 of 17 tasks
The guard that limits the LaunchServices refresh is per AppleAppAttestService, not per process. A provider without an availability schedule keeps one service per process, but a scheduled provider builds a new ProviderLoop, and so a new service, for each availability window, so it can re-register once per window. That is bounded and harmless; the words overstated it. The behavior is unchanged. - AppleAppAttestService: the registrationRefreshed and isSupportedRefreshingRegistration comments say once per service, and how many services each mode keeps. - doctor's GUI-session is_supported_false message: "re-registers its app once per process when this happens" becomes "re-registers its app by itself when this happens". - app-attest-shadow.md, attestation.md and the changelog fragment say once per process or once per scheduled availability window, citing the code that makes it so. - The test testPersistentUnsupportedReRegistersOnlyOncePerProcess is renamed ...OncePerService; it builds one service, and its assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 4, 2026
Brings #1763, #1765, #1764, #1770, #1772, #1767, #1768, #1769 and #1766 from dev. One conflict, in docs/provider/two-mac-cluster.md (2 hunks): before "## Undo", #1774's "Stopping and starting again", then #1770's "Pairing again"; Undo keeps #1770's opening, #1774's --service sentences, the Uninstall link, and #1772's "## Uninstall" section as written. Resolution verified in a dry run (tree 4737f00). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/provider/two-mac-cluster.md
This was referenced Nov 4, 2026
This branch had an error being deployed
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.
Summary
About 12–15% of updating Macs lose App Attest after every self-update, and restarts don't fix it. Without the MDM
profile, App Attest is a Mac's only way to get inference work, so those Macs get none until macOS happens to fix itself,
minutes to hours later. This PR makes the provider repair it at once.
Production proof (read-only; coordinator App Attest telemetry and provider report 6024, 2026-11-03/04 UTC)
One user's Mac (report 6024). An M5 Ultra with no MDM profile; every
readyran in the logged-in GUI session, withSIP on and valid entitlements.
readyreported_supported, grantedunsupported·is_supported_falseis_supported_falseis_supported_falsereported_supported→ granted → servingThe coordinator held the Mac at
trust_floor(no inference) the whole time.darkbloom doctorsent the user to ScreenSharing to restart, which can't help.
The fleet, in the first 78 minutes after each release:
starts on the first
readyof the updated process.trust_floorwith no inference.Cause. The self-update swaps
Darkbloom.appinto place by renaming directories (RENAME_SWAP) and never refreshesmacOS LaunchServices. Apple's
DCAppAttestService.isSupporteddepends on LaunchServices' record of the running app, sountil macOS re-registers the app, every process gets
is_supported_false, however it is started.lsregister -fbefore launching for exactlythis reason: "DeviceCheck still rejects a missing or stale LaunchServices entry".
The change
checkAvailabilityre-registers therunning bundle with LaunchServices and asks Apple again, so that same exchange succeeds.
LSRegisterURL(Bundle.main.bundleURL, true), the public API behindlsregister -f.provider. Nothing is touched when Apple says supported. No process, shell, sudo or Keychain.
process can repair it.
commitStagedBundleswaps the bundle, on the signature-verified path only, the updaterregisters
<install>/Darkbloom.app.lsregister -fcommand plus the SIP and Full Security checks. The advice outside the GUI session is unchanged.Everything else in App Attest is unchanged, including 0.10.7's unsupported restart (owner decision whether to keep it).
Linked issue
Provider report 6024 (an end user: "unable to app attest on the inference side since updating to latest version").
Test plan
dev(tests-only commit4fd2297e7d), green with the fix:AppAttestLaunchServicesRefreshTests(3 new): a stale record is repaired in the same exchange; supported nevertouches LaunchServices; at most once per service (
…OncePerService).SelfUpdaterTests(2 new): a verified commit registers<install>/Darkbloom.app; a refused commit registersnothing.
AppAttestLocalDiagnosisTests: the new GUI-session advice. Red: 6 issues (it said "Screen Sharing", with nolsregister).DARKBLOOM_RELEASE_ENVIRONMENT=prod, sandboxed):make docs-check,make docs-impact-check BASE=origin/dev,make changelog-check,git diff --check.fix/app-attest-attestation-survives-disconnect) is clean.is_supported_falserate withstart_reason=updateshould drop to about zero.Components touched
Protocol / interface changes
Documentation impact
docs/provider/attestation.md: cause, manual command, corrected advice;docs/provider/installation.md: the update registers the app;docs/provider/troubleshooting.md: the doctor row;docs/reference/app-attest-shadow.md: the restart row.Changelog
changelog.d/app-attest-launchservices-refresh.mdand ranmake changelog-check.Notes for reviewers
LSRegisterURL(url, true)is the same force registration aslsregister -f. Checked read-only on macOS 27.0.1:both reach
_LSRegisterBundleURLwith the force bit. No binary is spawned.isSupportedcall beside it. Both are synchronoussystem requests; a deadline would belong around the whole availability check.
lsregister -f) is the cheapest confirmation on thenext stuck Mac.
Before And After
Behavior
flowchart TB classDef bad fill:#fde2e1,stroke:#c0392b,color:#641e16 classDef good fill:#e3f6e8,stroke:#1e8449,color:#0b3d1f classDef step fill:#eef2f7,stroke:#5d6d7e,color:#1b2631 subgraph BEFORE["Before"] direction TB b1["Self-update swaps Darkbloom.app (RENAME_SWAP)"]:::step --> b2["LaunchServices still describes the old bundle"]:::bad b2 --> b3["isSupported = false in every process"]:::bad b3 --> b4["restart (automatic or manual): same answer"]:::bad b4 --> b5["no App Attest → trust_floor → no inference<br/>until macOS re-registers (minutes to hours)"]:::bad end subgraph AFTER["After"] direction TB a1["Self-update swaps Darkbloom.app"]:::step --> a2["updater registers the new app<br/>(signature-verified path)"]:::good a2 --> a3{"isSupported?"}:::step a3 -- "true" --> a5["App Attest granted"]:::good a3 -- "false (stale record)" --> a4["re-register the running bundle once,<br/>ask Apple again in the same exchange"]:::good a4 --> a5 endCode flow
flowchart LR classDef same fill:#eef2f7,stroke:#5d6d7e,color:#1b2631 classDef changed fill:#fff4d6,stroke:#b9770e,color:#4d3200 subgraph CB["Before"] direction TB u1["SelfUpdater.commitStagedBundle"]:::same --> u2["UpdateAtomicFilesystem.replace (RENAME_SWAP)"]:::same c1["AppleAppAttestService.checkAvailability"]:::same --> c2["requireSupported(isSupported)"]:::same end subgraph CA["After"] direction TB v1["SelfUpdater.commitStagedBundle"]:::same --> v2["UpdateAtomicFilesystem.replace"]:::same v2 --> v3["LaunchServicesRegistration.refresh(<install>/Darkbloom.app)<br/>verified path only"]:::changed d1["checkAvailability"]:::same --> d2["requireSupported(isSupportedRefreshingRegistration(app:))"]:::changed d2 --> d3["AppAttestSupport: isSupported, else refresh once → isSupported"]:::changed endValidation follow-up
An independent validator passed this PR with notes. One was that "once per process" overstated how often the refresh
can run.
2e35241c4c): the LaunchServices refresh runs at most once perAppleAppAttestService, not once per process. A provider without an availability schedule keeps one service perprocess; a scheduled provider makes one per availability window, so it can re-register once per window. The comments,
docs and changelog now say this, the
doctorsentence no longer states a frequency, and the test is renamed…OncePerService. Behavior is unchanged.2e35241c4c: prod-identity build. SandboxedProviderAppAttestTests(11 classes): 99 executed,0 failures, 1 skipped (it needs the installed app).
AppAttestLocalDiagnosisTests: 12/12.docs-check,docs-impact-check BASE=origin/dev,changelog-checkandgit diff --checkpass.Refactor Pass
A dedicated refactor pass (d-inference
AGENTS.md) reviewed the fix and added one behavior-preserving commit,8d4462d9b1:AppAttestSupportProbe→AppAttestSupport(file renamed). It also writes LaunchServices, so "probe" read as read-only, and itwas easy to confuse with
ProviderLoop.appAttestSupportProbe, the restart monitor's liveisSupportedread, which neverre-registers. Its redundant hand-written init is gone, and its closures are
let.refreshRegistrationreturnsVoid. Nothing read theOSStatus; asking Apple again is the check.lsregister -f(not onPATH) and points at the full commanddoctorprints. The attestation page drops a changelog-style "now" and says the manual command changes no Darkbloom file or key. The
reference row cites each claim's own code.
No logic changed:
Bundle.main.bundleURL, after the.appand entitlement checks, at most once per service (one per process, or one per availability windowwhen scheduled), with no
process, shell, sudo or Keychain access.
doctoradvice outside the GUI session is unchanged.Checked read-only on macOS 27.0.1:
LSRegisterURL(url, true)makes the same force-update registration thatlsregister -fdoes(
_LSRegisterBundleURLwith the force bit).Validation at
8d4462d9b1:mlx.metallib, now staged from the repo's cache.make docs-check,make docs-impact-check BASE=origin/dev,make changelog-checkandgit diff --checkall pass.fix/app-attest-attestation-survives-disconnectis clean.Left for the owner:
isSupportedcall beside it.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.