Repository navigation
refactor: concentrate settings persistence and application - #51
Merged
Merged
Conversation
7 tasks
This was referenced Jul 19, 2026
ElbertePlinio
added a commit
that referenced
this pull request
Jul 19, 2026
…module (#53) Concentrate the recording pipeline's deterministic decisions into a new src-tauri/src/lifecycle.rs so they can be characterized without an AppHandle, following #51's settings-module convention. - toggle_action(): pure Idle/Recording/busy -> Start/Stop/Ignore decision, used by the command, tray, and single-instance adapters via toggle(). - session_is_current(): single predicate replacing the three duplicated stale-session checks in is_session_current/set_state_for_session/ finish_session, gating every pipeline checkpoint. - failure_outcome()/no_speech_outcome()/delivery_outcome(): terminal projections for recorder/transcription failure, empty transcript, and post-delivery cleanup/paste/history results (supersedes the old final_delivery_status()). recorder/STT/cleanup/delivery/history stay effect implementations in engine.rs; incremental scheduling and visible Stage values are untouched. Adds characterization tests for duplicate start/toggle, stop before init finishes, cancellation at every pipeline checkpoint, stale completion after cancel/new session, cleanup failure with raw delivery, and history failure. Ref #47 (CAND-5).
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
Failure policy
Persistence failure returns before telemetry, minidump, float-window, or config-event effects. Atomic replacement also preserves the previous config bytes if the final rename fails.
Decisions
Validation
cargo test --workspace --locked --all-targets— 90 passedbun run test— 30 passedbun run check— 0 errors, 0 warningsbun run build— passedgit diff --check— passedRefs #47 (CAND-4 only)