Unify intent routing behind the route package and enable NFKC (I1 WP3/WP4) #74

Merged
weichen merged 1 commits from feature/agent-stack-i1 into main 2026-10-07 07:46:07 +00:00
Owner

I1 WP3/WP4(Backend 侧):唯一 Router 与 NFKC 对齐

Agent-Intent PR #6(命令模型/决胜/词界)、#7(spec.action)与 Agent-Squad PR #19(squadintent NFKC)已合入。本 PR 完成 Backend 侧:

改动

  • 新包 internal/route(唯一 Router,WP3):收编原散落两处的路由逻辑——server.go chat 内联分支与 runmgr HITL 自由输入转轨——统一消费库层命令列表。优先级明文:auto/handler = 命令总线 > 工作流 > 普通回合(与现网一致);显式 command/workflow/blueprint 按声明执行,目标不可解析时回落普通回合并写明 Reason,不静默错配;PromptTrigger 是提示词装配、不参与路由决胜(包注释与测试覆盖)。既有回归(TestCommandBusBeatsWorkflow、工作流启动、server e2e)原样通过 = 行为等价。
  • intentgate:MatchResult 携带库层 Commands;NFKC: true 开启(与 squadintent 对齐,I3 配套)。
  • blueprint 动作:Router 层裁决为 squad 决策(Kind/Blueprint 键)——「blueprint 经 ActionRef 到达 Router」的验收形态。已知边界(包注释如实记录):真正执行需 runmgr 的 per-run entry 覆盖(独立设计项),本版本按普通回合处理且不静默。
  • 嵌套 pins:deps/agent-intent → 2554b50、deps/agent-squad → 6b7a991。

验证

  • go vet ./... 通过;go test -count=1 ./... 30 包全 ok(新增 route 7 测:auto 优先级、显式三键、不可解析 Reason、legacy 兜底、槽位透传)。

合入顺序

Agent-Intent #6/#7 ✓ → Squad #19 ✓ → 本 PR → Dev 三 pin PR。

主任务:Dev 仓 feature/agent-stack-i1。

# I1 WP3/WP4(Backend 侧):唯一 Router 与 NFKC 对齐 [Agent-Intent PR #6](https://git-home.u1680832.nyat.app:30319/weichen/Agent-Intent/pulls/6)(命令模型/决胜/词界)、[#7](https://git-home.u1680832.nyat.app:30319/weichen/Agent-Intent/pulls/7)(spec.action)与 [Agent-Squad PR #19](https://git-home.u1680832.nyat.app:30319/weichen/Agent-Squad/pulls/19)(squadintent NFKC)已合入。本 PR 完成 Backend 侧: ## 改动 - **新包 `internal/route`(唯一 Router,WP3)**:收编原散落两处的路由逻辑——server.go chat 内联分支与 runmgr HITL 自由输入转轨——统一消费库层命令列表。优先级明文:auto/handler = 命令总线 > 工作流 > 普通回合(与现网一致);显式 command/workflow/blueprint 按声明执行,**目标不可解析时回落普通回合并写明 Reason,不静默错配**;PromptTrigger 是提示词装配、不参与路由决胜(包注释与测试覆盖)。既有回归(`TestCommandBusBeatsWorkflow`、工作流启动、server e2e)原样通过 = 行为等价。 - **intentgate**:`MatchResult` 携带库层 `Commands`;`NFKC: true` 开启(与 squadintent 对齐,I3 配套)。 - **blueprint 动作**:Router 层裁决为 squad 决策(Kind/Blueprint 键)——「blueprint 经 ActionRef 到达 Router」的验收形态。**已知边界(包注释如实记录)**:真正执行需 runmgr 的 per-run entry 覆盖(独立设计项),本版本按普通回合处理且不静默。 - 嵌套 pins:`deps/agent-intent` → 2554b50、`deps/agent-squad` → 6b7a991。 ## 验证 - `go vet ./...` 通过;`go test -count=1 ./...` 30 包全 ok(新增 route 7 测:auto 优先级、显式三键、不可解析 Reason、legacy 兜底、槽位透传)。 ## 合入顺序 Agent-Intent #6/#7 ✓ → Squad #19 ✓ → 本 PR → Dev 三 pin PR。 主任务:Dev 仓 `feature/agent-stack-i1`。
weichen added 1 commit 2026-10-07 07:44:56 +00:00
Unify intent routing behind the route package and enable NFKC
ci / vet-and-test (pull_request) Successful in 41s
ff43c7c9aa
Why: I1 WP3 - chat routing and the HITL free-text pivot now share one
router consuming the library's command list, and both intent hosts
fold compatibility-equivalent input.

Evidence: go vet clean; go test ./... 30 packages ok, including the
existing workflow-route and server e2e suites unchanged (behavior
parity) and the new route package tests.

Impact: new internal/route package (unique router with explicit
priority rules); intentgate carries Commands and folds NFKC;
server.go and runmgr.go route through it; nested pins at intent
2554b50 and squad 6b7a991. Blueprint actions resolve to a squad
decision at the router level; per-run squad entry stays a recorded
follow-up (no silent misrouting).

Refs: Documents proposal 2026-10-07-agent-stack-n1q1i1-plans.md I1 WP3/WP4
weichen merged commit 4da3cfc787 into main 2026-10-07 07:46:07 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#74