feat(ai): complete v3.2 risk watch agent
This commit is contained in:
@@ -132,22 +132,21 @@
|
||||
**触发**:
|
||||
- `on_track` 不触发。
|
||||
- `at_risk`、`likely_delayed`、`blocked` 自动触发。
|
||||
- `attention` 在风险分明显上升、趋势连续上升、关键 Bug 增加、失败用例增加、阻塞增加、静默风险增加、置信度下降或预测发版日延后时触发。
|
||||
- `attention` 当前服务端只在临近发版且仍有未完成工作时触发;前端历史趋势策略保留为兼容展示,不作为 V3.2 服务端后台触发要求。
|
||||
|
||||
**输出**:`summary`、`why[]`、`forecast`、`recommendedReleaseWindow`、`suggestedActions[]`、`ownerHints[]`。
|
||||
|
||||
**权限**:读规则结果和压缩证据;写 `xiaobao-risk-insights` 缓存。不修改 Version、Requirement、DevTask、TestCase、Bug、Member。
|
||||
**权限**:读规则结果和压缩证据;写 `xiaobao_risk_insights` 关系表缓存(历史兼容名 `xiaobao-risk-insights`)。不修改 Version、Requirement、DevTask、TestCase、Bug、Member。
|
||||
|
||||
**失败回退**:AI 不可用时保留规则预警,前端显示“规则预警已生成,AI 解读会在触发条件满足时自动补充”。AI 失败不影响快照保存和规则风险展示。
|
||||
|
||||
### Agent 3:Schedule Suggest Agent(排期建议)— 待规划
|
||||
|
||||
仅占位,正式规划见 roadmap.md V3.2。
|
||||
仅占位。本次 V3.2 不执行排期建议;后续如要做成员负载与历史耗时驱动的排期建议,需要先补独立规划。
|
||||
|
||||
## 多 Agent 协作(V3.2 规划)
|
||||
## 多 Agent 协作(暂不执行)
|
||||
|
||||
当前 V3.1 只有 Prototype Decompose Agent 单独运行。
|
||||
未来 Risk Watch / Schedule Suggest 引入后,编排策略另行设计。
|
||||
当前 Prototype Decompose Agent 和 Risk Watch Agent 相互独立运行:原型拆解由用户在产品方案 Tab 触发,Risk Watch 由小宝 summary 后台刷新后按 policy 入队。当前不做多 Agent 编排;未来 Schedule Suggest 引入后再另行设计。
|
||||
|
||||
## 实现位置
|
||||
|
||||
@@ -285,3 +284,37 @@ AI 草案在 DevTask / TestCase 列表中的视觉区分:
|
||||
- 标题旁紫色徽章「AI 草案」(`bg-purple-100 text-purple-600`)
|
||||
- 用户在详情抽屉里编辑保存任意字段后,徽章和左边线自动消失
|
||||
- 无需求ID分组不额外显示“原型发现”等标记,只在分组标题中展示 `无需求ID · {requirementName}`
|
||||
|
||||
## Business Analysis Agent(规划)
|
||||
|
||||
Business Analysis Agent 是只读业务数据分析 Agent,不复用 Prototype Decompose Agent 的草案写入契约,也不复用 Risk Watch Agent 的单版本风险解释契约。
|
||||
|
||||
入口:
|
||||
|
||||
- `/wenfan-xiaobao`:业务数据分析对话。
|
||||
- 产品、项目、版本详情页:带当前上下文的智能分析入口。
|
||||
|
||||
核心链路:
|
||||
|
||||
```text
|
||||
Question + Context
|
||||
-> Analysis Planner
|
||||
-> Semantic Layer
|
||||
-> Permission Scope Resolver
|
||||
-> Analysis Strategy
|
||||
-> Analysis Plan Processor
|
||||
-> Metric Engine
|
||||
-> Metric Result
|
||||
-> ChartSpec / Insight / Report / Follow-ups
|
||||
```
|
||||
|
||||
硬约束:
|
||||
|
||||
- AI 不写 SQL,不直接查数据库。
|
||||
- AI Planning 只生成 `AnalysisPlan` 建议,必须经系统校验和规范化。
|
||||
- Agent 仅查询当前用户已有权限的数据,不允许自然语言绕过权限。
|
||||
- 输出 ChartSpec 是平台统一契约,不是 ECharts option;前端第一版用 ECharts Renderer。
|
||||
- Metric Catalog 记录 metric version;公式或业务口径变化必须升版本。
|
||||
- 输出必须包含 Insight Card、图表、固定结构报告、可点击 Evidence 和只读 Follow-up。
|
||||
|
||||
视觉规范见 `docs/superpowers/specs/2026-07-08-business-analysis-agent-design.md` 的 AI Analysis Design System。
|
||||
|
||||
Reference in New Issue
Block a user