Repository navigation
Description
Goal
Reduce dual-path PickScribe behavior by concentrating shared incremental, cleanup, delivery, settings, and lifecycle policy while preserving local transcription, cancellation, partial-failure behavior, Linux CLI compatibility, and Linux-first scope.
Why
Incremental, cleanup, and final delivery currently have active CLI and desktop implementations. Recent incremental history required lockstep repairs; the live backlog path differs today. Configuration mutations also have inconsistent persistence/effect publication. Focused deep modules make the interface test surface deterministic without adding speculative cross-platform work.
Top priority
CAND-1 — shared incremental orchestration. First characterize and unify scheduling/fallback/finalization policy used by CLI and desktop. Preserve each adapter’s process files or Tauri events.
Architecture constraints
- Local whisper transcription remains local. Cleanup is the only optional remote step; local-only remains enforced.
- Preserve cancellation, stale-result rejection, raw fallback, segment-safety behavior, and
keep_audiocleanup. - Preserve legacy CLI binaries, wrappers, flags, environment overrides, stdin/stdout, and exit behavior.
- Linux ships; do not add macOS/Windows implementations, platform adapters, or native-host claims.
- Prefer one deep module over shallow pass-through layers. A seam requires two real adapters.
Scope / acceptance checklist
- CLI and Tauri incremental paths share deterministic timing, backlog, fallback, final-drain, and segment-state policy.
- All cleanup callers share provider/local-only/prompt/response/fallback policy while retaining CLI presentation.
- Linux delivery strategy is shared while CLI output/warning behavior remains compatible.
- Settings mutations persist before runtime effects and publish a consistent successful result.
- Lifecycle transition and terminal-outcome behavior has focused tests for cancellation and partial failure.
- No behavioral expansion to remote data handling or non-Linux platforms.
- Existing validation remains green; future release work includes targeted desktop smoke where stated.
Dependency-ordered PR plan
PR 1 — Incremental orchestration
- Depends on: none
- Touches:
src/engine/incremental.rs,src/engine/audio_segments.rs,src/engine/segments.rs,src/bin/pickscribe.rs,src-tauri/src/engine.rs - Prove: CLI and desktop share backlog/fallback/finalization decisions; cancellation and partial segment failure remain safe.
- Validation: focused core/CLI/Tauri incremental tests, then
cargo test --workspace --locked --all-targets. - Link: pending
PR 2 — Shared cleanup policy
- Depends on: none; may run in parallel with PR 1
- Touches:
src/engine/cleanup.rs,src/bin/pickscribe-cleanup.rs,src/bin/pickscribe.rs, desktop cleanup callers - Prove: CLI and desktop apply the same provider, local-only, prompt, response, raw-fallback, and segment-safety policy.
- Validation: cleanup library and CLI tests, then workspace tests.
- Link: pending
PR 3 — Shared Linux delivery
- Depends on: PR 2 if cleanup-binary restructuring conflicts; otherwise none
- Touches:
src/engine/paste.rs,src/bin/pickscribe-cleanup.rs, desktop delivery caller - Prove: CLI flags/output remain compatible while backend selection and insertion policy have one owner.
- Validation: focused paste configuration/CLI tests; manual Linux Wayland and X11 smoke before release.
- Link: pending
PR 4 — Settings application
- Depends on: none
- Touches:
src-tauri/src/lib.rs,src-tauri/src/tray.rs,src/lib/views/Settings.svelte, configuration frontend paths - Prove: persistence failure produces no runtime mutation; full save, float command, and tray use one result path; dirty external changes are explicit.
- Validation: Tauri library tests,
bun run test,bun run check, then workspace tests. - Link: pending
PR 5 — Lifecycle test seam
- Depends on: PR 1 policy contract settled; characterization may begin earlier
- Touches:
src-tauri/src/engine.rs, Tauri lifecycle entry paths and tests - Prove: duplicate requests, every cancellation stage, stale completion, raw fallback, delivery failure, and history failure reach defined terminal states.
- Validation:
cargo test -p pickscribe-app --locked --lib; workspace tests; future desktop smoke for start/stop/cancel before shipping. - Link: pending
Existing issue coordination
- Local AI: on-device transcript cleanup model (eval → baseline → QLoRA → GGUF sidecar) #31: This work may supply a cleanup-policy prerequisite only. Do not add local model evaluation, training, packaging, settings, or UI.
- Adopt responsive unsaved-settings actions #45: Preserve save/discard/navigation semantics; do not absorb responsive interaction work, which awaits PickGauge acceptance.
- Keep the floating capsule out of task switchers #46: Do not change task-switcher, taskbar, pager, focus, geometry, or platform window behavior; it awaits PickGauge validation.
Non-goals
- No macOS/Windows implementation or platform support claim.
- No generic process supervisor, multi-OS interface, or file-size-driven split.
- No feature expansion, provider addition, configuration migration, data migration, or feature flag.
- No implementation of Local AI: on-device transcript cleanup model (eval → baseline → QLoRA → GGUF sidecar) #31, Adopt responsive unsaved-settings actions #45, or Keep the floating capsule out of task switchers #46.
Feature-flag decision
No feature flags. Each PR preserves existing behavior and is independently reviewable; a flag would add another shallow state path without a rollout requirement.
Audit commit snapshot
2e1408619c35d205754ff34449b622fd8305e796 on main.
Current status
Planned.
Next action
Create the master issue from this body, then open PR 1 with characterization tests before changing incremental production routing.
Activity
fix: unblock the UI thread and stop tray subprocess churn (#49)
ElbertePlinio commentedon Jul 19, 2026
CAND-4 progress
PR #51 implements the settings-application slice only; CAND-1 incremental orchestration is untouched.
Status: review-ready — #51
ElbertePlinio commentedon Jul 19, 2026
CAND-2 progress
PR #52 implements the shared cleanup-policy slice only; CAND-1 incremental orchestration and the settings module from #51 are untouched.
engine::cleanup:cloudrejectionStatus: review-ready — #52
ElbertePlinio commentedon Jul 19, 2026
CAND-5 progress
PR #53 implements the lifecycle test-seam slice only; CAND-1 incremental orchestration is untouched.
toggle_action), session-current gating (session_is_current), and terminal-outcome projection (failure_outcome/no_speech_outcome/delivery_outcome) intosrc-tauri/src/lifecycle.rsengine.rswith the singlesession_is_currentpredicate shared by every pipeline checkpointengine.rs; incremental scheduling and theStageset are untouchedcargo test(lib +-p pickscribe-app --locked --lib),cargo test --workspace --locked --all-targets, andbun run buildStatus: review-ready — #53
With CAND-2, CAND-4, and CAND-5 review-ready, CAND-1 (shared incremental orchestration) is now the only remaining candidate, and it now has a lifecycle safety net in place: cancellation, stale-completion, and terminal-outcome behavior around the incremental result is characterized independently of the incremental scheduler itself, so CAND-1's move can proceed against a deterministic seam instead of Tauri effects.
refactor(lifecycle): extract deep transition/session-current/outcome …
refactor(incremental): route the Tauri worker loop through engine::in…
refactor(incremental): delete duplicate scheduling helpers from both …
ElbertePlinio commentedon Jul 19, 2026
CAND-1 (PR 1 — Incremental orchestration) is up: #55.
src/engine/incremental.rsnow owns scheduling/fallback/finalizationpolicy as a deep module (
SchedulingConfig,next_step/choose_segment_end/after_boundary/classify_slice,IncrementalHost+run()), and both theCLI worker loop (
src/bin/pickscribe.rs) and the desktop worker loop(
src-tauri/src/engine.rs) now drive through it instead of each carryingits own copy of the state machine. The one policy divergence between the
two (live backlog overflow: stop-immediately vs. flag-and-continue) is
unified on the CLI's stop-immediately behavior — see #55's description for
the rationale.
CLI process files/exit codes/orphan handling, Tauri events/stage
transitions, the #49
IncrementalResult::Partialsalvage path, andkeep_audioretention are all preserved;cargo test --workspace --locked --all-targets,bun run build, and manual CLI smoke (start/stop/cancelagainst real
pw-record/whisper-cli) are green.This issue completes when #55 merges (the remaining CAND items in the PR
plan are separate follow-up PRs).
refactor(incremental): concentrate incremental orchestration in the s…
ElbertePlinio commentedon Jul 19, 2026
All five candidates landed: #49 (P0 UI-thread + fallback salvage groundwork), #51 (settings module), #52 (shared cleanup policy), #54 (shared Linux delivery), #53 (lifecycle transition seam), #55 (shared incremental orchestration — CLI and desktop now route through one deep policy module; desktop's live backlog-overflow behavior intentionally unified to CLI's stop-immediately, documented in the PR). Main CI green.