Derive isRecording from coordinator state machine#1
Closed
Conversation
3 tasks
08cabe2 to
705ff94
Compare
isRecording was a writable stored property set by ContentView's 100ms polling loop. Any consumer outside that loop saw stale values when the main window was hidden. Replace with a computed property that reads directly from the coordinator's authoritative MeetingState. Also add MeetingMetadata.manual() factory to eliminate duplicate inline construction of manual session metadata.
705ff94 to
27fd880
Compare
Newarr
pushed a commit
that referenced
this pull request
Mar 21, 2026
Research-backed improvements to transcript refinement: - Add temperature parameter to LLMCompleting protocol and OpenRouterClient. Refinement uses temperature=0 for deterministic output (OpenAI Cookbook recommendation for correction tasks). - Implement detect-then-correct pattern: heuristic needsCleanup() check skips clean-looking text before hitting the LLM, reducing unnecessary API calls and avoiding over-correction (#1 problem per research). - Add backchannel preservation rule: keep "uh-huh", "yeah", "mm-hmm" when used as direct responses (professional transcription standard). - Consolidate 8 separate MainActor.run calls into single atomic read, preventing TOCTOU issues if settings change mid-read. - Remove dead contextWindowSize constant. - Add "Meeting Languages" label to settings for accessibility. - Tests: add needsCleanup tests, temperature verification, clean-text skipping, question bypass of needsCleanup. All test utterances updated to contain disfluency markers so they pass the new gate. https://claude.ai/code/session_01WgtdecTp9R6NYyLNv1uQSc
Newarr
pushed a commit
that referenced
this pull request
Mar 22, 2026
- Make cancel() async and await task completion to prevent data races (#1) - Move session-switch guard before backfillRefinedText to prevent stale writes (#3) - Cancel cleanup engine in teardownMeetingDetection (#4) - Add .pre-llm.md backup before overwriting Markdown with LLM sections (yazinsai#10) - Add safety documentation for nonisolated(unsafe) vars (#2) - Add unit tests for chunkRecords and parseResponse (#5) https://claude.ai/code/session_01QTKjQDQpoVqFrPJM8bp218
Newarr
pushed a commit
that referenced
this pull request
Mar 26, 2026
… refinement Integrate Cohere Transcribe (2B-param Conformer ASR, #1 on Open ASR Leaderboard at 5.42% WER) as a CoreML-based transcription backend for OpenOats. The model is converted via coremltools with INT4 quantization (~1.1GB) targeting Neural Engine. New files: - Scripts/convert_cohere_transcribe.py: PyTorch → CoreML conversion pipeline splitting model into ConformerEncoder + TransformerDecoder .mlpackage files with EnumeratedShapes bucketing and INT4/INT8/palettization options - CohereTranscribeBackend.swift: CoreML-based TranscriptionBackend with model download, mel spectrogram computation, and autoregressive decoding - BatchTranscriptionEngine.swift: Post-meeting batch re-transcription actor that processes saved audio through Cohere Transcribe for higher accuracy Modified files: - AppSettings: .cohereTranscribe enum case, enableBatchRefinement setting - AppCoordinator: Async batch re-transcription after session finalization with timestamp-based speaker label alignment - AudioRecorder: Per-channel M4A export (mic/system) for speaker-aware batch - SessionStore: backfillBatchRefinedText for index-based JSONL updates - AppRuntime: Wire savePerChannelAudio from enableBatchRefinement setting https://claude.ai/code/session_019DCqs5ak92DYNbHQA3rjvh
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.
Problem
isRecordingis a writable stored property onAppCoordinator, set by ContentView's 100ms polling loop viasynchronizeDerivedState(). Any consumer reading this property outside that loop -- such as a menu bar controller or termination guard -- sees stale values when the main window is hidden.This is a prerequisite for the menu bar background mode feature, where recording state must be accurate without any visible window.
Solution
Replace the writable
_isRecording/ getter / setter with a computed property that derives directly from the coordinator's authoritativeMeetingState:@ObservationIgnored nonisolated(unsafe) private var _isRecording = falsevar isRecording: Bool { if case .recording = state { return true }; return false }Changed files
AppCoordinator.swiftContentView.swiftcoordinator.isRecording = currentViewState.isRunningsetter callTest plan
isRecordingreturns trueisRecordingreturns falseisRecordingstill reflects true statePR 1 of 4 in the menu bar background mode series.
Next: #2 Extract service initialization for headless operation