Reject identity boilerplate over creative fallback #350

Merged
m merged 1 commits from codex/household-scenario-audit into main 2026-08-25 11:06:27 +00:00
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -517,11 +517,12 @@ func (g *gateway) handleChatMessage(w http.ResponseWriter, r *http.Request) {
}
func isBoilerplateAdvisory(value string) bool {
switch strings.ToLower(strings.TrimSpace(value)) {
normalized := strings.ToLower(strings.TrimSpace(value))
switch normalized {
case "я рядом.", "я рядом", "понял.", "понял", "принял.", "принял":
return true
default:
return false
return strings.Contains(normalized, "я — домов") || strings.Contains(normalized, "я - домов") || strings.Contains(normalized, "меня зовут домов")
}
}
+1 -1
View File
@@ -24,7 +24,7 @@ func TestLocalChatContextIncludesDomovoyIdentityAndOptionalActiveProject(t *test
}
func TestBoilerplateAdvisoryDoesNotReplaceUsefulFallback(t *testing.T) {
for _, value := range []string{"Я рядом", "Понял.", "Принял."} {
for _, value := range []string{"Я рядом", "Понял.", "Принял.", "Я — Домовой, ваш помощник."} {
if !isBoilerplateAdvisory(value) {
t.Fatalf("%q was not recognized as boilerplate", value)
}