agent: lumotia — v0.1 release-completion run
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

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.
This commit is contained in:
2026-05-15 06:59:08 +01:00
parent bf1b68275a
commit 3770815fbf
77 changed files with 8697 additions and 1017 deletions

View File

@@ -1,7 +1,9 @@
[package]
name = "lumotia-storage"
version = "0.1.0"
edition = "2021"
version.workspace = true
edition.workspace = true
repository.workspace = true
license.workspace = true
description = "SQLite persistence, BM25 search, and file storage for Lumotia"
[dependencies]

View File

@@ -1718,6 +1718,159 @@ pub async fn record_feedback(pool: &SqlitePool, params: RecordFeedbackParams) ->
Ok(row.get::<i64, _>("id"))
}
// --- Onboarding events ---
/// Row returned by [`list_onboarding_events`].
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct OnboardingEventRow {
pub id: i64,
pub event: String,
pub completed_at: i64,
pub version: String,
pub skipped: bool,
pub notes: Option<String>,
}
/// Row returned by [`list_lumotia_events`].
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct LumotiaEventRow {
pub id: i64,
pub kind: String,
pub occurred_at: i64,
pub payload: Option<String>,
}
/// Insert a single onboarding step event.
///
/// `now` is a Unix timestamp (seconds) — the caller is responsible for
/// computing it so the helper stays testable without a clock dependency.
pub async fn insert_onboarding_event(
pool: &SqlitePool,
event: &str,
version: &str,
skipped: bool,
notes: Option<&str>,
now: i64,
) -> Result<()> {
sqlx::query(
"INSERT INTO onboarding_events (event, completed_at, version, skipped, notes)
VALUES (?, ?, ?, ?, ?)",
)
.bind(event)
.bind(now)
.bind(version)
.bind(skipped as i64)
.bind(notes)
.execute(pool)
.await
.map_err(|source| Error::Query {
operation: "insert_onboarding_event".into(),
source,
})?;
Ok(())
}
/// Return all onboarding events, oldest first.
pub async fn list_onboarding_events(pool: &SqlitePool) -> Result<Vec<OnboardingEventRow>> {
let rows = sqlx::query(
"SELECT id, event, completed_at, version, skipped, notes
FROM onboarding_events
ORDER BY id ASC",
)
.fetch_all(pool)
.await
.map_err(|source| Error::Query {
operation: "list_onboarding_events".into(),
source,
})?;
Ok(rows
.into_iter()
.map(|r| OnboardingEventRow {
id: r.get("id"),
event: r.get("event"),
completed_at: r.get("completed_at"),
version: r.get("version"),
skipped: r.get::<i64, _>("skipped") != 0,
notes: r.get("notes"),
})
.collect())
}
/// Returns `true` if the user has ever recorded a `completed` or `skipped`
/// onboarding event — i.e. they do not need to see onboarding again.
pub async fn has_completed_onboarding(pool: &SqlitePool) -> Result<bool> {
let count: i64 = sqlx::query_scalar(
"SELECT COUNT(*) FROM onboarding_events WHERE event IN ('completed', 'skipped')",
)
.fetch_one(pool)
.await
.map_err(|source| Error::Query {
operation: "has_completed_onboarding".into(),
source,
})?;
Ok(count > 0)
}
/// Insert a single opt-in activation log event.
///
/// `now` is a Unix timestamp (seconds).
pub async fn insert_lumotia_event(
pool: &SqlitePool,
kind: &str,
payload: Option<&str>,
now: i64,
) -> Result<()> {
sqlx::query("INSERT INTO lumotia_events (kind, occurred_at, payload) VALUES (?, ?, ?)")
.bind(kind)
.bind(now)
.bind(payload)
.execute(pool)
.await
.map_err(|source| Error::Query {
operation: "insert_lumotia_event".into(),
source,
})?;
Ok(())
}
/// Return all lumotia events, oldest first.
pub async fn list_lumotia_events(pool: &SqlitePool) -> Result<Vec<LumotiaEventRow>> {
let rows = sqlx::query(
"SELECT id, kind, occurred_at, payload
FROM lumotia_events
ORDER BY id ASC",
)
.fetch_all(pool)
.await
.map_err(|source| Error::Query {
operation: "list_lumotia_events".into(),
source,
})?;
Ok(rows
.into_iter()
.map(|r| LumotiaEventRow {
id: r.get("id"),
kind: r.get("kind"),
occurred_at: r.get("occurred_at"),
payload: r.get("payload"),
})
.collect())
}
/// Delete all rows from `lumotia_events`.
pub async fn clear_lumotia_events(pool: &SqlitePool) -> Result<()> {
sqlx::query("DELETE FROM lumotia_events")
.execute(pool)
.await
.map_err(|source| Error::Query {
operation: "clear_lumotia_events".into(),
source,
})?;
Ok(())
}
/// Fetch the most recent feedback rows for a given target type, scoped to
/// the active profile. Used by the prompt builder to gather few-shot
/// exemplars. Orders by `created_at DESC` so the most recent corrections
@@ -3284,4 +3437,98 @@ mod tests {
"audio for surviving in-retention row must NOT be removed by purge"
);
}
// --- onboarding_events tests ---
#[tokio::test]
async fn onboarding_insert_and_list_roundtrip() {
let pool = test_pool().await;
insert_onboarding_event(&pool, "started", "0.1.0", false, None, 1_000_000)
.await
.unwrap();
insert_onboarding_event(
&pool,
"recorded_first",
"0.1.0",
false,
Some("took 45s"),
1_000_060,
)
.await
.unwrap();
let rows = list_onboarding_events(&pool).await.unwrap();
assert_eq!(rows.len(), 2);
assert_eq!(rows[0].event, "started");
assert_eq!(rows[0].version, "0.1.0");
assert!(!rows[0].skipped);
assert!(rows[0].notes.is_none());
assert_eq!(rows[1].event, "recorded_first");
assert_eq!(rows[1].notes.as_deref(), Some("took 45s"));
}
#[tokio::test]
async fn has_completed_onboarding_no_events() {
let pool = test_pool().await;
assert!(!has_completed_onboarding(&pool).await.unwrap());
}
#[tokio::test]
async fn has_completed_onboarding_only_started() {
let pool = test_pool().await;
insert_onboarding_event(&pool, "started", "0.1.0", false, None, 1_000_000)
.await
.unwrap();
assert!(!has_completed_onboarding(&pool).await.unwrap());
}
#[tokio::test]
async fn has_completed_onboarding_with_completed_event() {
let pool = test_pool().await;
insert_onboarding_event(&pool, "started", "0.1.0", false, None, 1_000_000)
.await
.unwrap();
insert_onboarding_event(&pool, "completed", "0.1.0", false, None, 1_000_120)
.await
.unwrap();
assert!(has_completed_onboarding(&pool).await.unwrap());
}
#[tokio::test]
async fn has_completed_onboarding_with_skipped_event() {
let pool = test_pool().await;
insert_onboarding_event(&pool, "skipped", "0.1.0", true, None, 1_000_005)
.await
.unwrap();
assert!(has_completed_onboarding(&pool).await.unwrap());
}
// --- lumotia_events tests ---
#[tokio::test]
async fn lumotia_event_insert_list_clear_roundtrip() {
let pool = test_pool().await;
insert_lumotia_event(&pool, "app_launched", None, 1_000_000)
.await
.unwrap();
insert_lumotia_event(
&pool,
"recording_started",
Some(r#"{"profile":"default"}"#),
1_000_010,
)
.await
.unwrap();
let rows = list_lumotia_events(&pool).await.unwrap();
assert_eq!(rows.len(), 2);
assert_eq!(rows[0].kind, "app_launched");
assert!(rows[0].payload.is_none());
assert_eq!(rows[1].kind, "recording_started");
assert_eq!(rows[1].payload.as_deref(), Some(r#"{"profile":"default"}"#));
clear_lumotia_events(&pool).await.unwrap();
let rows_after = list_lumotia_events(&pool).await.unwrap();
assert!(rows_after.is_empty());
}
}

View File

@@ -10,18 +10,20 @@ pub use error::{Entity, Error, MigrationStep, OpenOp, Result};
pub const DEFAULT_PROFILE_ID: &str = "00000000-0000-0000-0000-000000000001";
pub use database::{
add_profile_term, complete_subtask_and_check_parent, complete_task, count_transcripts,
create_profile, delete_implementation_rule, delete_profile, delete_profile_term, delete_task,
delete_transcript, get_implementation_rule, get_profile, get_setting, get_task_by_id,
get_transcript, init, init_readonly, insert_implementation_rule, insert_subtask, insert_task,
insert_transcript, list_feedback_examples, list_implementation_rules, list_profile_terms,
list_profiles, list_recent_completions, list_recent_errors, list_subtasks, list_tasks,
list_transcripts, list_transcripts_paged, list_trashed_transcripts, log_error,
mark_implementation_rule_fired, migrate_legacy_setting_keys, prune_error_log,
purge_deleted_transcripts, record_feedback, restore_transcript, search_transcripts,
set_implementation_rule_enabled, set_setting, set_task_energy, uncomplete_task, update_profile,
update_task, update_transcript, update_transcript_meta, DailyCompletionCount, ErrorLogRow,
FeedbackRow, FeedbackTargetType, ImplementationRuleRow, InsertTranscriptParams, ProfileRow,
add_profile_term, clear_lumotia_events, complete_subtask_and_check_parent, complete_task,
count_transcripts, create_profile, delete_implementation_rule, delete_profile,
delete_profile_term, delete_task, delete_transcript, get_implementation_rule, get_profile,
get_setting, get_task_by_id, get_transcript, has_completed_onboarding, init, init_readonly,
insert_implementation_rule, insert_lumotia_event, insert_onboarding_event, insert_subtask,
insert_task, insert_transcript, list_feedback_examples, list_implementation_rules,
list_lumotia_events, list_onboarding_events, list_profile_terms, list_profiles,
list_recent_completions, list_recent_errors, list_subtasks, list_tasks, list_transcripts,
list_transcripts_paged, list_trashed_transcripts, log_error, mark_implementation_rule_fired,
migrate_legacy_setting_keys, prune_error_log, purge_deleted_transcripts, record_feedback,
restore_transcript, search_transcripts, set_implementation_rule_enabled, set_setting,
set_task_energy, uncomplete_task, update_profile, update_task, update_transcript,
update_transcript_meta, DailyCompletionCount, ErrorLogRow, FeedbackRow, FeedbackTargetType,
ImplementationRuleRow, InsertTranscriptParams, LumotiaEventRow, OnboardingEventRow, ProfileRow,
ProfileTermRow, RecordFeedbackParams, TaskRow, TranscriptRow,
};
pub use file_storage::{app_data_dir, crashes_dir, database_path, logs_dir, recordings_dir};

View File

@@ -507,6 +507,32 @@ const MIGRATIONS: &[(i64, &str, &str)] = &[
ON transcripts(deleted_at) WHERE deleted_at IS NOT NULL;
"#,
),
(
17,
"onboarding_events + lumotia_events tables",
r#"
-- onboarding_events: gates first-run, supplies time-to-first-capture metric
CREATE TABLE IF NOT EXISTS onboarding_events (
id INTEGER PRIMARY KEY AUTOINCREMENT,
event TEXT NOT NULL,
completed_at INTEGER NOT NULL,
version TEXT NOT NULL,
skipped INTEGER NOT NULL DEFAULT 0,
notes TEXT
);
CREATE INDEX IF NOT EXISTS idx_onboarding_events_event ON onboarding_events(event);
-- lumotia_events: opt-in local activation log
CREATE TABLE IF NOT EXISTS lumotia_events (
id INTEGER PRIMARY KEY AUTOINCREMENT,
kind TEXT NOT NULL,
occurred_at INTEGER NOT NULL,
payload TEXT
);
CREATE INDEX IF NOT EXISTS idx_lumotia_events_kind ON lumotia_events(kind);
CREATE INDEX IF NOT EXISTS idx_lumotia_events_occurred ON lumotia_events(occurred_at);
"#,
),
];
/// Split SQL into individual statements, respecting BEGIN...END trigger blocks.
@@ -681,7 +707,7 @@ mod tests {
.fetch_one(&pool)
.await
.unwrap();
assert_eq!(count, 16);
assert_eq!(count, 17);
sqlx::query("INSERT INTO settings (key, value) VALUES ('test', 'value')")
.execute(&pool)
@@ -700,7 +726,7 @@ mod tests {
.fetch_one(&pool)
.await
.unwrap();
assert_eq!(count, 16);
assert_eq!(count, 17);
}
#[tokio::test]
@@ -1239,6 +1265,77 @@ mod tests {
);
}
#[tokio::test]
async fn migration_v17_creates_onboarding_and_lumotia_events_tables() {
// v0.1 onboarding-event tracking and opt-in local activation log.
// Verify both tables exist with the expected columns after running
// all migrations. Uses PRAGMA table_info to inspect column presence.
let pool = fk_test_pool().await;
run_migrations(&pool).await.expect("migrate");
// --- onboarding_events ---
let info = sqlx::query("PRAGMA table_info(onboarding_events)")
.fetch_all(&pool)
.await
.expect("pragma onboarding_events");
assert!(
!info.is_empty(),
"onboarding_events table must exist after v17"
);
let names: Vec<String> = info.iter().map(|r| r.get::<String, _>("name")).collect();
for col in ["id", "event", "completed_at", "version", "skipped", "notes"] {
assert!(
names.contains(&col.to_string()),
"onboarding_events must have column {col}; got {names:?}"
);
}
// Index on onboarding_events(event) must exist.
let idx_names: Vec<String> = sqlx::query_scalar(
"SELECT name FROM sqlite_master \
WHERE type = 'index' AND tbl_name = 'onboarding_events'",
)
.fetch_all(&pool)
.await
.expect("read onboarding_events indexes");
assert!(
idx_names.iter().any(|n| n == "idx_onboarding_events_event"),
"expected idx_onboarding_events_event, got {idx_names:?}",
);
// --- lumotia_events ---
let info2 = sqlx::query("PRAGMA table_info(lumotia_events)")
.fetch_all(&pool)
.await
.expect("pragma lumotia_events");
assert!(
!info2.is_empty(),
"lumotia_events table must exist after v17"
);
let names2: Vec<String> = info2.iter().map(|r| r.get::<String, _>("name")).collect();
for col in ["id", "kind", "occurred_at", "payload"] {
assert!(
names2.contains(&col.to_string()),
"lumotia_events must have column {col}; got {names2:?}"
);
}
// Both indexes on lumotia_events must exist.
let idx_names2: Vec<String> = sqlx::query_scalar(
"SELECT name FROM sqlite_master \
WHERE type = 'index' AND tbl_name = 'lumotia_events'",
)
.fetch_all(&pool)
.await
.expect("read lumotia_events indexes");
for idx in ["idx_lumotia_events_kind", "idx_lumotia_events_occurred"] {
assert!(
idx_names2.iter().any(|n| n == idx),
"expected index {idx}, got {idx_names2:?}",
);
}
}
#[tokio::test]
async fn migration_v16_adds_deleted_at_column_and_index() {
// Rev-2 / Rev-3 atomiser fix (2026-05-12). Verify the soft-delete