Files
Agent-System/.doc/test-reports/2026-09-25-doc-review-lifecycle-test-report.md
weichen b5a782bb38 feat(chat): dialogue triggers for comments/reopen/pending-supplements with mistouch guards
Wire intent→coordinator DocResolver confirm cards→action_executor kinds for comment, reopen, pending-supplements query, and real submit-review execution.
2026-09-25 20:14:10 +00:00

93 lines
3.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 受控文档三权流转控制完善 测试报告
## 一、测试背景 (Background)
补齐受控文档审核/批准/归档/重开链路与锁定期补充积压闭环(G1–G4),对应设计见 `.doc/system-design/2026-09-25-doc-review-lifecycle-design.md`。
## 二、测试目标 (Test Objectives)
1. 锁定态补充 → `skipped_locked` + 积压落账,不生成提案。
2. 流转通知收件人按职责槽位路由。
3. 批注阶段化权限矩阵(负例:viewer / approving 期 author)。
4. 重开审批:Approver 优先,缺位回退创建人(代码路径;HTTP 集成待环境)。
5. 前端批注策略与 API 形状。
## 三、测试方案与环境 (Test Plan & Environment)
- OS: Linux;Go 短测;前端 `tsx --test`。
- 层级:工程单元 / 包级短测(验证契约「工程工具验收补充」)。
- **真实 PI E2E**:本回合未获授权共享环境与产品 Runner 槽位,记为 **未运行**(不得冒充 PASS)。
## 四、预期结果 (Expected Results)
见各用例断言。
## 五、实际测试结果与判定 (Actual Results & Evaluation)
### 5.1 Go:`internal/docgov` / `supplementimpact` / `app/docnotify`
- **测试输入**:`go test ./internal/docgov/... ./internal/supplementimpact/... ./internal/app/docnotify/... -count=1`
- **实际输出**:
```text
ok chat-agent-system/internal/docgov 0.003s
ok chat-agent-system/internal/supplementimpact 0.002s
ok chat-agent-system/internal/app/docnotify 0.002s
```
- **评价判定**:PASS(含 `TestDecideLockedSkipsAndRecordsPending`、`TestAddCommentStageMatrix`、`TestRecipientForDocEvent`、`TestHandleReviewRequestedRoutesToReviewer`)
- **性能与耗时**:约 1–2s 量级冷启动后单包毫秒级
### 5.2 Go:`internal/server` short
- **测试输入**:`go test ./internal/server/ -count=1 -short`
- **实际输出**:`ok chat-agent-system/internal/server`(约 19s)
- **评价判定**:PASS
### 5.3 前端 commentPolicy
- **测试输入**:`./node_modules/.bin/tsx --test src/lib/commentPolicy.test.ts`
- **实际输出**:4 tests pass(stage matrix / viewer / resolve gates)
- **评价判定**:PASS
### 5.4 对话触发链路(批注 / 重开 / 积压 / 送审真执行)
- **测试输入**:
```bash
go test ./internal/intent/... ./internal/coordinator/... ./internal/chat/ \
-run 'TestIntentRecognition_DocGov_CommentReopenPending|TestListDocResolver|TestHandleDocGov|TestExecuteAction_' -count=1
```
- **实际输出**(摘录):
```text
ok chat-agent-system/internal/intent 0.008s
ok chat-agent-system/internal/coordinator 0.005s
ok chat-agent-system/internal/chat 0.005s
```
覆盖:查询语气/裸词「重开」负例、批注矩阵剪枝、DocResolver 0/多匹配澄清、送审确认卡→拍板 `docgov.submit_review`、comment/reopen action kinds 成功与权限失败路径。
- **评价判定**:PASS(对话触发与误触防护单测)
- **说明**:`TestChatSession_SemanticMemoryRecallAndAsyncTurnRecord` 仍偶发超时,与本变更无关,未纳入本节判定。
### 5.5 真实 PI E2E 全链
- **评价判定**:未运行(待授权环境:编制→送审→锁定批注→驳回→积压消化→再送审→批准→归档→重开;以及对话通道两步确认)
## 六、自动化测试套件汇总 (Test Suite Execution)
| 套件 | 结果 |
|---|---|
| `go test` docgov / supplementimpact / docnotify | PASS |
| `go test ./internal/server -short` | PASS |
| `commentPolicy.test.ts` | PASS |
| `go test` intent / coordinator / chat(对话触发子集) | PASS |
| 产品 PI E2E | 未运行 |
## 七、测试结论与后续优化建议 (Conclusion & Next Steps)
- 单元与短测覆盖 G1–G3 主路径与负例;G4 审批人逻辑与对话触发四道防线(语法护栏、DocResolver、角色×阶段、确认卡)已落代码。
- 合入后建议:跑 goose `00073`、再跑一次真实 PI 全链(含对话送审/批注/重开)并回填本节 5.5。