Commit Graph

3678 Commits

Author SHA1 Message Date
AWOOOI CD
6048102139 chore(cd): deploy 9239538 [skip ci] 2026-04-16 11:08:30 +00:00
OG T
9239538b4d fix(ci): 修復 apt index 失敗導致 python3.11 找不到
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 42m19s
症狀:apt-get update 下載 index 失敗 → python3.11 裝不上 → CI 全部失敗
修復:clean apt cache + --fix-missing + deadsnakes PPA fallback + python3 symlink fallback
影響:所有 2026-04-16 的修復 commit 都因此無法部署

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 18:49:35 +08:00
OG T
8b2a3df64b fix(telegram): 修復 Telegram 卡片 description 顯示 debug garbage
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 3m12s
問題:description = debate_summary[:500],用戶看到的是內部審計文字
修復:從 diagnosis.top_hypothesis + action_plan.top_candidate 組出人類可讀摘要
格式:「根因:[描述](信心 X%);方案:[動作]」

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 18:42:13 +08:00
AWOOOI CD
5c4efb8d15 chore(cd): deploy ded93cb [skip ci] 2026-04-16 08:42:52 +00:00
OG T
ded93cbba3 fix(aiops): 修復 evidence 空白 → AI ABSTAIN 問題
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 32m33s
問題:
- signal.alert_name 在頂層,但 _get_alertname() 從 labels["alertname"] 讀 → 空字串
- 所有 sensor 失敗時 evidence_summary 只有 120 字元,AI 無法分析 → ABSTAIN
- labels 為空時 AI 根本不知道是什麼告警

修復:
1. _get_alertname(): 優先讀 signal.alert_name,fallback labels["alertname"]
2. _get_labels(): 自動補 alertname 到 labels dict
3. EvidenceSnapshot.alert_info: 新增告警基礎欄位(sensors=0 時的最小情報)
4. build_summary(): alert_info 永遠放在最前,讓 AI 至少知道告警類型+嚴重度

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 16:26:07 +08:00
OG T
588b0d745b fix(aiops): 修復 sensors=0/0 根因 — MCPToolRegistry 從未在 startup 初始化
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 1m44s
三個問題同時修復:

1. main.py: 補上 init_mcp_tool_registry() 呼叫
   - ADR-081 Phase 1 建立了 MCPToolRegistry 但從未在 lifespan startup 被呼叫
   - 導致 PreDecisionInvestigator sensors=0/0,evidence_summary 永遠空白
   - 空白 evidence → Diagnostician 永遠 ABSTAIN

2. signal_producer.py: str(dict) → json.dumps()
   - labels/annotations 用 Python str() 序列化,寫入 Redis 後無法反序列化

3. brain/incident_engine.py: 新增 _parse_dict_field() helper
   - 從 Redis 讀回的 labels/annotations 可能是 JSON 字串
   - isinstance(..., dict) 防禦不足,需先 json.loads()

2026-04-16 ogt + Claude Sonnet 4.6(亞太): 飛輪感官修復

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 15:35:19 +08:00
OG T
d294caf830 fix(solver): 相容 openclaw_nemo 回傳格式 → candidates 格式轉換
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 3m51s
與 diagnostician 同步:openclaw_nemo 回傳 action_title/risk_level/confidence,
solver 的 _extract_candidates() 找不到 candidates key → 空方案 → no_candidates

修復: 檢測 action_title 存在時轉換為 candidates 格式
risk_level → blast_radius 映射: critical=60, high=40, medium=25, low=10

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 14:34:50 +08:00
OG T
d31e491585 Merge remote-tracking branch 'gitea/main'
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
2026-04-16 14:32:42 +08:00
OG T
c27709d11b fix(diagnostician): 相容 openclaw_nemo 回傳格式 → 解除全面 ABSTAIN
根因: AI Router DIAGNOSE→openclaw_nemo 回傳 ClawBot 格式:
     {"action_title":"...","risk_level":"...","confidence":0.85}
     Diagnostician 只解析 {"hypotheses":[...]} → 永遠 0 hypotheses → ABSTAIN

