From e400909a3aae8bf8ba2f006acb2d3f2f170b018d Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 21 Sep 2026 08:47:26 +0000 Subject: [PATCH] docs(test): record real PI acceptance for intent confirm stage-aware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Capture 陈威 project 6579 chat evidence: weak-verb confirm card, affirm execution (~3m), option-2 no task, and strong-path direct TRIGGER_TASK. Co-authored-by: Cursor --- .../2026-09-21-intent-confirm-stage-aware.md | 9 ++- .doc/ops/CURRENT.md | 6 +- ...-intent-confirm-stage-aware-test-report.md | 69 +++++++++---------- .../health-after-e2e.json | 1 + .../live-chat-probe2-db.txt | 20 ++++++ .../live-chat-round1-fresh.json | 1 + .../live-chat-round1-summary.txt | 13 ++++ .../live-chat-round1.json | 1 + .../live-chat-round2-summary.txt | 21 ++++++ .../live-chat-window-probe2.json | 1 + .../live-opt2-r1.json | 1 + .../live-opt2-r2.json | 1 + .../live-opt2-summary.txt | 6 ++ .../live-strong-db.txt | 1 + 14 files changed, 107 insertions(+), 44 deletions(-) create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/health-after-e2e.json create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-probe2-db.txt create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1-fresh.json create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1-summary.txt create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1.json create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round2-summary.txt create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-window-probe2.json create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-r1.json create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-r2.json create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-summary.txt create mode 100644 .doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-strong-db.txt diff --git a/.doc/archive/ops/2026-09-21-intent-confirm-stage-aware.md b/.doc/archive/ops/2026-09-21-intent-confirm-stage-aware.md index af6e96a0..b8482ff0 100644 --- a/.doc/archive/ops/2026-09-21-intent-confirm-stage-aware.md +++ b/.doc/archive/ops/2026-09-21-intent-confirm-stage-aware.md @@ -7,7 +7,6 @@ owner: Cursor branch: fix/intent-confirm-stage-aware-2026-09-21 worktree: .worktrees/intent-confirm-stage-aware-2026-09-21 base_dev_sha: 49fb68fec1ea56f00616c23d08efb15950c2300d -merged_dev_sha: 0c40190449fe5ef6d07d62cfc5a06e80ed2e1ac6 mutex: intent+web+docgov --- @@ -22,18 +21,18 @@ mutex: intent+web+docgov - 批次5 `feat(intent)`:弱写动词 + `stageAwareRequirementsTask` + `needs_confirmation` - 批次6 `feat(coordinator)`:智能确认门禁(PendingExpectation) - 批次7 `feat(web)`:阶段错误降级聊天一次 -- 批次8:验收报告 + 合回 `dev` + rebuild +- 批次8:验收报告 + 合回 `dev` + 真实 PI 抽样 ## 步骤 1. [x] 批次5–7 实现与单元门禁 -2. [x] 批次8:合入 `dev@0c401904` + 从正确树 no-cache rebuild + 制品字符串核验 +2. [x] 批次8:合入 `dev@0c401904` + rebuild + 真实链路抽样(陈威项目 6579) ## 验收标准 -- [x] V0.1「整理一下需求」→ 确认 →「好」→ intake(单元 E2E) +- [x] V0.1「整理一下需求」→ 确认 →「好」→ intake(单元 + 真实 PI) - [x] 强指令不强制确认;「编写用户需求表」无 rdev 误拦 -- [x] 合入后制品含 `needs_confirmation` / `confirm-trigger-` / 确认话术;前端含降级文案 +- [x] 合入后真实 PI 抽样(见测试报告) ## 相关链接 diff --git a/.doc/ops/CURRENT.md b/.doc/ops/CURRENT.md index cbb00726..c819f76a 100644 --- a/.doc/ops/CURRENT.md +++ b/.doc/ops/CURRENT.md @@ -1,7 +1,7 @@ # 当前焦点 **更新**: 2026-09-21 -**production_ready**: yes(门禁 B1–B4 已签;dev schema **60**,test/main 仍为 **58**。P0 热修 done;rdev 种子热修 done,见 [报告](../test-reports/2026-09-20-rdev-seed-hotfix-test-report.md)) +**production_ready**: yes(门禁 B1–B4 已签;dev schema **61**,test/main 仍为 **58**。P0 热修 done;rdev 种子热修 done,见 [报告](../test-reports/2026-09-20-rdev-seed-hotfix-test-report.md)) ## 焦点 @@ -183,7 +183,7 @@ | holder | phase | since | scope | queue | |--------|-------|-------|-------|-------| -| - | idle | 2026-09-21 | intent-confirm-stage-aware 已合入 `dev@0c401904` 并 no-cache rebuild;制品核验 PASS | - | +| - | idle | 2026-09-21 | intent-confirm 合入+rebuild+真实 PI 抽样 PASS;schema=61 | - | **phase**: `idle` | `merging` | `smoke` | `e2e` @@ -193,7 +193,7 @@ | 环境 | 端口 | schema | 状态 | |------|------|--------|------| -| dev | 8080 | **60** | healthy(文档键 `00060` 已迁移;`/health` schema_version=60;`pi-agent`;events `:8088`) | +| dev | 8080 | **61** | healthy(`/health` schema_version=61;intent-confirm 真实 PI 验收 PASS;`pi-agent`;events `:8088`) | | test | 8081 | **58** | healthy(`rc-v1.0.0-beta.7`;rdev v1 active;`published_by` 回落到用户 4;events `:8089`) | | main | 8000 | **58** | healthy(P0 Wave3 rebuild 已追平 schema;分支树对齐仍记 backlog;口令已轮换;events `:8090`) | diff --git a/.doc/test-reports/2026-09-21-intent-confirm-stage-aware-test-report.md b/.doc/test-reports/2026-09-21-intent-confirm-stage-aware-test-report.md index 525e69d9..f262b921 100644 --- a/.doc/test-reports/2026-09-21-intent-confirm-stage-aware-test-report.md +++ b/.doc/test-reports/2026-09-21-intent-confirm-stage-aware-test-report.md @@ -16,9 +16,10 @@ ## 三、 测试方案与环境 (Test Plan & Environment) -- OS:linux;分支 `fix/intent-confirm-stage-aware-2026-09-21`;base `dev@9798b130` +- OS:linux;分支 `fix/intent-confirm-stage-aware-2026-09-21`;已合入 `dev@0c401904` - 单元:`go test ./internal/intent ./internal/coordinator`;`web npm test` / `npm run build` -- 真实容器 rebuild:合入后从 `agent-governance-dev-integration`(`dev@0c401904`)对 `app` 执行 `--no-cache` 构建并 recreate(主目录当时为 detached 旧树,避免误用缓存制品) +- 真实环境:`./scripts/env-service.sh dev rebuild`(no-cache);`:8080` `agent_backend=pi-agent`,schema **61**;pi-agent `MiniMax-M2.7-highspeed` +- 端到端:为用户 398(陈威)签发一次性会话(验收后立即撤销,不改口令);项目 6579;会话 `sess-confirm-probe-2` / `sess-confirm-opt2` / `sess-confirm-strong` - 证据:`.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/` ## 四、 预期结果 (Expected Results) @@ -26,60 +27,56 @@ | 输入 | 预期 | |------|------| | V0.1「整理一下需求」 | 确认话术含《用户初始需求收集表》;默认选项 intake | -| 回复「好」 | `TRIGGER_TASK/intake`,StatusAccepted(无 runner 时 stub) | -| 「生成需求表」 | 直接 TRIGGER_TASK/intake,无 needs_confirmation | -| 「编写用户需求表」 | TRIGGER_TASK/user_requirements,无 workflow_scope_mismatch | +| 回复「好」 | `EXPECTATION_HIT` → 执行 intake,真实 PI 产出正文 | +| 回复「2」 | 不启动文档任务 | +| 「生成需求表」 | 直接 TRIGGER_TASK conf≈0.86,无 needs_confirmation / 无确认卡片 | | 阶段错误码 | 前端 `isTaskStageDegradeCode` 为 true,hook 含降级路径 | ## 五、 实际测试结果与判定 (Actual Results & Evaluation) -### 用例 1:弱写需求 → 确认 → 拍板 +### 用例 1:弱写需求 → 确认 → 拍板(真实 PI) -- **测试输入**:`整理一下需求` → 确认后 `好` -- **实际输出**:见 `assets/.../go-unit.txt` 与 `post-merge-e2e.txt` — `TestProcessIntent_WeakRequirementsConfirmsIntake` PASS;首轮 conf=0.78 ClarificationRequired;拍板后 EXPECTATION_HIT conf=1 Accepted +- **测试输入**:陈威 `POST /api/v1/chat`,`整理一下需求` → `好`(会话 `sess-confirm-probe-2`,项目 6579) +- **实际输出**: + - 首轮:`TRIGGER_TASK` conf=0.78,`needs_confirmation=true`,`target_task=intake`;回复含「更稳妥的做法是开始整理并编写《用户初始需求收集表》」与选项 1/2(`live-chat-round1-fresh.json`) + - 拍板:日志 `intent_recognition intent=TRIGGER_TASK branch=EXPECTATION_HIT confidence=1`;助手消息 id=4501:「已为您自适应规划并完成生成【用户初始需求收集表】!交付物正文已保存至:…/intake_1789980049487120828/output.md,耗时: 2m59s」(`live-chat-probe2-db.txt` / `live-chat-round2-summary.txt`) - **评价判定**:PASS -- **性能与耗时**:约 10ms 内 +- **性能与耗时**:确认门禁 <20ms;真实小队生成约 3 分钟 -### 用例 2:强指令不确认 +### 用例 2:回复「2」不启动任务 -- **测试输入**:`生成需求表`;协调层 `Confidence=0.86` intake -- **实际输出**:`TestStageAwareRequirements_StrongIntakeDirect` / `TestConfirmGate_StrongHighConfidenceDirect` PASS +- **测试输入**:`整理一下需求` → `2`(`sess-confirm-opt2`) +- **实际输出**:首轮同确认卡片;次轮 `EXPECTATION_HIT` / `CASUAL_CHAT` conf=0.98,无新 workspace 由该会话创建;未出现任务执行中/交付物保存话术(`live-opt2-summary.txt`) +- **评价判定**:PASS(未启动文档任务;对话兜底话术偏通用,属既有 CASUAL_CHAT 体验,不阻塞本验收) + +### 用例 3:强指令不确认 + +- **测试输入**:`生成需求表`(`sess-confirm-strong`) +- **实际输出**:日志 `intent_recognition intent=TRIGGER_TASK branch=NEW_INTENT_PREEMPT confidence=0.86`(无 `needs_confirmation`);随即出现工作区 `bd_intake_1789980313416744818` / `intake_1789980275257152831`,说明直连小队执行而非确认卡片 +- **评价判定**:PASS +- **补充**:同步 `POST /chat` 在长任务期间可能被网关超时掐断(空 body),落库与工作区仍可证明直执路径 + +### 用例 4:单元 / 前端门禁 + +- **实际输出**:`TestProcessIntent_WeakRequirementsConfirmsIntake`、`TestStageAwareRequirements_*`、`TestConfirmGate_*` PASS;`useTaskRunAttempts` 降级路径与 `isTaskStageDegradeCode` PASS;`web npm test` / `npm run build` PASS(合入前证据见 `go-unit.txt` / `web-degrade.txt`) - **评价判定**:PASS -### 用例 3:用户需求表不再跨流误拦 +### 用例 5:部署核验 -- **测试输入**:main + V0.1「编写用户需求表」 -- **实际输出**:`TestStageAwareRequirements_WriteUserRequirementsV01` → TRIGGER_TASK/user_requirements,无 mismatch +- **实际输出**:`dev-deploy-evidence.txt` — `/health` schema_version=61,`pi-agent`;二进制含 `needs_confirmation` / 「更稳妥的做法是开始整理」;验收后 `auth_sessions` 一次性令牌已 `revoked_at` - **评价判定**:PASS -### 用例 4:前端降级 - -- **测试输入**:源码/单测 `isTaskStageDegradeCode` -- **实际输出**:`useTaskRunAttempts.test.ts` PASS;含「改由对话确认引导」;部署制品 `index-BvTtfGhA.js` 含该文案 -- **评价判定**:PASS - -### 用例 5:合入后制品与健康 - -- **测试输入**:`dev@0c401904` no-cache rebuild;`GET /health` -- **实际输出**:见 `assets/.../dev-deploy-evidence.txt` — health ok,`pi-agent`,schema 61;server 含 `needs_confirmation` / `confirm-trigger-` / 「更稳妥的做法是开始整理」 -- **评价判定**:PASS(未代登用户口令做浏览器点按;链路以制品+单元 E2E 为准) - -### 用例 6:全量回归 - -- **实际输出**:`web npm test` 471+33 PASS,`npm run build` PASS;`go test -short ./internal/intent ./internal/coordinator` PASS。全量 `./...` 中 `notification`/`storage` 既有 PG 唯一约束失败,与本改动无关。 -- **评价判定**:PASS(本改动路径) - ## 六、 自动化测试套件汇总 (Test Suite Execution) ```text go test ./internal/intent ./internal/coordinator -run 'StageAware|ConfirmGate|ProcessIntent_Weak' → PASS -web npm test → 471 + vitest 33 PASS +web npm test → 471 + vitest 33 PASS(合入前) npm run build → PASS -merged_dev_sha=0c401904;health status=ok agent_backend=pi-agent +dev rebuild + 真实 PI 抽样 → PASS(本报告 §五 用例 1–3) ``` ## 七、 测试结论与后续优化建议 (Conclusion & Next Steps) -- 已合入 `dev@0c401904` 并完成正确树重建与制品核验,达到交付标准。 -- 建议人工在商务对接项目点一次「整理一下需求」确认卡片 UX(未代用账号口令)。 +- 批次5–7 已合入 `dev@0c401904`,真实 PI 链路验收通过,可关闭 short-term。 - test/main 不晋升;不改 `production_ready`;项目 143 未改写。 +- 后续可选:选项「2」命中后的 CASUAL_CHAT 话术改为「先在对话中梳理需求要点」定向引导,避免通用欢迎语。 diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/health-after-e2e.json b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/health-after-e2e.json new file mode 100644 index 00000000..4dd40d2c --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/health-after-e2e.json @@ -0,0 +1 @@ +{"status":"ok","env":"dev","agent_backend":"pi-agent","version":"v1.0","shared_kb_port":5432,"kb_ready":true,"database_ready":true,"schema_version":61,"schema_ready":true,"task_store_ready":true} diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-probe2-db.txt b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-probe2-db.txt new file mode 100644 index 00000000..8d92ec51 --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-probe2-db.txt @@ -0,0 +1,20 @@ + id | role | intent | content +------+-----------+--------------+-------------------------------------------------------------------------------------- + 4498 | user | | 整理一下需求 + 4499 | assistant | TRIGGER_TASK | 我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:+ + | | | + + | | | 1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」) + + | | | 2. 先在对话中梳理,暂不启动文档任务 + + | | | + 4500 | user | | 好 + 4501 | assistant | TRIGGER_TASK | 已为您自适应规划并完成生成【用户初始需求收集表】! + + | | | 交付物正文已保存至:/app/data/workspaces/bizdev/intake_1789980049487120828/output.md+ + | | | 耗时: 2m59.272312334s + + | | | + + | | | 📌 预设基准假设(已融入方案,您可随时修正): + + | | | • 硬件与模具研发暂按国内 ISO 13485 标准 CDMO 体系工程规范核算 + + | | | • 临床评价路径暂按免临床评价/同品种对比做基准成本估算 + + | | | • 软件若涉及 AI 或算法质控,暂假定数据不出域、私有化部署 + + | | | +(4 rows) + diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1-fresh.json b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1-fresh.json new file mode 100644 index 00000000..9540a6e0 --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1-fresh.json @@ -0,0 +1 @@ +{"reply_text":"我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:\n\n1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」)\n2. 先在对话中梳理,暂不启动文档任务\n","branch":"NEW_INTENT_PREEMPT","intent_result":{"raw_input":"整理一下需求","top_intent":{"intent":"TRIGGER_TASK","confidence":0.78,"branch":"NEW_INTENT_PREEMPT","filled_slots":{"needs_confirmation":"true","target_task":"intake"},"reasoning":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行"},"candidates":[{"intent":"TRIGGER_TASK","confidence":0.78,"branch":"NEW_INTENT_PREEMPT","filled_slots":{"needs_confirmation":"true","target_task":"intake"},"reasoning":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行"},{"intent":"CASUAL_CHAT","confidence":0.2,"branch":"NEW_INTENT_PREEMPT","filled_slots":{},"reasoning":"未匹配到明确业务指令,归入通用对话"}],"context_snapshot_id":"ctx_1789980038080206806","requires_clarifying":false,"branch":"NEW_INTENT_PREEMPT","shadow_score":0.78,"shadow_margin":0.5800000000000001,"shadow_dialogue_act":"command","shadow_decision_hint":"allowed","intent_frame_v2":{"version":"v2.0","action_key":"task.run","domain":"project","object":"task","goal":"generate","dialogue_act":"command","slots":{"needs_confirmation":{"value":"true","source":"rule"},"target_task":{"value":"intake","source":"rule"}},"relation":"new","evidence":[{"kind":"rule_match","detail":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行","weight":0.78},{"kind":"dialogue_act","detail":"command","weight":0.1}],"score":0.78,"margin":0.5800000000000001,"legacy_intent":"TRIGGER_TASK"},"ranked_frames":{"candidates":[{"version":"v2.0","action_key":"task.run","domain":"project","object":"task","goal":"generate","dialogue_act":"command","slots":{"needs_confirmation":{"value":"true","source":"rule"},"target_task":{"value":"intake","source":"rule"}},"relation":"new","evidence":[{"kind":"rule_match","detail":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行","weight":0.78}],"score":0.78,"margin":0.5800000000000001,"legacy_intent":"TRIGGER_TASK"},{"version":"v2.0","action_key":"conversation.chat","domain":"conversation","object":"system_ui","goal":"converse","dialogue_act":"command","relation":"new","evidence":[{"kind":"rule_match","detail":"未匹配到明确业务指令,归入通用对话","weight":0.2}],"score":0.2,"margin":0.5800000000000001,"legacy_intent":"CASUAL_CHAT"}],"top_margin":0.5800000000000001},"plan_proposal":{"segmenter_version":"segmenter.v2","digest":"56c1513d8ca6d6d7e6cf4757e4e4719197dbe61943528fc75d6229ec3e34ecb4","combo_hint":"single","segments":[{"step_id":"1","text":"整理一下需求","normalized":"整理一下需求","span":{"start":0,"end":18},"evidence":"single","structure_confidence":"high","frame":{"version":"v2.0","action_key":"task.run","domain":"project","object":"task","goal":"generate","dialogue_act":"command","slots":{"needs_confirmation":{"value":"true","source":"rule"},"target_task":{"value":"intake","source":"rule"}},"relation":"new","evidence":[{"kind":"rule_match","detail":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行","weight":0.78},{"kind":"dialogue_act","detail":"command","weight":0.1}],"score":0.78,"margin":0.5800000000000001,"legacy_intent":"TRIGGER_TASK"}}],"evidence":[{"kind":"segmenter","detail":"segmenter.v2","weight":1},{"kind":"split","detail":"single","weight":0.5}]},"plan_shadow":{"enabled":true,"segmenter_version":"segmenter.v2","segment_count":1,"digest":"56c1513d8ca6d6d7e6cf4757e4e4719197dbe61943528fc75d6229ec3e34ecb4","combo_hint":"single","legacy_plan_attached":false,"legacy_dropped_write":true,"counterfactual_auto_read":"would_confirm"}},"coordination_result":{"status":"CLARIFICATION_REQUIRED","intent":"TRIGGER_TASK","branch":"NEW_INTENT_PREEMPT","clarification_prompt":"我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:\n\n1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」)\n2. 先在对话中梳理,暂不启动文档任务\n","natural_reply":"我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:\n\n1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」)\n2. 先在对话中梳理,暂不启动文档任务\n","updated_context":{"version":6,"snapshot_id":"ctx_1789980038080206806","assembled_at":"2026-09-21T08:40:38.080208866Z","user":{"id":"u_sess-confirm-probe-2","name":"用户","role":"engineer","project_role":"composer"},"project":{"id":"","name":"新的测试项目","customer_name":"水木东方客户","device_type":"","intended_use":"","target_market":"","active_workflow_key":"main","current_workflow":"intake","current_stage":"V0.1_triage"},"user_docs":{"composed":null,"reviewed":null,"approved":null,"claimed":null},"pending":{},"blackboard_facts":{},"pending_expectation":{"expectation_id":"confirm-trigger-1789980038091481551","expected_intent":"TRIGGER_TASK","target_action":"confirm_trigger_task","prompt":"是否开始编写《用户初始需求收集表》?","affirmative_word":"好","decline_word":"先不","expires_at":"2026-09-21T09:10:38.091482101Z","context_snippet":"候选任务:用户初始需求收集表(intake)","default_option":{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},"options":[{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}],"allow_affirmative":true,"created_at":"2026-09-21T08:40:38.091482871Z"},"available_actions":["QUERY_PROGRESS","SUPPLEMENT_INFO","VIEW_DOC","TRIGGER_TASK:intake","ADVANCE_STAGE:V0.5_feasibility"],"task_state":{"active_task":"TRIGGER_TASK","topic_anchor":"整理一下需求","collected_slots":{"needs_confirmation":"true","target_task":"intake"},"missing_slots":["device_type","target_market","budget"],"updated_at":"2026-09-21T08:40:38.091456282Z"}},"next_expectation":{"expectation_id":"confirm-trigger-1789980038091481551","expected_intent":"TRIGGER_TASK","target_action":"confirm_trigger_task","prompt":"是否开始编写《用户初始需求收集表》?","affirmative_word":"好","decline_word":"先不","expires_at":"2026-09-21T09:10:38.091482101Z","context_snippet":"候选任务:用户初始需求收集表(intake)","default_option":{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},"options":[{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}],"allow_affirmative":true,"created_at":"2026-09-21T08:40:38.091482871Z"}},"pending_expectation":{"expectation_id":"confirm-trigger-1789980038091481551","expected_intent":"TRIGGER_TASK","target_action":"confirm_trigger_task","prompt":"是否开始编写《用户初始需求收集表》?","affirmative_word":"好","decline_word":"先不","expires_at":"2026-09-21T09:10:38.091482101Z","context_snippet":"候选任务:用户初始需求收集表(intake)","default_option":{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},"options":[{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}],"allow_affirmative":true,"created_at":"2026-09-21T08:40:38.091482871Z"}} diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1-summary.txt b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1-summary.txt new file mode 100644 index 00000000..c75f785d --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1-summary.txt @@ -0,0 +1,13 @@ +intent: TRIGGER_TASK +confidence: 0.78 +slots: {'needs_confirmation': 'true', 'target_task': 'intake'} +branch: NEW_INTENT_PREEMPT +reply_text: +我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认: + +1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」) +2. 先在对话中梳理,暂不启动文档任务 + +status: None +next_expectation present: True +options: [('1', '开始整理并编写《用户初始需求收集表》'), ('2', '先在对话中梳理,暂不启动文档任务')] diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1.json b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1.json new file mode 100644 index 00000000..817a51a2 --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round1.json @@ -0,0 +1 @@ +{"reply_text":"我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:\n\n1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」)\n2. 先在对话中梳理,暂不启动文档任务\n","branch":"NEW_INTENT_PREEMPT","intent_result":{"raw_input":"整理一下需求","top_intent":{"intent":"TRIGGER_TASK","confidence":0.78,"branch":"NEW_INTENT_PREEMPT","filled_slots":{"needs_confirmation":"true","target_task":"intake"},"reasoning":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行"},"candidates":[{"intent":"TRIGGER_TASK","confidence":0.78,"branch":"NEW_INTENT_PREEMPT","filled_slots":{"needs_confirmation":"true","target_task":"intake"},"reasoning":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行"},{"intent":"CASUAL_CHAT","confidence":0.2,"branch":"NEW_INTENT_PREEMPT","filled_slots":{},"reasoning":"未匹配到明确业务指令,归入通用对话"}],"context_snapshot_id":"ctx_1789979691528167169","requires_clarifying":false,"branch":"NEW_INTENT_PREEMPT","shadow_score":0.78,"shadow_margin":0.5800000000000001,"shadow_dialogue_act":"command","shadow_decision_hint":"allowed","intent_frame_v2":{"version":"v2.0","action_key":"task.run","domain":"project","object":"task","goal":"generate","dialogue_act":"command","slots":{"needs_confirmation":{"value":"true","source":"rule"},"target_task":{"value":"intake","source":"rule"}},"relation":"new","evidence":[{"kind":"rule_match","detail":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行","weight":0.78},{"kind":"dialogue_act","detail":"command","weight":0.1}],"score":0.78,"margin":0.5800000000000001,"legacy_intent":"TRIGGER_TASK"},"ranked_frames":{"candidates":[{"version":"v2.0","action_key":"task.run","domain":"project","object":"task","goal":"generate","dialogue_act":"command","slots":{"needs_confirmation":{"value":"true","source":"rule"},"target_task":{"value":"intake","source":"rule"}},"relation":"new","evidence":[{"kind":"rule_match","detail":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行","weight":0.78}],"score":0.78,"margin":0.5800000000000001,"legacy_intent":"TRIGGER_TASK"},{"version":"v2.0","action_key":"conversation.chat","domain":"conversation","object":"system_ui","goal":"converse","dialogue_act":"command","relation":"new","evidence":[{"kind":"rule_match","detail":"未匹配到明确业务指令,归入通用对话","weight":0.2}],"score":0.2,"margin":0.5800000000000001,"legacy_intent":"CASUAL_CHAT"}],"top_margin":0.5800000000000001},"plan_proposal":{"segmenter_version":"segmenter.v2","digest":"56c1513d8ca6d6d7e6cf4757e4e4719197dbe61943528fc75d6229ec3e34ecb4","combo_hint":"single","segments":[{"step_id":"1","text":"整理一下需求","normalized":"整理一下需求","span":{"start":0,"end":18},"evidence":"single","structure_confidence":"high","frame":{"version":"v2.0","action_key":"task.run","domain":"project","object":"task","goal":"generate","dialogue_act":"command","slots":{"needs_confirmation":{"value":"true","source":"rule"},"target_task":{"value":"intake","source":"rule"}},"relation":"new","evidence":[{"kind":"rule_match","detail":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行","weight":0.78},{"kind":"dialogue_act","detail":"command","weight":0.1}],"score":0.78,"margin":0.5800000000000001,"legacy_intent":"TRIGGER_TASK"}}],"evidence":[{"kind":"segmenter","detail":"segmenter.v2","weight":1},{"kind":"split","detail":"single","weight":0.5}]},"plan_shadow":{"enabled":true,"segmenter_version":"segmenter.v2","segment_count":1,"digest":"56c1513d8ca6d6d7e6cf4757e4e4719197dbe61943528fc75d6229ec3e34ecb4","combo_hint":"single","legacy_plan_attached":false,"legacy_dropped_write":true,"counterfactual_auto_read":"would_confirm"}},"coordination_result":{"status":"CLARIFICATION_REQUIRED","intent":"TRIGGER_TASK","branch":"NEW_INTENT_PREEMPT","clarification_prompt":"我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:\n\n1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」)\n2. 先在对话中梳理,暂不启动文档任务\n","natural_reply":"我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:\n\n1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」)\n2. 先在对话中梳理,暂不启动文档任务\n","updated_context":{"version":12,"snapshot_id":"ctx_1789979691528167169","assembled_at":"2026-09-21T08:34:51.528170428Z","user":{"id":"u_sess-p6579-u398","name":"用户","role":"engineer","project_role":"composer"},"project":{"id":"","name":"新的测试项目","customer_name":"水木东方客户","device_type":"","intended_use":"","target_market":"","active_workflow_key":"main","current_workflow":"intake","current_stage":"V0.1_triage"},"user_docs":{"composed":null,"reviewed":null,"approved":null,"claimed":null},"pending":{},"blackboard_facts":{},"pending_expectation":{"expectation_id":"confirm-trigger-1789979697041456933","expected_intent":"TRIGGER_TASK","target_action":"confirm_trigger_task","prompt":"是否开始编写《用户初始需求收集表》?","affirmative_word":"好","decline_word":"先不","expires_at":"2026-09-21T09:04:57.041457533Z","context_snippet":"候选任务:用户初始需求收集表(intake)","default_option":{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},"options":[{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}],"allow_affirmative":true,"created_at":"2026-09-21T08:34:57.041458053Z"},"available_actions":["QUERY_PROGRESS","SUPPLEMENT_INFO","VIEW_DOC","TRIGGER_TASK:intake","ADVANCE_STAGE:V0.5_feasibility"],"task_state":{"active_task":"TRIGGER_TASK","topic_anchor":"整理一下需求","collected_slots":{"needs_confirmation":"true","target_task":"intake"},"missing_slots":["device_type","target_market","budget"],"updated_at":"2026-09-21T08:34:57.041430264Z"}},"next_expectation":{"expectation_id":"confirm-trigger-1789979697041456933","expected_intent":"TRIGGER_TASK","target_action":"confirm_trigger_task","prompt":"是否开始编写《用户初始需求收集表》?","affirmative_word":"好","decline_word":"先不","expires_at":"2026-09-21T09:04:57.041457533Z","context_snippet":"候选任务:用户初始需求收集表(intake)","default_option":{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},"options":[{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}],"allow_affirmative":true,"created_at":"2026-09-21T08:34:57.041458053Z"}},"pending_expectation":{"expectation_id":"confirm-trigger-1789979697041456933","expected_intent":"TRIGGER_TASK","target_action":"confirm_trigger_task","prompt":"是否开始编写《用户初始需求收集表》?","affirmative_word":"好","decline_word":"先不","expires_at":"2026-09-21T09:04:57.041457533Z","context_snippet":"候选任务:用户初始需求收集表(intake)","default_option":{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},"options":[{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}],"allow_affirmative":true,"created_at":"2026-09-21T08:34:57.041458053Z"}} diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round2-summary.txt b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round2-summary.txt new file mode 100644 index 00000000..2994c7dc --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-round2-summary.txt @@ -0,0 +1,21 @@ +message_count 4 +--- 4498 user None +整理一下需求 +--- 4499 assistant TRIGGER_TASK +我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认: + +1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」) +2. 先在对话中梳理,暂不启动文档任务 + +--- 4500 user None +好 +--- 4501 assistant TRIGGER_TASK +已为您自适应规划并完成生成【用户初始需求收集表】! +交付物正文已保存至:/app/data/workspaces/bizdev/intake_1789980049487120828/output.md +耗时: 2m59.272312334s + +📌 预设基准假设(已融入方案,您可随时修正): + • 硬件与模具研发暂按国内 ISO 13485 标准 CDMO 体系工程规范核算 + • 临床评价路径暂按免临床评价/同品种对比做基准成本估算 + • 软件若涉及 AI 或算法质控,暂假定数据不出域、私有化部署 + diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-window-probe2.json b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-window-probe2.json new file mode 100644 index 00000000..a9944f50 --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-chat-window-probe2.json @@ -0,0 +1 @@ +{"session_id":"sess-confirm-probe-2","days":[{"day_key":"2026-09-21","count":4,"loaded_count":4,"truncated":false,"first_message_id":4498,"last_message_id":4501,"messages":[{"id":4498,"session_id":"sess-confirm-probe-2","user_id":398,"role":"user","content":"整理一下需求","metadata":{"project_id":6579,"scope_kind":"workflow_stage","stage_instance_id":557,"stage_key":"V0.1_triage","workflow_instance_id":366},"day_key":"2026-09-21","category":"uncategorized","content_kind":"conversational_text","export_policy":"none","content_revision":1,"content_sha256":"0c65173fd920f361b335478604a16f741f1cc71f792016acad2ab2feaba0dd7b","workflow_instance_id":366,"stage_instance_id":557,"stage_key":"V0.1_triage","scope_kind":"workflow_stage","export_capability":{"policy":"none","formats":[],"body_selector":"content_only","reason_code":"NOT_ASSISTANT","content_revision":1,"content_sha256":"0c65173fd920f361b335478604a16f741f1cc71f792016acad2ab2feaba0dd7b"},"created_at":"2026-09-21T08:40:38.085019Z"},{"id":4499,"session_id":"sess-confirm-probe-2","user_id":0,"role":"assistant","content":"我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:\n\n1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」)\n2. 先在对话中梳理,暂不启动文档任务\n","intent":"TRIGGER_TASK","branch":"NEW_INTENT_PREEMPT","metadata":{"content_kind":"document_text","content_revision":1,"content_sha256":"63f585b18fe40fe306fb6a15b3592f804144fdb0011034f19cb0e667f1d62c23","export_policy":"full","milestone":true,"project_id":6579,"reply_source":"template","scope_kind":"workflow_stage","stage_instance_id":557,"stage_key":"V0.1_triage","turn_intent":"TRIGGER_TASK","workflow_instance_id":366},"day_key":"2026-09-21","category":"milestone","content_kind":"document_text","export_policy":"full","content_revision":1,"content_sha256":"63f585b18fe40fe306fb6a15b3592f804144fdb0011034f19cb0e667f1d62c23","workflow_instance_id":366,"stage_instance_id":557,"stage_key":"V0.1_triage","scope_kind":"workflow_stage","export_capability":{"policy":"full","formats":["rich_clipboard","markdown","docx","pdf","private_document"],"body_selector":"content_only","content_revision":1,"content_sha256":"63f585b18fe40fe306fb6a15b3592f804144fdb0011034f19cb0e667f1d62c23"},"created_at":"2026-09-21T08:40:38.091499Z"},{"id":4500,"session_id":"sess-confirm-probe-2","user_id":398,"role":"user","content":"好","metadata":{"project_id":6579,"scope_kind":"workflow_stage","stage_instance_id":557,"stage_key":"V0.1_triage","workflow_instance_id":366},"day_key":"2026-09-21","category":"uncategorized","content_kind":"conversational_text","export_policy":"none","content_revision":1,"content_sha256":"f867f34178594f891eb70a4260f62b1d9289cfa60394f9fee1cbbe4a8b4bf436","workflow_instance_id":366,"stage_instance_id":557,"stage_key":"V0.1_triage","scope_kind":"workflow_stage","export_capability":{"policy":"none","formats":[],"body_selector":"content_only","reason_code":"NOT_ASSISTANT","content_revision":1,"content_sha256":"f867f34178594f891eb70a4260f62b1d9289cfa60394f9fee1cbbe4a8b4bf436"},"created_at":"2026-09-21T08:40:49.48389Z"},{"id":4501,"session_id":"sess-confirm-probe-2","user_id":0,"role":"assistant","content":"已为您自适应规划并完成生成【用户初始需求收集表】!\n交付物正文已保存至:/app/data/workspaces/bizdev/intake_1789980049487120828/output.md\n耗时: 2m59.272312334s\n\n📌 预设基准假设(已融入方案,您可随时修正):\n • 硬件与模具研发暂按国内 ISO 13485 标准 CDMO 体系工程规范核算\n • 临床评价路径暂按免临床评价/同品种对比做基准成本估算\n • 软件若涉及 AI 或算法质控,暂假定数据不出域、私有化部署\n","intent":"TRIGGER_TASK","branch":"EXPECTATION_HIT","metadata":{"content_kind":"document_text","content_revision":1,"content_sha256":"9b66b6f349592bbbfb5fc51e42f89f61ea3dc3a991c9a0ab9bad971872cff79f","export_policy":"full","milestone":true,"project_id":6579,"reply_source":"template","scope_kind":"workflow_stage","stage_instance_id":557,"stage_key":"V0.1_triage","task_key":"intake","task_status":"completed","turn_intent":"TRIGGER_TASK","workflow_instance_id":366},"day_key":"2026-09-21","category":"milestone","content_kind":"document_text","export_policy":"full","content_revision":1,"content_sha256":"9b66b6f349592bbbfb5fc51e42f89f61ea3dc3a991c9a0ab9bad971872cff79f","workflow_instance_id":366,"stage_instance_id":557,"stage_key":"V0.1_triage","scope_kind":"workflow_stage","export_capability":{"policy":"full","formats":["rich_clipboard","markdown","docx","pdf","private_document"],"body_selector":"content_only","content_revision":1,"content_sha256":"9b66b6f349592bbbfb5fc51e42f89f61ea3dc3a991c9a0ab9bad971872cff79f"},"created_at":"2026-09-21T08:43:49.638256Z"}]}],"has_more_before":false,"oldest_loaded_day":"2026-09-21"} diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-r1.json b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-r1.json new file mode 100644 index 00000000..4cf3ff0d --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-r1.json @@ -0,0 +1 @@ +{"reply_text":"我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:\n\n1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」)\n2. 先在对话中梳理,暂不启动文档任务\n","branch":"NEW_INTENT_PREEMPT","intent_result":{"raw_input":"整理一下需求","top_intent":{"intent":"TRIGGER_TASK","confidence":0.78,"branch":"NEW_INTENT_PREEMPT","filled_slots":{"needs_confirmation":"true","target_task":"intake"},"reasoning":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行"},"candidates":[{"intent":"TRIGGER_TASK","confidence":0.78,"branch":"NEW_INTENT_PREEMPT","filled_slots":{"needs_confirmation":"true","target_task":"intake"},"reasoning":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行"},{"intent":"CASUAL_CHAT","confidence":0.2,"branch":"NEW_INTENT_PREEMPT","filled_slots":{},"reasoning":"未匹配到明确业务指令,归入通用对话"}],"context_snapshot_id":"ctx_1789980264908223034","requires_clarifying":false,"branch":"NEW_INTENT_PREEMPT","shadow_score":0.78,"shadow_margin":0.5800000000000001,"shadow_dialogue_act":"command","shadow_decision_hint":"allowed","intent_frame_v2":{"version":"v2.0","action_key":"task.run","domain":"project","object":"task","goal":"generate","dialogue_act":"command","slots":{"needs_confirmation":{"value":"true","source":"rule"},"target_task":{"value":"intake","source":"rule"}},"relation":"new","evidence":[{"kind":"rule_match","detail":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行","weight":0.78},{"kind":"dialogue_act","detail":"command","weight":0.1}],"score":0.78,"margin":0.5800000000000001,"legacy_intent":"TRIGGER_TASK"},"ranked_frames":{"candidates":[{"version":"v2.0","action_key":"task.run","domain":"project","object":"task","goal":"generate","dialogue_act":"command","slots":{"needs_confirmation":{"value":"true","source":"rule"},"target_task":{"value":"intake","source":"rule"}},"relation":"new","evidence":[{"kind":"rule_match","detail":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行","weight":0.78}],"score":0.78,"margin":0.5800000000000001,"legacy_intent":"TRIGGER_TASK"},{"version":"v2.0","action_key":"conversation.chat","domain":"conversation","object":"system_ui","goal":"converse","dialogue_act":"command","relation":"new","evidence":[{"kind":"rule_match","detail":"未匹配到明确业务指令,归入通用对话","weight":0.2}],"score":0.2,"margin":0.5800000000000001,"legacy_intent":"CASUAL_CHAT"}],"top_margin":0.5800000000000001},"plan_proposal":{"segmenter_version":"segmenter.v2","digest":"56c1513d8ca6d6d7e6cf4757e4e4719197dbe61943528fc75d6229ec3e34ecb4","combo_hint":"single","segments":[{"step_id":"1","text":"整理一下需求","normalized":"整理一下需求","span":{"start":0,"end":18},"evidence":"single","structure_confidence":"high","frame":{"version":"v2.0","action_key":"task.run","domain":"project","object":"task","goal":"generate","dialogue_act":"command","slots":{"needs_confirmation":{"value":"true","source":"rule"},"target_task":{"value":"intake","source":"rule"}},"relation":"new","evidence":[{"kind":"rule_match","detail":"弱写动词触发需求整理,阶段感知消解为 intake,需用户确认后执行","weight":0.78},{"kind":"dialogue_act","detail":"command","weight":0.1}],"score":0.78,"margin":0.5800000000000001,"legacy_intent":"TRIGGER_TASK"}}],"evidence":[{"kind":"segmenter","detail":"segmenter.v2","weight":1},{"kind":"split","detail":"single","weight":0.5}]},"plan_shadow":{"enabled":true,"segmenter_version":"segmenter.v2","segment_count":1,"digest":"56c1513d8ca6d6d7e6cf4757e4e4719197dbe61943528fc75d6229ec3e34ecb4","combo_hint":"single","legacy_plan_attached":false,"legacy_dropped_write":true,"counterfactual_auto_read":"would_confirm"}},"coordination_result":{"status":"CLARIFICATION_REQUIRED","intent":"TRIGGER_TASK","branch":"NEW_INTENT_PREEMPT","clarification_prompt":"我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:\n\n1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」)\n2. 先在对话中梳理,暂不启动文档任务\n","natural_reply":"我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认:\n\n1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」)\n2. 先在对话中梳理,暂不启动文档任务\n","updated_context":{"version":6,"snapshot_id":"ctx_1789980264908223034","assembled_at":"2026-09-21T08:44:24.908226204Z","user":{"id":"u_sess-confirm-opt2","name":"用户","role":"engineer","project_role":"composer"},"project":{"id":"","name":"新的测试项目","customer_name":"水木东方客户","device_type":"","intended_use":"","target_market":"","active_workflow_key":"main","current_workflow":"intake","current_stage":"V0.1_triage"},"user_docs":{"composed":null,"reviewed":null,"approved":null,"claimed":null},"pending":{},"blackboard_facts":{},"pending_expectation":{"expectation_id":"confirm-trigger-1789980264917027472","expected_intent":"TRIGGER_TASK","target_action":"confirm_trigger_task","prompt":"是否开始编写《用户初始需求收集表》?","affirmative_word":"好","decline_word":"先不","expires_at":"2026-09-21T09:14:24.917027992Z","context_snippet":"候选任务:用户初始需求收集表(intake)","default_option":{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},"options":[{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}],"allow_affirmative":true,"created_at":"2026-09-21T08:44:24.917028562Z"},"available_actions":["QUERY_PROGRESS","SUPPLEMENT_INFO","VIEW_DOC","TRIGGER_TASK:intake","ADVANCE_STAGE:V0.5_feasibility"],"task_state":{"active_task":"TRIGGER_TASK","topic_anchor":"整理一下需求","collected_slots":{"needs_confirmation":"true","target_task":"intake"},"missing_slots":["device_type","target_market","budget"],"updated_at":"2026-09-21T08:44:24.917006163Z"}},"next_expectation":{"expectation_id":"confirm-trigger-1789980264917027472","expected_intent":"TRIGGER_TASK","target_action":"confirm_trigger_task","prompt":"是否开始编写《用户初始需求收集表》?","affirmative_word":"好","decline_word":"先不","expires_at":"2026-09-21T09:14:24.917027992Z","context_snippet":"候选任务:用户初始需求收集表(intake)","default_option":{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},"options":[{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}],"allow_affirmative":true,"created_at":"2026-09-21T08:44:24.917028562Z"}},"pending_expectation":{"expectation_id":"confirm-trigger-1789980264917027472","expected_intent":"TRIGGER_TASK","target_action":"confirm_trigger_task","prompt":"是否开始编写《用户初始需求收集表》?","affirmative_word":"好","decline_word":"先不","expires_at":"2026-09-21T09:14:24.917027992Z","context_snippet":"候选任务:用户初始需求收集表(intake)","default_option":{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},"options":[{"option_id":"1","title":"开始整理并编写《用户初始需求收集表》","description":"确认后启动正式文档任务,写入受控交付物","intent":"TRIGGER_TASK","slots":{"target_task":"intake"}},{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}],"allow_affirmative":true,"created_at":"2026-09-21T08:44:24.917028562Z"}} diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-r2.json b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-r2.json new file mode 100644 index 00000000..4b69a819 --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-r2.json @@ -0,0 +1 @@ +{"reply_text":"您好,用户!我是您的项目助手,很高兴协助您推进医疗器械立项与研发协同。\n\n针对「新的测试项目」,我可以帮您:\n• 查询进展、成熟度与风险;\n• 沉淀客户需求与技术指标;\n• 起草沟通话术与方案要点;\n• 推进方案论证与报价核算。\n\n如果您愿意,我们可以先从您当前最关心的一块开始——您想先看进展、补事实,还是直接聊方案?","branch":"EXPECTATION_HIT","intent_result":{"raw_input":"2","top_intent":{"intent":"CASUAL_CHAT","confidence":0.98,"branch":"EXPECTATION_HIT","filled_slots":{"target_action":"confirm_trigger_task"},"reasoning":"用户按序号选择了备选动作 [2: 先在对话中梳理,暂不启动文档任务]","matched_option":{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}},"candidates":[{"intent":"CASUAL_CHAT","confidence":0.98,"branch":"EXPECTATION_HIT","filled_slots":{"target_action":"confirm_trigger_task"},"reasoning":"用户按序号选择了备选动作 [2: 先在对话中梳理,暂不启动文档任务]","matched_option":{"option_id":"2","title":"先在对话中梳理,暂不启动文档任务","description":"继续对话细化需求要点,稍后再决定是否生成正式文档","intent":"CASUAL_CHAT"}}],"context_snapshot_id":"ctx_1789980264908223034","requires_clarifying":false,"branch":"EXPECTATION_HIT","shadow_score":0.98,"shadow_dialogue_act":"command","shadow_decision_hint":"allowed","intent_frame_v2":{"version":"v2.0","action_key":"conversation.chat","domain":"conversation","object":"system_ui","goal":"converse","dialogue_act":"command","slots":{"target_action":{"value":"confirm_trigger_task","source":"rule"}},"relation":"expectation_hit","evidence":[{"kind":"rule_match","detail":"用户按序号选择了备选动作 [2: 先在对话中梳理,暂不启动文档任务]","weight":0.98},{"kind":"dialogue_act","detail":"command","weight":0.1}],"score":0.98,"legacy_intent":"CASUAL_CHAT"},"ranked_frames":{"candidates":[{"version":"v2.0","action_key":"conversation.chat","domain":"conversation","object":"system_ui","goal":"converse","dialogue_act":"command","slots":{"target_action":{"value":"confirm_trigger_task","source":"rule"}},"relation":"expectation_hit","evidence":[{"kind":"rule_match","detail":"用户按序号选择了备选动作 [2: 先在对话中梳理,暂不启动文档任务]","weight":0.98}],"score":0.98,"legacy_intent":"CASUAL_CHAT"}],"top_margin":0},"plan_proposal":{"segmenter_version":"segmenter.v2","digest":"1c8b5ef9536dcf536e936d10aa908fa91c3993e36eed5cbd79cd3faa5ce2c627","combo_hint":"single","segments":[{"step_id":"1","text":"2","normalized":"2","span":{"start":0,"end":1},"evidence":"single","structure_confidence":"high","frame":{"version":"v2.0","action_key":"conversation.chat","domain":"conversation","object":"system_ui","goal":"converse","dialogue_act":"command","slots":{"target_action":{"value":"confirm_trigger_task","source":"rule"}},"relation":"expectation_hit","evidence":[{"kind":"rule_match","detail":"用户按序号选择了备选动作 [2: 先在对话中梳理,暂不启动文档任务]","weight":0.98},{"kind":"dialogue_act","detail":"command","weight":0.1}],"score":0.98,"legacy_intent":"CASUAL_CHAT"}}],"evidence":[{"kind":"segmenter","detail":"segmenter.v2","weight":1},{"kind":"split","detail":"single","weight":0.5}]},"plan_shadow":{"enabled":true,"segmenter_version":"segmenter.v2","segment_count":1,"digest":"1c8b5ef9536dcf536e936d10aa908fa91c3993e36eed5cbd79cd3faa5ce2c627","combo_hint":"single","legacy_plan_attached":false,"counterfactual_auto_read":"would_passthrough"}},"coordination_result":{"status":"ACCEPTED","intent":"CASUAL_CHAT","branch":"NEW_INTENT_PREEMPT","natural_reply":"您好,用户!我是您的项目助手,很高兴协助您推进医疗器械立项与研发协同。\n\n针对「新的测试项目」,我可以帮您:\n• 查询进展、成熟度与风险;\n• 沉淀客户需求与技术指标;\n• 起草沟通话术与方案要点;\n• 推进方案论证与报价核算。\n\n如果您愿意,我们可以先从您当前最关心的一块开始——您想先看进展、补事实,还是直接聊方案?","updated_context":{"version":11,"snapshot_id":"ctx_1789980264908223034","assembled_at":"2026-09-21T08:44:24.908226204Z","user":{"id":"u_sess-confirm-opt2","name":"用户","role":"engineer","project_role":"composer"},"project":{"id":"","name":"新的测试项目","customer_name":"水木东方客户","device_type":"","intended_use":"","target_market":"","active_workflow_key":"main","current_workflow":"intake","current_stage":"V0.1_triage"},"user_docs":{"composed":null,"reviewed":null,"approved":null,"claimed":null},"pending":{},"blackboard_facts":{},"pending_expectation":{"expires_at":"0001-01-01T00:00:00Z","context_snippet":"项目「新的测试项目」当前处于初始摸底期,基准产品画像已梳理完成。","default_option":{"option_id":"1","title":"进入 V0.5 方案成型与法规对齐","description":"自动比选技术路线,并梳理分类路径与型检标准","intent":"ADVANCE_STAGE","slots":{"target_stage":"V0.5_feasibility"}},"options":[{"option_id":"1","title":"进入 V0.5 方案成型与法规对齐","description":"自动比选技术路线,并梳理分类路径与型检标准","intent":"ADVANCE_STAGE","slots":{"target_stage":"V0.5_feasibility"}},{"option_id":"2","title":"补充或微调事实信息","description":"随时告知我客户的最新的预算、目标市场或使用场景","intent":"SUPPLEMENT_INFO"},{"option_id":"3","title":"查阅当前立项成熟度与对外沟通建议","description":"获取进展研判与对外商务沟通话术","intent":"QUERY_PROGRESS","slots":{"query_topic":"all"}}],"allow_affirmative":true,"created_at":"2026-09-21T08:44:24.928694496Z"},"available_actions":["QUERY_PROGRESS","SUPPLEMENT_INFO","VIEW_DOC","TRIGGER_TASK:intake","ADVANCE_STAGE:V0.5_feasibility"],"task_state":{"active_task":"TRIGGER_TASK","topic_anchor":"整理一下需求(关于2)","collected_slots":{"needs_confirmation":"true","target_action":"confirm_trigger_task","target_task":"intake"},"missing_slots":["device_type","target_market","budget"],"updated_at":"2026-09-21T08:44:24.928676207Z"}},"next_expectation":{"expires_at":"0001-01-01T00:00:00Z","context_snippet":"项目「新的测试项目」当前处于初始摸底期,基准产品画像已梳理完成。","default_option":{"option_id":"1","title":"进入 V0.5 方案成型与法规对齐","description":"自动比选技术路线,并梳理分类路径与型检标准","intent":"ADVANCE_STAGE","slots":{"target_stage":"V0.5_feasibility"}},"options":[{"option_id":"1","title":"进入 V0.5 方案成型与法规对齐","description":"自动比选技术路线,并梳理分类路径与型检标准","intent":"ADVANCE_STAGE","slots":{"target_stage":"V0.5_feasibility"}},{"option_id":"2","title":"补充或微调事实信息","description":"随时告知我客户的最新的预算、目标市场或使用场景","intent":"SUPPLEMENT_INFO"},{"option_id":"3","title":"查阅当前立项成熟度与对外沟通建议","description":"获取进展研判与对外商务沟通话术","intent":"QUERY_PROGRESS","slots":{"query_topic":"all"}}],"allow_affirmative":true,"created_at":"2026-09-21T08:44:24.928694496Z"},"reply_source":"template"},"pending_expectation":{"expires_at":"0001-01-01T00:00:00Z","context_snippet":"项目「新的测试项目」当前处于初始摸底期,基准产品画像已梳理完成。","default_option":{"option_id":"1","title":"进入 V0.5 方案成型与法规对齐","description":"自动比选技术路线,并梳理分类路径与型检标准","intent":"ADVANCE_STAGE","slots":{"target_stage":"V0.5_feasibility"}},"options":[{"option_id":"1","title":"进入 V0.5 方案成型与法规对齐","description":"自动比选技术路线,并梳理分类路径与型检标准","intent":"ADVANCE_STAGE","slots":{"target_stage":"V0.5_feasibility"}},{"option_id":"2","title":"补充或微调事实信息","description":"随时告知我客户的最新的预算、目标市场或使用场景","intent":"SUPPLEMENT_INFO"},{"option_id":"3","title":"查阅当前立项成熟度与对外沟通建议","description":"获取进展研判与对外商务沟通话术","intent":"QUERY_PROGRESS","slots":{"query_topic":"all"}}],"allow_affirmative":true,"created_at":"2026-09-21T08:44:24.928694496Z"}} diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-summary.txt b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-summary.txt new file mode 100644 index 00000000..4b3a7374 --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-opt2-summary.txt @@ -0,0 +1,6 @@ +live-opt2-r1.json intent TRIGGER_TASK conf 0.78 branch NEW_INTENT_PREEMPT + slots {'needs_confirmation': 'true', 'target_task': 'intake'} + reply 我理解您希望先整理需求。更稳妥的做法是开始整理并编写《用户初始需求收集表》。请确认: / / 1. 开始整理并编写《用户初始需求收集表》(推荐,回复「好」或「1」) / 2. 先在对话中梳理,暂不启动文档任务 / +live-opt2-r2.json intent CASUAL_CHAT conf 0.98 branch EXPECTATION_HIT + slots {'target_action': 'confirm_trigger_task'} + reply 您好,用户!我是您的项目助手,很高兴协助您推进医疗器械立项与研发协同。 / / 针对「新的测试项目」,我可以帮您: / • 查询进展、成熟度与风险; / • 沉淀客户需求与技术指标; / • 起草沟通话术与方案要点; / • 推进方案论证与报价核算。 / / 如果您愿意,我们可以先从您当前最关心的一块开始——您想先看进展、补事实,还是直接聊方案? diff --git a/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-strong-db.txt b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-strong-db.txt new file mode 100644 index 00000000..b0f0fe83 --- /dev/null +++ b/.doc/test-reports/assets/2026-09-21-intent-confirm-stage-aware/live-strong-db.txt @@ -0,0 +1 @@ +4506|user||生成需求表