# Next Session: Live Test Voice Personality + Verify Adversarial Fixes

**Use this prompt to continue from session 395**

---

```
@docs/NEXT-SESSION-VOICE-PERSONALITY-TEST.md

## What was done (session 395)

### Voice Personality Rewrite
- SOUL.md rewritten (60+ lines): identity, traits to embody/avoid, contradictions, emotional response patterns, 5 calibration examples, 5 anti-examples. Deployed to Panda ~/.her-os/annie/
- RULES.md rewritten: "MAY ask ONE follow-up question", 1-3 sentences, anti-hallucination rule 9. Deployed to Panda.
- USER.md enriched: family (Roshni, Reethi, Roshan, Mom), coffee, health goals, career. Deployed to Panda.
- Research: docs/RESEARCH-VOICE-PERSONALITY.md (713 lines — Pi, Replika, Hume, Claude soul doc, Samantha, character cards)

### TTS Markdown Filter
- tts_text_clean.py: 18 regex patterns (tuple, immutable), zero deps. Images before links, re.DOTALL on partial JSON.
- speech_text_filter.py: delegates to tts_text_clean (no duplication with bot.py Pipecat pipeline)
- phone_loop.py: clean_for_tts() before TTS, cleaned text in messages, raw logged for forensics

### Adversarial Review (planning-with-review) — 23/23 issues fixed, 0 deferred
All fixes in commits 61df0c5, 662b2f3, a24a20a. Key fixes:
- Transcript: scan by role not position (no lost turns after compaction)
- Double-compaction guard in _call_llm retry
- Barge-in exceptions logged (not swallowed)
- GPU heartbeat chmod 0o600
- WAV cleanup after each turn (not accumulated)
- XML sanitization in prompt_builder._sanitize()
- CachedFile thread-safe with threading.Lock
- Fallback utterance on empty tts_text (no dead air)

### First Live Test Result (pre-adversarial-fixes)
- 10 turns, Rajesh said: "This is fantastic. I'm really thrilled."
- Follow-up questions working, weather referenced walking from USER.md
- 3 bugs found: markdown leak (**8 hours** — now fixed), hallucination (Dialog Pro care unit — rule 9 added), "Hey love" (too intimate)

## What to do now

### 1. Live Phone Call Test (verify all fixes)
Run: `ssh panda "source ~/workplace/her/her-os/.venv/bin/activate && cd ~/workplace/her/her-os && python scripts/phone_call.py call +917899218911"`

Verify:
- No markdown artifacts (asterisks, backticks) in TTS speech
- Follow-up questions are warm and natural
- Annie doesn't hallucinate facts when she doesn't know something
- "Hey love" or overly intimate language — if still present, add to SOUL.md anti-examples
- Barge-in still works (interrupt Annie mid-speech)

### 2. Iterate on personality based on call
- If too verbose: tighten RULES.md sentence count
- If too generic: add more calibration examples to SOUL.md
- If hallucinating: strengthen rule 9 wording or add structural guard

### 3. Carry forward (from session 394)
- Test tool use (web_search, search_memory) during phone call
- Test auto-answer daemon mode
- Bypass charging on Pixel 9a
- Wireless ADB backup
- Fi Money + GPay setup
- Kannada TTS/STT (IndicF5 + IndicConformer on Panda)
- Workspace files on Panda (SOUL.md etc. are scp'd, should be in a deploy script)
```
