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:
@@ -411,7 +411,7 @@ How narrative, NPCs, and world content are created: content tiers, NPC generatio
|
||||
- **Date:** 2026-03-07
|
||||
- **Decision:** NPC observable behaviors and dialogue are processed through an LLM re-voicing pipeline that translates culture-neutral semantic base text into character-voiced output. The pipeline is a background runtime enhancement, not a live generation system. Tell behaviors are base-text passthrough — always. Active tell state influences the re-voicing prompt for surrounding content (tells are read-only inputs to the LLM, never LLM outputs). The game is complete and functional without the pipeline; it is an enhancement that elevates voice quality for players with sufficient hardware.
|
||||
- **Architecture:**
|
||||
- **Model:** Gemma 2 2B (Q4_K_M, ~1.5GB), bundled with game. Phi-3 (MIT) as fallback. No Chinese-origin models.
|
||||
- **Model:** Gemma 2 2B IT Q4_K_M (~1.6GB), bundled as `server/models/gemma2.gguf`. No fallback model. *(Amended 2026-03-07: Phi-3 dropped entirely after Spike 1 — Gemma 2B produces superior culturally-differentiated output at the same quantization. Original GGUF: `gemma-2-2b-it-Q4_K_M.gguf` from Hugging Face bartowski/gemma-2-2b-it-GGUF.)*
|
||||
- **Runtime:** `llama-cpp-rs` with GGUF format. Separate inference thread pool at below-normal priority.
|
||||
- **Content tiers:** Baked (hub zones, build-time, human-reviewed) → Pre-voiced (background queue, priority-ordered) → Base text fallback (always present).
|
||||
- **Tell treatment:** Passthrough always. Tell state flows into re-voicing prompts as universal tone injectors. Cultural flavor is conditional and additive — humans are humans first; micro-expressions and body language must remain universally recognizable. Per-culture tell-tone tables are optional enrichment, not a launch requirement.
|
||||
|
||||
Reference in New Issue
Block a user