feat(ai): 优化拆解重跑与结果展示
This commit is contained in:
@@ -29,6 +29,11 @@
|
||||
- ❓ 注释含糊无法转化
|
||||
- 对账报告先呈现给用户,用户审核后才执行写入
|
||||
|
||||
4. **AI 预估不等于执行人预估**
|
||||
- AI 只能输出 `aiEstimateHours`
|
||||
- `estimateHours` 留给负责人/执行人确认后填写
|
||||
- AI 不输出预计开始/截止时间,排期由负责人后续维护
|
||||
|
||||
4. **历史版本不强制存储**
|
||||
- 系统不要求历史原型 URL 作为基准
|
||||
- 拆偏问题靠"对账报告"暴露给用户,由人工补救
|
||||
@@ -45,7 +50,7 @@
|
||||
- 当前版本关联需求列表(已被加进 Version 的 Requirement[])
|
||||
- 版本成员清单(带角色:前端/后端/UI/测试)
|
||||
|
||||
**调用入口**:版本详情页 → 产品方案 Tab → 计划状态 = completed 后,按钮「AI 拆解任务和用例」
|
||||
**调用入口**:版本详情页 → 产品方案 Tab → 计划状态 = completed 后,按钮「AI 拆解开发任务」或「AI 拆解测试用例」
|
||||
|
||||
**触发条件**:
|
||||
- 当前版本至少有 1 条 type=product 的 VersionPlan 处于 `completed` 且 resultUrl 非空(提交了原型)
|
||||
@@ -53,12 +58,16 @@
|
||||
|
||||
**输出**:
|
||||
- 对账报告(结构化文本,含"完美对应/单边/含糊"三段)
|
||||
- DevTask 草案数组(每条带 `aiDraft: true` + `references[]`)
|
||||
- TestCase 草案数组(每条带 `aiDraft: true` + `references[]`)
|
||||
- DevTask 草案数组(每条带 `aiDraft: true` + `references[]` + `aiEstimateHours`)
|
||||
- TestCase 草案数组(每条带 `aiDraft: true` + `references[]` + `aiEstimateHours`)
|
||||
- `target = dev_tasks` 时 `testCaseDrafts` 必须为空数组;`target = test_cases` 时 `devTaskDrafts` 必须为空数组
|
||||
|
||||
**写入**:
|
||||
- 用户确认后,调用 `useDevTaskStore.createTask` 和 `useTestCaseStore.createTestCase`
|
||||
- 打开采纳弹窗前,前端先过滤当前版本已采纳过的重复 DevTask/TestCase 草案
|
||||
- 写入字段中 `aiDraft: true`、`aiDraftAt: ISO时间戳`
|
||||
- 写入 `aiEstimateHours`,不写入执行人预估 `estimateHours`
|
||||
- DevTask 草案不写预计开始/截止时间,负责人后续排期时再填写
|
||||
|
||||
**权限**:
|
||||
- 读:Version, Requirement, VersionPlan, Member
|
||||
@@ -172,6 +181,7 @@ interface Reference {
|
||||
aiDraft?: boolean;
|
||||
aiDraftAt?: string; // ISO 时间戳
|
||||
references?: Reference[];
|
||||
aiEstimateHours?: number; // AI 预估耗时,单位小时
|
||||
```
|
||||
|
||||
### Agent 输入预期
|
||||
@@ -182,6 +192,7 @@ interface DecomposeInput {
|
||||
prototypeUrl: string; // 从产品方案 completed 计划的 resultUrl 派生
|
||||
requirements: Requirement[]; // 当前版本所属项目下已采纳、可用于本次拆解的需求
|
||||
members: VersionMember[]; // 该版本参与人员(带角色)
|
||||
target?: 'all' | 'dev_tasks' | 'test_cases';
|
||||
}
|
||||
```
|
||||
|
||||
@@ -197,12 +208,12 @@ interface DecomposeOutput {
|
||||
noteOnly: string[]; // 原型注释 ID 列表
|
||||
ambiguous: Array<{ noteId: string; reason: string }>;
|
||||
};
|
||||
devTaskDrafts: Array<Omit<DevTask, 'id' | 'taskNo' | 'createdAt' | 'updatedAt' | 'isBlocked' | 'categoryId'> & { categoryCode: string; aiDraft: true; aiDraftAt: string; references: Reference[] }>;
|
||||
testCaseDrafts: Array<Omit<TestCase, 'id' | 'caseNo' | 'createdAt' | 'updatedAt' | 'status' | 'categoryId'> & { categoryCode: string; aiDraft: true; aiDraftAt: string; references: Reference[] }>;
|
||||
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[] }>;
|
||||
}
|
||||
```
|
||||
|
||||
要求:AI 不输出数据库 `categoryId`,只输出稳定 `categoryCode`。前端确认写入时按 `TaskCategory.code` 映射成 `categoryId`;映射失败时使用对应分组的默认类型兜底。
|
||||
要求:AI 不输出数据库 `categoryId`,只输出稳定 `categoryCode`。前端确认写入时按 `TaskCategory.code` 映射成 `categoryId`;映射失败时使用对应分组的默认类型兜底。AI 不输出 `estimateHours`、预计开始或预计截止。
|
||||
|
||||
## 视觉规范
|
||||
|
||||
|
||||
Reference in New Issue
Block a user