feat(pipeline): S4-T7 per-app tone profiles for LLM cleanup#39
Open
rdemeritt wants to merge 7 commits into
Open
feat(pipeline): S4-T7 per-app tone profiles for LLM cleanup#39rdemeritt wants to merge 7 commits into
rdemeritt wants to merge 7 commits into
Conversation
Adds ToneProfile enum (casual/formal/code/raw) with per-app persistence via AppToneProfileStore (UserDefaults-backed, @observable, @mainactor). Wires into TranscriptionPipeline: .raw bypasses the LLM entirely; other profiles append their systemPromptSuffix via ToneProfileCleanupWrapper. CleanupProfile gains customSystemPrompt so both LlamaCpp and Ollama providers consume it via effectiveSystemPrompt without API changes. Settings tab "Tone" added to SettingsView. Store injected into AppDelegate and pipeline at launch. 16 new tests cover CRUD, sorting, persistence, and Codable round-trip.
- cyclomatic_complexity: extract applySilenceTrim and applyFillerScrubber helpers from stopAndTranscribe, reducing complexity from 12 to 10 - line_length: split SnippetExpander logger.info call into local bindings - file_length: add swiftlint:disable file_length to SettingsView.swift - implicitly_unwrapped_optional/force_unwrapping: replace IUO setUp with setUpWithError throws + XCTUnwrap in ToneProfileStoreTests
Zero violations under swiftlint lint --strict across 105 files. Fixes cover cyclomatic_complexity, identifier_name, opening_brace, trailing_comma, sorted_imports, force_unwrapping, implicitly_unwrapped_optional, for_where, large_tuple, line_length, superfluous_disable_command, static_over_final_class, file_length, function_body_length, type_body_length, nesting, colon, and redundant_discardable_let across 17 source and test files. Logic unchanged.
build-and-test (debug + tests) completes before the 10-min runner job token window. The release build was starting ~3 min after expiry and getting cancelled. Moving it to its own job gives it a fresh token.
…ndow Job token window is 10 min. Debug build with --jobs 4 was taking 12-13 min. Removing the CPU throttle allows the build to complete before token expiry. The original --jobs 4 was a CPU-starvation guard that is no longer needed.
swift build --build-tests compiles all test targets. Without --skip-build, swift test rebuilds them again (~11 min), exceeding the token window. With --skip-build the test step runs in seconds.
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
ToneProfileenum (casual/formal/code/raw) withsystemPromptSuffixper variantAppToneProfileStore(@Observable,@MainActor) persists bundle ID → profile mappings in UserDefaults; CRUD + sorted listingTranscriptionPipeline.setToneProfileStore(_:)setter;.rawbypasses LLM entirely, other profiles inject suffix viaToneProfileCleanupWrapperCleanupProfile.customSystemPrompt/effectiveSystemPrompt— LlamaCpp and Ollama providers updated to use it; no LLMProvider protocol change neededToneProfilesSettingsView— "Tone" tab in Settings with live app hint, add/delete UI, prompt-suffix previewAppToneProfileStore.sharedinjected into AppDelegate and pipeline at launchTest plan
swift build— zero errors (confirmed)swift test— 16 new tests pass; 4 pre-existing failures in ModelDownloadManagerTests and VoiceCommandProcessorTests are unrelated to this PR