feat(ai): 优化拆解目标和负责人推荐
This commit is contained in:
@@ -34,7 +34,13 @@
|
||||
- `estimateHours` 留给负责人/执行人确认后填写
|
||||
- AI 不输出预计开始/截止时间,排期由负责人后续维护
|
||||
|
||||
4. **历史版本不强制存储**
|
||||
5. **AI 可推荐负责人,但不自动分配**
|
||||
- AI 只能从当前版本成员 `members[].name` 中输出可选的 `recommendedAssigneeName`
|
||||
- 推荐只作为采纳弹窗里的辅助信息,默认不写入 `assigneeId`
|
||||
- 用户勾选“采纳推荐负责人”后,前端再次校验推荐姓名属于当前版本成员,才写入 DevTask/TestCase
|
||||
- 没有明确匹配成员时不输出推荐字段
|
||||
|
||||
6. **历史版本不强制存储**
|
||||
- 系统不要求历史原型 URL 作为基准
|
||||
- 拆偏问题靠"对账报告"暴露给用户,由人工补救
|
||||
- 这条决定见 decisions.md #17
|
||||
@@ -58,16 +64,30 @@
|
||||
|
||||
**输出**:
|
||||
- 对账报告(结构化文本,含"完美对应/单边/含糊"三段)
|
||||
- DevTask 草案数组(每条带 `aiDraft: true` + `references[]` + `aiEstimateHours`)
|
||||
- TestCase 草案数组(每条带 `aiDraft: true` + `references[]` + `aiEstimateHours`)
|
||||
- DevTask 草案数组(每条带 `aiDraft: true` + `references[]` + `aiEstimateHours`,可选 `recommendedAssigneeName` / `recommendedAssigneeReason`)
|
||||
- TestCase 草案数组(每条带 `aiDraft: true` + `references[]` + `aiEstimateHours`,可选 `recommendedAssigneeName` / `recommendedAssigneeReason`)
|
||||
- `target = dev_tasks` 时 `testCaseDrafts` 必须为空数组;`target = test_cases` 时 `devTaskDrafts` 必须为空数组
|
||||
|
||||
**原型与需求匹配规则**:
|
||||
- 优先按需求编号匹配:原型批注或文本出现 `requirement.id` / `requirement.code` 时,必须优先判定为该需求命中。
|
||||
- 编号未出现时,再按需求标题和需求概述(`title` / `description`)做语义匹配。
|
||||
- 有 QY 编号时,`prototype_note` 引用只能使用真实存在的 QY 编号。
|
||||
- 没有 QY 编号但原型文本已命中需求编号或需求概述时,不应丢弃;可只引用 `requirement`,并在 `matched.noteIds` 返回空数组。
|
||||
- 只有既匹配不到需求编号,也匹配不到需求概述语义的原型批注,才进入 `noteOnly` 或 `ambiguous`。
|
||||
|
||||
**测试用例拆解粒度**:
|
||||
- TestCase 要按功能点、UI 交互、表单校验、接口、数据一致性、权限、异常、边界、状态流转、兼容性和回归点拆细。
|
||||
- 不允许用一条“验证 XX 完整流程”覆盖多个交互、多个接口或多个规则。
|
||||
- 一条 QY 若同时涉及 UI、接口、数据、异常和状态变化,通常应拆出 3-8 条 TestCase。
|
||||
- 测试用例 `categoryCode` 可使用:`test_functional`、`test_ui_interaction`、`test_form_validation`、`test_api`、`test_data_consistency`、`test_permission`、`test_exception`、`test_boundary`、`test_state_flow`、`test_compatibility`、`test_regression`。
|
||||
|
||||
**写入**:
|
||||
- 用户确认后,调用 `useDevTaskStore.createTask` 和 `useTestCaseStore.createTestCase`
|
||||
- 打开采纳弹窗前,前端先过滤当前版本已采纳过的重复 DevTask/TestCase 草案
|
||||
- 写入字段中 `aiDraft: true`、`aiDraftAt: ISO时间戳`
|
||||
- 写入 `aiEstimateHours`,不写入执行人预估 `estimateHours`
|
||||
- DevTask 草案不写预计开始/截止时间,负责人后续排期时再填写
|
||||
- 只有用户在采纳弹窗勾选“采纳推荐负责人”时,才把已校验的 `recommendedAssigneeName` 写入 `assigneeId`
|
||||
|
||||
**权限**:
|
||||
- 读:Version, Requirement, VersionPlan, Member
|
||||
@@ -82,7 +102,7 @@
|
||||
|
||||
**MVP 阶段限制**(V3.1):
|
||||
- 只生成 DevTask 和 TestCase 草案
|
||||
- 不自动分配 assignee(assignee 留给用户从草案编辑时手填)
|
||||
- 不自动分配 assignee;AI 只提供可选推荐,用户确认采纳后才写入
|
||||
- 不做"上一版基准 diff"
|
||||
|
||||
### Agent 2:Risk Watch Agent(风险预警)— 待规划
|
||||
@@ -208,8 +228,8 @@ interface DecomposeOutput {
|
||||
noteOnly: string[]; // 原型注释 ID 列表
|
||||
ambiguous: Array<{ noteId: string; reason: string }>;
|
||||
};
|
||||
devTaskDrafts: Array<{ title: string; description?: string; categoryCode: string; priority: Priority; aiEstimateHours: number; references: Reference[] }>;
|
||||
testCaseDrafts: Array<{ title: string; description: string; categoryCode: string; priority: Priority; aiEstimateHours: number; references: Reference[] }>;
|
||||
devTaskDrafts: Array<{ title: string; description?: string; categoryCode: string; priority: Priority; aiEstimateHours: number; recommendedAssigneeName?: string; recommendedAssigneeReason?: string; references: Reference[] }>;
|
||||
testCaseDrafts: Array<{ title: string; description: string; categoryCode: string; priority: Priority; aiEstimateHours: number; recommendedAssigneeName?: string; recommendedAssigneeReason?: string; references: Reference[] }>;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user