DEV-000066 human response continuation semantics
CI / test (push) Successful in 21s
CI / test (pull_request) Successful in 16s

This commit is contained in:
m
2026-08-17 17:02:33 +03:00
parent e8e51ffdba
commit 8b9b841645
22 changed files with 1163 additions and 45 deletions
+12 -2
View File
@@ -112,7 +112,7 @@ func projectReferences(utterance interaction.HumanUtterance, projects []situatio
}
}
}
if len(refs) == 0 && previousFocus != nil && strings.Contains(lower, "туда") {
if len(refs) == 0 && previousFocus != nil && inheritedFocusAllowed(utterance.SpeechAct, utterance.Content) {
ref, err := newProjectReference(utterance.ID, previousFocus.ProjectID, previousFocus.ProjectDisplayName, interaction.ProjectRolePrimary, situation.ProjectResolutionInheritedFocus, 700, millis)
if err != nil {
return nil, err
@@ -196,7 +196,17 @@ func requestedOutcome(message string, act interaction.SpeechAct) string {
}
func inheritedFocusAllowed(act interaction.SpeechAct, message string) bool {
return strings.Contains(strings.ToLower(message), "туда") && act != interaction.SpeechActUnknown
lower := strings.ToLower(message)
if act == interaction.SpeechActUnknown {
return false
}
if strings.Contains(lower, "туда") || strings.Contains(lower, "там") || strings.Contains(lower, "в этом проекте") {
return true
}
if act == interaction.SpeechActQuestion || act == interaction.SpeechActRequestToInvestigate {
return strings.Contains(lower, "база") || strings.Contains(lower, "сервер") || strings.Contains(lower, "почему тормозит") || strings.Contains(lower, "что там")
}
return false
}
func isAmbiguousDestructive(act interaction.SpeechAct, message string, projects []interaction.ProjectReference) bool {