kcode-audio-session-ingress 0.3.2

Application-level facade over AudioIngress and exact Session History handoff
Documentation
# Audio Session Ingress 0.3.2

`kcode-audio-session-ingress` 0.3.2 is the application-level facade that
coordinates durable `kcode-audio-ingress` recordings with exact
`kcode-session-history` handoff.

`kcode-audio-ingress` remains the sole owner of original audio, transcription
processing, recording retries, speaker confirmation, and completed
transcripts. `kcode-session-history` remains the sole owner of session
persistence and ingress lifecycle. This library owns no persistence, provider,
HTTP, messaging, or deployment behavior.

Deterministic transcript-piece planning is delegated to
`kcode-audio-transcript-plan` 0.2 through
`kcode-audio-history-handoff` 0.2. The handoff leaf owns History presence
checks, cross-store projection, synchronization, canonical piece correlation,
and exact memory-ingress retry.

Deterministic facade view adaptation is delegated to
`kcode-audio-session-view` 0.2. Submission, recording lists, and recording
history pass each matching Audio status and handoff projection to its `render`
operation. That leaf owns recording fields, ingress-piece fields, processing
stage mapping, speaker-review summaries, and combined status selection. This
facade publicly re-exports the leaf's `Recording`, `SpeakerReview`, and
`IngressPiece` types, preserving the established
`kcode_audio_session_ingress::{Recording, SpeakerReview, IngressPiece}` source
paths, fields, and `Clone, Debug` derives without duplicate definitions.

The cloneable `Coordinator` is scoped to one configured application user. It:

- attributes new submissions to that user and fails closed when AudioIngress's
  global SHA-256 deduplication returns another user's recording;
- exposes, looks up, retries, confirms, and projects only recordings whose
  `RecordingStatus.user_id` exactly matches the configured user;
- batches recording projection through one History listing while preserving
  AudioIngress input order;
- exposes AudioIngress correction packets and applies exact human speaker
  per-chunk known/unknown signoffs through its typed API and exposes sorted known-speaker choices;
- returns an authorized correction-packet interval through
  `Coordinator::speaker_review_audio(recording_id, chunk_index)` as the
  re-exported `SpeakerReviewAudio { content_type, filename, bytes }`, with
  seek-based WAV extraction kept off the async runtime's worker threads;
- leaves analyzed recordings in `speaker_review` until every chunk is signed off and final reconciliation completes;
- resolves finalized recordings with obsolete unsigned packets before returning
  browser views: a recording without accepted History ingress is archived and
  requeued through current Audio Ingress analysis, while one with accepted
  ingress is preserved as complete and never exposed for relabeling;
- synchronizes authorized completed transcripts through deterministic
  `audio:<recording-id>:<piece-index>` identities; and
- retries memory ingress only after the handoff leaf validates the retained
  History record against the exact current configured-user audio piece.

An exact retry of an accepted confirmation is idempotent and synchronizes the
recording. A different confirmation is rejected once any matching audio
ingress identity is present, including a retained malformed suffix under the
recording's canonical prefix. This preserves confirmation conflict precedence.

The established facade states remain unchanged. Audio processing reports
`uploaded`, `chunking`, `transcribing`, `analyzing_speakers`,
`reconciling`, `speaker_review`, or `failed`. An
authorized completed recording with no represented pieces is
`ready_for_ingress`; represented pieces project `ingressing`,
`ingress_failed`, or `complete` according to their retained History phases.

The public optional `RetryIngress.state` remains for 0.2 wire compatibility.
When supplied, it must exactly equal current retained Session History state.
Caller state never replaces retained state; retry passes the retained state and
the caller's optimistic version through the handoff.

Public types, fields, coordinator methods, state strings, and
InvalidInput/NotFound/Conflict/Internal categories remain compatible with
0.2.3. Audio errors keep their established facade mapping. Handoff errors map
to the matching facade category with their contained messages; raw Session
History storage messages remain visible for compatibility. Recording history
retains the final transcript and correction packet before the owned Audio
status is passed to the view renderer. Obsolete packets resolved as already
ingressed are deliberately suppressed by Audio Ingress; reprocessed recordings
instead expose the new current-schema packet after analysis completes.

This migration does not change transcript payload sizing, Unicode token
estimation, confirmation concurrency, projection currentness, resumable
partial effects, full-store scans, projected timing, raw History storage
messages, or state strings. Publication, host adoption, deployment, provider
work, and live audio effects are separate lifecycle gates.