kcode-audio-ingress
kcode-audio-ingress 0.4.0 provides durable automatic audio transcription
with transport-neutral speaker correction. It retains complete caller-owned
WAV bytes, sends overlapping chunks to Gemini for unstructured speaker
analysis, validates a typed GPT parse, scores speaker rows through a persistent
classifier, reconciles a readable transcript, and durably exposes one complete
correction packet.
The embedding application supplies typed audio and text-generation callbacks. It owns provider routing, credentials, accounting, object creation, Kmap storage, and user messaging. This crate adds no provider client, HTTP, Kmap, Telegram, object-store, or application-framework dependency.
use Utc;
use ;
async
Pipeline
- Chunking remains bounded to four-minute windows, 15-second overlap, and four concurrent chunks.
- Each chunk goes directly to
gemini-3.1-pro-previewwith the exact exportedGEMINI_SPEAKER_PROMPT_V0_1;AudioChunkRequest::schemaisNone. - The complete raw Gemini response is retained verbatim. A separate
gpt-5.6-solxhightext callback converts it to validated machine JSON containing utterances, notes, clip validity, ISO 639-3 language, and exactly one typed 24-feature row per local speaker. - The persistent classifier is opened beneath the ingress root. Read-only scoring uses a nonaccepting finite threshold and explicit deterministic probe keys. Clean recordings alone train their deterministic correction keys.
- Reconciliation receives explicit chunk-local mappings, marks unclean chunks uncertain, and is forbidden from guessing real identities.
- Completed status includes the transcript and complete transport-neutral
correction packet.
confirm_speakersvalidates exact observation coverage, updates classifier assignments idempotently, and persists confirmed names.
Version 0.4.0 intentionally breaks the former structured-audio callback:
AudioChunkRequest::schema changed from serde_json::Value to
Option<serde_json::Value>. See Documentation.md for the
complete API and Specification.md for behavioral and
persistence guarantees.