diff --git a/docs/LOGBOOK.md b/docs/LOGBOOK.md index 1d7f514a5..864386c4e 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -1,3 +1,71 @@ +## 2026-05-20|T105 Alerts 完整清單接上 AwoooP status-chain + +**觸發**: + +- T104 已讓首頁最新 25 筆事件使用 `truth-chain / ADR-100`,但首頁「查看全部告警」連到的 `/alerts` 仍把所有 incident 直接丟給 `IncidentCard`,沒有傳入 `statusChain`。 +- 這會造成首頁可信、完整清單卻退回 heuristic 進度條,Operator 仍無法在 Alerts 頁判斷「跑到哪個流程、哪個階段、是否需要人工介入」。 +- `/alerts` 一次渲染 400+ 張 incident card,也會造成前端效能和可讀性問題。 + +**修正**: + +- 新增共用 hook `useIncidentStatusChains()`,統一首頁與 Alerts 讀取 `GET /api/v1/platform/status-chain?project_id=awoooi&incident_id=` 的邏輯,避免兩頁各自複製狀態鏈 fetch。 +- 首頁改用共用 hook,保留 T104 的 25 筆首頁 blast-radius。 +- Alerts 頁新增 50 筆分頁;每頁只對當頁 incident 預取 50 筆 status-chain,避免一次對 400+ incident 發出大量查詢。 +- Alerts 頁每張 `IncidentCard` 傳入 `statusChain`,並顯示本頁 AI 流程證據接上狀態:`AI 流程證據:本頁 50/50 筆已接上 truth-chain`。 +- Severity badge 改吃 i18n label,順手移除原本寫死的英文 `CRITICAL/HIGH/MEDIUM/LOW`。 + +**邊界**: + +- 本輪仍是 read-only 告警清單可觀測性,不改 incident / approval / execution / auto-repair 狀態機。 +- Alerts 每頁 50 筆是前端 blast-radius 控制;完整 448 筆仍可用分頁逐頁查看,不再把首頁或 Alerts 變成不可讀長列表。 + +**Local / production verification**: + +```text +node JSON parse zh-TW/en messages + -> i18n json ok +pnpm --dir apps/web exec tsc --noEmit --pretty false + -> pass +pnpm --dir apps/web exec next lint --file alerts/page.tsx --file page.tsx --file useIncidentStatusChains.ts + -> exit 0; only existing homepage any/literal-string warnings remain +NEXT_PUBLIC_API_URL=https://awoooi.wooo.work pnpm --dir apps/web run build + -> compiled successfully, 90/90 static pages +Local Playwright http://localhost:3030/zh-TW/alerts + -> firstFlowCount=50, firstStatusChainOk=50, evidence banner visible, page summary visible, page 2 works, pageErrors=0, consoleErrors=0 +Local Playwright http://localhost:3030/zh-TW + -> homepage flowCount=25, statusChainOkCount=25, latest footer visible +Production health + -> healthy, prod, mock_mode=false +Production incidents + -> count=448 +Production Playwright https://awoooi.wooo.work/zh-TW/alerts + -> firstFlowCount=50, firstStatusChainOk=50, evidence banner visible, page 2 works, pageErrors=0, consoleErrors=0 + -> screenshot /tmp/awoooi-t105-alerts-production.png +``` + +**Gitea deploy / smoke**: + +```text +Code commit: + 0870cdf7 fix(web): show status chain evidence on alerts + +Deploy marker: + 5b699ec3 chore(cd): deploy 0870cdf [skip ci] + +Gitea Actions: + 1923 Code Review -> success in 12s + 1922 CD -> success in 8m52s +``` + +**目前整體進度**: + +- 首頁資料可信度:約 99.9%。 +- Alerts 完整清單可追蹤性:約 99.6%。 +- 前端 AI 自動化管理介面同步:約 99.9%。 +- AwoooP 告警可觀測鏈:約 99.8%。 +- 低風險自動修復閉環:約 95.2%。 +- 完整 AI 自動化管理產品化:約 99.1%。 + ## 2026-05-20|T104 Homepage live-data trust 與 Incident flow 對齊 **觸發**: diff --git a/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md b/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md index cf3d0b5dc..e16375b95 100644 --- a/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md +++ b/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md @@ -2418,6 +2418,14 @@ Phase 6 完成後 - 邊界:T104 是 read-only 首頁產品化與資料可信度修正,不新增自動修復權限、不改 incident / approval / execution 狀態機。完整事件處理仍由 Alerts / Work Items / AwoooP Runs 承接。 - 目前進度更新:首頁資料可信度約 99.9%;前端 AI 自動化管理介面同步約 99.8%;AwoooP 告警可觀測鏈約 99.8%;低風險自動修復閉環約 95.2%;完整 AI 自動化管理產品化約 98.9%。 +**T105 Alerts 完整清單接上 AwoooP status-chain(2026-05-20 台北)**: +- 觸發:T104 後首頁連到的 `/alerts` 仍直接渲染所有 active incidents,沒有傳 `statusChain`,完整清單會退回 heuristic 進度條;448 筆 incident 一次渲染也不利於 Operator 掃描。 +- 修正:新增共用 `useIncidentStatusChains()` hook,首頁與 Alerts 共用 status-chain fetch;Alerts 改為每頁 50 筆,當頁每張 `IncidentCard` 都傳入 AwoooP `statusChain`,並顯示本頁 `AI 流程證據:50/50` 接上 truth-chain。Severity badge 改吃 i18n label,移除寫死的英文風險字串。 +- 驗證:i18n JSON ok;`tsc --noEmit` pass;目標 lint exit 0(僅首頁既有 warnings);production build 90/90 static pages。Local Playwright `/alerts` 確認 firstFlowCount=50、statusChainOk=50、evidence banner visible、page 2 works、pageErrors=0 / consoleErrors=0;首頁回歸確認 flowCount=25、statusChainOk=25。 +- Production / CI:`0870cdf7 fix(web): show status chain evidence on alerts` 已推 Gitea main;deploy marker `5b699ec3 chore(cd): deploy 0870cdf [skip ci]`。Actions:#1923 Code Review success 12s、#1922 CD success 8m52s。Production health healthy/prod/mock_mode=false;`/api/v1/incidents` count=448;Production Playwright `/zh-TW/alerts` 確認 firstFlowCount=50、firstStatusChainOk=50、page 2 works、pageErrors=0 / consoleErrors=0。 +- 邊界:T105 是 read-only 前端可觀測性與效能/可讀性收斂,不改 incident / approval / execution / auto-repair 狀態機;完整事件仍透過分頁逐頁查看。 +- 目前進度更新:首頁資料可信度約 99.9%;Alerts 完整清單可追蹤性約 99.6%;前端 AI 自動化管理介面同步約 99.9%;AwoooP 告警可觀測鏈約 99.8%;低風險自動修復閉環約 95.2%;完整 AI 自動化管理產品化約 99.1%。 + --- ### 2026-04-20 晚 (台北) — C1-C4 全流程串接 — Playbook 鏈路保護(commit de2d34d)