diff --git a/docs/LOGBOOK.md b/docs/LOGBOOK.md index 5e3ea070a..66d7602f8 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -1,3 +1,106 @@ +## 2026-05-31|Alerts 告警入口接上 Incident 真相鏈 + +**背景**: + +- 使用者指出 Telegram 告警、詳情、歷史與前端頁面仍無法直接回答:同一筆告警是否重複、AI 流程跑到哪、是否真的自動修復、是否卡人工、Sentry / SigNoz / MCP / 自建 MCP / Ansible / KM 是否真的被用到。 +- Runs、Work Items、Tickets、Approvals、Authorizations、Monitoring 已能用 `project_id + incident_id` 追同一筆 Incident;本輪把 `/zh-TW/alerts?project_id=...&incident_id=...` 也接上同一條 evidence chain,讓 Telegram 點回告警入口時不再只看到壓縮卡片。 + +**本次調整**: + +- `apps/web/src/app/[locale]/alerts/page.tsx`: + - 支援 `project_id` / `incident_id` query focus mode。 + - 新增 `焦點告警真相鏈` 區塊,直接讀 `useIncidentStatusChains`,顯示 source refs、Sentry / SigNoz correlation、MCP Gateway、Ansible 與嵌入式 `AwoooPStatusChainPanel`。 + - 補上 Monitoring、Work Items、Runs、Approvals、Tickets 五個同 Incident drill-down 入口。 + - 若焦點 Incident 已不在 active alerts list,仍保留只讀 truth-chain 查詢與明確空狀態,不讓 operator 誤判成資料遺失。 + - 明確標示此頁只讀:不建立新 Incident、不觸發修復、不靜音 Telegram。 +- `apps/web/src/components/incident/incident-card.tsx`: + - Incident 卡片新增 `真相鏈` 快捷入口列:Monitoring / Work Items / Runs / Approvals / Tickets。 + - 將本次觸碰區域的建議說明 emoji 改為 lucide `Lightbulb`,符合前端 icon 規範。 +- `apps/web/messages/zh-TW.json` / `apps/web/messages/en.json`: + - 補齊 Alerts focus 與 IncidentCard truth-link 文案;`en.json` 維持繁中鏡像。 + +**驗證**: + +```text +python3 -m json.tool apps/web/messages/zh-TW.json / en.json -> pass +git diff --check -> pass +pnpm --dir apps/web exec tsc --noEmit --tsBuildInfoFile /tmp/awoooi-alerts-incident-evidence-20260531-final.tsbuildinfo -> pass +NEXT_PUBLIC_API_URL=https://awoooi.wooo.work pnpm --dir apps/web run build -> pass + +local browser with read-only production API proxy: + /zh-TW/alerts?project_id=awoooi&incident_id=INC-20260530-0DD83C + desktop/mobile: + hasFocus=true + hasIncident=true + hasMonitoringLink=true + hasWorkItemsLink=true + hasRunsLink=true + hasApprovalsLink=true + hasTicketsLink=true + hasStatusChain=true + hasSourceRefs=true + hasMcp=true + hasAnsible=true + hasTruthLinksOnCard=true + canScroll=true + horizontalOverflow=false + screenshots: + /tmp/awoooi-alerts-incident-evidence-mobile.png + /tmp/awoooi-alerts-incident-evidence-desktop.png +``` + +**Gitea / Production deploy**: + +```text +7d30b034 fix(web): connect alerts to incident evidence chain +d4119468 chore(cd): deploy 7d30b03 [skip ci] + +Gitea: + code-review run 2337 -> success + cd run 2336 -> success + +k8s: + awoooi-web image = 192.168.0.110:5000/awoooi/web:7d30b0342c02283eb4bbb5201341424764af01f7 + awoooi-api image = 192.168.0.110:5000/awoooi/api:7d30b0342c02283eb4bbb5201341424764af01f7 + awoooi-worker image = 192.168.0.110:5000/awoooi/api:7d30b0342c02283eb4bbb5201341424764af01f7 + awoooi-web/api/worker rollout = successfully rolled out + web pods = ready true, restarts 0 + +production API: + /api/v1/health = healthy prod + ollama_route_order = ["ollama_gcp_a", "ollama_gcp_b", "ollama_local"] + +production browser smoke: + https://awoooi.wooo.work/zh-TW/alerts?project_id=awoooi&incident_id=INC-20260530-0DD83C&_v=7d30b034 + hasFocus=true + hasIncident=true + hasMonitoringLink=true + hasWorkItemsLink=true + hasRunsLink=true + hasApprovalsLink=true + hasTicketsLink=true + hasStatusChain=true + hasSourceRefs=true + hasMcp=true + hasAnsible=true + hasTruthLinksOnCard=true + hasNoFocusLoadFailure=true + canScroll=true + horizontalOverflow=false + displayed: Source refs 54 入站 / 3 出站, MCP Gateway 17 / 19, Ansible failed + screenshot=/tmp/awoooi-alerts-incident-evidence-production-7d30b034.png +``` + +**目前整體進度(post-deploy)**: + +- Telegram / AwoooP / 前端真相鏈可見性:約 90%;Alerts、Runs、Work Items、Tickets、Approvals、Authorizations、Monitoring 已能用同一組 Incident 追 evidence。 +- 前端 AI 自動化管理介面:約 96%;核心頁面已能從告警、工單、執行、審批、授權、監控角度 drill-down 同一個 Incident。 +- Sentry / SigNoz per-incident matching 可見性:約 90%;目前已能顯示 provider 有心跳但此 Incident 尚未匹配 event。 +- MCP / 自建 MCP 可視化:約 97%。 +- Ansible / PlayBook 可視化:約 89%;已能看見 executor / ansible status,但 runtime 自動 apply 仍不可宣稱完成。 +- 整體 AI 自動化飛輪:約 79%。 +- 24h 完整 AI Agent 自動修復 production claim:0%;仍需 24h production evidence 才能宣稱真正全自動閉環。 + ## 2026-05-31|IwoooS 主機與工具證據鏈首層化 **背景**: