Files
coucou/scripts/test-voice-conversation.sh
Louis RailleandClaude Sonnet 4.6 c2e39bcd92 voice: review fixes — real VoiceBrain Tools, speaker race, single phrase list
1. VoiceBrain: replace stub with real FoundationModels Tools (PillTool,
   MusicTool, StatusTool) + BrainResult struct, IntentCollector, SessionContainer,
   4-second timeout via withThrowingTaskGroup. Remove languageUnsupported case.
   Called from handleVoiceCommand after .unknown; beginConversation/endConversation
   wired at conversation boundaries.

2. VoiceSpeaker: track currentUtterance identity with ObjectIdentifier so
   didCancel for a replaced utterance never clears isSpeaking for the new one.

3. VoiceEngine: remove onDidFinish init side-effect (was overwritten by IWC);
   add audio?.resetVAD() in startConversationTurn.

4. IslandWindowController: .question outcome speaks via VoiceSpeaker then
   re-listens only after onDidFinish; handleAnswer path continues conversation
   via speakAndContinueConversation; VoiceBrain called after .unknown; remove
   local conversationEndPhrases (use TurnEndPolicy); VoiceBrain lifecycle at all
   conversation boundaries including collapse() and silence-end path.

5. TurnEndPolicy: add static conversationEndPhrases as single source of truth
   for VoiceEngine and IslandWindowController.

6. ConversationContext: remove bare "annule" from reverse triggers (it is a
   conversation-end phrase, not an undo trigger; use "annule ça" instead).

7. SettingsView: @AppStorage("voiceSpeakEnabled") for proper binding invalidation;
   remove languageUnsupported from localModelStatusLabel switch.

8. VoiceActionRunner: musicPlaySearch — opening Apple Music search is .success.

9. New test: scripts/test-voice-conversation.sh verifies conversationEndPhrases
   membership; wired into CI. Updated VoiceActionRunnerTests and
   ConversationContextTests to match corrected behaviours.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-10 08:50:19 +02:00

11 lines
352 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
OUT=/tmp/voice-conversation-tests
echo "=== Voice conversation end-phrase tests ==="
swiftc -swift-version 6 -strict-concurrency=complete \
"$ROOT/NotchBuddy/Sources/App/Voice/TurnEndPolicy.swift" \
"$ROOT/tests/VoiceConversationTests.swift" \
-o "$OUT"
"$OUT"