Repository navigation
Conversation
The app was never signed as a bundle. SwiftPM ad-hoc signs the binary, and make-app.sh wrapped it without signing anything: `Sealed Resources=none`, `Info.plist=not bound`, and a signing identifier derived from the binary (`NotebookApp-5555...`) rather than the `com.dai.notebookmlx` in Info.plist. TCC keys its grants on code signing identity, so an app in that state cannot hold a Documents folder permission against its own bundle id - the identifier it presents is not the identifier anybody grants, and `tccutil reset com.dai.notebookmlx` matches nothing to reset. The visible failure was a notebook shelf that was simply empty. The library folder had five notebooks in it and the app could still write new ones, because `reload()` does `(try? contentsOfDirectory(...)) ?? []` and a refused directory read is indistinguishable from an empty folder by the time it reaches the screen. It reads as "there are no notebooks" rather than "macOS would not let me look", which is the wrong component to go and investigate. Signed with Developer ID when one is in the keychain, ad-hoc otherwise and saying so. The difference is not cosmetic: a Developer ID signature gives the same designated requirement on every build, so the permission is answered once, where ad-hoc hashes the binary and every rebuild is a new app that has to ask again. Nested bundles are signed first, because signing the outer one fails with "code object is not signed at all" while MLX's resource bundle - which SwiftPM copies in unsigned - is still unsigned inside it. Hardened runtime and a secure timestamp when a real certificate is used, both required for notarisation, and no entitlements: dAI's agent signs the same MLX stack this way and Apple notarises it. Metal shader loading out of the nested bundle works under library validation because both are signed by the same team. notarize.sh submits and staples. It checks the hardened runtime and the absence of get-task-allow up front rather than letting Apple refuse minutes later with a log URL naming the flag instead of the fix - and get-task-allow arrives by accident, since SwiftPM puts it on everything it ad-hoc signs. It archives with ditto rather than zip, because a plain zip drops the extended attributes the signature lives in and Apple then reads the upload as unsigned. The ticket is stapled to the .app and not to the archive, so the app does not need to reach Apple to be checked - an unstapled build fails on a machine that is offline or behind a filter, which is the worst kind of intermittent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0157siweEqdaNhvgsQXPenzW
Hold space in an empty Ask field, or click the microphone, and the question is dictated into the field. Return sends it, so a misheard product name is fixed before it reaches the fleet rather than answered. Answers to spoken questions are read back. All of it on this Mac. Recognition is SpeechAnalyzer with SpeechTranscriber (macOS 26), chosen over the older recogniser, which is worse at exactly what a notebook question is made of - product names, filenames, long sentences - and over Whisper, which would mean a model to ship and manage and no live text. The open notebook's source names are offered as vocabulary. Read-back is AVSpeechSynthesizer with citations, markdown and addresses removed first, so an answer is heard as prose and not as a filename and a page number. Dictation is hidden below macOS 26; reading aloud works everywhere. Space is also a character, so a press is held back until it is known to be a hold. A tap is replayed as an ordinary space, keys that overlap it in fast typing keep their order, Escape throws a recording away, and losing focus mid-hold stops rather than leaving the microphone open. Only in an empty Ask field, or where no text is being edited; anywhere else space is untouched. That rule lives in NotebookKit as a pure type and is tested there. Latency, measured rather than guessed. The first build missed a fast talker's first words, and a timing line per dictation showed why: 1.7 s building an analyzer on every press, because the warm-up treated the framework's per-launch installation request as a download and stopped, silently, every time. Now the analyzer and a tapped, prepared audio engine are ready before the press, the microphone opens on the press rather than after the quarter second spent deciding it is a hold, and a warm-up that fails says so in the log. Press to microphone went from 1,943 ms to 75-96 ms. Also a clear button in the Ask field, which stops a running dictation too so it does not write the words back. Packaging: NSMicrophoneUsageDescription and NSSpeechRecognitionUsageDescription in Info.plist, and the audio-input entitlement on the app - the hardened runtime denies the microphone without it, and silently. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013iVkaT35YkmM7itiMcNXAt
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
Everything runs on this Mac:
Also in this PR
It includes
3696aaa("Sign the bundle, so a permission can stick to it") from the unmergedsign-the-bundlebranch. The microphone permission depends on it: the grant only sticks to a consistently signed bundle, and the new microphone entitlement goes into that same signing step.Holding space
A press is held back until it's clear whether it's a tap or a hold (250 ms).
The rule lives in
NotebookKit/HoldToTalk.swiftas a plain type, so it's tested without a keyboard.Latency
A timing line is written to the log for every dictation (subsystem
com.dai.notebookmlx, categorydictation).Packaging
Info.plistgainsNSMicrophoneUsageDescriptionandNSSpeechRecognitionUsageDescription.packaging/NotebookMLX.entitlementswithcom.apple.security.device.audio-input, applied to the app only. Without it, the hardened runtime blocks the microphone and shows no prompt.Testing
swift test: all 121 tests in 21 suites pass. New tests cover the space tap/hold logic, the live transcript, and the read-aloud text cleanup./Applications: dictation by holding space and by the mic button, and answers read back.🤖 Generated with Claude Code
https://claude.ai/code/session_013iVkaT35YkmM7itiMcNXAt