From 29e17f1ac8032eaa4976bdedd4a123c9cef0775c Mon Sep 17 00:00:00 2001 From: Mikhail Date: Tue, 25 Aug 2026 15:40:24 +0300 Subject: [PATCH] Remove canned creative object replies --- cmd/core-runtime/household_scenario_test.go | 12 ++++-------- modules/interaction/domain/chat.go | 18 +++--------------- modules/interaction/domain/chat_test.go | 16 ++++++---------- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/cmd/core-runtime/household_scenario_test.go b/cmd/core-runtime/household_scenario_test.go index 4b273b7..6b839a1 100644 --- a/cmd/core-runtime/household_scenario_test.go +++ b/cmd/core-runtime/household_scenario_test.go @@ -73,14 +73,10 @@ func TestHouseholdBearDrawingUsesCreativeLocalRoute(t *testing.T) { t.Fatalf("bear drawing selected web research: %+v", candidate) } } - if got := interactiondomain.CreativeDeterministicReply("нарисуй бурого медведя"); got != "🐻" { - t.Fatalf("bear drawing fallback=%q", got) - } - if got := interactiondomain.CreativeDeterministicReply("нарисуй птицу"); got != "🐦" { - t.Fatalf("bird drawing fallback=%q", got) - } - if got := interactiondomain.CreativeDeterministicReply("нарисуй коня"); got != "🐴" { - t.Fatalf("horse drawing fallback=%q", got) + for _, message := range []string{"нарисуй бурого медведя", "нарисуй птицу", "нарисуй зеленую птицу", "нарисуй птицу в HD", "нарисуй коня"} { + if got := interactiondomain.CreativeDeterministicReply(message); got != "" { + t.Fatalf("creative request %q received a canned reply=%q", message, got) + } } } diff --git a/modules/interaction/domain/chat.go b/modules/interaction/domain/chat.go index cbdcdf9..5456aa4 100644 --- a/modules/interaction/domain/chat.go +++ b/modules/interaction/domain/chat.go @@ -658,22 +658,10 @@ func IsCreativeRequest(message string) bool { return isCreativeRequestTokens(tokens) } -// CreativeDeterministicReply covers simple geometric sketches that do not -// need a model or external source. Rich creative content remains cognitive. +// CreativeDeterministicReply intentionally has no example-specific answer +// branches. Creative requests must retain their full meaning and go through +// cognition; canned object or color answers hide lost attributes. func CreativeDeterministicReply(message string) string { - tokens := semanticTokens(message) - if containsStemInTokens(tokens, "нарис", "рису", "изобраз") && containsStemInTokens(tokens, "круг", "окруж") { - return "◯" - } - if containsStemInTokens(tokens, "нарис", "рису", "изобраз") && containsStemInTokens(tokens, "медвед", "мишк") { - return "🐻" - } - if containsStemInTokens(tokens, "нарис", "рису", "изобраз") && containsStemInTokens(tokens, "птиц", "птичк", "ворон", "голуб") { - return "🐦" - } - if containsStemInTokens(tokens, "нарис", "рису", "изобраз") && containsStemInTokens(tokens, "кон", "лошад", "жереб") { - return "🐴" - } return "" } diff --git a/modules/interaction/domain/chat_test.go b/modules/interaction/domain/chat_test.go index 2cd698f..458c4f5 100644 --- a/modules/interaction/domain/chat_test.go +++ b/modules/interaction/domain/chat_test.go @@ -277,8 +277,8 @@ func TestInterpretCreativeRequestDoesNotRequireExternalEvidence(t *testing.T) { if result.Interpretation.SpeechAct == interaction.SpeechActQuestion || containsString(result.CapabilityHints, "WEB_RESEARCH") { t.Fatalf("creative request was routed as external research: %+v", result) } - if got := CreativeDeterministicReply("нарисуй круг"); got != "◯" { - t.Fatalf("circle reply = %q", got) + if got := CreativeDeterministicReply("нарисуй круг"); got != "" { + t.Fatalf("creative request received a canned reply = %q", got) } if !IsCreativeRequest("расскажи сказку о колобке") { t.Fatal("story request was not recognized as creative") @@ -286,14 +286,10 @@ func TestInterpretCreativeRequestDoesNotRequireExternalEvidence(t *testing.T) { if got := CreativeFallbackReply("расскажи сказку о колобке"); !strings.Contains(got, "Колоб") { t.Fatalf("story fallback = %q", got) } - if got := CreativeDeterministicReply("нарисуй бурого медведя"); got != "🐻" { - t.Fatalf("bear reply = %q", got) - } - if got := CreativeDeterministicReply("нарисуй птицу"); got != "🐦" { - t.Fatalf("bird reply = %q", got) - } - if got := CreativeDeterministicReply("нарисуй коня"); got != "🐴" { - t.Fatalf("horse reply = %q", got) + for _, message := range []string{"нарисуй птицу", "нарисуй зеленую птицу", "нарисуй птицу в HD", "нарисуй коня"} { + if got := CreativeDeterministicReply(message); got != "" { + t.Fatalf("creative request %q received a canned reply = %q", message, got) + } } }