修復: _extract_hypotheses() 新增 openclaw_nemo 格式檢測與轉換
     action_title→description, confidence→confidence, risk_level→category

影響: 所有 critical alert 自 2026-04-15 收到後一律 ABSTAIN,無任何修復動作

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 14:32:32 +08:00
AWOOOI CD
11a3522d39 chore(cd): deploy eff40a4 [skip ci] 2026-04-16 05:54:04 +00:00
OG T
eff40a4949 fix(ci): 修復 cd.yaml YAML 解析失敗 — ├ 字元缺縮排導致 CI 全停
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 23m35s
根因: commit 5ee76dc 引入 HTML 結構化格式時,MSG 多行字串的
      ├/└ 行縮排為 0,YAML block scalar 解析失敗
      (yaml: line 72: could not find expected ':')

影響: 2026-04-16 03:27 後所有 commit 均無法觸發 CI build
      包含: cd1c0ff (5-tuple 修復) + 9ea1f77 (ghost button) + 8582439 (KB fix)

修復: 兩處 MSG 改用 printf 單行格式,消除多行 YAML 縮排陷阱

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 13:38:23 +08:00
OG T
8582439d2d fix(kb): Signal 無 description 欄位,改用 alert_name + annotations
knowledge_extractor_service 兩處直接訪問 s.description:
- L87 signals_text 組裝:改用 alert_name + annotations.summary/description
- L198 Fallback 標題:改用 alert_name[:60]

Signal model 只有 alert_name, annotations(dict),無 description 屬性。
此修復防止 KB 萃取時 AttributeError 導致草稿無法建立。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 08:54:11 +08:00
OG T
9ea1f77e41 fix(telegram): 移除 7 個 ghost button (3-part/無handler)
違規 buttons 一覽:
- flywheel_diag / flywheel_dashboard (META告警卡)
- pause_1h / ignore (業務告警卡)
- postmortem / escalation_ack / dr_manual (升級通知卡)
- secops_block_ip / secops_evict (SecOps 卡,spec=nonce 但用 2-part)

所有 buttons 均無 callback handler,點擊無回應 = 鬼魂按鈕
鐵律: 寧可沒按鈕,不可有死按鈕 (feedback_no_ghost_buttons.md)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 03:29:41 +08:00
OG T
cd1c0ffdb8 fix(openclaw): call() 5值→3值 — 修復全部 AI 分析降級根因
根因: _call_with_fallback() 回傳 5-tuple,但 call() 直接 return
導致呼叫端 (diagnostician/solver/critic agents) 3-var unpack
→ ValueError: too many values to unpack → 全部 降級 20%

修復: call() 明確解包再回傳 (response, provider, success)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 03:27:48 +08:00
OG T
5e4dbbbb41 fix(alertmanager): webhook URL 改指向 VIP 192.168.0.125:32334
根因: Alertmanager 打 120:32334 → Connection Refused
      120/121 NodePort 直接訪問不通,只有 VIP 125:32334 可通
影響: 告警完全無法送達 AWOOOI API,鏈路靜默失效 (自 2026-04-12 起)
修復: url → http://192.168.0.125:32334/api/v1/webhooks/alertmanager
驗證: 手動 inject 測試告警,API 端收到並觸發完整 LLM 分析流程

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 03:19:58 +08:00
AWOOOI CD
9a4fa5edf5 chore(cd): deploy 27ba97e [skip ci] 2026-04-15 19:12:19 +00:00
OG T
62e2efda85 fix(heartbeat): 恢復 30 分鐘心跳報告到 SRE 戰情室
2026-04-15 停用理由(forwarded_to_separate_group)有誤,
SRE 戰情室就是 SRE_GROUP_CHAT_ID,不應停用。
恢復 start_heartbeat_monitor(interval=30min)。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 03:05:01 +08:00
OG T
5ee76dc30d fix(cd): CI/CD Telegram 通知改用 HTML 結構化格式
Deploy Start / Failure 從純文字 pipe 格式改為:
  🚀 AWOOOI 部署開始
  ├ 📝 <commit>
  ├ 🔖 <sha>
  └ 👤 <actor>

