Keep the server admission test inside the intent boundary

Why: the U6 admission test imported agent-intent directly from
internal/server, which lint-boundaries forbids (only intentgate,
intentsem and the squad intent adapter may import it).
Evidence: repair receipt success; server/intentgate/route tests pass
(verify-u6r.json); fixtures moved behind intentgate helpers.
Impact: test-only rework plus a small intentgate fixture helper.
Refs: feature/agent-stack-audit-remediation-b1 U6 repair
This commit is contained in:
2026-10-21 17:35:53 +00:00
parent 4030449f4b
commit 49c1259e00
3 changed files with 12 additions and 8 deletions
+7 -4
View File
@@ -55,11 +55,14 @@ type MatchResult struct {
// Complete 报告槽位是否齐全且全部通过权威校验:false 时业务动作不得派发。
func (m MatchResult) Complete() bool { return len(m.Missing) == 0 && len(m.Invalid) == 0 }
// 命令类型经闸门投影(别名):生态库按边界规则只许本包导入,
// Router/runmgr 等消费方只依赖本包表面。
// 命令与目录类型经闸门投影(别名):生态库按边界规则只许本包导入,
// Router/runmgr 等消费方只依赖本包表面。CatalogSpec/CatalogSlot 随生成器端口
// (SetGenerator 的入参)投影,实现生成器不必越过本包直接引用生态库。
type (
Command = agentintent.Command
ActionRef = agentintent.ActionRef
Command = agentintent.Command
ActionRef = agentintent.ActionRef
CatalogSpec = agentintent.CatalogSpec
CatalogSlot = agentintent.CatalogSlot
)
const (
+1 -1
View File
@@ -946,7 +946,7 @@ func TestStaticServed(t *testing.T) {
_ = io.Discard
}
// TestHITLIntentPivot:装载插件意图后,自由输入命中其他意图 → 转轨(agent-intent 闸门)。
// TestHITLIntentPivot:装载插件意图后,自由输入命中其他意图 → 转轨(intentgate 闸门)。
func TestHITLIntentPivot(t *testing.T) {
srv, _ := newTestServer(t)
h := srv.Handler()
+4 -3
View File
@@ -7,7 +7,6 @@ import (
"testing"
agentcommand "agent-command"
agentintent "agent-intent/intent"
"agent-system-backend/internal/cmdbus"
"agent-system-backend/internal/intentgate"
)
@@ -303,8 +302,10 @@ func TestHighRiskCommandStillRequiresConfirmation(t *testing.T) {
// 显式取消命令宿主未实现:如实回落普通回合,不派发同一句里的 Start。
type cancelGenerator struct{}
func (cancelGenerator) Generate(context.Context, string, []agentintent.CatalogSpec) ([]agentintent.Command, error) {
return []agentintent.Command{
// 生成器只经 intentgate 表面接线:目录与命令类型都由闸门投影,
// 宿主实现不必(也不应)直接导入生态库。
func (cancelGenerator) Generate(context.Context, string, []intentgate.CatalogSpec) ([]intentgate.Command, error) {
return []intentgate.Command{
{Kind: intentgate.CommandStart, Action: intentgate.ActionRef{Kind: intentgate.ActionCommand, ID: "demo.report"}},
{Kind: intentgate.CommandCancel, Target: "demo.report"},
}, nil