From 48dfd364e44cafcc6c4a15623cff3881297a48dc Mon Sep 17 00:00:00 2001 From: Mikhail Date: Mon, 17 Aug 2026 14:47:13 +0300 Subject: [PATCH] DEV-000062 answer focus questions without cognition --- modules/interaction/domain/semantics.go | 11 +++++++++++ modules/interaction/domain/semantics_test.go | 3 +++ 2 files changed, 14 insertions(+) diff --git a/modules/interaction/domain/semantics.go b/modules/interaction/domain/semantics.go index e711893..c320ac4 100644 --- a/modules/interaction/domain/semantics.go +++ b/modules/interaction/domain/semantics.go @@ -71,6 +71,9 @@ func InterpretUtterance(utterance interaction.HumanUtterance, projects []situati result.Relations = append(result.Relations, relations...) } result.Reply = semanticReply(utterance.Content, result, previousFocus) + if isCurrentFocusQuestion(utterance.Content, act) && previousFocus != nil { + result.NeedsCognition = false + } return result, nil } @@ -229,3 +232,11 @@ func semanticReply(message string, result SemanticResult, previousFocus *situati } return FallbackText(result.Interpretation.SpeechAct) } + +func isCurrentFocusQuestion(message string, act interaction.SpeechAct) bool { + if act != interaction.SpeechActQuestion { + return false + } + lower := strings.ToLower(message) + return strings.Contains(lower, "сейчас") || strings.Contains(lower, "что мы") || strings.Contains(lower, "делаем") +} diff --git a/modules/interaction/domain/semantics_test.go b/modules/interaction/domain/semantics_test.go index 90d2288..dee6790 100644 --- a/modules/interaction/domain/semantics_test.go +++ b/modules/interaction/domain/semantics_test.go @@ -61,6 +61,9 @@ func TestInterpretUtteranceQuestionAboutCurrentWorkUsesFocus(t *testing.T) { if !strings.Contains(result.Reply, "Assistant") { t.Fatalf("expected focus-aware reply, got %q", result.Reply) } + if result.NeedsCognition { + t.Fatalf("focus question should be answered from canonical focus without cognition") + } } func TestInterpretUtteranceInheritedFocusForThere(t *testing.T) { -- 2.54.0