feat(engine): voice pipeline Phase 1 — composition engine and data model

Add the voice pipeline composition engine (D-138 Spike 2, Phase 1):

- voice/prompt_builder.rs: full prompt assembly from culture profile,
  tell state, and base text. Handles occasional injection gating,
  epistemic marker extraction, content-length-gated tell injection.
  16 unit tests.

- blueprint.rs: CultureProfile gains voice_persona, voice_examples,
  occasional_injections fields. NpcBlueprint gains tell_behaviors.
  OccasionalInjection struct with kind discriminator (oath/faith/
  hesitancy/etc), frequency, and tell-suppression gating.

- culture-krenn.ron: v2 voice injector from Spike 1 — persona block,
  3 examples, oath injection at 0.25 frequency.

- D-138 amended: Phi-3 dropped entirely, exact Gemma 2B provenance
  documented. Model file renamed to gemma2.gguf.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 16:35:39 +01:00
co-authored by Claude Opus 4.6
parent 2d03776365
commit 33030fcc58
7 changed files with 620 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
//! Voice pipeline integration (D-138, Spike 2).
//!
//! Translates culture-neutral semantic base text into character-voiced output
//! via an LLM re-voicing pipeline. The pipeline is a background runtime
//! enhancement — the game is complete and functional without it.
//!
//! ## Components
//!
//! - `prompt_builder` — composition engine: NPC data + culture + tell state → prompt string
//! - `cache` — MessagePack voice cache (store/retrieve, length-gated variants)
//! - `queue` — crossbeam work queue with priority + backpressure
//! - `worker` — inference worker pool (dynamic scaling, owns sr-voice HTTP clients)
//! - `hardware` — hardware detection + dynamic sr-voice instance management
pub mod prompt_builder;