From 9000d90d7224faaa7c89174cf9c4fadc7d7e64fa Mon Sep 17 00:00:00 2001 From: Mikhail Date: Tue, 25 Aug 2026 20:49:39 +0300 Subject: [PATCH] Describe local Domovoy capabilities --- cmd/core-runtime/main.go | 3 + contracts/interaction/types.go | 93 +++++++++++++------------ modules/interaction/domain/chat.go | 3 + modules/interaction/domain/chat_test.go | 2 +- 4 files changed, 54 insertions(+), 47 deletions(-) diff --git a/cmd/core-runtime/main.go b/cmd/core-runtime/main.go index 8f09d60..235eee1 100644 --- a/cmd/core-runtime/main.go +++ b/cmd/core-runtime/main.go @@ -763,6 +763,9 @@ func main() { planningReply = "Я умею общаться, сохранять контекст, искать проверяемую информацию и работать с подключёнными моделями. Дополнительные действия подключаются отдельно." } needsCognition = false + case interaction.InformationRequestLocalCapabilityInventory: + planningReply = "Без внешних моделей я могу поддерживать разговор, хранить контекст, вести цели и напоминания, а также честно сообщать состояние подключённых возможностей." + needsCognition = false case interaction.InformationRequestCognitiveModelInventory: candidates, inventoryErr := capabilityRepository.LoadCognitiveCandidates(r.Context(), capability.CapabilityID("creator-advisory"), session.PrincipalID) planningReply = humanCognitiveModelInventory(candidates, inventoryErr) diff --git a/contracts/interaction/types.go b/contracts/interaction/types.go index ef64241..eaec928 100644 --- a/contracts/interaction/types.go +++ b/contracts/interaction/types.go @@ -27,52 +27,53 @@ type SemanticCandidateSelectionState string type InformationRequestKind string const ( - ChannelWebChat Channel = "WEB_CHAT" - ConversationOpen ConversationState = "OPEN" - ConversationArchived ConversationState = "ARCHIVED" - SpeechActDirective SpeechAct = "DIRECTIVE" - SpeechActAssertion SpeechAct = "ASSERTION" - SpeechActDecision SpeechAct = "DECISION" - SpeechActPreference SpeechAct = "PREFERENCE" - SpeechActQuestion SpeechAct = "QUESTION" - SpeechActHypothesis SpeechAct = "HYPOTHESIS" - SpeechActCorrection SpeechAct = "CORRECTION" - SpeechActRequestToInvestigate SpeechAct = "REQUEST_TO_INVESTIGATE" - SpeechActConfirmation SpeechAct = "CONFIRMATION" - SpeechActRejection SpeechAct = "REJECTION" - SpeechActCancellation SpeechAct = "CANCELLATION" - SpeechActConversational SpeechAct = "CONVERSATIONAL" - SpeechActUnknown SpeechAct = "UNKNOWN" - InterpretationRecorded InterpretationState = "RECORDED" - InterpretationInterpreted InterpretationState = "INTERPRETED" - RelationCorrects InteractionRelationKind = "CORRECTS" - RelationRespondsTo InteractionRelationKind = "RESPONDS_TO" - RelationRequestsCognition InteractionRelationKind = "REQUESTS_COGNITION" - RelationCognitionFallback InteractionRelationKind = "COGNITION_FALLBACK" - RelationSupersedes InteractionRelationKind = "SUPERSEDES" - RelationClarifies InteractionRelationKind = "CLARIFIES" - ProjectRolePrimary ProjectReferenceRole = "PRIMARY" - ProjectRoleRelated ProjectReferenceRole = "RELATED" - ProjectRoleReferenceSource ProjectReferenceRole = "REFERENCE_SOURCE" - ClarificationNotRequired ClarificationState = "NOT_REQUIRED" - ClarificationRequired ClarificationState = "REQUIRED" - SemanticApplicable SemanticApplicability = "APPLICABLE" - SemanticLowConfidence SemanticApplicability = "LOW_CONFIDENCE" - SemanticMixedIntent SemanticApplicability = "MIXED_INTENT" - SemanticNeedsBroaderInterpret SemanticApplicability = "NEEDS_BROADER_INTERPRETATION" - SemanticCandidateClarify SemanticApplicability = "CLARIFICATION_REQUIRED" - CandidateSourceDeterministic SemanticCandidateSource = "DETERMINISTIC_V2" - CandidateSourceCognitive SemanticCandidateSource = "COGNITIVE_V1" - CandidateSelected SemanticCandidateSelectionState = "SELECTED" - CandidateObserved SemanticCandidateSelectionState = "OBSERVED" - CandidateRejected SemanticCandidateSelectionState = "REJECTED" - InformationRequestCapabilityInventory InformationRequestKind = "CAPABILITY_INVENTORY" - InformationRequestCognitiveModelInventory InformationRequestKind = "COGNITIVE_MODEL_INVENTORY" - InformationRequestCognitiveCurrentModel InformationRequestKind = "COGNITIVE_CURRENT_MODEL" - InformationRequestCognitiveChannelStatus InformationRequestKind = "COGNITIVE_CHANNEL_STATUS" - InformationRequestCognitiveRecovery InformationRequestKind = "COGNITIVE_RECOVERY" - InformationRequestMemoryInventory InformationRequestKind = "MEMORY_INVENTORY" - InformationRequestTimeDifference InformationRequestKind = "TIME_DIFFERENCE" + ChannelWebChat Channel = "WEB_CHAT" + ConversationOpen ConversationState = "OPEN" + ConversationArchived ConversationState = "ARCHIVED" + SpeechActDirective SpeechAct = "DIRECTIVE" + SpeechActAssertion SpeechAct = "ASSERTION" + SpeechActDecision SpeechAct = "DECISION" + SpeechActPreference SpeechAct = "PREFERENCE" + SpeechActQuestion SpeechAct = "QUESTION" + SpeechActHypothesis SpeechAct = "HYPOTHESIS" + SpeechActCorrection SpeechAct = "CORRECTION" + SpeechActRequestToInvestigate SpeechAct = "REQUEST_TO_INVESTIGATE" + SpeechActConfirmation SpeechAct = "CONFIRMATION" + SpeechActRejection SpeechAct = "REJECTION" + SpeechActCancellation SpeechAct = "CANCELLATION" + SpeechActConversational SpeechAct = "CONVERSATIONAL" + SpeechActUnknown SpeechAct = "UNKNOWN" + InterpretationRecorded InterpretationState = "RECORDED" + InterpretationInterpreted InterpretationState = "INTERPRETED" + RelationCorrects InteractionRelationKind = "CORRECTS" + RelationRespondsTo InteractionRelationKind = "RESPONDS_TO" + RelationRequestsCognition InteractionRelationKind = "REQUESTS_COGNITION" + RelationCognitionFallback InteractionRelationKind = "COGNITION_FALLBACK" + RelationSupersedes InteractionRelationKind = "SUPERSEDES" + RelationClarifies InteractionRelationKind = "CLARIFIES" + ProjectRolePrimary ProjectReferenceRole = "PRIMARY" + ProjectRoleRelated ProjectReferenceRole = "RELATED" + ProjectRoleReferenceSource ProjectReferenceRole = "REFERENCE_SOURCE" + ClarificationNotRequired ClarificationState = "NOT_REQUIRED" + ClarificationRequired ClarificationState = "REQUIRED" + SemanticApplicable SemanticApplicability = "APPLICABLE" + SemanticLowConfidence SemanticApplicability = "LOW_CONFIDENCE" + SemanticMixedIntent SemanticApplicability = "MIXED_INTENT" + SemanticNeedsBroaderInterpret SemanticApplicability = "NEEDS_BROADER_INTERPRETATION" + SemanticCandidateClarify SemanticApplicability = "CLARIFICATION_REQUIRED" + CandidateSourceDeterministic SemanticCandidateSource = "DETERMINISTIC_V2" + CandidateSourceCognitive SemanticCandidateSource = "COGNITIVE_V1" + CandidateSelected SemanticCandidateSelectionState = "SELECTED" + CandidateObserved SemanticCandidateSelectionState = "OBSERVED" + CandidateRejected SemanticCandidateSelectionState = "REJECTED" + InformationRequestCapabilityInventory InformationRequestKind = "CAPABILITY_INVENTORY" + InformationRequestLocalCapabilityInventory InformationRequestKind = "LOCAL_CAPABILITY_INVENTORY" + InformationRequestCognitiveModelInventory InformationRequestKind = "COGNITIVE_MODEL_INVENTORY" + InformationRequestCognitiveCurrentModel InformationRequestKind = "COGNITIVE_CURRENT_MODEL" + InformationRequestCognitiveChannelStatus InformationRequestKind = "COGNITIVE_CHANNEL_STATUS" + InformationRequestCognitiveRecovery InformationRequestKind = "COGNITIVE_RECOVERY" + InformationRequestMemoryInventory InformationRequestKind = "MEMORY_INVENTORY" + InformationRequestTimeDifference InformationRequestKind = "TIME_DIFFERENCE" ) type Conversation struct { diff --git a/modules/interaction/domain/chat.go b/modules/interaction/domain/chat.go index 3da8ae8..36555b8 100644 --- a/modules/interaction/domain/chat.go +++ b/modules/interaction/domain/chat.go @@ -663,6 +663,9 @@ func informationRequestKind(message string, candidate interaction.SemanticCandid } capabilitySubject := containsStemInTokens(tokens, "уме", "возможност", "способн", "capabilit") || (containsMeaningfulInterrogative(tokens) && containsToken(tokens, "можешь")) if inquiry && capabilitySubject { + if containsStemInTokens(tokens, "без", "внешн", "локальн") && containsStemInTokens(tokens, "модел", "ии", "ai") { + return interaction.InformationRequestLocalCapabilityInventory + } return interaction.InformationRequestCapabilityInventory } recoveryCue := containsStemInTokens(tokens, "восстанов", "исправ", "почин", "подключ", "настро", "недоступ", "нет") diff --git a/modules/interaction/domain/chat_test.go b/modules/interaction/domain/chat_test.go index a37b0b0..cb51ff1 100644 --- a/modules/interaction/domain/chat_test.go +++ b/modules/interaction/domain/chat_test.go @@ -120,7 +120,7 @@ func TestInformationRequestsAreClassifiedOnceByInteraction(t *testing.T) { {"какие модели доступны?", interaction.InformationRequestCognitiveModelInventory}, {"назови доступные модели", interaction.InformationRequestCognitiveModelInventory}, {"какая модель отвечает?", interaction.InformationRequestCognitiveCurrentModel}, - {"что ты можешь сделать без внешних моделей?", interaction.InformationRequestCapabilityInventory}, + {"что ты можешь сделать без внешних моделей?", interaction.InformationRequestLocalCapabilityInventory}, {"что ты умеешь?", interaction.InformationRequestCapabilityInventory}, {"проверь состояние локального канала", interaction.InformationRequestCognitiveChannelStatus}, {"нет связи с ИИ, восстанови канал", interaction.InformationRequestCognitiveRecovery}, -- 2.54.0