fix(awooop): expose quality summary aggregate
All checks were successful
Code Review / ai-code-review (push) Successful in 16s
CD Pipeline / tests (push) Successful in 1m7s
CD Pipeline / build-and-deploy (push) Successful in 3m27s
CD Pipeline / post-deploy-checks (push) Successful in 1m32s

This commit is contained in:
Your Name
2026-05-13 16:33:46 +08:00
parent 94fc25dc39
commit 356bfce2c8
2 changed files with 11 additions and 8 deletions

View File

@@ -22,24 +22,26 @@ router = APIRouter()
"/truth-chain/quality/summary",
summary="查詢 AI 自動化品質總覽",
description=(
"T12c read-only endpoint. 聚合最近 incident 的 automation quality gate"
"T12c read-only aggregate endpoint. 聚合最近 incident 的 automation quality gate"
"讓 Operator 不必逐張 Telegram 卡片判斷是否真正完成 AI 自動修復。"
"此總覽不回傳逐筆 examplessource-level truth-chain 詳情仍需 operator auth。"
),
)
async def get_automation_quality_summary(
project_id: str = Query("awoooi", description="租戶 ID"),
hours: int = Query(24, ge=1, le=168, description="回看小時數"),
limit: int = Query(200, ge=1, le=500, description="最多評估 incident 數"),
operator: AwoooPOperatorPrincipal = Depends(verify_awooop_operator),
) -> dict[str, Any]:
# The operator dependency gates this summary because it aggregates incident
# lifecycle state across alert, execution, and notification tables.
_ = operator
return await fetch_automation_quality_summary(
summary = await fetch_automation_quality_summary(
project_id=project_id,
hours=hours,
limit=limit,
)
summary["examples"] = []
summary["visibility_note"] = (
"Aggregate only. Use /truth-chain/{source_id} with operator auth for source-level details."
)
return summary
@router.get(

View File

@@ -7461,8 +7461,8 @@ awoooi-api / awoooi-worker / awoooi-web successfully rolled out
health:
https://awoooi.wooo.work/api/v1/health -> 200
route auth smoke:
GET /api/v1/platform/truth-chain/quality/summary?project_id=awoooi&hours=24&limit=1 -> 401 Operator authentication required
route visibility note:
T12d 後此 summary endpoint 改為 read-only aggregate不回傳 examplessource-level `/truth-chain/{source_id}` 仍需 operator auth。
production summary service smoke, hours=24, limit=50:
schema_version=automation_quality_summary_v1
@@ -7511,6 +7511,7 @@ top gate_failures:
- 只讀,不觸發任何修復動作
- 新增 `awooop.home.quality` 雙語字典,新增文字都走 `next-intl`
- UI 使用 Lucide `ShieldCheck`,沒有新增 emoji icon 或 mock data。
- `GET /api/v1/platform/truth-chain/quality/summary` 改為 read-only aggregate供 Operator Console 讀取;回應會清空 examples逐筆 truth-chain 詳情仍保留 operator auth。
**local verification**