Merge pull request 'Reject identity boilerplate over creative fallback' (#350) from codex/household-scenario-audit into main
CI / test (push) Successful in 1m44s
CI / test (push) Successful in 1m44s
Merge PR #350
This commit was merged in pull request #350.
This commit is contained in:
@@ -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, "меня зовут домов")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user