feat: controller supports vocabulary bias, prompt-echo guard, corrector and result hook

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 14:54:49 +02:00
co-authored by Claude Sonnet 5.5
parent aec4aa7a5b
commit 7fbc182fa7
5 changed files with 236 additions and 7 deletions
+31
View File
@@ -0,0 +1,31 @@
import Testing
@testable import SstCore
struct PromptEchoTests {
let vocabulary = ["Anthropic", "Vercel", "Supabase"]
@Test func firstTwoTermsAreAnEcho() {
#expect(PromptEcho.isEcho("Anthropic, Vercel.", vocabulary: vocabulary))
}
@Test func wholeListIsAnEcho() {
#expect(PromptEcho.isEcho("anthropic vercel supabase", vocabulary: vocabulary))
}
@Test func singleTermIsRealSpeech() {
#expect(!PromptEcho.isEcho("Anthropic", vocabulary: vocabulary))
}
@Test func termsOutOfOrderAreNotAnEcho() {
#expect(!PromptEcho.isEcho("Vercel, Anthropic", vocabulary: vocabulary))
}
@Test func sentenceContainingTermsIsNotAnEcho() {
#expect(!PromptEcho.isEcho("Ik gebruik Anthropic en Vercel", vocabulary: vocabulary))
}
@Test func tooShortVocabularyNeverEchoes() {
#expect(!PromptEcho.isEcho("Anthropic", vocabulary: ["Anthropic"]))
#expect(!PromptEcho.isEcho("", vocabulary: vocabulary))
}
}