commit message 做 HTML escape 防特殊字元

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 03:04:23 +08:00
OG T
27ba97e586 fix(ollama): 清除所有硬寫 188:11434 fallback — 全部改指向 111 GPU
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 15m59s
- decision_manager.py: 兩處 getattr fallback 188 → 111
- routes/agent.py: OLLAMA_BASE_URL 188 → 111
- knowledge_extractor_service.py: _OLLAMA_BASE 188 → 111

config.py 預設早已是 111,此次清掉 code 層殘留的 188 硬寫值。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 03:01:31 +08:00
OG T
5f9c9d84a2 fix(configmap): Ollama 改指向 111 GPU + fallback 順序調整
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
- OLLAMA_URL: 188(CPU-only) → 111(RTX GPU,avg 10s)
- AI_FALLBACK_ORDER: nvidia→gemini→ollama→claude
  改為 ollama→nvidia→gemini→claude
  本地 GPU 優先,外部 API 備援,雲端 Claude 最終兜底

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 03:00:16 +08:00
OG T
7e3cc8b3b0 fix(agents): 移除人工 per-agent timeout,LLM 必須等完整回應
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
原設計 asyncio.wait_for(timeout_sec=25s) 是任意截斷,
只要 LLM 超過時限就降級為 confidence=20%,根本沒有分析。

正確做法:
- 移除所有 4 個 agent 的 asyncio.wait_for() 包裝
- 只留 except Exception 捕真實異常(連線失敗、模型崩潰)
- 全流程由 Orchestrator GLOBAL_TIMEOUT_SEC=90s 防掛死
- _PER_AGENT_TIMEOUT_SEC 常數廢棄移除

影響:LLM 推理多久就等多久,不再人工截斷,
      deepseek-r1:14b 等模型得以完整輸出分析結果。

2026-04-16 ogt + Claude Sonnet 4.6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 02:54:34 +08:00
OG T
5a3a649f8a fix(decision): TYPE-1 告警重複洗版兩個根因修復
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
根因 1: TYPE-1 bypass 在 existing_token 檢查之前執行
→ 每次 get_or_create_decision() 不管 token 是否存在,都直接推 TG
→ 修復: existing_token 檢查提前到 TYPE-1 bypass 之前(統一入口)

根因 2: TYPE-1 token TTL 僅 3600s
→ 1h 後 token 過期,下次掃描重新建立並再推 TG
→ 修復: TYPE-1 token TTL 提升至 86400s (24h)

影響: HostBackupFailed 等 TYPE-1 告警每個 incident 只推 1 次(24h 內)

2026-04-16 ogt + Claude Sonnet 4.6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 02:49:31 +08:00
OG T
62bcc50770 fix(tg+km): 補齊 Telegram 操作紀錄揭露與 KM 分類修復 (ADR-076)
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
Telegram 訊息新增欄位:
- alert_category 分類標籤(🏷️ 主機/K8s/資料庫/服務等)
- playbook_name 顯示匹配到的 Playbook 名稱
- 頻率統計從 count_24h>1 降至 >=1(初次告警也顯示)
- TelegramMessage 新增 alert_category/playbook_name 欄位
- decision_manager → send_approval_card 穿透 playbook_name

KM 修復:
- EntryType.PLAYBOOK → EntryType.AUTO_RUNBOOK(前者不存在,會 AttributeError)
- category "auto_generated" → "ai_system"(前端 i18n 有對應翻譯)
- runbook_generator 同步修正 category
- KM 建立後推 Telegram 通知(best-effort)

DB decision_chain 補欄位:
- 新增 playbook_id / playbook_name / alert_category

