kcode-k1-full-audio 0.3.5

Durable orchestration of full audio into classified overlapping K1 fragments
Documentation
# Full audio

`K1FullAudio` synchronously converts a complete media value to Ogg Opus, fragments it, submits every fragment for classification, and stores one private manifest Object.

## Public API

```rust
pub type FullAudioId = kcode_k1_objects::TxId;
pub struct K1FullAudio { /* private fields */ }
pub enum FullAudioState { Processing, AwaitingLabels, NeedsAttention, Complete }
pub struct FullAudioFragmentStatus { pub fragment_id: FragmentId, pub start_sample_48k: u64, pub end_sample_48k: u64, pub status: FragmentStatus }
pub struct FullAudioStatus { pub state: FullAudioState, pub fragments: Vec<FullAudioFragmentStatus>, pub final_transcript: Option<String> }
impl K1FullAudio {
    pub fn open(ffmpeg_path: impl AsRef<Path>, objects: Arc<K1Objects>, classification: Arc<AudioClassification>) -> Result<Self, String>;
    pub fn submit(&self, audio: &[u8]) -> Result<FullAudioId, String>;
    pub fn status(&self, id: FullAudioId) -> Result<FullAudioStatus, String>;
    pub fn fragment_audio(&self, id: FullAudioId, fragment_id: FragmentId) -> Result<Vec<u8>, String>;
}
```

`FullAudioId` is the manifest Object transaction ID. `K1FullAudio` has private fields. `FullAudioState` implements `Clone`, `Debug`, `Eq`, and `PartialEq`; both status structs implement `Clone`, `Debug`, and `PartialEq`. The crate exports no public constants or free functions.

### Operations

`open` requires an absolute trusted FFmpeg path and does not probe the filesystem. Objects and classification retain persistence and transaction authority. It copies and validates the path without filesystem I/O.

`submit` accepts the converter's nonempty self-contained media domain, converts its first audio stream exactly, deterministically fragments normalized Ogg Opus in source order, validates metadata, submits every complete fragment sequentially and strictly, then saves one immutable private `k1-full-audio-manifest-v1` Object with empty filename and description. Equal submissions remain independent. Intervals start at zero, have positive duration of at most 7,200,000 samples, strictly increasing starts and ends, positive overlap, unique fragment IDs, and a fragmenter-guaranteed 720,000-sample overlap. A later failure can leave earlier fragment Objects and work, but no manifest is saved unless all submissions and encoding succeed. There is no rollback, cancellation, or background work.

`status` requires the exact present private Object and metadata, strictly validates its immutable manifest, queries one present classification status per fragment, and preserves order. Unknown IDs, malformed Objects, invalid geometry, duplicates, missing statuses, and inconsistent values are errors. `NeedsAttention` takes precedence for `Failed` or `Discarded`, then `Processing` for `Queued` or `Running`; only `Completed` and `Confirmed` yields `AwaitingLabels`, while all `Confirmed` with transcripts yields `Complete`. Transcript presence in any other state is inconsistent.

`fragment_audio` requires the exact present private manifest Object and strictly validates it before proving that the supplied fragment belongs to that FullAudio. It then loads that exact immutable fragment Object, requires an empty filename and description plus media type `audio/ogg`, and returns its original bytes. Unknown or malformed manifests, foreign or missing fragments, and invalid fragment Object metadata are errors. The operation performs no classification read, mutation, conversion, authorization, or Person lookup.

Returned statuses preserve `SpeakerLabelV1.person_id: Option<PersonId>` unchanged: `Some` is known and `None` is Unknown. Full audio makes no Persons call, name lookup, canonicalization, discovery, or identity authority decision. Label submission and final-fragment construction remain classification-owned. Manifest version-1 bytes contain no Person identity and are unchanged. A complete result stitches transcripts deterministically, preserving known-ID or `Unknown` attribution while removing only confident seam duplicates; other states return no final transcript. Status and fragment-audio retrieval are read-only. Work and allocation are linear in addressed media, fragments, manifests, statuses, and transcripts; performance is not yet benchmarked.

## Compatibility

Release 0.3.5 preserves the public API, source behavior, manifest bytes, object/status/label semantics, retry and discard behavior, errors, schemas, concurrency, and lifecycle while exact-pinning `kcode-k1-audio-classification` 0.5.4 for the approved Audio Codex-adapter cutover. Provider interaction remains classification-owned; this crate adds no provider calls. All other direct dependencies are unchanged.

Release 0.3.4 adds the read-only `fragment_audio` operation while preserving submit, status, manifest bytes, identity semantics, and all existing dependencies.

Release 0.3.3 preserves the prior top-level API and all behavior while selecting audio-classification 0.5.3 for exact dependency closure; all other direct dependencies and all non-identity semantics are unchanged.