docs(test): record U2 rule segmenter shadow proposal report
Close the U2 checklist with golden/hard-negative evidence while keeping production routing unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+3
-2
@@ -5,7 +5,7 @@
|
||||
|
||||
## 焦点
|
||||
|
||||
1. **MULTI-INTENT HITL**:U2 规则分段进行中([U2](./short-term/2026-09-15-multi-intent-u2-segmenter.md);[U1 报告](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md))
|
||||
1. **MULTI-INTENT HITL**:U2 规则分段已签([U2 报告](../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md));下一单元 U3 PG/CAS 待认领
|
||||
2. **发布门禁**:CI `TEST_DATABASE_URL`、真实 PI 三工作流 E2E、前端人工抽检仍开放([gap-matrix](../remediation/gap-matrix.md))
|
||||
3. **CHAT-INTENT**:双标签 busy 已签(项目 **6275**);不删 `sess-p143-u9`;项目 143 只读
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
| owner | task | branch | worktree | mutex | status |
|
||||
|-------|------|--------|----------|-------|--------|
|
||||
| Cursor | 2026-09-15-multi-intent-u2-segmenter | feature/multi-intent-u2-segmenter | - | intent | in_progress |
|
||||
| Cursor | 2026-09-15-multi-intent-u2-segmenter | feature/multi-intent-u2-segmenter | - | intent | done |
|
||||
| Cursor | 2026-09-15-multi-intent-u1-contracts | feature/multi-intent-u1-contracts | - | architecture-docs | done |
|
||||
| Cursor | app-composition-u11-u12 | feature/app-composition-u11-u12 | - | app | done |
|
||||
| Cursor | chatlog-contextasm-u10 | feature/chatlog-contextasm-u10 | - | chat | done |
|
||||
@@ -121,6 +121,7 @@
|
||||
| Phase 2 修订计划 | [../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md](../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md) |
|
||||
| 多意图 HITL 复核方案 | [../system-design/2026-09-15-multi-intent-hitl-plan.md](../system-design/2026-09-15-multi-intent-hitl-plan.md) |
|
||||
| 多意图 HITL U1 契约 | [../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md) |
|
||||
| 多意图 HITL U2 分段 | [../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md](../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md) |
|
||||
| 文档可靠性 M1 报告 | [../test-reports/2026-09-14-document-reliability-pilot-test-report.md](../test-reports/2026-09-14-document-reliability-pilot-test-report.md) |
|
||||
| 文档可靠性 M1 活验 | [../test-reports/2026-09-14-document-reliability-pilot-live-test-report.md](../test-reports/2026-09-14-document-reliability-pilot-live-test-report.md) |
|
||||
| 文档可靠性 M2 | [../test-reports/2026-09-14-document-reliability-m2-test-report.md](../test-reports/2026-09-14-document-reliability-m2-test-report.md) |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "多意图 HITL U2 规则分段 checklist"
|
||||
status: in_progress
|
||||
status: done
|
||||
created: 2026-09-15
|
||||
updated: 2026-09-15
|
||||
related_task: "2026-09-15-multi-intent-u2-segmenter"
|
||||
@@ -10,13 +10,13 @@ related_task: "2026-09-15-multi-intent-u2-segmenter"
|
||||
|
||||
## Wave 1
|
||||
|
||||
- [ ] characterization 锁定 legacy IntentPlan
|
||||
- [ ] 分段器 golden(连接词/句号/序号/先再最后)
|
||||
- [ ] 查询并总结不拆;写段进入提案;5 段拒绝;红线整体拒绝;指代澄清
|
||||
- [ ] digest 稳定;shadow 不改 TopIntent
|
||||
- [ ] 反事实 auto_read 错误自动执行 = 0
|
||||
- [ ] `go test -short ./internal/intent ./internal/coordinator ./internal/app/intentflow`
|
||||
- [x] characterization 锁定 legacy IntentPlan — 证据:`internal/intent/plan_builder_test.go`;[报告 §5.1](../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md)
|
||||
- [x] 分段器 golden(连接词/句号/序号/先再最后) — 证据:[proposal-verbose.txt](../../test-reports/assets/2026-09-15-multi-intent-u2-segmenter/proposal-verbose.txt)
|
||||
- [x] 查询并总结不拆;写段进入提案;5 段拒绝;红线整体拒绝;指代澄清 — 证据:同上
|
||||
- [x] digest 稳定;shadow 不改 TopIntent — 证据:`TestPlanProposal_DigestStable` / `TestPlanProposal_WriteNotDroppedAndLegacyUnchanged`
|
||||
- [x] 反事实 auto_read 错误自动执行 = 0 — 证据:`plan-proposal eval denom=8 false_auto_execute=0`
|
||||
- [x] `go test -short ./internal/intent ./internal/coordinator ./internal/app/intentflow` — 证据:[unit.txt](../../test-reports/assets/2026-09-15-multi-intent-u2-segmenter/unit.txt);[short.txt](../../test-reports/assets/2026-09-15-multi-intent-u2-segmenter/short.txt)
|
||||
|
||||
## 完成定义
|
||||
|
||||
- [ ] 全部勾选且有证据链接
|
||||
- [x] 全部勾选且有证据链接
|
||||
|
||||
@@ -3,10 +3,10 @@ title: "多意图持久计划与 HITL(核心 U1–U8,扩面 U9–U12)"
|
||||
status: in_progress
|
||||
created: 2026-09-15
|
||||
updated: 2026-09-15
|
||||
owner: Cursor(U2);其余单元待认领
|
||||
branch: feature/multi-intent-u2-segmenter
|
||||
owner: 待认领(下一单元 U3)
|
||||
branch: "-"
|
||||
worktree: "-"
|
||||
mutex: intent
|
||||
mutex: "-"
|
||||
---
|
||||
|
||||
# 多意图持久计划与 HITL(核心 U1–U8,扩面 U9–U12)
|
||||
@@ -52,7 +52,7 @@ mutex: intent
|
||||
## 步骤
|
||||
|
||||
1. [x] U1 冻结边界、状态机、批量策略、错误码、事件和默认 legacy tier([独立任务](./2026-09-15-multi-intent-u1-contracts.md);[报告](../../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md));
|
||||
2. [ ] U2 characterization-first 建 golden/hard-negative 与 shadow 基线;
|
||||
2. [x] U2 characterization-first 建 golden/hard-negative 与 shadow 基线([独立任务](./2026-09-15-multi-intent-u2-segmenter.md);[报告](../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md));
|
||||
3. [ ] U3 建 intentflow owner、PG schema、CAS/lease/fencing/retention;
|
||||
4. [ ] U4 接 Track E outbox/dispatcher,只投影状态事实;
|
||||
5. [ ] U5 建统一 decision command 与动作 owner 授权端口;
|
||||
@@ -92,12 +92,13 @@ mutex: intent
|
||||
|
||||
## 相关链接
|
||||
|
||||
- Checklist: [U1](../checklists/2026-09-15-multi-intent-u1-contracts.md)
|
||||
- Checklist: [U1](../checklists/2026-09-15-multi-intent-u1-contracts.md);[U2](../checklists/2026-09-15-multi-intent-u2-segmenter.md)
|
||||
- Handoff: 每个 U-ID 独立建立
|
||||
- Test report: [U1](../../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)
|
||||
- Test report: [U1](../../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md);[U2](../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md)
|
||||
|
||||
## 证据 / 备注
|
||||
|
||||
- 当前 `plan_builder.go` 最多两段且写意图返回 nil;`action_planner.go` 的确认仍是文字提示。
|
||||
- 当前 `module-boundaries.yaml` 中 intent 仅依赖 maturity;Track E live,FAV off。
|
||||
- U1 已冻结 intentflow 契约、事件与 BatchActionPolicy,默认 `MULTI_INTENT_PLAN_TIER=legacy`。
|
||||
- U2 已落地规则分段与 shadow `PlanProposal`;生产 TopIntent / IntentPlan 不变;反事实 `false_auto_execute=0`。下一单元 U3:intentflow PG/CAS/lease。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "多意图 HITL U2:规则分段与 shadow 提案"
|
||||
status: in_progress
|
||||
status: done
|
||||
created: 2026-09-15
|
||||
updated: 2026-09-15
|
||||
owner: Cursor
|
||||
@@ -31,22 +31,22 @@ mutex: intent
|
||||
|
||||
## 步骤
|
||||
|
||||
1. [ ] 认领 CURRENT,characterization 锁定现有 IntentPlan
|
||||
2. [ ] 分段器 + PlanProposal + digest
|
||||
3. [ ] 接入 Recognize(leaf 识别防递归)
|
||||
4. [ ] golden/hard-negative/反事实与报告
|
||||
1. [x] 认领 CURRENT,characterization 锁定现有 IntentPlan
|
||||
2. [x] 分段器 + PlanProposal + digest
|
||||
3. [x] 接入 Recognize(leaf 识别防递归)
|
||||
4. [x] golden/hard-negative/反事实与报告
|
||||
|
||||
## 验收标准
|
||||
|
||||
- [ ] 「查风险,然后查法规」现有 IntentPlan 仍为 2 步 query
|
||||
- [ ] 「查法规然后生成报价单」生产 IntentPlan 仍为 nil(路由不变),提案含写段且 ComboHint=needs_confirm
|
||||
- [ ] 「查询并总结」不拆
|
||||
- [ ] 指代失败 → needs_clarify
|
||||
- [ ] 红线混入 → rejected
|
||||
- [ ] 5 段 → rejected_batch_size
|
||||
- [ ] 同输入 digest 稳定
|
||||
- [ ] 反事实错误自动执行 = 0
|
||||
- [ ] `intent -> maturity` 保持
|
||||
- [x] 「查风险,然后查法规」现有 IntentPlan 仍为 2 步 query
|
||||
- [x] 「查法规然后生成报价单」生产 IntentPlan 仍为 nil(路由不变),提案含写段且 ComboHint=needs_confirm
|
||||
- [x] 「查询并总结」不拆
|
||||
- [x] 指代失败 → needs_clarify
|
||||
- [x] 红线混入 → rejected
|
||||
- [x] 5 段 → rejected_batch_size
|
||||
- [x] 同输入 digest 稳定
|
||||
- [x] 反事实错误自动执行 = 0
|
||||
- [x] `intent -> maturity` 保持
|
||||
|
||||
## 相关链接
|
||||
|
||||
@@ -54,3 +54,10 @@ mutex: intent
|
||||
- 设计: [../../system-design/2026-09-15-multi-intent-hitl-plan.md](../../system-design/2026-09-15-multi-intent-hitl-plan.md)
|
||||
- Checklist: [../checklists/2026-09-15-multi-intent-u2-segmenter.md](../checklists/2026-09-15-multi-intent-u2-segmenter.md)
|
||||
- Test report: [../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md](../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md)
|
||||
|
||||
## 证据 / 备注
|
||||
|
||||
- L1 不 import intentflow;`ComboHint` 只是结构提示,不是授权。
|
||||
- 单段复用 primary frame,避免二次 Recognize。
|
||||
- 冒烟:`go vet ./...`、`go test -short ./...`、`./scripts/arch-check.sh --mode block` PASS。U2 无 schema/容器变更。
|
||||
- 提交:`4751348` docs(ops) 认领;`9005766` test(intent) characterization;`932ba87` feat(intent) 分段器与 shadow 提案。
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
| 模块 | 能力 | 状态 | 证据 | 缺口/后续 | mutex |
|
||||
|------|------|------|------|-----------|-------|
|
||||
| 意图识别 L1 | 18 类 Intent + 三分支消解 | partial | [system-design/intent-recognition](../system-design/intent-recognition/);[现场专项审计](../audit/2026-09-13-conversation-intent-runtime-state.md);[运行态报告](../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md);[双标签活验](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/live.json);[多意图复核方案](../system-design/2026-09-15-multi-intent-hitl-plan.md);[U1 契约](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md) | 明确写动作与只读总结已分流;双标签 `DOC_BUSY` 已签(项目 6275)。多意图 U1 契约已冻(intentflow 边界/事件/BatchActionPolicy/legacy tier);U2–U8 未实施;intent 纯依赖边界不得回退 | `intent` |
|
||||
| 多意图持久计划 | app/intentflow 生命周期与 HITL 契约 | planned | [设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[U1 报告](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md);[U1 任务](../ops/short-term/2026-09-15-multi-intent-u1-contracts.md) | U1 仅冻结合约。U2 规则分段 shadow;U3 PG/CAS;U4 投影;U5–U8 决策/Web/只读执行/task.generate | `intent-plan` |
|
||||
| 意图识别 L1 | 18 类 Intent + 三分支消解 | partial | [system-design/intent-recognition](../system-design/intent-recognition/);[现场专项审计](../audit/2026-09-13-conversation-intent-runtime-state.md);[运行态报告](../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md);[双标签活验](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/live.json);[多意图复核方案](../system-design/2026-09-15-multi-intent-hitl-plan.md);[U1 契约](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md);[U2 分段](../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md) | 明确写动作与只读总结已分流;双标签 `DOC_BUSY` 已签(项目 6275)。多意图 U1 契约已冻;U2 shadow `PlanProposal` 已落地且生产路由不变;U3–U8 未实施;intent 纯依赖边界不得回退 | `intent` |
|
||||
| 多意图持久计划 | app/intentflow 生命周期与 HITL 契约 | planned | [设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[U1 报告](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md);[U2 报告](../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md);[U2 任务](../ops/short-term/2026-09-15-multi-intent-u2-segmenter.md) | U1 契约 + U2 规则分段 shadow 已完成。下一单元 U3 PG/CAS/lease;U4 投影;U5–U8 决策/Web/只读执行/task.generate | `intent-plan` |
|
||||
| 对话 / ctxmgr | 多轮上下文、记忆、摘要 | partial | [system-design/multi-turn-dialogue](../system-design/multi-turn-dialogue/);[刷新恢复专项审计](../audit/2026-09-13-chat-history-refresh-disappears.md);[U10 端口化](../archive/ops/2026-09-15-chatlog-contextasm-u10.md);[U10 报告](../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md) | `CHAT-HISTORY-REFRESH` 闲聊刷新活验已补。U10 原地端口 **停止扩面**(未物理拆包)。语义摘要(D5 backlog) | `chat` |
|
||||
| 智能体小队 | 角色-任务-工作区-黑板 | done | [system-design/agent-squad](../system-design/agent-squad/);[test 2026-09-07](../test-reports/2026-09-07-dynamic-squad-planning-test-report.md) | 非关键步骤降级(A5/A6 backlog) | `squad` |
|
||||
| 工作流治理 | 三正式工作流 + 阶段门禁 | partial | [remediation/three-workflows](../remediation/2026-09-12-three-workflows-strict-governance-remediation.md);[test 2026-09-12](../test-reports/2026-09-12-three-workflows-governance-remediation-test-report.md);[冻结态/职责可选整改](../remediation/2026-09-14-workflow-plan-409-frozen-and-optional-duties-remediation.md);[Wave 5 页面矩阵](../test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md);[职责-动作鉴权](../test-reports/2026-09-14-governance-action-level-authz-test-report.md) | 设置页/DutyMode + 动作级鉴权/未激活 202-blocked/关闭创建直通已落地。后续:none 文档真实 PI 审批长链路、CI 三工作流 E2E | `workflow` |
|
||||
|
||||
@@ -127,6 +127,7 @@
|
||||
| 复核 | [../audit/2026-09-15-multi-intent-hitl-plan-review.md](../audit/2026-09-15-multi-intent-hitl-plan-review.md) |
|
||||
| 任务总览 | [../ops/short-term/2026-09-15-multi-intent-hitl.md](../ops/short-term/2026-09-15-multi-intent-hitl.md) |
|
||||
| U1 契约 | [../ops/short-term/2026-09-15-multi-intent-u1-contracts.md](../ops/short-term/2026-09-15-multi-intent-u1-contracts.md) |
|
||||
| U2 分段 | [../ops/short-term/2026-09-15-multi-intent-u2-segmenter.md](../ops/short-term/2026-09-15-multi-intent-u2-segmenter.md);[报告](../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md) |
|
||||
| 一句话总结 | intent 保持纯规则,intentflow 持久化计划并统一确认、授权、幂等、恢复和逐动作执行 |
|
||||
|
||||
**硬边界**:确认不等于授权;PG 是计划真相,卡片/SSE 是投影;写动作按 owner 端口逐项接入;LLM 只能提出不可信分段建议。
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
# 多意图 HITL U2 规则分段与 shadow 提案 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
U1 已冻结 `app/intentflow` 契约与默认 `legacy` tier。生产路径仍由 `plan_builder` 最多拆两段查询,写意图直接丢弃。U2 要在不改 TopIntent / 现有 IntentPlan 路由的前提下,用纯规则分段器生成 2–4 步 `PlanProposal`,并把写段、指代、红线、超限记录进 shadow,供后续 intentflow 消费。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
- 连接词 / 句号 / 分号 / 换行 / 序号 / 「先…再…最后」能拆出 2–4 段
|
||||
- 「查询并总结」内部链不拆;5 段不截断而是 `rejected_batch_size`
|
||||
- 写段进入提案且 `ComboHint=needs_confirm`;生产 IntentPlan 仍为 nil
|
||||
- 指代 → `needs_clarify`;红线 → 整句 `rejected`
|
||||
- 同输入 digest 稳定;反事实 `auto_read` 错误自动执行 = 0
|
||||
- `intent -> maturity` 保持;coordinator / chat 无回归
|
||||
- 无运行时路由变更,因此不做真实 PI / 浏览器验收
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
| 项 | 值 |
|
||||
|----|-----|
|
||||
| OS | Linux 7.0.0-31-generic |
|
||||
| Go | go1.27.1 linux/amd64 |
|
||||
| 分支 | `feature/multi-intent-u2-segmenter`(从本地 `dev@8ac3d3f` 检出) |
|
||||
| Schema | **43**(本单元不迁移) |
|
||||
| 容器 | 不 rebuild |
|
||||
| 项目 143 | **只读** |
|
||||
| 证据 | `.doc/test-reports/assets/2026-09-15-multi-intent-u2-segmenter/` |
|
||||
|
||||
测试层级:characterization(legacy IntentPlan)/ 分段器单测 / PlanProposal + golden eval / `go test -short ./...`。无 PG 集成、无真实 PI。
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
| 用例 | 判定 |
|
||||
|------|------|
|
||||
| 「查风险,然后查法规」 | 生产 IntentPlan 仍为 2 步 query;提案 `read_only`,反事实 `would_execute` |
|
||||
| 「查法规然后生成报价单」 | 生产 IntentPlan=nil,TopIntent 仍为查询;提案含写段、`needs_confirm`、`would_confirm`;shadow `LegacyDroppedWrite=true` |
|
||||
| 「查询并总结」 | 不分段;生产无 multi-intent plan;提案 `single` / `would_passthrough` |
|
||||
| 「然后再看一下它的适用范围」 | `needs_clarify` / `would_clarify` |
|
||||
| 「然后修改我的工号」 | 整句 `rejected` / `would_reject` |
|
||||
| 5 段编号 | 分段器保留 5 段;提案 `rejected_batch_size`,不静默截成 4 |
|
||||
| 同输入 digest | SHA-256 稳定 |
|
||||
| golden v1 denom=8 | `false_auto_execute=0` |
|
||||
| arch-check block | production gate passed |
|
||||
| 全仓 short | PASS |
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 5.1 characterization:生产路由不变
|
||||
|
||||
- **测试输入 (Input)**:`go test -count=1 ./internal/intent -run 'TestLegacyIntentPlan|TestLimitedIntentPlan_QueryThenQuery'`
|
||||
- **实际输出 (Actual Output)**:
|
||||
|
||||
```
|
||||
--- PASS: TestLegacyIntentPlan_WriteComboStillDropped (0.00s)
|
||||
--- PASS: TestLegacyIntentPlan_NoConnectorStaysSingle (0.00s)
|
||||
--- PASS: TestLimitedIntentPlan_QueryThenQuery (0.00s)
|
||||
ok chat-agent-system/internal/intent 0.012s
|
||||
```
|
||||
|
||||
- **评价判定 (Evaluation / Verdict)**:PASS。写组合生产 IntentPlan 仍为 nil;「查询并总结」不产生 legacy 计划;双查询仍是 2 步 IntentPlan。
|
||||
- **性能与耗时 (Duration & Latency)**:约 12ms
|
||||
|
||||
### 5.2 分段器 golden
|
||||
|
||||
- **测试输入**:`go test -v -count=1 ./internal/intent -run TestSplitPlanSegments`
|
||||
- **实际输出**:
|
||||
|
||||
```
|
||||
--- PASS: TestSplitPlanSegments_ConnectorAndNumbered (0.00s)
|
||||
--- PASS: TestSplitPlanSegments_PeriodAndSemicolon (0.00s)
|
||||
--- PASS: TestSplitPlanSegments_InternalChainNotSplit (0.00s)
|
||||
--- PASS: TestSplitPlanSegments_FirstThenFinally (0.00s)
|
||||
--- PASS: TestSplitPlanSegments_FiveNumberedKeptIntact (0.00s)
|
||||
```
|
||||
|
||||
- **评价判定**:PASS。连接词、编号、「先再最后」、句号/分号均可拆;内部链保持 1 段;5 段不被截断。
|
||||
- **性能与耗时**:<10ms
|
||||
|
||||
### 5.3 写段进入提案且路由不变
|
||||
|
||||
- **测试输入**:`查一下相关法规,然后帮我生成报价单`
|
||||
- **实际输出**:见 [proposal-verbose.txt](assets/2026-09-15-multi-intent-u2-segmenter/proposal-verbose.txt)
|
||||
|
||||
```
|
||||
--- PASS: TestPlanProposal_WriteNotDroppedAndLegacyUnchanged (0.00s)
|
||||
```
|
||||
|
||||
断言:`IntentPlan==nil`,`TopIntent=QUERY_REGULATIONS`,提案 ≥2 段,`ComboHint=needs_confirm`,`LegacyDroppedWrite=true`,`CounterfactualAutoRead=would_confirm`。
|
||||
|
||||
- **评价判定**:PASS。提案层不再静默丢写段;生产路由未改。
|
||||
- **性能与耗时**:<10ms
|
||||
|
||||
### 5.4 指代 / 红线 / 批量上限 / digest
|
||||
|
||||
- **测试输入**:对应 `TestPlanProposal_AnaphoraClarify`、`SecurityRejectsWhole`、`BatchSizeRejected`、`DigestStable`
|
||||
- **实际输出**:
|
||||
|
||||
```
|
||||
--- PASS: TestPlanProposal_AnaphoraClarify (0.00s)
|
||||
--- PASS: TestPlanProposal_SecurityRejectsWhole (0.00s)
|
||||
--- PASS: TestPlanProposal_BatchSizeRejected (0.00s)
|
||||
--- PASS: TestPlanProposal_DigestStable (0.00s)
|
||||
```
|
||||
|
||||
- **评价判定**:PASS。指代澄清、红线整句拒绝、5 段 `rejected_batch_size`、digest 稳定。
|
||||
- **性能与耗时**:<10ms
|
||||
|
||||
### 5.5 golden eval 与反事实安全
|
||||
|
||||
- **测试输入**:`internal/intent/testdata/plan-proposal-eval-v1.json`(denom=8)
|
||||
- **实际输出**:
|
||||
|
||||
```
|
||||
proposal_test.go:221: plan-proposal eval denom=8 false_auto_execute=0
|
||||
--- PASS: TestPlanProposalEvalGolden (0.00s)
|
||||
--- PASS: TestPlanProposal_HardNegativeNoFalseAutoExecute (0.00s)
|
||||
```
|
||||
|
||||
- **评价判定**:PASS。写/红线/指代/超限均不会被反事实判成 `would_execute`。`ComboHint` 只是结构提示,不是授权。
|
||||
- **性能与耗时**:<10ms
|
||||
|
||||
### 5.6 边界与全仓 short
|
||||
|
||||
- **测试输入**:`go vet ./...`;`./scripts/arch-check.sh --mode block`;`unset TEST_DATABASE_URL; go test -short -count=1 ./internal/intent ./internal/coordinator ./internal/chat ./internal/archtest ./internal/app/intentflow`;`go test -short -count=1 ./...`
|
||||
- **实际输出**:`go vet` 无输出。`arch-check block: production gate passed`。包级见 [unit.txt](assets/2026-09-15-multi-intent-u2-segmenter/unit.txt);全仓见 [short.txt](assets/2026-09-15-multi-intent-u2-segmenter/short.txt)。`internal/server` 9.687s;全包 ok。
|
||||
- **评价判定**:PASS。`intent -> maturity` 保持;L1 未 import intentflow。coordinator / chat 无回归。
|
||||
- **性能与耗时**:全仓 short 约 12s
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 命令 | 结果 |
|
||||
|------|------|
|
||||
| `go vet ./...` | PASS |
|
||||
| `go test -count=1 ./internal/intent -run 'TestSplitPlanSegments\|TestPlanProposal\|TestLegacyIntentPlan'` | PASS |
|
||||
| `go test -short -count=1 ./internal/intent ./internal/coordinator ./internal/chat ./internal/archtest ./internal/app/intentflow` | PASS |
|
||||
| `go test -short -count=1 ./...` | PASS |
|
||||
| `./scripts/arch-check.sh --mode block` | PASS |
|
||||
|
||||
通过率 100%。未跑 PG / 真实 PI(本单元无副作用路径)。
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
U2 达到合入标准:规则分段与 shadow `PlanProposal` 落地,生产 TopIntent / IntentPlan 不变,反事实错误自动执行为 0。
|
||||
|
||||
后续:U3 在独立分支 `feature/multi-intent-u3-intentflow-pg` 建 intentflow owner、PG schema、CAS/lease/fencing;不得把 HITL/tier 回灌 ActionRegistry,也不得把 shadow 提案当作生产 IntentPlan。
|
||||
@@ -0,0 +1,104 @@
|
||||
=== RUN TestLegacyIntentPlan_WriteComboStillDropped
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=TRIGGER_TASK branch=NEW_INTENT_PREEMPT confidence=0.86
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=TRIGGER_TASK branch=NEW_INTENT_PREEMPT confidence=0.86
|
||||
--- PASS: TestLegacyIntentPlan_WriteComboStillDropped (0.00s)
|
||||
=== RUN TestLegacyIntentPlan_NoConnectorStaysSingle
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
--- PASS: TestLegacyIntentPlan_NoConnectorStaysSingle (0.00s)
|
||||
=== RUN TestSplitPlanSegments_ConnectorAndNumbered
|
||||
--- PASS: TestSplitPlanSegments_ConnectorAndNumbered (0.00s)
|
||||
=== RUN TestSplitPlanSegments_PeriodAndSemicolon
|
||||
--- PASS: TestSplitPlanSegments_PeriodAndSemicolon (0.00s)
|
||||
=== RUN TestSplitPlanSegments_InternalChainNotSplit
|
||||
--- PASS: TestSplitPlanSegments_InternalChainNotSplit (0.00s)
|
||||
=== RUN TestSplitPlanSegments_FirstThenFinally
|
||||
--- PASS: TestSplitPlanSegments_FirstThenFinally (0.00s)
|
||||
=== RUN TestSplitPlanSegments_FiveNumberedKeptIntact
|
||||
--- PASS: TestSplitPlanSegments_FiveNumberedKeptIntact (0.00s)
|
||||
=== RUN TestPlanProposal_WriteNotDroppedAndLegacyUnchanged
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=TRIGGER_TASK branch=NEW_INTENT_PREEMPT confidence=0.86
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=TRIGGER_TASK branch=NEW_INTENT_PREEMPT confidence=0.86
|
||||
--- PASS: TestPlanProposal_WriteNotDroppedAndLegacyUnchanged (0.00s)
|
||||
=== RUN TestPlanProposal_QueryPairAutoReadCandidate
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_PROGRESS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_PROGRESS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
--- PASS: TestPlanProposal_QueryPairAutoReadCandidate (0.00s)
|
||||
=== RUN TestPlanProposal_AnaphoraClarify
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=CASUAL_CHAT branch=AMBIGUOUS_FALLBACK confidence=0.2
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=CASUAL_CHAT branch=AMBIGUOUS_FALLBACK confidence=0.2
|
||||
--- PASS: TestPlanProposal_AnaphoraClarify (0.00s)
|
||||
=== RUN TestPlanProposal_SecurityRejectsWhole
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=SECURITY_FORBIDDEN branch=NEW_INTENT_PREEMPT confidence=1
|
||||
--- PASS: TestPlanProposal_SecurityRejectsWhole (0.00s)
|
||||
=== RUN TestPlanProposal_BatchSizeRejected
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_USER_RIGHTS branch=NEW_INTENT_PREEMPT confidence=0.95
|
||||
--- PASS: TestPlanProposal_BatchSizeRejected (0.00s)
|
||||
=== RUN TestPlanProposal_DigestStable
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_PROGRESS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_PROGRESS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_PROGRESS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_PROGRESS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
--- PASS: TestPlanProposal_DigestStable (0.00s)
|
||||
=== RUN TestPlanProposalEvalGolden
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_PROGRESS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_PROGRESS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=TRIGGER_TASK branch=NEW_INTENT_PREEMPT confidence=0.86
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=TRIGGER_TASK branch=NEW_INTENT_PREEMPT confidence=0.86
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=CASUAL_CHAT branch=AMBIGUOUS_FALLBACK confidence=0.2
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=CASUAL_CHAT branch=AMBIGUOUS_FALLBACK confidence=0.2
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=SECURITY_FORBIDDEN branch=NEW_INTENT_PREEMPT confidence=1
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_USER_RIGHTS branch=NEW_INTENT_PREEMPT confidence=0.95
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_USER_RIGHTS branch=NEW_INTENT_PREEMPT confidence=0.95
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_SIMILAR_CASES branch=NEW_INTENT_PREEMPT confidence=0.92
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_USER_RIGHTS branch=NEW_INTENT_PREEMPT confidence=0.95
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_USER_RIGHTS branch=NEW_INTENT_PREEMPT confidence=0.95
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_SIMILAR_CASES branch=NEW_INTENT_PREEMPT confidence=0.92
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_USER_RIGHTS branch=NEW_INTENT_PREEMPT confidence=0.95
|
||||
proposal_test.go:221: plan-proposal eval denom=8 false_auto_execute=0
|
||||
--- PASS: TestPlanProposalEvalGolden (0.00s)
|
||||
=== RUN TestPlanProposal_HardNegativeNoFalseAutoExecute
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=TRIGGER_TASK branch=NEW_INTENT_PREEMPT confidence=0.86
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=TRIGGER_TASK branch=NEW_INTENT_PREEMPT confidence=0.86
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=SECURITY_FORBIDDEN branch=NEW_INTENT_PREEMPT confidence=1
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_USER_RIGHTS branch=NEW_INTENT_PREEMPT confidence=0.95
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=CASUAL_CHAT branch=AMBIGUOUS_FALLBACK confidence=0.2
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=QUERY_REGULATIONS branch=NEW_INTENT_PREEMPT confidence=0.9
|
||||
2026/09/15 23:15:06 INFO intent_recognition intent=CASUAL_CHAT branch=AMBIGUOUS_FALLBACK confidence=0.2
|
||||
--- PASS: TestPlanProposal_HardNegativeNoFalseAutoExecute (0.00s)
|
||||
PASS
|
||||
ok chat-agent-system/internal/intent 0.012s
|
||||
@@ -0,0 +1,61 @@
|
||||
ok chat-agent-system/cmd/bizdev-cli 1.901s
|
||||
? chat-agent-system/cmd/dataset [no test files]
|
||||
ok chat-agent-system/cmd/document-content-reconcile 0.006s
|
||||
? chat-agent-system/cmd/document-revision-backfill [no test files]
|
||||
? chat-agent-system/cmd/eventmode [no test files]
|
||||
? chat-agent-system/cmd/events [no test files]
|
||||
? chat-agent-system/cmd/recategorize [no test files]
|
||||
? chat-agent-system/cmd/server [no test files]
|
||||
ok chat-agent-system/internal/agent 3.162s
|
||||
ok chat-agent-system/internal/app 0.017s
|
||||
ok chat-agent-system/internal/app/chatflow 0.004s
|
||||
ok chat-agent-system/internal/app/docadvance 0.006s
|
||||
ok chat-agent-system/internal/app/docflow 0.003s
|
||||
ok chat-agent-system/internal/app/docnotify 0.003s
|
||||
ok chat-agent-system/internal/app/docproject 0.002s
|
||||
ok chat-agent-system/internal/app/intentflow 0.002s
|
||||
ok chat-agent-system/internal/app/stageflow 0.010s
|
||||
ok chat-agent-system/internal/app/uow 0.003s
|
||||
ok chat-agent-system/internal/archtest 0.230s
|
||||
ok chat-agent-system/internal/artifactvault 0.005s
|
||||
ok chat-agent-system/internal/auth 0.837s
|
||||
ok chat-agent-system/internal/authz 0.004s
|
||||
ok chat-agent-system/internal/bizdev 0.185s
|
||||
ok chat-agent-system/internal/chat 0.027s
|
||||
ok chat-agent-system/internal/config 0.002s
|
||||
ok chat-agent-system/internal/coordinator 0.015s
|
||||
ok chat-agent-system/internal/ctxmgr 0.100s
|
||||
ok chat-agent-system/internal/dataset 0.010s
|
||||
ok chat-agent-system/internal/db 0.004s
|
||||
ok chat-agent-system/internal/doccontent 0.003s
|
||||
ok chat-agent-system/internal/docduty 0.010s
|
||||
ok chat-agent-system/internal/docgov 0.022s
|
||||
ok chat-agent-system/internal/docquery 0.010s
|
||||
ok chat-agent-system/internal/docrevision 0.012s
|
||||
ok chat-agent-system/internal/events 0.010s
|
||||
ok chat-agent-system/internal/freedoc 0.031s
|
||||
ok chat-agent-system/internal/fsutil 0.002s
|
||||
ok chat-agent-system/internal/httpx 0.012s
|
||||
ok chat-agent-system/internal/intent 0.039s
|
||||
ok chat-agent-system/internal/kb 0.015s
|
||||
ok chat-agent-system/internal/maturity 0.002s
|
||||
ok chat-agent-system/internal/notification 0.093s
|
||||
? chat-agent-system/internal/observability [no test files]
|
||||
ok chat-agent-system/internal/projectcontext 0.007s
|
||||
ok chat-agent-system/internal/projectinstance 0.005s
|
||||
ok chat-agent-system/internal/projectworkflow 0.002s
|
||||
ok chat-agent-system/internal/quote 0.009s
|
||||
ok chat-agent-system/internal/replyexport 0.002s
|
||||
ok chat-agent-system/internal/server 9.687s
|
||||
ok chat-agent-system/internal/squad 0.033s
|
||||
ok chat-agent-system/internal/storage 0.014s
|
||||
ok chat-agent-system/internal/stream 0.003s
|
||||
ok chat-agent-system/internal/stream/transport 0.002s
|
||||
ok chat-agent-system/internal/taskrun 0.145s
|
||||
ok chat-agent-system/internal/template 0.776s
|
||||
ok chat-agent-system/internal/upload 0.003s
|
||||
? chat-agent-system/internal/workflow [no test files]
|
||||
ok chat-agent-system/internal/workflow/runtime 0.002s
|
||||
ok chat-agent-system/internal/workflowdef 0.003s
|
||||
ok chat-agent-system/internal/workspace 0.003s
|
||||
? chat-agent-system/templates [no test files]
|
||||
@@ -0,0 +1,5 @@
|
||||
ok chat-agent-system/internal/intent 0.018s
|
||||
ok chat-agent-system/internal/coordinator 0.009s
|
||||
ok chat-agent-system/internal/chat 0.013s
|
||||
ok chat-agent-system/internal/archtest 0.163s
|
||||
ok chat-agent-system/internal/app/intentflow 0.002s
|
||||
Reference in New Issue
Block a user