2026-04-16 ogt + Claude Sonnet 4.6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 02:46:17 +08:00
AWOOOI CD
44ecf609e0 chore(cd): deploy 9538f6c [skip ci] 2026-04-15 18:39:05 +00:00
OG T
9538f6cca4 fix(agents): 修正 Agent 5s timeout 導致 LLM 推理全部失敗
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 16m14s
根本原因: deepseek-r1:14b 實測推理 2.2-27.3s avg 10.6s
但 Diagnostician/Critic/Solver/Reviewer 全部使用 timeout_sec=5.0 (開發機測試值)
→ 67% 的 Agent 推理 timeout → 降級 confidence=20% → 自動修復從不觸發

修復:
- _PER_AGENT_TIMEOUT_SEC: 5s → 25s (覆蓋 avg 的 2.3x buffer)
- GLOBAL_TIMEOUT_SEC: 30s → 90s (3個序列Agent × 25s + buffer)
- 明確傳遞 timeout_sec 給所有 4 個 Agent 呼叫

預期效果: 正常告警 AI 分析 confidence ≥ 0.5 → 觸發自動修復

2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 02:28:05 +08:00
OG T
a07daf7e3f fix(incidents): GET /incidents 加 48h age filter,阻止舊 incident 反覆觸發 AI 分析
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
根本原因: DECISION_TOKEN_TTL=3600s → 舊 incident token 每小時過期
→ GET /api/v1/incidents 重複觸發 get_or_create_decision → OPENCLAW_NEMO timeout
→ Expert System fallback (confidence=20%) → Telegram 洪水

修復: 只對 created_at 在 48h 內的 incident 觸發背景 AI 分析
48h+ 的舊 incident 不再觸發(仍顯示在列表,只是不重新分析)

2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 02:21:53 +08:00
OG T
e8bf37cfd9 docs(logbook): 最終確認 f5e33da2 全節點 E2E 鏈路打通 (2026-04-16)
- CI 894 完成,f5e33da2 已部署
- flywheel outcome 欄位修復確認
- telegram _send_request 修復確認(零 AttributeError)
- Sweeper:20/20 近48h incidents sweeper_done 標記完整
- E2E 鏈路 7 節點完整流程確認(36 incidents)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 02:18:45 +08:00
AWOOOI CD
381be78344 chore(cd): deploy f5e33da [skip ci] 2026-04-15 17:55:11 +00:00
OG T
588ecfd940 docs(logbook): 2026-04-16 E2E 全節點驗證 + 生產 bug 修復記錄
2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 01:46:39 +08:00
OG T
f5e33da2fc fix(telegram): 修正 _make_request → _send_request 方法名稱不一致
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 15m48s
7 處呼叫 _make_request 但方法實際名稱為 _send_request,
導致 sweeper 分析完後 telegram_decision_push_failed 錯誤。

影響方法:send_push_notification, send_drift_card 等 ADR-071 系列。
_send_request 定義於 line 1272,OTEL 追蹤已含括。

2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 01:44:29 +08:00
OG T
1e86cc2896 fix(flywheel): 修正 incidents.outcomes → outcome 欄位錯誤
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
GET /api/v1/stats/summary 觸發 UndefinedColumnError: column "outcomes" does not exist
實際欄位為 incidents.outcome (json 型別)

2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 01:42:14 +08:00
AWOOOI CD
644cae33c3 chore(cd): deploy 9bfa6fc [skip ci] 2026-04-15 17:37:10 +00:00
OG T
9bfa6fc045 fix(sweeper): 限制只掃 48h 內 incident,防止歷史舊案洗版 Telegram
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
問題:
  首次部署 sweeper 時,找到 117 個無 sweeper_done: 標記的舊 incident
  (最舊 2026-04-09,7 天前) → 觸發全部 LLM 分析
  舊 incident 資料格式 → OPENCLAW_NEMO timeout → Expert System 降級
  confidence=0.2 "降級" → Telegram 連發相同格式告警洗版

修正:
  加入 _MAX_INCIDENT_AGE_HOURS=48 過濾
  只處理 48h 內的 INVESTIGATING incident
  確保 created_at 時區安全(naive → UTC)

