Ponytail minimization pass: dead code, formatter locale fixes, redundant-work cuts - #1701
Merged
Merged
Conversation
…gs, cut redundant work Repo-wide minimalism audit (ponytail decision ladder) applied for performance and reliability, adversarially verified finding-by-finding before landing: - Delete the dead legacy SystemAudioCapture CoreAudio process-tap path (791 lines; SCKAudioCapture is the only production backend) plus its orphaned CoreAudioUtils helpers - Pin transcript date:/time: frontmatter and stats-DB date strings to the POSIX-pinned DateFormattingHelper so writes match their POSIX-pinned readers on non-Gregorian system calendars (frontmatter dates feed audio-retention decisions) - Stop parsing each meeting transcript's frontmatter 2-3x per audio retention maintenance pass - Make FailedTranscription audio/error fields var so the five copy-with-mutation sites can't silently drop a future field; same with(...) pattern for RecordingHealthInfo - Share the crash-safe JSONL log prepare sequence (EventReporter + ReliabilityPacketRecorder) and the duration_bucket helper so Sentry and reliability packets can't drift; repoint the pinned source-text test - Replace ContextCaptureEngine's mirrored _sharedSessionController global with an explicit hotkey-routing flag (keeps the late-CGEventTap-event guard the global was silently providing) - Delete dead surface: old Call Recording saver + formatMarkdown, SpeakerProfileMerger name-merge API + name-variants table (MCP keeps its standalone mirror), unused wrappers in TranscriptionTaskManager, RetroactiveSpeakerUpdater (moved to a test helper), ParakeetEngine, ParakeetModelLifecycle, WhisperEngine, and an NSLock.withLock shadow of Foundation's own - Hoist per-call regex compilation and DateFormatter allocation out of per-line scan loops (DictationTranscriptStore, RecentCaptureScanners, CaptureMarkdownParser, HomeView); stop SpeakerPeopleSettingsSection re-running its O(n) grouping several times per render; make the Agent page's collapsed disclosure stop stat()ing the filesystem every render - Tools: CLI reads each meeting file once instead of three times and drops a write-only batch results array; MCP receipts tools stop hydrating titles twice (2x disk reads), dictation reads read the day file once, the SQLite indexer prepares INSERTs once per transaction, and the filename-title fallback is shared; QA dedups process termination, report writing, and the isolated-launch env block, and drops dead params 66 files changed, ~1,430 net lines removed. Verified: build-deps --force, build.sh --no-open, run-tests.sh (12,203), run-integration-smoke.sh, swift test (1,036), run-e2e-smoke.sh, and all four tool package suites. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The repo-hygiene CI step diffed the nickname table between TranscriptedCore and the MCP server's standalone mirror. The Core copy was deleted in the previous commit (its only consumer, the name-merge API, was dead code), so there is nothing left to drift: remove the parity script, its workflow step, and its README entry, and reword the MCP table's header as the sole copy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…optimization-198164 # Conflicts: # Sources/TranscriptedCore/Audio/Audio.swift # Sources/TranscriptedCore/Audio/AudioDeviceRecovery.swift # Sources/TranscriptedCore/Audio/AudioFileManager.swift # Sources/TranscriptedCore/Audio/SystemAudioCaptureEngine.swift # Sources/TranscriptedCore/CLAUDE.md # Tools/TranscriptedCLI/Sources/TranscriptedCLI/ContextStore.swift
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.
Why
Repo-wide minimalism pass (the ponytail decision ladder: delete > reuse > stdlib > native > shrink) targeting performance and reliability. Every finding was adversarially verified against the repo's landmines (source-text-pinned tests, CoreAudio real-time rules, failed-audio retention, privacy sanitizers) before being applied; refuted findings were dropped.
Product Impact
dictation/meetings/agent artifactsdictation reliability/meeting reliabilityWhat changed
SystemAudioCaptureCoreAudio process-tap path (791 lines, zero production callers —SCKAudioCaptureis the only backend) plus its orphanedCoreAudioUtilshelpers; docs updateddate:/time:and six stats-DB sites now write via the POSIX-pinnedDateFormattingHelper, matching their POSIX-pinned readersFailedTranscription: audio/error fields arevar, collapsing five 10-field copy-with-mutation sites that could silently drop a future field; samewith(...)shape forRecordingHealthInfoduration_buckethelper; the pinned source-text test now guards the shared helperContextCaptureEngine: the mirrored_sharedSessionControllerglobal became an explicitisHotkeyRoutingActiveflag — same late-CGEventTap-event protection, no triple manual syncformatMarkdown,SpeakerProfileMergername-merge API + variants table (MCP keeps its standalone mirror), unused wrappers inTranscriptionTaskManager/RetroactiveSpeakerUpdater(moved to a test helper) /ParakeetEngine/ParakeetModelLifecycle/WhisperEngine, and anNSLock.withLockshadow of Foundation's ownHow I checked it
scripts/dev/agent-preflight.sh.agents/test-matrix.ymlfor the files changedbash build.sh --no-open(launch-to-interactive 906ms / 3000ms budget)bash run-tests.sh(12,203 passed)bash build.sh --no-openruns the bundle gate)bash run-integration-smoke.shif I touchedSources/Meeting/orSources/TranscriptedCore/swift testif I touchedPackage.swift,Sources/TranscriptedCore/, or the public core seam (1,036 passed, 13 hardware-skips)bash run-e2e-smoke.sh+ all four tool package suites (CaptureKit 53, CLI 78, MCP 192, QA 65) +scripts/dev/check-build-source-lists.pyRisk Review
.agent-review/visuals/evidence (UI changes are behavior-preserving refactors: identical view output)Notes
Deliberately skipped (verified-risky or refuted): caching a meeting title column in the MCP index (real perf win, needs a schema migration — good follow-up), two large
ParakeetEngineextractions (the claimed-identical paths differ by anasrManagerguard), CameraActivityMonitor/MicActivityMonitor scheduler unification (documented intentional parallelism),TranscriptedStoragePathscaching (freshness checks are load-bearing), andCaptureLibrarySize/ModelCacheInventoryunification (symlink semantics differ).Environment note: this machine needed Xcode's Metal Toolchain component (
xcodebuild -downloadComponent MetalToolchain, 687.9 MB) forbuild-deps.shto compile the MLX shaders — installed during verification. Also,build-deps.sh/build.shfailures are easy to mask by piping throughtail(staleness message prints even on the success path of a later run); worth a follow-up to make the stale-deps case louder.Agent handoff
COORD_DONE: GREEN | (this PR) | ponytail minimization across Sources+Tools, −1,430 net lines, 2 locale-correctness fixes | none | none | build-deps, build, run-tests (12,203), integration smoke, swift test (1,036), e2e smoke, 4 tool package suites, source-list check | merge🤖 Generated with Claude Code