Files
Agent-System-Backend/internal/app/intent_flags_test.go
T
weichen 45b011af9f
ci / vet-and-test (pull_request) Failing after 34s
Wire the intent slow lane behind settings flags (I2 WP3)
Why: I2 increments 1-2 shipped the agent-intent ports (SemanticScorer,
CommandGenerator); the backend still had no implementation, so the slow
lane could not be enabled in the product.
Evidence: go test ./... green; lint-boundaries ok; the two new
runtime.intentSemantic / runtime.intentGenerator flags are registered
with default false and the gate defaults to the I1 recognizer when both
are off (TestIntentSlowLaneFlagsDefaultOff, TestGate*).
Impact: no behavior change by default; enabling runtime.intentSemantic
routes ambiguous rule matches through embedding cosine scoring, and
runtime.intentGenerator lets the lightweight model propose commands on
fallback with library-side fail-closed validation. Nested agent-intent
pin moves to 343b1e6 (I2 increments 1-2).
Refs: I2 increment 3
2026-10-07 11:20:41 +00:00

30 lines
810 B
Go

package app
import (
"testing"
"agent-system-backend/internal/settings"
core "agent-system-core"
)
// 慢通道开关默认关(行为与 I1 一致的机器证明):
// 两条 runtime.intentSemantic / runtime.intentGenerator 必须注册且默认 false。
func TestIntentSlowLaneFlagsDefaultOff(t *testing.T) {
seen := map[string]core.SettingDesc{}
for _, d := range settings.Schema() {
seen[d.Key] = d
}
for _, key := range []string{"runtime.intentSemantic", "runtime.intentGenerator"} {
d, ok := seen[key]
if !ok {
t.Fatalf("设置未注册:%s", key)
}
if d.Type != core.SettingBool {
t.Fatalf("%s 类型应为 bool,得到 %v", key, d.Type)
}
if def, isBool := d.Default.(bool); !isBool || def {
t.Fatalf("%s 必须默认 false,得到 %v", key, d.Default)
}
}
}