Refactor recording metadata to JSON sidecar

Replaces the `.transcript.txt` sidecar with a structured `.json` file
for recording metadata. This change consolidates transcript text,
duration, and other potential metadata into a single, extensible JSON
object.

This also refactors the `TranscriptState` enum to better represent the
on-disk state (absence of file means pending) and the in-memory
representation. The `Transcript` enum now specifically models the
terminal outcomes of the transcriber (`Silent` or `Content`).

The commit includes updates to documentation, data structures, path
handling, and various tests to align with the new metadata format.
This commit is contained in:
2026-04-27 12:48:25 +02:00
parent a510c20e75
commit 66b3b7e4c8
20 changed files with 637 additions and 335 deletions
+16 -10
View File
@@ -250,11 +250,14 @@ async fn early_latch_skips_llm_call_when_manual_set() {
// Also seed a transcript so update_oneliner has content to pass to LLM
// (would call without latch).
std::fs::write(case_dir.join("2026-04-26T11-00-00Z.m4a"), b"audio-bytes").unwrap();
std::fs::write(
case_dir.join("2026-04-26T11-00-00Z.transcript.txt"),
"Patient hat Fieber.",
)
.unwrap();
common::seed_recording_meta(
&case_dir,
"2026-04-26T11-00-00Z",
common::Transcript::Content {
text: "Patient hat Fieber.".into(),
},
None,
);
let locks = OnelinerLocks::new();
let events_tx = doctate_server::events::channel();
@@ -316,11 +319,14 @@ async fn re_check_drops_llm_result_when_manual_appears_during_regen() {
// Seed transcript so update_oneliner enters the LLM branch.
std::fs::write(case_dir.join("2026-04-26T11-00-00Z.m4a"), b"audio-bytes").unwrap();
std::fs::write(
case_dir.join("2026-04-26T11-00-00Z.transcript.txt"),
"Patient klagt über Schwindel.",
)
.unwrap();
common::seed_recording_meta(
&case_dir,
"2026-04-26T11-00-00Z",
common::Transcript::Content {
text: "Patient klagt über Schwindel.".into(),
},
None,
);
let locks = OnelinerLocks::new();
let events_tx = doctate_server::events::channel();