From 13bbcdf747fcbd3cc6b63466b3b3539df77dd19a Mon Sep 17 00:00:00 2001 From: Mikhail Date: Tue, 25 Aug 2026 22:46:20 +0300 Subject: [PATCH] Preserve specialized research routes --- cmd/core-runtime/chat_orchestrator.go | 8 ++++++++ cmd/core-runtime/chat_orchestrator_test.go | 12 ++++++++++++ cmd/core-runtime/main.go | 8 ++++---- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/cmd/core-runtime/chat_orchestrator.go b/cmd/core-runtime/chat_orchestrator.go index 8ee76ce..bcb551c 100644 --- a/cmd/core-runtime/chat_orchestrator.go +++ b/cmd/core-runtime/chat_orchestrator.go @@ -72,3 +72,11 @@ func hasChatRoute(routes []chatRoute, kind chatRouteKind) bool { } return false } + +// specializedRouteBypassesGeneralInterpretation keeps a concrete capability +// route stable. General cognition may still be used later to assess evidence, +// but it must not replace an executable research or media route with a vague +// conversational clarification before the capability is attempted. +func specializedRouteBypassesGeneralInterpretation(routes []chatRoute) bool { + return hasChatRoute(routes, chatRouteMedia) || hasChatRoute(routes, chatRouteResearch) +} diff --git a/cmd/core-runtime/chat_orchestrator_test.go b/cmd/core-runtime/chat_orchestrator_test.go index a70150f..ed88618 100644 --- a/cmd/core-runtime/chat_orchestrator_test.go +++ b/cmd/core-runtime/chat_orchestrator_test.go @@ -39,3 +39,15 @@ func TestBuildChatRoutePlanAlwaysKeepsLocalConversationRoute(t *testing.T) { t.Fatalf("unexpected local route: %+v", planned) } } + +func TestSpecializedRouteBypassesGeneralInterpretation(t *testing.T) { + if !specializedRouteBypassesGeneralInterpretation([]chatRoute{{Kind: chatRouteResearch}}) { + t.Fatal("research route must execute before general cognition") + } + if !specializedRouteBypassesGeneralInterpretation([]chatRoute{{Kind: chatRouteMedia}}) { + t.Fatal("media route must execute before general cognition") + } + if specializedRouteBypassesGeneralInterpretation([]chatRoute{{Kind: chatRouteConversation}}) { + t.Fatal("conversation-only route must retain general cognition") + } +} diff --git a/cmd/core-runtime/main.go b/cmd/core-runtime/main.go index 32d3e5e..dca053e 100644 --- a/cmd/core-runtime/main.go +++ b/cmd/core-runtime/main.go @@ -653,10 +653,10 @@ func main() { cognitiveAvailable := true semanticInterpretationRequested := shouldRequestSemanticInterpretation(semantic) semanticReflexAudit := shouldAuditDeterministicReflex(semantic, string(utterance.ID), now) - // A selected specialized media route already has an executable semantic - // outcome. Do not block it on the general cognitive channel: image - // generation must reach its own adapter even when cognition is degraded. - if hasChatRoute(routePlan, chatRouteMedia) { + // A selected specialized route already has an executable semantic outcome. + // Do not block it on the general cognitive channel: research and image + // generation must reach their own adapters even when cognition is degraded. + if specializedRouteBypassesGeneralInterpretation(routePlan) { semanticInterpretationRequested = false semanticReflexAudit = false }