diff --git a/cmd/core-runtime/household_scenario_test.go b/cmd/core-runtime/household_scenario_test.go index 078384b..d401a8a 100644 --- a/cmd/core-runtime/household_scenario_test.go +++ b/cmd/core-runtime/household_scenario_test.go @@ -80,3 +80,41 @@ func TestHouseholdBearDrawingUsesCreativeLocalRoute(t *testing.T) { t.Fatalf("bird drawing fallback=%q", got) } } + +func TestHouseholdRouteMatrixKeepsMeaningBoundaries(t *testing.T) { + tests := []struct { + message string + wantResearch bool + wantCreative bool + wantHint string + }{ + {message: "найди на WB бренд marka-wear", wantResearch: true}, + {message: "какая погода в Казани?", wantResearch: true}, + {message: "найди билеты до Сочи", wantResearch: true}, + {message: "нарисуй птицу", wantCreative: true}, + {message: "расскажи сказку о Колобке", wantCreative: true}, + {message: "что такое гравитация?", wantHint: "COGNITIVE_REASONING"}, + } + for _, test := range tests { + candidate := interactiondomain.BuildDeterministicCandidate(test.message, "", time.Unix(10, 0).UnixMilli()) + if interactiondomain.IsCreativeRequest(test.message) != test.wantCreative { + t.Fatalf("message=%q creative=%v want=%v candidate=%+v", test.message, interactiondomain.IsCreativeRequest(test.message), test.wantCreative, candidate) + } + gotResearch := false + gotHint := false + for _, hint := range candidate.CapabilityHints { + if hint == "WEB_RESEARCH" { + gotResearch = true + } + if hint == test.wantHint { + gotHint = true + } + } + if gotResearch != test.wantResearch { + t.Fatalf("message=%q research=%v want=%v candidate=%+v", test.message, gotResearch, test.wantResearch, candidate) + } + if test.wantHint != "" && !gotHint { + t.Fatalf("message=%q missing hint=%q candidate=%+v", test.message, test.wantHint, candidate) + } + } +}