feat(awooop): summarize automation quality
All checks were successful
Code Review / ai-code-review (push) Successful in 11s
CD Pipeline / tests (push) Successful in 1m14s
CD Pipeline / build-and-deploy (push) Successful in 3m43s
CD Pipeline / post-deploy-checks (push) Successful in 1m29s

This commit is contained in:
Your Name
2026-05-13 15:56:42 +08:00
parent c00e911b28
commit ae7c7cbd23
5 changed files with 351 additions and 2 deletions

View File

@@ -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%。