olenji.

Published application 1.2.0 · Versioned documentation · Markdown source

Terminal captions and agent snapshots

olenji tui SESSION_ID --translation tr opens a live terminal view of the same saved source and source-linked Turkish translations used by the browser and exports. An existing agent can write translation tracks, name speakers and correct source text through the ordinary commands while the view is open. No terminal interaction is required to perform those operations.

olenji tui SESSION_ID --translation tr
olenji tui SESSION_ID --translation tr --seconds 30
olenji live start --source microphone --model faster-whisper.tiny --diarize --tui

The live-start example requires the selected recognition model, the speaker model and a working capture source. The terminal does not download models or grant microphone permissions. Omitting --translation uses the saved default translation language.

What the viewer shows

The viewer polls at roughly 0.4-second intervals and retains a bounded tail of 15 source turns plus the context needed to validate connected translation groups. It fits the newest turns to the terminal's actual dimensions and leaves room for session/capture status and the Ctrl-C detach instruction. Resizing is reflected on a subsequent refresh. Earlier turns remain stored; the terminal is a live viewport rather than a transcript archive. Very long text shows its newest words with an ellipsis. Use segment reads, the browser or an export to inspect all of it.

Every source turn retains its speaker label and color. Unknown attribution remains Speaker unknown. A translated sentence covering several turns appears once, after its last visible source turn, with a label containing its full time span, turn count and source speaker labels. These labels include context outside the visible tail, so a sentence covering Ada and Ece is not presented as Ada's translation alone. Source revisions and human ownership determine whether a translation is current. Stale translations remain saved for review but are not presented as current terminal text.

The existing recognition pipeline's transient previews appear in a separate Draft area. Before acoustic attribution is available, the label is speaker pending. A preview is not committed source, does not advance the durable event cursor, and is not a translation request. Buffered recognition still depends on the model finishing an audio window; a terminal refresh does not imply word-by-word native streaming. A level indicator reflects supplied pipeline measurements, when available. Paused/stopped sessions and connection loss do not pretend that fresh audio is arriving.

Automatic translation has a separate status line when space permits: waiting for a worker, in progress, retry at a stated UTC time, needs attention, or cancelled. The service owns these states; the viewer never submits a retry. The layout reserves that line before fitting speech, preserving recent source, linked translations and the detach instruction. A completed or disabled automatic request removes the line. Machine snapshots expose the same translation_automation metadata; see translation recovery.

Ctrl-C detaches the terminal; it does not stop capture or cancel an admitted job. The command printed in the footer, olenji live stop SESSION_ID, ends that capture through its owning service. --seconds limits the interactive viewing period and also leaves capture running.

Structured output for agents

JSON, JSONL and redirected stdout return one bounded snapshot, without entering an alternate screen or starting a follow loop:

olenji tui SESSION_ID --translation tr --json
olenji tui SESSION_ID --translation tr --jsonl
olenji tui SESSION_ID > recent-transcript.json

The normal {ok, schema_version, data} envelope contains the /tail projection in data: session, segments, translations, speakers, annotations, views, tail_ids, cursor and transient partials. Render the source IDs in tail_ids; additional source rows provide translation context. The existing tail limits are 100 recent turns at the API boundary, 1,000 connected translation tracks and 5,000 additional source IDs. The CLI requests 15 recent turns. The tail includes the session's speaker metadata. These are record-count limits, not an assertion that the serialized payload is a fixed number of bytes.

--seconds applies only to the interactive display; a machine snapshot always returns once. For a durable follow stream, use olenji events SESSION_ID --follow --committed-only --jsonl. For full-session search, filters, bounded notes/speaker pages or a selected source window, use olenji sessions window SESSION_ID --query '{"limit":100,"target_language":"tr"}' --json.

The display timer starts after the initial snapshot. Refreshes and reconnects share the client's bounded observer transport: the remaining display/reconnect budget limits health probes and data reads, and expiry is checked between response chunks. An observer body over 8 MiB returns RESPONSE_TOO_LARGE; choose a smaller session window or export for that content. These synchronous checks are not a hard real-time interrupt of an OS call; a late response is discarded instead of being rendered as an in-budget refresh.

olenji live start --tui --json returns the ordinary capture-start result with an additional terminal snapshot and immediately releases the caller. Inspect the session's capture status before saying audio is flowing. Explicit --output human on a non-terminal fails with TERMINAL_REQUIRED; for live start --tui this check happens before capture is started.

Transient polling and reconnects

GET /api/sessions/SESSION_ID/tail?include_partials=true samples the runtime's current transient records even when the committed snapshot is unchanged. For example, a response may contain {unchanged:true,cursor:123,partials:[...]}. Each partial includes its session ID, runtime epoch and increasing draft_revision. Transcript previews and input levels are separate records. The response excludes other sessions' drafts. Without include_partials, the prior tail response contract is unchanged.

The cursor still belongs exclusively to the atomic SQLite snapshot. Transients are sampled separately and may be replaced or cleared between polls; consumers must not save them as committed transcript or derive a durable event checkpoint from their revision. Source changes still return a complete bounded tail and its new cursor. A checkpoint ahead of a restored database produces a replacement snapshot, rather than a mixture of old and new rows.

During a retryable local connection failure, the interactive viewer keeps its last committed view, hides obsolete transient previews and displays Reconnecting. Retry delays increase up to two seconds within a 15-second recovery budget; refresh requests are bounded by the remaining view/recovery duration and a five-second request timeout, with the client's separate ownership probe bounded to one second. Authentication, missing/deleted-session and compatibility failures remain explicit errors. An expired recovery budget returns the connection failure.

Initial viewing can start the local service through the standard client path. Subsequent refreshes verify the existing workspace and application-version identity without entering the client's automatic service-start branch. The viewer can follow an explicitly restarted service for that same workspace and use its new cursor, but cannot restart capture or silently replace a missing owner itself.

Verification boundary

The focused terminal suite renders real Rich output at multiple console dimensions, checks complete translation ownership and saved revisions through real SQLite, and coordinates transient/reconnect boundaries without elapsed-time races. The API regression verifies that draft/level changes remain available on unchanged responses without creating durable source or events. A separate real CLI/PTY exercise covers an 80×24 terminal, structured redirection, source correction, translation staleness, history, service restart, active-view reconnection and detach ownership.

Those checks use synthetic text and a Linux terminal. They do not establish microphone, acoustic speaker quality, native macOS/Windows terminal behavior or real model inference. See the current validation and native handoff documents for those separately executed gates.