Why: Allow consumers to download an immutable module revision without nested source checkouts or local path replacements. Evidence: SELF package tests and the prior canonical-path rejection are recorded in the Dev dependency-workspace task card; remote consumption is replayed against the committed candidate. Impact: Change the module identity and its Go imports while preserving API behavior. Existing historical submodule revisions remain buildable. Refs: Versioned dependencies U1/U3; feature/dependency-workspace
45 lines
1.5 KiB
Go
45 lines
1.5 KiB
Go
package app
|
||
|
||
import (
|
||
"testing"
|
||
|
||
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
|
||
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
|
||
)
|
||
|
||
// 慢通道开关默认关(行为与 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)
|
||
}
|
||
}
|
||
}
|
||
|
||
// 遥测开关默认安全(N3 WP4):otlpEndpoint 默认空(不导出,保持现状),
|
||
// serviceName 有非空默认。两处都注册进 Schema。
|
||
func TestTelemetryFlagsDefaults(t *testing.T) {
|
||
seen := map[string]core.SettingDesc{}
|
||
for _, d := range settings.Schema() {
|
||
seen[d.Key] = d
|
||
}
|
||
if d, ok := seen["telemetry.otlpEndpoint"]; !ok || d.Default != "" {
|
||
t.Fatalf("otlpEndpoint 必须注册且默认空:%+v", d)
|
||
}
|
||
if d, ok := seen["telemetry.serviceName"]; !ok || d.Default != "agent-system-backend" {
|
||
t.Fatalf("serviceName 必须注册且默认 agent-system-backend:%+v", d)
|
||
}
|
||
}
|