fix(web): align homepage automation truth metrics
All checks were successful
CD Pipeline / tests (push) Successful in 1m18s
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / build-and-deploy (push) Successful in 3m26s
CD Pipeline / post-deploy-checks (push) Successful in 1m20s

This commit is contained in:
Your Name
2026-05-25 15:30:00 +08:00
parent d6d7c27152
commit ffe479dbcc
4 changed files with 164 additions and 14 deletions

View File

@@ -19956,3 +19956,50 @@ format_governance_alert_card("knowledge_degradation", legacy payload)
- CI/CD runner hygiene約 96%。
- 治理告警可讀性 / 可處置性:約 90%。
- 完整 AI 自動化管理產品化:約 89.6%。
---
## 2026-05-25 T180 — 首頁 KPI / 小龍蝦流程條對齊 truth-chain
**背景**
- 首頁上方 KPI 顯示「自動處置率 35%」,來源是 `/api/v1/stats/disposition` 的歷史累計總表;但 AwoooP Automation Evidence / truth-chain quality 近 24h 顯示 `verified_auto_repair_total=0 / evaluated_total=25`,容易讓 operator 誤解成目前 35% 事件已完成 AI 自動修復。
- 「活躍事件」實際取自 `/api/v1/incidents` 未解事件列表,語意應改成「未解事件」,避免和真正 running / active stage 混淆。
- 首頁事件流程條本身已能吃 status-chain truth source缺口是畫面沒有明確顯示這批首屏事件的 truth-chain coverage使用者無法看出流程條是 DB/truth-chain 還是 heuristic fallback。
**本輪修正**
- 首頁自動修復 KPI 改用 `/api/v1/platform/truth-chain/quality/summary?project_id=awoooi&hours=24&limit=30` 作為主要資料源。
- KPI 顯示「24h 驗證修復率」與 `已驗證 {verified}/{evaluated}`,當 `production_claim.can_claim_full_auto_repair=false` 時用 amber 呈現,不再用綠色成功口吻包裝未驗證自動修復。
- `/api/v1/stats/disposition` 只保留為 truth-chain quality 尚未載入時的歷史 fallback 文案,不再作為首頁主判斷。
- 首頁事件區塊改為「未解事件」,並新增 `truth-chain {loaded}/{shown}` 覆蓋率 chip讓 operator 直接看到小龍蝦流程條是否已對到 status-chain evidence。
- 新增 zh-TW / en i18n key未新增 mock data、未新增內網 IP、未新增新 API contract。
**local validation完成**
```text
jq empty apps/web/messages/zh-TW.json apps/web/messages/en.json
git diff --check
pnpm --dir apps/web exec tsc --noEmit --tsBuildInfoFile /tmp/awoooi-t180-tsconfig.tsbuildinfo
pnpm --dir apps/web lint -- --file 'src/app/[locale]/page.tsx'
NEXT_PUBLIC_API_URL=https://awoooi.wooo.work pnpm --dir apps/web run build
```
**local browser note**
- 本機 `localhost:30180` 預覽會被 production API CORS 擋住,所以 local Playwright 只能驗證靜態殼;首頁真實資料仍需以 Gitea CD 後的 production Playwright 為準。
**目前整體進度**
- AwoooP 告警可觀測鏈:約 99.34%。
- 低風險自動修復閉環:約 95.8%。
- 前端 AI 自動化管理介面同步:約 98.1%。
- 首頁 KPI / 小龍蝦流程 truth alignment約 96.5%。
- Telegram 詳情 / 歷史可追溯:約 95.5%。
- callback / DB replayability約 96.0%。
- MCP / 自建 MCP 可視化:約 88%。
- Sentry / SigNoz source correlation約 88%。
- Ansible / PlayBook 可視化:約 85.2%。
- KM governance約 84%。
- AI Provider lane visibility約 92%。
- 完整 AI 自動化管理產品化:約 95.6%。