2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 01:27:02 +08:00
OG T
0760315059 fix(decision-manager): 修正 CAST 語法 + 關閉 shadow_mode
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
decision_chain_persist_failed 根因:
  asyncpg 不支援 :dc::json 語法 (:: 與具名參數 : 衝突)
  改為 CAST(:dc AS jsonb) — asyncpg 標準寫法

configmap:
  AIOPS_P4_SHADOW_MODE: true → false
  真實主動監控啟用 (proactive_inspector 輸出供 PreDecisionInvestigator 讀取)

2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 01:24:48 +08:00
OG T
20b3fefca7 fix(sweeper): 修正 decision key 格式 BUG (decision:INC-* → sweeper_done:INC-*)
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
根本原因:
  decision token 實際 key 格式為 decision:DEC-{HEX12}
  sweeper 錯誤地查詢 decision:{incident_id} (永遠 = 0)
  → 每 90s 將 186 個 incident 全部列為「未分析」
  → 觸發大量重複 AI 分析請求 (雖 get_or_create_decision 有去重保護)

修正方式:
  改用 sweeper_done:{incident_id} 輕量標記 (TTL 1h)
  分析完成後才設標記,確保失敗的 incident 下輪仍會重試
  get_or_create_decision 內部已有 COMPLETED/READY 去重,雙重保護

2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 01:20:16 +08:00
OG T
bb7441ec8a docs: 更新 CLAUDE.md + HARD_RULES.md v2.0 + LOGBOOK (2026-04-16)
- HARD_RULES.md v2.0: 新增 Self-Loop Workflow、Circuit Breaker Exception、State & Flow Validation
- CLAUDE.md: 補充 §4 必讀Memory 表格
- LOGBOOK: 記錄 AIOps E2E 修復進度

2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 01:20:16 +08:00
AWOOOI CD
3fc2c41216 chore(cd): deploy 457018c [skip ci] 2026-04-15 17:18:47 +00:00
OG T
457018c0f9 fix(decision-manager): AI 分析結果寫入 incidents.decision_chain (DB 長期保存)
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
修復 Gap: decision token 只有 Redis TTL 12min,AI 診斷歷史永久丟失
  - 新增 _persist_decision_to_db() method
  - get_or_create_decision() 完成後 fire-and-forget 寫入 PG
  - 寫入: ts / confidence / risk_level / provider / source / diagnosis[:200]
  - try/except 吞錯不影響主流程,warning log 追蹤

DB/Cache 分層:
  PG (長期): incidents.decision_chain (歷史) + outcomes + KM entries
  Redis (短期): decision token dedup + working memory + playbook cache

2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 01:08:30 +08:00
OG T
ce1a4d286e feat(sweeper): 新增 Incident Analysis Sweeper — 自動觸發未分析 Incident AI 決策
Gap修復:
  Signal Worker 創建 Incident 後,AI 分析只在 GET /api/v1/incidents 被呼叫時觸發
  若前端無人訪問,新 Incident 永遠沒有 AI 分析與 Telegram 通知

解法:
  新增 src/jobs/incident_analysis_sweeper.py
  每 90 秒掃描無 decision token 的 INVESTIGATING incidents
  自動背景觸發 get_or_create_decision() — Semaphore(3) 限流,每批最多 5 筆
  main.py lifespan 啟動時 asyncio.create_task() 掛載

2026-04-16 Claude Sonnet 4.6 Asia/Taipei

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 01:08:30 +08:00
AWOOOI CD
34dd20298a chore(cd): deploy d258a1f [skip ci] 2026-04-15 16:22:45 +00:00
OG T
d258a1fb87 test(ai-router): 更新 DIAGNOSE routing 測試 — None → OPENCLAW_NEMO
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 14m52s
test_diagnose_override_is_none → test_diagnose_override_is_openclaw_nemo
配合 ai_router.py DIAGNOSE 路由修復(Ollama 238s timeout 根因修復)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 00:13:00 +08:00
OG T
d4fed639f6 fix(ai-router): DIAGNOSE 恢復 OPENCLAW_NEMO 路由,修復全部 timeout 降級問題
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 2m16s
根因: 2026-04-12 patch 把 DIAGNOSE 改為 None(複雜度路由)
→ 落入 Rule 6 → Ollama deepseek-r1:14b (CPU 238s) → timeout
→ 降級 20% 信心 + 「待分析」→ 全部 unknown

