Files
Agent-System/internal/app/composition_query_owner_test.go
WeiCHEN d019388f37 feat(intent): wire production QueryOwner and confirm dispatcher
Replace FakeActionOwner with QueryOwner+QueryGuard at the composition
root; DispatchEligible reuses claim/execute/recover so confirm stays
zero-write before dispatch and default tier remains legacy.
2026-09-22 21:44:56 +08:00

37 lines
975 B
Go

package app
import (
"os"
"path/filepath"
"strings"
"testing"
"chat-agent-system/internal/app/intentflow"
)
func TestProductionCompositionRoot_NoFakeQueryOwner(t *testing.T) {
root := "."
src, err := os.ReadFile(filepath.Join(root, "app.go"))
if err != nil {
t.Fatal(err)
}
body := string(src)
if strings.Contains(body, "NewFakeActionOwner()") {
t.Fatal("production composition root must not construct FakeActionOwner")
}
if !strings.Contains(body, "NewQueryOwner(") {
t.Fatal("production composition root must wire NewQueryOwner")
}
if !strings.Contains(body, "QueryGuard{Inner: queryOwner}") {
t.Fatal("production composition root must wrap QueryOwner in QueryGuard")
}
}
func TestDefaultPlanTierRemainsLegacy(t *testing.T) {
t.Setenv("MULTI_INTENT_PLAN_TIER", "")
intentflow.ResetFeatureFlagsForTest()
if got := intentflow.CurrentFeatureFlags().PlanTier; got != intentflow.TierLegacy {
t.Fatalf("default tier = %s, want legacy", got)
}
}