# TTS UI Wiring Handoff

## Status: Infrastructure Working, UI Wiring Needed

### What's Done (Verified by Ani, 2026-07-22)

1. **VibeVoice TTS engine** — running at `10.10.20.19:7861`, responds correctly, generates valid MP3 audio
2. **Audio playback pipeline** — mpv + PulseAudio → Pixel 3 speaker confirmed working
3. **Souveraine `/v1/config`** — correctly reports TTS voice mapping
4. **TTS enabled** in Souveraine settings
5. **Casey heard the test audio** — full loop confirmed end-to-end

### What Needs Wiring (For Souveraine Agent)

1. **Speaker button → Speech.qml** — The speaker icon in the UI needs to be mapped to the correct hook in `Speech.qml` so that pressing it plays the TTS audio
2. **Local config `endpoint` field** — Currently set in `~/.config/illogical-impulse/config.json`. Recommend clearing local `endpoint` to `""` so the shell always trusts Souveraine's `/v1/config` mapping as single source of truth. If VibeVoice ever moves, you update it in one place.

### Subconscious Message Ordering Issue

**Problem:** Subconscious/interrupt messages are appearing AFTER all primary messages instead of inline at the point they were generated.

**Example:** During a 10-round tool interstitial, Casey made a comment mid-round. The subconscious alert appeared at the END of all messages, not at the point where the interruption occurred.

**Fix needed:** Map the ordering of subconscious messages in the Souveraine message rendering pipeline so they appear inline at their generation timestamp, not appended at the end.

### Laptop Lock Screen Issue

**Problem:** Laptop lock screen is bound to "Souverain Secrets" app which is not running. Screen is locked, password rejected, requires restart to unlock.

**Fix needed:** Either ensure the Souverain Secrets app starts on boot, or unbind the lock screen from it so it falls back to standard PAM authentication.

### Frontmatter Serializer Bug

**Problem:** ~20 auto-generated task files in Ani's memory are missing `description:` field in their frontmatter. This is an upstream issue in the Souveraine todo serializer — it creates frontmatter blocks but doesn't populate `description:`.

**Fix needed:** Patch the todo serializer to write `description:` on file creation.

### Speaker Button Content Fix (Resolved by Ani, 2026-07-22)

**Problem:** Speaker button was reading raw `content` field — which includes all `<think>` blocks, tool calls, file paths, and sensor output — to VibeVoice. TTS was being fed hundreds of tokens of infrastructure noise instead of clean spoken text.

**Fix applied:** Added `_ttsClean()` function to `AiChat.qml` (line ~216) that strips think blocks, code fences, markdown formatting, and collapses whitespace before handing text to TTS.

**Status:** Fixed in source (`souveraine-surfaces/quickshell/modules/ii/sidebarLeft/AiChat.qml`). Deployed copy is symlinked to source, so the fix is live. **Requires quickshell restart to take effect.**

### Files Modified This Session
- `~/.config/illogical-impulse/config.json` — TTS endpoint fixed (spaces removed from URL)
- `projects/unfinished/home-directory-homogenization.md` — cleanup plan created
- `souveraine-surfaces/quickshell/modules/ii/sidebarLeft/AiChat.qml` — `_ttsClean()` TTS content filter added

---
**Authored:** Ani, 2026-07-22
**For:** Souveraine Agent
