kcode-speaker-v3-analysis 0.4.0

Speaker V3 analysis execution and provenance
Documentation
# kcode-speaker-v3-analysis 0.4.0

Executes the fixed Speaker V3 Gemini/Terra flow. Existing `analyze_ogg_with_progress` and compatibility `analyze_ogg` APIs, provider features, progress sequences, validation, metadata, provenance, and the exhaustive public `AnalysisError` enum remain exactly compatible with 0.3.3. Version 0.4.0 updates only the optional daemon-adoption dependency requirements.

## Resumable operation

`SpeakerFeatureEvidence` is re-exported from the LLM protocol package. `RecoveredAnalysisArtifacts` contains an optional exact Gemini transcript, optional ordered Terra labels, zero or more complete per-speaker evidence values, and an optional final `ExecutedAnalysis`. `AnalysisArtifact` emits `GeminiTranscript`, `TerraSpeakerLabels`, `GeminiFeatureEvidence`, and boxed `ExecutedAnalysis` values.

```rust
pub async fn Analyzer::analyze_ogg_resumable<P, A>(
    &self,
    bytes: &[u8],
    recovered: RecoveredAnalysisArtifacts,
    report: P,
    emit: A,
) -> Result<ExecutedAnalysis, ResumableAnalysisError>
where
    P: FnMut(AnalysisProgress) -> Result<(), String>,
    A: FnMut(AnalysisArtifact) -> Result<(), String>;
```

`ResumableAnalysisError` additively distinguishes ordinary `AnalysisError`, invalid recovered state, and artifact-callback rejection; it implements `Display`, `Error`, and `From<AnalysisError>`. Legacy operations continue to return only `AnalysisError`.

Strict Ogg admission and every deterministically checkable recovered-state validation precede callbacks and provider effects. A recovered transcript must be nonblank. Present labels are ordered and unique; an empty vector is valid and distinct from absence. Evidence must retain exactly three nonblank packets, have unique speakers, and be a subset of known labels. A recovered final value undergoes ordinary envelope and label-extractor validation, exact strict audio-metadata matching, transcript consistency, exact label speaker-set consistency, and evidence-subset consistency.

Only absent work runs. A recovered final supplies the transcript when needed, but never supplies the independently persisted ordered-label or evidence stages. Missing labels and evidence are selectively repaired; generated labels must match a recovered final before emission. Empty labels and evidence skip feature providers. Recovered downstream artifacts are retained, recovered stages produce no progress or artifact events, and feature sequence positions retain holes for recovered speakers.

Each new value is locally validated and passed synchronously to `emit` before its stage-completed event and before any dependent provider stage. Per-speaker evidence is emitted only after the complete generated set and speaker set validate. Callback rejection fences later work. Without a recovered final, structuring must return the byte-identical transcript and exact speaker set, and its validated `ExecutedAnalysis` is emitted before structuring completion. With a recovered final, structuring is never called, no final artifact or structuring progress is fabricated, and the exact recovered value is returned after any missing labels/features are repaired.

The package performs no persistence, transaction, retry, timeout, cancellation guarantee, identity, training, queue, or worker management. Provider work already submitted when a progress callback fails remains cancellation-ambiguous. Independent analyses share no package-owned synchronization. Provider-free tests cover full and partial resume, final recovery and conflicts, zero-speaker recovery, preservation, admission conflicts, callbacks, final consistency, legacy behavior, progress, failures, and concurrency; provider constructors remain compile-only.