Phase 9 of the rebrand cascade. Sweep covers everything the Phase 8
frontend pass deliberately skipped: docs/, root markdown, scripts,
Cargo.toml descriptions, code comments that survived earlier
word-boundary sed, plus a handful of identifiers caught on the final
verify pass.
transcription-app changes:
- README.md, HANDOVER.md, KNOWN-ISSUES.md, run.sh — magnotia/Magnotia
-> lumotia/Lumotia.
- docs/ — sweep across all subdirs except docs/handovers/ (preserved
as immutable audit trail). Includes architecture-map references
to magnotia_core::*, magnotia_storage::*, etc. now pointing at
lumotia_*; dev-setup.md tracing output examples (lumotia_startup
target); brief/ + superpowers/ + issues/ + whisper-ecosystem/ +
audit/.
- Cargo.toml descriptions on 9 crates (core, audio, cloud-providers,
hotkey, llm, mcp, plus referenced others).
- crates/core/src/{error,hardware,recommendation,paths}.rs +
crates/audio/src/wav.rs + crates/llm/src/model_manager.rs +
crates/cloud-providers/src/keystore.rs + crates/mcp/src/lib.rs —
doc comments and a model-manager user-agent string.
- Caught on final pass: BroadcastChannel("magnotia_task_sync") -> ...
("lumotia_task_sync"); magnotia_locale i18n localStorage key
renamed + migration shim added; CSS keyframe names
magnotiaPulse / magnotiaBar / magnotiaFade renamed in the design-
system kit; magnotia_viewer_item / magnotia_viewer_mode handoff
keys renamed in HistoryPage + viewer/+page.svelte; src/assets/
wordmark.svg text.
- src-tauri/src/lib.rs comment cleanup ("magnotia era" was sed'd
to "lumotia era" earlier — restored).
Preserved (intentional):
- crates/core/src/paths.rs — keeps "magnotia" / "Magnotia" / ".magnotia"
legacy detection strings in legacy_and_target_paths() so the
migration shim can still find user data from the magnotia era.
- src/lib/stores/{page,focusTimer}.svelte.ts + src/lib/i18n/index.ts
— migration call sites reference the legacy magnotia keys
deliberately.
- docs/handovers/ — historical audit trail.
cargo build --workspace passes. npm run check: 0 errors / 0 warnings
(3958 files). cargo test --workspace: 339 pass / 0 fail.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5.2 KiB
5.2 KiB
name, type, slice, last_verified
| name | type | slice | last_verified |
|---|---|---|---|
| LLM extract_tasks surface | architecture-map-page | 04-llm-formatting-mcp | 2026/05/09 |
LLM extract_tasks surface
Where you are: Architecture map → LLM, Formatting, MCP → extract_tasks
Plain English summary. extract_tasks reads a transcript and pulls out the action items the speaker actually committed to. Output is a JSON array of imperative sentences, possibly empty. The GBNF accepts an empty array, the prompt asks the model to return one when nothing was committed. A feedback-conditioned variant supports HITL few-shot examples.
At a glance
- Crate:
lumotia-llm - Path:
crates/llm/src/lib.rs:294(extract_tasks) and:358(extract_tasks_with_feedback) - LOC: ~50 across both methods
- Public surface:
pub fn extract_tasks(&self, transcript: &str) -> Result<Vec<String>, EngineError>pub fn extract_tasks_with_feedback(&self, transcript: &str, examples: &[prompts::FeedbackExample]) -> Result<Vec<String>, EngineError>
- External deps that matter: GBNF sampler from llama-cpp-2;
serde_jsonfor the array parse. - Tauri command that calls this (slice 2, best guess):
commands::tasks::extract_tasks_from_transcript_cmd(src-tauri/src/commands/tasks.rs:346), wired viasrc-tauri/src/lib.rs:366. The actual call is attasks.rs:364—tokio::task::spawn_blocking(move || engine.extract_tasks_with_feedback(&transcript, &examples)).
What's in here
extract_tasks (crates/llm/src/lib.rs:294)
Convenience wrapper that calls extract_tasks_with_feedback(transcript, &[]).
extract_tasks_with_feedback (crates/llm/src/lib.rs:358)
Steps:
- If
transcript.trim().is_empty(), returnOk(Vec::new())immediately. No model touch — distinct fromcleanup_textwhich returns an empty string. The empty-vec convention matches what callers expect from "the speaker said nothing actionable". - Borrow the loaded model via
loaded_model_arc().EngineError::NotLoadedif no model is loaded. - Build the system prompt:
prompts::build_conditioned_system_prompt(prompts::EXTRACT_TASKS_SYSTEM, examples). Same conditioning logic asdecompose_task_with_feedback. - Render a chat prompt with two messages —
("system", system)and("user", &format!("Transcript:\n{transcript}")). - Call
generatewith:max_tokens: 768temperature: 0.0stop_sequences: ["<|im_end|>", "<|im_end_of_text|>"]grammar: Some(grammars::OPTIONAL_TASK_ARRAY_GRAMMAR.to_string())
- Parse the raw output via
parse_string_array.
The empty-array case is the difference from decompose_task: OPTIONAL_TASK_ARRAY_GRAMMAR permits [] as a valid root expansion; TASK_ARRAY_GRAMMAR does not.
Data flow
(transcript: &str, examples: &[FeedbackExample])
→ empty-transcript short-circuit (returns Vec::new())
→ loaded_model_arc()
→ build_conditioned_system_prompt(EXTRACT_TASKS_SYSTEM, examples)
→ render_chat_prompt([(system, system), (user, "Transcript:\n{transcript}")])
→ generate(prompt, GenerationConfig {
max_tokens: 768, temp: 0.0,
stops: [<|im_end|>, <|im_end_of_text|>],
grammar: Some(OPTIONAL_TASK_ARRAY_GRAMMAR),
})
→ parse_string_array(raw)
→ Vec<String>
Prompts and grammars
- System prompt:
prompts::EXTRACT_TASKS_SYSTEMatcrates/llm/src/prompts.rs:40. Crucial line: "Output an empty array if there are no action items." - GBNF:
grammars::OPTIONAL_TASK_ARRAY_GRAMMARatcrates/llm/src/grammars.rs:30. Two root alternatives:"[" ws "]"for the empty case, or"[" ws string tail ws "]"with a recursive tail for one-or-more strings.
See llm-prompts-and-grammars.md for full text.
Watch-outs
- Empty array is a valid, expected output. UI and downstream code must treat
Ok(Vec::new())as the "no tasks" success path, not as an error.extract_corrections-style learning loops should skip empty results entirely. max_tokens: 768is larger thandecompose_task's 512. A long meeting transcript can produce many actions; the looser cap reflects that. It does not bound the count of items, only the total tokens of the JSON literal.- The system prompt is the only thing telling the model "explicit commitments only". A model that ignores instruction would happily list observations and wishes; the GBNF is silent on content. If the cleanup_text-style "translator not editor" framing is ever copied here, that is a deliberate prompt-engineering decision, not a refactor.
- Feedback conditioning weight. Recent-first ordering in
examplesis preserved; the prompt builder appends them as a- Input: ... \n Good output: ...bullet list. Long lists dilute the weighting; the Tauri command atsrc-tauri/src/commands/tasks.rsdecides how many examples to pass. - Same GBNF parse-vs-serde concerns as
decompose_task. The grammar guarantees a valid JSON array shape;serde_json::from_strcan still fail on an unfortunate truncation when output approachesmax_tokens.