diff --git a/docs/LOGBOOK.md b/docs/LOGBOOK.md index 5f586b8b..98af449e 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -6,6 +6,23 @@ --- +## 📍 當前狀態 (2026-04-11 深夜 — ADR-072 P0+P1 全修復) + +### ADR-072 Bug 修復完成 (2026-04-11 深夜) + +| Bug | 說明 | Commit | +|-----|------|--------| +| BUG-001 ✅ | drift_interpreter 改用 Ollama httpx,消除 4-tuple unpack 永久失敗 | 88e3197 | +| BUG-002 ✅ | _auto_execute 新增 K8s MCP 動態查詢 Pod,解決 deployment="unknown" | 88e3197 | +| BUG-003 ✅ | safety guard 後加入 K8s deployment 存在性驗證 | 88e3197 | +| BUG-004 ✅ | km_conversion_service 建 KM 後補寫 incidents.vectorized=True | 5aa0244 | +| BUG-005 ✅ | resend_stale_ready_tokens() + lifespan startup 補送 ready decisions | 5aa0244 | +| BUG-006 ✅ | _push_auto_repair_result 補寫 outcome+verification_result 到 DB | 5aa0244 | + +**待修 P2**: BUG-007 (severity labels) + BUG-008 (alertname_to_type) → 下 Session + +--- + ## 📍 當前狀態 (2026-04-11 深夜 — Session 6 Telegram 全面審計 + 規格整合) ### Session 6 Redis DB10 全面審計發現 (2026-04-11 深夜) diff --git a/docs/adr/ADR-072-aiops-bug-fixes.md b/docs/adr/ADR-072-aiops-bug-fixes.md index 2111ee66..3f3e3492 100644 --- a/docs/adr/ADR-072-aiops-bug-fixes.md +++ b/docs/adr/ADR-072-aiops-bug-fixes.md @@ -1,7 +1,8 @@ # ADR-072: AIOps 閉環 Bug 修復清單 -> **狀態**: 進行中 +> **狀態**: P0/P1 已修復,P2 待修 > **建立**: 2026-04-11 (台北時間) +> **更新**: 2026-04-11 深夜 — P0 (BUG-001/002/003) + P1 (BUG-004/005/006) 全修復並推送 Gitea > **背景**: Session 6 對 Redis DB10 + 程式碼全面審計發現 8 個系統性問題 --- @@ -17,21 +18,21 @@ ADR-070/071 實作完成後,Session 6 對 62 個 DecisionToken、112 個 Incid ### P0 — 立即修復(閉環核心失效) -#### BUG-001: drift_interpreter 永久失敗 +#### ✅ BUG-001: drift_interpreter 永久失敗 (已修復 commit 88e3197) - **位置**: `apps/api/src/services/drift_interpreter.py:112` - **症狀**: 所有 K8s 漂移解析失敗,`too many values to unpack (expected 4)` - **根因**: `response_text, success, _tokens, _cost = await nvidia.chat(...)` — nvidia_provider 已重構為返回 `NvidiaProviderResult` 物件,非 4-tuple - **修復方案**: 改用 `drift_narrator_service`(ADR-067 Phase 30,qwen2.5:7b-instruct,已存在)做漂移摘要,完全繞過 nvidia_provider - **影響**: 所有 K8s config drift 告警無法生成可讀摘要 -#### BUG-002: 自動修復 deployment name 全為 "unknown" +#### ✅ BUG-002: 自動修復 deployment name 全為 "unknown" (已修復 commit 88e3197) - **位置**: `apps/api/src/services/decision_manager.py:_auto_execute()` + `apps/api/src/services/incident_service.py:extract_affected_services()` - **症狀**: 24/62 DecisionToken = error,safety guard 攔截(`"unknown" in action`) - **根因**: HostHighCpuLoad / DockerContainerUnhealthy 等主機層告警只有 `{alertname, host}` label,無 `component`/`job`/`pod` → `extract_affected_services()` 返回 `[]` → target = "unknown" - **修復方案**: 在 `_auto_execute()` 執行前,呼叫 K8s MCP `k8s_describe_pod` / `kubectl get pods` 根據 alert 類型動態查詢受影響 Pod,填入 target - **影響**: 所有非 K8s 源頭告警的自動修復全部失敗 -#### BUG-003: nemotron_validation 接受無效 deployment name +#### ✅ BUG-003: nemotron_validation 接受無效 deployment name (已修復 commit 88e3197) - **位置**: `apps/api/src/services/decision_manager.py:_nemoclaw_second_opinion()` - **症狀**: ``、`HostHighCpuLoad`、`unknown` 等無效值通過 schema 驗證 - **根因**: 只做 JSON schema 結構驗證,不驗證 deployment name 是否真實存在於 K8s @@ -42,19 +43,19 @@ ADR-070/071 實作完成後,Session 6 對 62 個 DecisionToken、112 個 Incid ### P1 — 本 Sprint 修復(功能性問題) -#### BUG-004: KM vectorization 108/112 = False +#### ✅ BUG-004: KM vectorization 108/112 = False (已修復 commit 5aa0244) - **位置**: `apps/api/src/services/km_conversion_service.py` - **症狀**: RAG 知識庫未累積,飛輪自癒閉環(ADR-068)學習效果為零 - **根因**: KM 轉換服務呼叫後未確保 embedding 寫入 pgvector(Session 6 確認 `vectorized=False`,`persisted_to_pg=False`) - **修復方案**: 修復 `convert()` 後的 embedding 寫入流程,確保 `nomic-embed-text` 768d 向量化並持久化 -#### BUG-005: 15 ready decisions 無人審核 +#### ✅ BUG-005: 15 ready decisions 無人審核 (已修復 commit 5aa0244) - **位置**: incident_id → approval UUID 對應流程 - **症狀**: 15 個 `status=ready` 的 DecisionToken 長期無審核,Telegram 未發出審核卡片 - **根因**: approval flow 的 `incident_id` UUID 對應問題 - **修復方案**: 診斷 `incident_id` 查詢鏈,修復 Telegram 審核卡片未發送的問題 -#### BUG-006: outcome/verification_result 全 null +#### ✅ BUG-006: outcome/verification_result 全 null (已修復 commit 5aa0244) - **位置**: `apps/api/src/services/decision_manager.py:_push_auto_repair_result()` - **症狀**: 所有已完成修復無 outcome 記錄 - **根因**: post-repair 驗證邏輯未寫入 DB outcome 欄位