# Audio classification coordinator
Lifecycle owner for the exact KTO subsystem `audio-classification`.
## Public API
`FragmentId`, `FragmentStatus`, `OverallState`, and `SpeakerLabelV1` are re-exported from `kcode_k1_audio_classification_projection`; `TxId` is re-exported from `kcode_k1_txn_ordering`.
`pub struct AudioClassificationCoordinator;`
- `pub fn open(root: &Path, ordering: Arc<K1TxnOrdering>, peering: Arc<K1Peering>, objects: Arc<K1Objects>, analyzer: Analyzer) -> Result<Self, String>`
- `pub fn status(&self, fragment_id: FragmentId) -> Result<Option<FragmentStatus>, String>`
- `pub fn validate_labels(&self, fragment_id: FragmentId, labels: &[SpeakerLabelV1]) -> Result<TxId, String>`
- `pub fn ensure_healthy(&self) -> Result<(), String>`
- `pub fn fault_ambiguous_commitment(&self)`
- `pub fn shutdown(&self)`
With feature `testkit`, `EngineFuture` and `FragmentEngine` are re-exported from `kcode_k1_audio_classification_driver`, and these methods are available:
- `pub fn with_engine(root: &Path, ordering: Arc<K1TxnOrdering>, peering: Arc<K1Peering>, objects: Arc<K1Objects>, engine: Arc<dyn FragmentEngine>) -> Result<Self, String>`
- `pub fn inject_errors(&self, fragment_id: FragmentId, errors: Vec<String>) -> Result<(), String>`
- `pub fn startup_replay_count(root: &Path) -> Result<u64, String>`
`AudioClassificationCoordinator` implements `Drop`; dropping it performs bounded shutdown.
`SpeakerLabelV1.person_id` is the current typed `Option<PersonId>`: `Some` carries a supplied known identity and `None` means Unknown. The coordinator forwards labels to projection validation without lookup, discovery, canonicalization, migration, or identity decisions.
## Lifecycle, failures, concurrency, and performance
Opening replays without starting provider work, durably fails interrupted Running fragments, then starts Queued fragments.
Live Start effects enter the driver; Abort and confirmed-label effects cancel the addressed generation; a no-effect callback cancels a terminal generation.
Projection, callback-effect, driver, and reorganization failures permanently fault the coordinator and deactivate work; reopen is required. `status` and `validate_labels` reject use while unhealthy; `shutdown` is idempotent and does not wait for provider return.
The health lock protects one optional diagnostic and spans no dependency or provider work. Projection retains per-root SQLite serialization; the driver retains bounded independent lanes and FIFO overflow. Independent coordinators share no coordinator lane.
Registration and replay are linear in matching canonical history; startup recovery is linear in projected actionable fragments. Dependency I/O, callback, provider, and lane latency has no finite wall-clock bound.
## Compatibility
Version 0.2.3 preserves the coordinator API and subsystem identity while requiring driver 0.2.2, audio-fragment-transactions 0.5.2, and projection 0.4.2. The direct Speaker V3 analysis dependency is 0.3.0 with default features disabled and only `adapter-providers` enabled; this coordinator accepts an existing `Analyzer` and constructs no provider. The production dependency closure therefore does not select the analysis `providers` feature or `kcode-codex-terra`.