Expand description
~/.omni-dev/voice/<id>/ session directory I/O.
Lays out and reads the session directory format from #799:
~/.omni-dev/voice/<session-id>/
meta.yaml # session config (this issue: last_reflected_event_id + ttl defaults)
transcript.jsonl # append-only TranscriptEvent stream from `voice transcribe`
events.jsonl # append-only Event stream from `voice reflect` (and later `voice review`)
reflections.log # per-reflection summary line (cost, latency, status)Shared with #804 (voice review), which reads the same events.jsonl
to produce materialised markdown projections. The session root path is
derived from dirs::home_dir() by default; the OMNI_DEV_VOICE_ROOT
environment variable overrides it (intended for tests, not a stable
user-facing knob).
Structs§
- Session
- Combination of paths and the parsed meta document.
- Session
Meta - Parsed contents of
meta.yaml. - Session
Paths - Filesystem paths under a single session directory.
- TtlDefaults
- Default TTLs per item class (per #799), stored in
meta.yamlso a session can override them. Serialised as integer seconds.
Functions§
- append_
events - Appends events as JSONL to
path. Each event is one line, flushed after the batch. Skips silently wheneventsis empty. - append_
log_ line - Appends a single line (with newline) to
reflections.log. Creates the file if it does not exist. - open_
or_ create - Opens an existing session, or creates an empty one if the directory
doesn’t exist. Bootstrap is idempotent: re-running against an
already-populated session reads the existing
meta.yaml. - open_
or_ create_ under - Variant of
open_or_createthat takes an explicit voice root — useful for tests that drive several sessions under atempfiledirectory. - read_
events - Reads all reflection
Events fromevents.jsonl. Returns an empty vec if the file doesn’t exist (greenfield session). - read_
meta - Reads and parses
meta.yaml. - read_
transcript - Reads all
TranscriptEvents from a JSONL file. Blank lines are skipped; parse errors include the line number. - read_
transcript_ finals_ after - Reads only
Finaltranscript events after the optional marker. - voice_
root - Resolves the session root:
$OMNI_DEV_VOICE_ROOTif set, else~/.omni-dev/voice. - write_
meta - Writes
meta.yamlatomically (write-temp-then-rename).