feat(awooop): summarize automation quality
This commit is contained in:
@@ -7410,3 +7410,35 @@ _format_automation_quality_lines(...) returned 6 lines with verdict + score + ex
|
||||
- 目前實況仍顯示多筆 incident 是 `execution_unverified`,不能宣稱完整 AI 自動修復已完成。
|
||||
- 下一步應把 `execution_unverified` 的 verification gap 收斂到 post-execution verifier / learning writeback,而不是只在 Telegram 補文案。
|
||||
- 目前整體進度更新:約 72%。
|
||||
|
||||
### 2026-05-13 — AwoooP truth-chain T12c:全體告警自動化品質總覽(local green)
|
||||
|
||||
**目的**:
|
||||
|
||||
- Operator 不應逐張 Telegram 卡片猜「是否重複發生」、「是否已進 AI 自動修復」、「卡在哪個流程」。
|
||||
- T12c 先提供 read-only 聚合 API,把最近 incident 全部套用 T12b automation quality gate,回傳 verdict 分布、分數區間、缺失 gate、代表案例與 production claim。
|
||||
|
||||
**變更**:
|
||||
|
||||
- 新增 `GET /api/v1/platform/truth-chain/quality/summary`:
|
||||
- query: `project_id` / `hours` / `limit`
|
||||
- 回傳 `automation_quality_summary_v1`
|
||||
- 顯示 `by_verdict`、`score_buckets`、`gate_failures`、`examples`
|
||||
- `production_claim.can_claim_full_auto_repair` 嚴格要求所有評估 incident 都是 `auto_repaired_verified`
|
||||
- 新增純函式 `summarize_automation_quality_records(...)`,讓品質總覽可單元測試。
|
||||
- 新增 route-order 測試,確保 `/truth-chain/quality/summary` 不會被 `/truth-chain/{source_id}` 誤吃。
|
||||
|
||||
**local verification**:
|
||||
|
||||
```text
|
||||
DATABASE_URL=postgresql+asyncpg://u:p@localhost:5432/db pytest tests/test_awooop_truth_chain_service.py tests/test_platform_router_order.py -q
|
||||
19 passed
|
||||
|
||||
ruff check --select F821 src/services/awooop_truth_chain_service.py src/api/v1/platform/truth_chain.py tests/test_awooop_truth_chain_service.py tests/test_platform_router_order.py
|
||||
All checks passed
|
||||
|
||||
python3 -m py_compile src/services/awooop_truth_chain_service.py src/api/v1/platform/truth_chain.py tests/test_awooop_truth_chain_service.py tests/test_platform_router_order.py
|
||||
OK
|
||||
```
|
||||
|
||||
**目前整體進度**:約 73%。
|
||||
|
||||
Reference in New Issue
Block a user