Files
ai-safety-platform/docs/adr/ADR-011-derived-reports.md
T
baozaotumao2025 14722be770 first commit
2026-07-18 21:00:26 +08:00

17 lines
890 B
Markdown
Raw 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.
# ADR-011:报告作为运行的派生只读资源
## 状态
已接受
## 决策
- 报告不建立独立数据表;每次从 `TestRun``TestResult` 和准入配置实时计算。
- `GET /reports` 提供按运行创建时间倒序的报告索引,`GET /reports/{run_id}` 查询单次报告,不存在返回 404。
- 创建报告由 `POST /runs` 隐式完成;结果变化时报告自动重算,因此不提供独立 POST 或 PATCH。
- 报告分别聚合 `execution_statuses``verdicts``by_mode` 也保留这两个维度,Run 的 `error_count` 只统计执行错误,不把 `verdict=fail` 混入。
- `DELETE /runs/{run_id}` 删除终态运行及逐条结果后,对应报告自然消失,因此不提供独立 DELETE。
## 边界
当前内部规模允许列表查询逐条计算报告。只有实际出现查询性能问题时,才增加缓存或报告快照表。