Files
Lumotia/src-tauri/src/commands/mod.rs
Jake 3770815fbf
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled
agent: lumotia — v0.1 release-completion run
Closes the code-side v0.1 ship gate. All quality gates green:
cargo fmt/clippy/test (~327 tests), npm check (0/0), vitest 13/13,
scripts/dogfood-rebrand-drill.sh 8/8.

Phase F — first-run onboarding promoted to v0.1
- FirstRunPage with skip-to-main + failure recovery + event recording
- Six onboarding commands (record/list/has-completed + lumotia_events)
- Storage migration v17 (onboarding_events + lumotia_events tables)

UI hardening (in-scope items from v0.1-ui-hardening.md)
- StatusPill + PostCaptureCard components, 21st preview entry
- Sidebar recording-as-sacred-state (opacity + aria-disabled, reduced-motion)
- Settings 6-section regroup + Help section + Activation log + Privacy toggle
- Error-state copy sweep (DictationPage + SettingsPage, plain-language)
- Global :focus-visible rule, textarea outlines restored
- Ctrl+K / Ctrl+, / Escape bindings in +layout

LLM resilience
- rule_based_extract_tasks (regex-free imperative-verb extractor) +
  extract_tasks_with_fallback wrapper — task extraction never returns zero
- tokio::time::timeout(120s) wraps cleanup/tags/tasks commands

Release artefacts
- LICENSE (canonical AGPL-3.0), CHANGELOG (Keep-a-Changelog format)
- v0.1-release-notes, privacy-and-ai-use, install-warnings,
  tester-onboarding-kit, tester-acceptance-runbook, code-signing-setup,
  apple-silicon-rb08-runbook, virtual-audio-setup, v0.1-contrast-audit
- Workspace versioning + AGPL spdx; npm exact-pin (10 ranges removed)
- AppImage SHA-256 sidecar in build.yml
- README v0.1 section + Reporting-issues; canonical repo slug

Closure pass — items moved from human-required to code-complete
- KI-02 Linux idle inhibit: zbus 5 → org.freedesktop.login1.Manager.Inhibit
- KI-03 Windows sleep prevention: SetThreadExecutionState(ES_CONTINUOUS|...)
- acquire/release_idle_inhibit Tauri commands, wired in DictationPage
- Diagnostic-bundle frontend wire-up (Settings → Help button)
- WCAG-AA contrast fix via .btn-filled-text utility (no token changes)
- 8 destructive-action sites wrapped in plain-language confirm() guards
- KNOWN-ISSUES.md + v0.1-known-limitations.md updated (KI-02/03 fixed)

Scripts
- pre-tag-verify.sh, tag-day.sh, smoke-linux + driver
- parse-diagnostic-bundle.sh, parse-activation-log.py

Per-item audit trail: docs/release/v0.1-completion-status.md
Remaining: W-01…W-08 (signing certs, hardware probes, smoke matrix,
tester recruitment) — see docs/release/v0.1-known-limitations.md.
2026-05-15 06:59:08 +01:00

116 lines
3.3 KiB
Rust

pub mod audio;
pub mod clipboard;
pub mod diagnostics;
pub mod feedback;
pub mod fs;
pub mod hardware;
pub mod hotkey;
pub mod intentions;
pub mod live;
pub mod llm;
pub mod meeting;
pub mod models;
pub mod nudges;
pub mod onboarding;
pub mod paste;
pub mod power;
pub mod profiles;
pub mod rituals;
pub mod security;
pub mod tasks;
pub mod transcription;
pub mod transcripts;
pub mod tts;
pub mod update;
pub mod windows;
/// Build the Whisper `initial_prompt` for a transcription request.
///
/// Precedence:
/// 1. Caller-supplied `request_prompt` (non-empty wins outright — the caller
/// has already made the decision).
/// 2. Profile's stored prompt + profile terms (joined: the prompt frames the
/// task, the vocabulary biases recognition toward domain terms).
/// 3. Profile prompt alone, or vocabulary alone.
/// 4. `None` if nothing is set.
///
/// Feeding `profile_terms` into `initial_prompt` (the OpenWhispr pattern) lets
/// whisper.cpp bias its decoder toward the correct spelling of user-specific
/// vocabulary at decode time, before any LLM cleanup pass.
pub fn build_initial_prompt(
request_prompt: &str,
profile_prompt: &str,
profile_terms: &[String],
) -> Option<String> {
let trimmed_request = request_prompt.trim();
if !trimmed_request.is_empty() {
return Some(trimmed_request.to_string());
}
let trimmed_profile = profile_prompt.trim();
let terms_list = profile_terms
.iter()
.map(|term| term.trim())
.filter(|term| !term.is_empty())
.collect::<Vec<_>>()
.join(", ");
match (trimmed_profile.is_empty(), terms_list.is_empty()) {
(true, true) => None,
(false, true) => Some(trimmed_profile.to_string()),
(true, false) => Some(format!("Vocabulary: {terms_list}.")),
(false, false) => Some(format!("{trimmed_profile} Vocabulary: {terms_list}.")),
}
}
#[cfg(test)]
mod tests {
use super::build_initial_prompt;
#[test]
fn caller_prompt_overrides_everything() {
let got = build_initial_prompt(
"caller wins",
"profile prompt",
&["Wren".into(), "CORBEL".into()],
);
assert_eq!(got.as_deref(), Some("caller wins"));
}
#[test]
fn profile_prompt_and_terms_are_joined() {
let got = build_initial_prompt(
"",
"You are a meeting notes assistant.",
&["Wren".into(), "CORBEL".into()],
);
assert_eq!(
got.as_deref(),
Some("You are a meeting notes assistant. Vocabulary: Wren, CORBEL."),
);
}
#[test]
fn terms_only_produces_vocabulary_sentence() {
let got = build_initial_prompt("", "", &["Wren".into(), "CORBEL".into()]);
assert_eq!(got.as_deref(), Some("Vocabulary: Wren, CORBEL."));
}
#[test]
fn profile_prompt_alone_is_passed_through() {
let got = build_initial_prompt("", "Be concise.", &[]);
assert_eq!(got.as_deref(), Some("Be concise."));
}
#[test]
fn all_empty_returns_none() {
assert_eq!(build_initial_prompt("", "", &[]), None);
}
#[test]
fn whitespace_only_terms_are_skipped() {
let got = build_initial_prompt("", "", &[" ".into(), "Wren".into(), "".into()]);
assert_eq!(got.as_deref(), Some("Vocabulary: Wren."));
}
}