docs(adr-072): 更新 Bug 修復狀態 + LOGBOOK

ADR-072: BUG-001~006 標記已修復 (P0 commit 88e3197, P1 commit 5aa0244)
LOGBOOK: 新增 ADR-072 P0+P1 全修復條目
P2 待修: BUG-007 severity labels + BUG-008 alertname_to_type

2026-04-11 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-11 20:26:27 +08:00
parent 5aa0244c9a
commit 85c71bf73c
2 changed files with 25 additions and 7 deletions

View File

@@ -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 深夜)

View File

@@ -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 30qwen2.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 = errorsafety 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()`
- **症狀**: `<deployment_name>``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 寫入 pgvectorSession 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 欄位