修復:
1. ai_router.py: DIAGNOSE → OPENCLAW_NEMO(via 188:8088 NVIDIA NIM, 2-27s)
2. ai_router.py: 移除 Rule 6 的 DIAGNOSE deepseek 特殊case(已無用)
3. 04-configmap.yaml: AI_FALLBACK_ORDER 改為 nvidia 優先
   gemini→ollama→nvidia(舊)→ nvidia→gemini→ollama(新)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 00:03:04 +08:00
AWOOOI CD
b55575b56b chore(cd): deploy c9efaa3 [skip ci] 2026-04-15 15:59:47 +00:00
OG T
c9efaa3740 fix(playbook-seed): 修正 get_db_context import 路徑(db.session → db.base)
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
seed 啟動時靜默失敗的根因:
  from src.db.session import get_db_context  ← 模組不存在
  from src.db.base import get_db_context     ← 正確路徑

此 bug 導致 yaml_rule playbooks 完全無法建立。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 23:49:56 +08:00
AWOOOI CD
7d3391cb69 chore(cd): deploy 800ab16 [skip ci] 2026-04-15 15:41:49 +00:00
OG T
800ab1685f fix(playbook+flywheel): 修復 PlaybookSource enum + repair_steps 相容 + KM stats raw SQL
Some checks failed
CD Pipeline / build-and-deploy (push) Successful in 14m58s
Type Sync Check / check-type-sync (push) Failing after 1m17s
修復三個串聯 bug,讓 Playbook seed 能正常執行:

1. PlaybookSource 新增 YAML_RULE enum(alert_rules.yaml 匯入專用)
2. playbook_seed_service: source=YAML_RULE,dedup 改用 raw SQL by name,
   不再呼叫 list_playbooks(舊格式 repair_steps 會 validation error)
3. playbook_repository._orm_to_pydantic: 舊格式 repair_steps 補齊
   step_number/action_type 必填欄位(向下相容)
4. flywheel_stats_service: embedding IS NULL 改用 raw SQL,
   修復 KnowledgeEntryRecord ORM 無 embedding 屬性的 AttributeError

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 23:32:04 +08:00
AWOOOI CD
4bee14ae08 chore(cd): deploy 77a92eb [skip ci] 2026-04-15 14:39:13 +00:00
OG T
77a92eb469 feat(P6): 提交 offline_replay_service + model_rollback_service (漏提)
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 14m59s
Phase 6 ADR-087 治理閉環兩個核心服務,
之前建立後沒有 git add,一直是 untracked 狀態。

2026-04-15 Claude Sonnet 4.6 Asia/Taipei
2026-04-15 22:29:09 +08:00
OG T
85c4e3b434 fix(km): 修復 KM 寫入全為 unknown 的根因 (三個節點)
Some checks are pending
CD Pipeline / build-and-deploy (push) Has started running
Bug-A: approval_execution.py 呼叫不存在的 get_incident() → AttributeError
被 except 吞掉 → alertname/alert_category/affected_services 全用預設值
修復: 改用 get_from_working_memory() + get_from_episodic_memory() 雙路徑

Bug-B: _record_to_incident() 從 PG 還原 Incident 時漏掉
notification_type + alert_category 欄位 → km_conversion 讀到 None
修復: 加入這兩個欄位的還原

Bug-C: main.py working_memory_warmup 重建 Incident 時同樣遺漏
notification_type + alert_category
修復: 同步補上

2026-04-15 Claude Sonnet 4.6 Asia/Taipei
2026-04-15 22:28:48 +08:00
AWOOOI CD
65c8eb587c chore(cd): deploy 256a24e [skip ci] 2026-04-15 14:20:27 +00:00