c15590f3e0
This commit changes the way transcriptions are stored and accessed. Instead of using plain text files (`.transcript.txt`), transcriptions will now be part of a JSON metadata file (`<stem>.json`). This allows for richer metadata to be stored alongside the transcript, such as duration, and provides a more robust mechanism for tracking transcription states. The changes include: - Updating documentation and code to reflect the new `.json` file extension. - Modifying file handling logic to read and write JSON metadata. - Adjusting tests to accommodate the new file format.
Dictation fixtures
Persistent, committed test recordings. These are the regression corpus for the
Whisper pipeline — scripts/regress_whisper.sh iterates over them and compares
live output against the golden transcripts.
File layout
Per fixture, three files share a common stem:
| File | Required | Purpose |
|---|---|---|
<name>.m4a |
yes | Raw AAC recording as produced by scripts/dictate.sh / the watch |
<name>.expected.txt |
yes | Golden transcript, hand-reviewed — the regression target |
<name>.hotwords.txt |
no | One-line hotwords list if the fixture is meant to test Fachvokabular |
<name>.notes.md |
no | Short description: what this case exercises, any gotchas |
Naming convention
<domain>_<topic>[_<variant>] — all lowercase, snake_case, no spaces:
cardio_hocm_valsalvacardio_hocm_valsalva_quiet(same content, low SNR variant)ortho_knie_meniskuspsych_ptbs_flashbacks
The prefix encodes the medical domain so we can group by specialty when we start per-user hotwords tuning.
Adding a new fixture
- Record via
./scripts/dictate.sh -n. Speak a realistic case. - Note the case UUID the script prints.
- Copy
$DATA_PATH/<slug>/open/<case_id>/<timestamp>.m4a→tests/fixtures/dictations/<name>.m4a. - Extract the transcript from the recording metadata sidecar:
jq -r '.transcript.text' $DATA_PATH/<slug>/open/<case_id>/<timestamp>.json→ write it totests/fixtures/dictations/<name>.expected.txt. - Review the transcript — fix any Whisper errors by hand. This is the golden reference; accept nothing that is actually wrong.
- If the fixture tests Fachvokabular, add
<name>.hotwords.txtwith the domain-specific words, one space-separated line. - Commit all three/four files together.
What not to commit here
- Personal / real patient data — everything here must be synthetic.
- Long recordings (>2 min) — keep fixtures tight, we want fast regression runs.
- Multiple takes of the same content unless they test a specific variant (noise, speaker, tempo).