OG T
|
457018c0f9
|
fix(decision-manager): AI 分析結果寫入 incidents.decision_chain (DB 長期保存)
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
|
ecfb7148bf
|
fix(prod): 接通 YAML 規則引擎與自動執行路徑 — 架構核心斷點
CD Pipeline / build-and-deploy (push) Has started running
架構斷點根因:
YAML 規則引擎(alert_rules.yaml)是人工審閱的權威動作來源,
但自動執行路徑只讀 proposal_data["kubectl_command"](LLM 生成),
兩者完全脫節 → HostHighCpuLoad 得到 kubectl restart,DockerContainerUnhealthy
的 SSH 指令被 LLM 的 kubectl 覆蓋。
修復策略:
在 auto_execute 入口,先查 YAML match_rule:
1. YAML → NO_ACTION(如 HostHighCpuLoad)→ 立即返回,不執行任何操作
2. YAML → 非 kubectl 指令(如 ssh docker restart)→ 覆蓋 LLM action,
後續 infrastructure SSH 路由才能生效
影響:
- HostHighCpuLoad / NodeCPUUsageHigh → 停止自動執行,降級人工審核
- DockerContainerUnhealthy → SSH docker restart(若 labels 有 host/container)
2026-04-15 ogt + Claude Sonnet 4.6(亞太): 生產緊急修復第三批
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-15 21:50:25 +08:00 |
|
OG T
|
3696fb5938
|
fix(prod): 修復 host_resource 誤發 K8s kubectl + 自動執行重複風暴
CD Pipeline / build-and-deploy (push) Has been cancelled
1. decision_manager: host_resource 告警(HostHighCpuLoad 等)
不得執行 kubectl 操作 → 降級人工審核
根因:原本只擋 infrastructure,host_resource 漏進 K8s 路徑
→ 導致 kubectl rollout restart deployment/HostHighCpuLoad 被真實執行
2. decision_manager: auto_execute 路徑補入 Redis cooldown
同一 target 5 分鐘內最多自動執行 2 次,防止 awoooi-worker 3x 風暴
根因:decision_manager 自動執行路徑完全無冷卻保護
2026-04-15 ogt + Claude Sonnet 4.6(亞太): 生產緊急修復第二批
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-15 21:45:46 +08:00 |
|
OG T
|
67f437043a
|
fix(prod): 修復四個生產致命 bug — outcome 寫入 / OpenClaw / Telegram 通知 / LLM 規則顯示
CD Pipeline / build-and-deploy (push) Has been cancelled
1. decision_manager: 移除 UPDATE incidents 中的 verification_result 欄位
(incidents 表無此欄位 → 所有 outcome 寫入失敗 outcome_write_failed)
2. failure_watcher: get_openclaw_service → get_openclaw
(函數名錯誤 → OpenClaw 分析全部 ImportError 崩潰)
3. failure_watcher: tg.send_message → tg.send_notification
(TelegramGateway 無 send_message 方法 → 修復通知無法送出)
4. decision_manager: expert_analyze 補齊 initial_diagnosis / diagnosis_description key
(openclaw.py 讀這兩個 key,但 expert_analyze 只有 matched_rule / description
→ LLM 永遠看到 Matched Rule=unknown,無法正確分析)
2026-04-15 ogt + Claude Sonnet 4.6(亞太): 生產緊急修復
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-15 21:41:31 +08:00 |
|
OG T
|
65838708ce
|
fix(format): 剩餘 send_notification raw text 改為 ADR-075 TYPE-X 格式
CD Pipeline / build-and-deploy (push) Successful in 18m11s
- decision_manager.py: 自動修復通知改為 TYPE-2 ├─/└─ 樹狀格式
- gitea_webhook_service.py: Code Review 通知改為 TYPE-1 格式,移除 ═══ border
至此所有 3 個外部 send_notification 呼叫者均符合 ADR-075 格式規範:
1. ai_router.py — TYPE-1 AI Provider 不可用(已於 3ce5025 修復)
2. decision_manager.py — TYPE-2 自動修復完成/失敗(本 commit)
3. gitea_webhook_service.py — TYPE-1 Code Review(本 commit)
2026-04-15 ogt + Claude Sonnet 4.6(亞太): Phase 6 format enforcement
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-15 20:05:49 +08:00 |
|
OG T
|
fab65e7d7a
|
fix(alerts): PENDING 收斂無 TTL → 老記錄永久封鎖 Telegram 告警
CD Pipeline / build-and-deploy (push) Has started running
根因:find_by_fingerprint 的 PENDING 匹配條件無時間上限,
2026-04-12 建立的 3 筆 PENDING approval records(hit=77/30/17)
持續吃掉所有同指紋告警,造成 2+ 小時 Telegram 靜音。
修正(approval_db.py):
- PENDING_TTL_HOURS = 24:PENDING 記錄逾 24h 不再收斂新告警
- 原本:OR(status=PENDING, created_at>=30min前)
- 修正:OR(PENDING AND created_at>=24h前, created_at>=30min前)
緊急修復:kubectl exec 直接將 7 筆過期 PENDING 記錄設為 expired,
即時恢復 Telegram 告警流(不等部署)。
Phase 6 AI 自我治理閉環(ADR-087):
- feat(db): 新增 ai_governance_events 表 + 3 個 index(base.py + models.py)
- feat(svc): ai_slo_calculator.py — 7d 滾動 SLO(success/override/false_neg)
- feat(svc): trust_drift_detector.py — Playbook 信任度極端偏態偵測
- feat(job): kb_rot_cleaner.py — K8s API/Prom metric/老舊 incident_case 腐爛清理
- feat(svc): decision_manager.py — 自我降級守衛(SLO 違反 → 提高門檻/保守模式)
2026-04-15 ogt + Claude Sonnet 4.6(亞太)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-15 18:56:26 +08:00 |
|
OG T
|
655d1a568a
|
feat(Phase 5): Declarative 修復抽象化 + Blast Radius 分控 全部完成
CD Pipeline / build-and-deploy (push) Has been cancelled
## Phase 5 交付(ADR-086)
### 新增服務(4 個)
- blast_radius_calculator.py: 爆炸半徑計算器(0-100 純函數)
- 18 種 kubectl 動作基礎分 + 命名空間倍率 + 特殊 flag 修正
- HARD_RULES 永擋:delete ns/pv/pvc/clusterrole + rm -rf + DROP TABLE
- 分級:≤10 auto / 11-50 human / 51-99 dual / 100 blocked
- declarative_remediation.py: DeclarativeSpec 不可變規格(frozen dataclass)
- evaluate() 封裝 Blast Radius + dry-run + rollback_plan + constraints
- rollback_plan 從 kubectl 動作類型自動推導(不呼叫 LLM)
- gitops_pr_service.py: Gitea Issue 高風險修復審核(tier=dual)
- 含 Blast Radius + 目標狀態 + 回滾計畫 + 雙人審核流程
- AIOPS_P5_GITOPS_PR flag 守衛
- rollback_manager.py: 驗證失敗自動回滾
- 先驗 rollout history ≥ 2 revision,防止無版本可回滾
- kubectl rollout undo + 120s 收斂等待
### decision_manager.py 接線(AIOPS_P5_BLAST_RADIUS_CHECK)
- _auto_execute() 在安全守衛後、ApprovalRequest 前插入分級守衛
- blocked → 永擋 + 人工審核通知
- dual → 非同步 GitOps Issue + 升級人工審核
- human → 升級人工審核(不自動執行)
- auto(≤10)→ 原有自動執行流程
- 失敗降級:計算異常 → 保守升人工
### learning_service.py
- record_declarative_outcome(): 記錄 DeclarativeSpec 執行結果
anomaly_key=declarative:{incident_id},含 blast_radius_score/tier/rollback
2026-04-15 ogt + Claude Sonnet 4.6(亞太): Phase 5 全部完成
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-15 16:06:54 +08:00 |
|
OG T
|
7da64eaad2
|
feat(Phase 3): 學習閉環重建 — 三根因修復 + 2x EWMA + Evolver Agent
CD Pipeline / build-and-deploy (push) Failing after 19m7s
Type Sync Check / check-type-sync (push) Failing after 1m18s
ADR-083 Phase 3 學習閉環重建:
**三根因修復**
- approval_execution.py: fire-and-forget create_task → await asyncio.wait_for(timeout=30) × 2
(成功路徑 L265 + 失敗路徑 L353,超時記錄 learning_trigger_timeout metric,主流程不 crash)
- models/approval.py: ApprovalRequestBase 新增 matched_playbook_id 欄位
- decision_manager.py: _auto_execute 建立 ApprovalRequest 時填充 matched_playbook_id
- learning_service.py: 雙路徑查找 _matched_pb_id(matched_playbook_id + metadata fallback)
**2x EWMA 負向強化**
- models/playbook.py: 新增 trust_score: float = 0.3(EWMA 動態信任度欄位)
- repositories/playbook_repository.py: update_stats 加 EWMA
成功: trust = 0.9 × old + 0.1 × 1.0
失敗: trust = 0.8 × old + 0.2 × 0.0(衰減速度 2x)
trust < 0.1 → log warning,等 Evolver 封存
**Evolver Agent(新建)**
- services/playbook_evolver.py: 三功能全靜態規則
1. 低信任封存: trust < 0.1 → DEPRECATED
2. 休眠封存: 30d 未使用 AND trust < 0.5 → DEPRECATED
3. 相似合併: 症狀 Jaccard > 0.9 → 保留高 trust,封存低 trust
AIOPS_P3_EVOLVER_ENABLED=False 預設關閉
**文件**
- ADR-083 學習閉環重建
- MASTER §8 Phase 3 完工記錄
AIOPS_P3_ENABLED=False(預設),骨架就位等統帥批准開啟
Co-Authored-By: Claude Sonnet 4.6(亞太)<noreply@anthropic.com>
|
2026-04-15 14:01:37 +08:00 |
|
OG T
|
5ddba6d6e0
|
feat(adr-082): Phase 2 多 Agent 協作 — 5 角色辯證系統骨架上線
新增 5 個 Agent + Orchestrator + DecisionManager 接線:
- protocol.py: DiagnosisReport / ActionPlan / ReviewVerdict / CriticReport / DecisionPackage 型別系統
- DiagnosticianAgent: RCA 根因分析,confidence < 0.4 → ABSTAIN
- SolverAgent: 修復方案軍師,blast_radius 評分 + 降級 rule-based mock
- ReviewerAgent: 安全審查,HARD_RULES 靜態 pattern + blast_radius 閾值 (>50 revision, >80 reject)
- CriticAgent: 刻意唱反調,強制 3 問批判性思維,critical challenge → REJECT
- CoordinatorAgent: 純規則聚合,6 級決策閘,REQUEST_REVISION → 強制人工
- AgentOrchestrator: 30s 全局超時,Reviewer ‖ Critic 並行,DB Immutable Event Sourcing + Redis Streams
- DecisionManager: AIOPS_P2_ENABLED gate + _package_to_proposal_data 橋接既有 proposal_data 格式
- AgentSession DB table + 4 個複合 index
- ADR-082 決策記錄
Gate 2 修復(7 項):
- CRITICAL: DELETE FROM regex lookahead 位置錯誤(移至 FROM 後)
- CRITICAL: REQUEST_REVISION 可抵達 auto-execute 路徑(改回 requires_human_approval=True)
- IMPORTANT: _extract_json flat regex 不支援巢狀 JSON(改 find/rfind 邊界提取)
- IMPORTANT: all_degraded 遺漏 verdict.degraded(補全 4 個 Agent)
- IMPORTANT: Solver ABSTAIN guard 放行降級假設(改為無論 hypotheses 有無均跳過)
- IMPORTANT: dataclasses.asdict() Enum 未序列化導致 DB 寫入靜默失敗(加 json.dumps default handler)
- IMPORTANT: P2 gate 直讀屬性繞過父 Phase 守衛(改用 is_phase_enabled(2))
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-15 13:48:55 +08:00 |
|
OG T
|
f1cbf6db7d
|
feat(adr-081): Phase 1 感官縱深 — 8D 情報蒐集 + 執行後驗證
成品:
- IncidentEvidence DB model(8D 感官 + pre/post 執行狀態)
- EvidenceSnapshot dataclass(build_summary → LLM 上下文)
- SanitizationService(Prompt Injection 0-tolerance,12 pattern)
- MCPToolRegistry(動態工具登記,suggest_tools 不寫死告警類型)
- PreDecisionInvestigator(8D 並行感官,P99 < 8s,Redis 30s 快取)
- PostExecutionVerifier(warmup 10s → 後狀態評估 success/degraded/failed)
- decision_manager + approval_execution 接線(feature flag 守衛)
Gate 1 修復:D4/D5/D7/D8 補 sanitize_dict_values;移除裸 "error" failure
signal 防 error_rate key 誤判;evidence_snapshot rowcount 零行警告。
測試:130 passed(+111 新增)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-15 13:08:38 +08:00 |
|
OG T
|
6c7f648b60
|
fix: 3 個飛輪沉默未打通節點 — 統帥截圖盤出
CD Pipeline / build-and-deploy (push) Successful in 18m56s
統帥截圖證據 (Telegram MEDIUM 告警仍走人工審核):
INC-20260411-A03B2E / A2BB29 顯示「[規則匹配]」+ action=unknown-service
節點 1: AutoApprovePolicy 擋下規則匹配 (飛輪主因)
- ADR-073 規則匹配 confidence=0.0 (防偽造)
- AutoApprovePolicy.min_confidence=0.50 → 擋下
- 結果: MEDIUM 規則匹配永遠人工審核,飛輪不轉
修復: auto_approve.py 加 _is_rule_based 判斷
(is_rule_based / source=expert_system / rule_id / matched_rule)
→ bypass min_confidence 檢查
→ 驗證: should_auto_approve=True ✅
節點 2: _is_bad_target 漏 unknown-service magic string
- _resolve_target_from_k8s fallback 產 unknown-service / unknown-pod
- GAP-A4 Phase 1/2 只擋 'unknown' 而非前綴
修復: alert_rule_engine.py 加 unknown-/none-/null-/undefined- 前綴黑名單
→ 驗證: 4 個 magic 全 bad ✅
節點 3: stale_ready_tokens_resend 無時效過濾
- 截圖是 2026-04-11 (4 天前) 告警
- 舊 labels 過期,重 process 也產不出新 target
- 壓爆 Ollama + 污染 Telegram 卡片
修復: decision_manager.py 跳過 > 3 天的 stale incident
→ skip + log stale_ready_token_skipped_too_old
回歸: 113/113
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
2026-04-15 10:56:48 +08:00 |
|
OG T
|
ca862c5575
|
fix(GAP-A4 Phase 2): LLM 路徑 target 救援 — 解開 12 次飛輪攔截
CD Pipeline / build-and-deploy (push) Has been cancelled
統帥全景報告診斷(2026-04-14 20:00):
2h 內 12 次 auto_execute_blocked_unresolved_placeholder
全是 LLM 直接產出 `kubectl ... deployment HostHighCpuLoad`
GAP-A4 Phase 1 只修了 alert_rule_engine._extract_vars
但 LLM 在 decision_manager 路徑沒做同樣檢查 → 12 次擋下 → 0 KM 0 飛輪
修復 (decision_manager._auto_execute placeholder 替換後):
1. 從 action regex 提取 deployment 名(kubectl ... deployment XXX)
2. 套用 alert_rule_engine._is_bad_target() 驗證
3. 若是垃圾(==alertname/unknown/IP)→ 從 incident.signals[0].labels
重推 (用 _extract_vars 同一套 multi-layer 邏輯)
4. 若有合法 target → action.replace(llm_target, good_target)
5. 若 labels 也救不了 → log target_rescue_failed → safety guard 處理
效果:
- KubePodCrashLooping (有 deployment label) → LLM 即使填錯也救回
- HostHighCpuLoad (純主機,無 K8s label) → 仍進 safety guard,
但 log 變 target_rescue_failed 而非 unresolved_placeholder
- 12 次飛輪攔截可望大幅減少
回歸:66/66 (GAP-A4 + kubectl validation) 全過
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
2026-04-14 20:06:05 +08:00 |
|
OG T
|
8b7e9cbfb8
|
fix(BLOCKER): LLM 連續失敗 — 4 個違反設計處全部修復
CD Pipeline / build-and-deploy (push) Successful in 14m21s
統帥盤點發現飛輪沉默真因:4 個違反既定架構設計的 bug 同時撞車。
P0a — Ollama timeout 違反 GAP-B4 設計
config.py:OPENCLAW_TIMEOUT 從 120s 改 30s
原 120s 違反 ADR-052 GAP-B4 (LLM 25s hard timeout) 設計
致 Ollama 過載時 thread 飢餓 120s 才降級
P0b — AI Router silent skip 觀測性修復
ai_router.py: not_registered/circuit_open/rate_limit/privacy_skip
全部累積到 errors 陣列,log all_providers_failed 時可知為何 skip
原本 errors=["ollama: Timeout"] 但 tried=4 個,無法診斷
P1a — send_text 方法不存在 bug
ai_router.py:1005 tg.send_text() → tg.send_notification(parse_mode=HTML)
TelegramGateway 只有 send_notification 沒 send_text
致 fallback 失敗通知本身失敗(雙重靜默)
P1b — resend_stale_ready_tokens 並發爆炸
decision_manager.py: 加 asyncio.Semaphore(5) + 200ms throttle
原本 fire_and_forget N 個 task 同時跑,N=108 時 Ollama embedding
全部 timeout,包括我打的 live-fire 也被擠爆
改:max 5 並發 + 每完成喘 200ms
CD 流程審查 (Blocker 1): 完全符合 ADR-039 設計,10-15 min 是預期
不需修,是設計就需要這時間。
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
2026-04-14 19:37:03 +08:00 |
|
OG T
|
dd0a778e1f
|
feat(GAP-B4): LLM 超時降級扶梯 — 精確化內層 timeout
CD Pipeline / build-and-deploy (push) Successful in 14m19s
_dual_engine_analyze 強化(2026-04-14 Claude Sonnet 4.6):
- OpenClaw LLM 呼叫獨立 25s hard timeout(留 5s 給後續處理)
- 超時時明確 llm_timeout_fallback 日誌,立即降級 Expert System
- NemoClaw second opinion 加 3s timeout(advisory 不拖累主流程)
- 保留外層 decide() 30s wait_for 作為 defence-in-depth
為何要做:
- 外層 30s 會把 LLM 卡死整段吃光,thread pool 可能飢餓
- 內層 25s 更早降級 → Expert System 仍能在 SLA 內回應
- LLM timeout 與其他異常用不同日誌標記,便於 SLO-2 監控
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
2026-04-14 15:51:23 +08:00 |
|
OG T
|
c0ba1000f3
|
Revert "fix(auto-repair): 中低風險+無kubectl_command → TYPE-1 純資訊,不顯示審核按鈕"
This reverts commit abf1ffa91e7327a36af93be2742d53dac1933f0d.
|
2026-04-14 13:33:24 +08:00 |
|
OG T
|
2df4945880
|
fix(auto-repair): 中低風險+無kubectl_command → TYPE-1 純資訊,不顯示審核按鈕
問題: HostHighCpuLoad 等主機層告警 affected_services=[] → OpenClaw 生成
kubectl unknown → safety guard 攔截 → 退回 READY + TYPE-3 帶按鈕卡片
用戶一直看到帶按鈕的中/低風險告警,按鈕無法修復任何東西
修復三處:
1. openclaw.py: _call_openclaw_analyze() 回傳 suggested_action 欄位
+ target_resource 預設改為 "" (避免 "unknown" 進入 safety guard)
2. decision_manager.py: classify_notification() 傳入
suggested_action / risk_level / has_kubectl_command
3. telegram_gateway.py: classify_notification() 新規則 —
無 kubectl_command + risk=low/medium + action=investigate/no_action
→ TYPE-1 (純資訊,無按鈕)
搭配 clawbot-v5 f4b84d7 (OpenClaw prompt CRITICAL RULES) 一起生效
2026-04-14 Claude Sonnet 4.6 Asia/Taipei
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-14 13:33:24 +08:00 |
|
OG T
|
9c8dde0951
|
fix(telegram): 修復 Incident 無 title 欄位導致所有 Telegram 推送失敗
CD Pipeline / build-and-deploy (push) Failing after 2m3s
根因: _push_decision_to_telegram() 有兩處引用 incident.title,
但 Incident model 從來沒有此欄位,導致所有告警卡片推送都
拋 AttributeError,事件在 telegram_decision_push_failed 靜默失敗。
修法:
- line 188: message 改用 signal annotation summary/description/alert_name
- line 249: TYPE-1 title 改用 alertname label / signal.alert_name
影響: 自從 decision_manager 加入這兩行以來,所有 Telegram 通知都沒發出
(包含 TYPE-1 資訊通知和 TYPE-3 審批卡)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-12 21:02:55 +08:00 |
|
OG T
|
a5f17cea79
|
fix(notification): TYPE-1 backup/info 告警不再發審批卡
CD Pipeline / build-and-deploy (push) Has been cancelled
classify_notification() 不知道 alert_category,對 backup 告警
(confidence=0, auto_executed=False)返回 TYPE-3,覆蓋掉
classify_alert_early() 已設好的 notification_type=TYPE-1。
修法:在路由分支前,讓 incident.notification_type 明確值
(TYPE-1 / TYPE-4D / TYPE-8M)覆蓋 classify_notification()。
影響:backup/info/watchdog 告警只發 send_info_notification(),
不再噴帶按鈕的審批卡到 Telegram。
2026-04-12 ogt (ADR-075 bugfix)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-12 19:49:31 +08:00 |
|
OG T
|
bc2665ef6b
|
feat(adr075): Step-5 decision_manager TYPE-5S/TYPE-6B 路由分支
CD Pipeline / build-and-deploy (push) Has been cancelled
- 新增 secops elif:alert_category=secops → send_secops_card()
(resource, threat_behavior 從 incident.signals labels 提取)
- 新增 business elif:alert_category=business → send_business_alert()
(metric_name/current_value/threshold 從 Prometheus labels 提取)
- TYPE-7E escalation_monitor 標記 out-of-scope (ADR-075 範疇外)
- 兩分支均加 2026-04-12 ogt (ADR-075 Step-5) 變更標記
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-12 19:12:35 +08:00 |
|
OG T
|
1cb654cf59
|
fix(adr-075): CR P0/P1 修補 — TYPE_8M enum + 死碼清理 + docstring 更新
CD Pipeline / build-and-deploy (push) Has been cancelled
P0-2: NotificationType 新增 TYPE_8M = "TYPE-8M"
classify_notification 早期回傳 TYPE-8M
decision_manager 改用 NotificationType.TYPE_8M enum 比較(移除字串字面量)
P1-1: 移除 _CATEGORY_BUTTONS 中不可達的 alertchain_health/flywheel_health 條目
P1-4: test_classify_alert_early.py docstring 更新為 13 條規則/10 分類
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-12 18:44:12 +08:00 |
|
OG T
|
561c1d806b
|
feat(adr-075): Phase 2 — TYPE-8M 飛輪/告警鏈路健康通知格式與路由
CD Pipeline / build-and-deploy (push) Failing after 4m0s
新增 send_meta_alert() — ⚙️ META SYSTEM 卡片(觸發診斷/查看面板/靜默)
decision_manager 新增 TYPE-8M elif 分支(在 TYPE-4D 後)
_alert_category 提取提前至 if 鏈前,三個分支共用
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-12 18:39:04 +08:00 |
|
OG T
|
2cef2098d3
|
feat(adr-075): 修復 Telegram 動態按鈕 4 個斷點 + 新增 7 種告警分類
CD Pipeline / build-and-deploy (push) Has been cancelled
斷點 A: decision_manager 提取 alert_category/notification_type 傳入 send_approval_card
斷點 B: send_approval_card 新增參數並傳遞至 _build_inline_keyboard
斷點 C: 互動型通知 (TYPE-3/4/4D/8M) 禁止發 SRE 群組,防 nonce 洩漏
斷點 D: _CATEGORY_BUTTONS k8s_workload → kubernetes + 新增 6 類按鈕組
classify_alert_early 新增: alertchain_health, flywheel_health, storage,
devops_tool, external_site, ssl_cert, host_resource (從 infrastructure 分離)
Test: 52 classify + 664 total passed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-12 18:35:56 +08:00 |
|
OG T
|
c09521a1c6
|
fix(cr): Code Review P0/P1 全修補 — 積木化+SSH路由+安全守衛順序
CD Pipeline / build-and-deploy (push) Failing after 2m30s
P0-1: classify_alert_early 移至 incident_service (Service層),webhooks.py import 修正
P0-2: _ssh_execute() 改用 self._ssh,移除冗餘 SSHProvider() 實例化
P1-1: infrastructure SSH routing 移至 kubectl safety guard 之前,docker指令不再被攔截
P1-2: alert_rule_engine 新增 get_risk_for_alertname() public API
P1-3: classify_notification() docstring 修正 ORM→Pydantic
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-12 14:51:12 +08:00 |
|
OG T
|
dbc77c5e62
|
feat(flywheel): Phase 3 — decision_manager Tier 3 七大修復 (首席架構師授權)
CD Pipeline / build-and-deploy (push) Has been cancelled
ADR-073 Phase 3 全部完成:
3-1: TYPE-1 triage guard
- get_or_create_decision() 入口: notification_type=TYPE-1 直接 bypass LLM 分析
- classify_notification() 優先讀 incident.notification_type (早期分診結果)
- ConfigurationDrift/KubeConfigDrift 補入 TYPE-4D 匹配清單
3-2: infrastructure → SSH MCP routing
- _auto_execute() 中 alert_category=infrastructure + 非 kubectl action → _ssh_execute()
- _ssh_execute(): docker_restart / service_restart tool 路由
- 取 instance label 對應 SSH_MCP_ALLOWED_HOSTS 白名單主機
3-3: send_info_notification() TYPE-1 已存在,classify_notification 修復確保正確呼叫
3-4: Dynamic button builder 已存在 _build_inline_keyboard + _CATEGORY_BUTTONS
3-5: action | parse fix
- _auto_execute() 開頭: action 含 | 時取第一段 (LLM 有時輸出 "kubectl X | kubectl get")
3-6: risk_level YAML priority override LLM
- dual_engine_analyze() LLM 結果返回後,用 alert_rules.yaml 對應 rule.risk 覆蓋
3-7: send_drift_card() TYPE-4D 已存在,classify_notification 修復確保正確觸發
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-12 14:39:19 +08:00 |
|
OG T
|
184b37a8b1
|
refactor(decision_manager): I2 DI 化 MCP Providers + fix config list type bug
- DecisionManager.__init__ 注入 SSHProvider/K8sProvider,移除函數內 import+實例化
- config.get_tg_user_whitelist() 支援 list 輸入(monkeypatch/直接傳入),修復 AttributeError
- LOGBOOK 更新(test fix 6e0ee8b)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-12 13:04:46 +08:00 |
|
OG T
|
8be87b0f32
|
fix(review): 首席架構師 Code Review — c439277 Tier 3 紅區修補
CD Pipeline / build-and-deploy (push) Failing after 8m39s
Critical:
- C1: decision_manager _collect_mcp_context container 變數 Python ternary 優先度 bug 修正
原: `A or B or C[0] if list else ""` (ternary 控制全式)
修: `A or B or (C[0] if list else "")` (明確括號)
- C2: 所有 MCP 呼叫加 asyncio.wait_for timeout=5s,防止阻塞決策主路徑
同時加 unknown host warning log (C4)
- C3+M1: _DESTRUCTIVE_PATTERNS 補全移至模組頂層常量
新增: delete pods(複數)/kubectl drain/kubectl cordon/kubectl rollout undo/
docker rm/docker stop/docker kill/rm -rf/"replicas": 0(JSON patch)
Important:
- I1: webhooks.py IP 排除改用 is_internal_ip() 支援全 RFC-1918 (10.x/172.16-31.x/192.168.x)
- I4: 新增 test_destructive_patterns.py — 25 測試全過
涵蓋: 常量存在、攔截、誤攔迴歸、critical 永遠攔截
🔴 Tier 3 紅區 — 首席架構師 Code Review 通過後 push
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 22:05:52 +08:00 |
|
OG T
|
c439277fc3
|
feat(aiops): ADR-070 全自動化方向 — 三大修復
CD Pipeline / build-and-deploy (push) Has been cancelled
1. auto_approve.py: 允許 high risk 自動執行 (low/medium/high 全開放)
- min_confidence 0.65→0.50 (信心門檻降低)
- 新增 DESTRUCTIVE_PATTERNS 攔截真正危險指令
(scale=0, delete deployment/pvc/namespace, drop table)
- 核心: critical + 破壞性操作 → 人工; 其他 → 全自動
2. decision_manager.py: 新增 _collect_mcp_context()
- LLM 分析前先收集真實環境狀態 (SSH/K8s MCP)
- Host/Docker 告警 → ssh_get_container_status + ssh_get_top_processes
- K8s 告警 → k8s_get_events
- 注入 diagnosis_context "當前環境狀態 (MCP 實時查詢)" 區段
3. webhooks.py: 修復 target_resource 提取
- 新增 name/container/job label 提取
- DockerContainerUnhealthy 不再 target=alertname
- IP 位址自動排除 (192.x 開頭不作為 target)
🔴 Tier 3 紅區 — 需首席架構師批准
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 21:39:52 +08:00 |
|
OG T
|
b2dfcf9b0d
|
fix(telegram): safety guard 攔截改發人工審核卡片,不再發 ❌ 失敗訊息
問題:AI 無法確認 deployment name 時,每次告警都發一條
「❌ 自動修復失敗 kubectl scale deployment unknown」的垃圾訊息
修復:
- safety guard 攔截 → token.state 回 READY(非 ERROR)
- 改呼叫 _push_decision_to_telegram,發 TYPE-4 人工審核卡片
- mcp_all_failed=True 讓 classify_notification 選 TYPE-4
- K8s 找不到 target 的路徑同樣處理
效果:統帥看到的是「需要人工介入的審核卡片」而非「修復失敗」錯誤訊息
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 21:33:19 +08:00 |
|
OG T
|
f2c18c4e63
|
feat(D1): models.json 集中化 — ADR-067 五大 Ollama 應用 hardcode 消除
CD Pipeline / build-and-deploy (push) Successful in 12m56s
- models.json v1.3.0: providers.ollama.models 新增 9 個 purpose keys
(drift_summary/drift_intent/log_anomaly/nemoclaw/playbook_draft/
code_review/embedding/rag_generate/image_analysis)
- drift_narrator_service: NARRATOR_MODEL → get_model("ollama","drift_summary")
- drift_interpreter: MODEL → get_model("ollama","drift_intent")
- log_summary_service: SUMMARY_MODEL → get_model("ollama","log_anomaly")
- local_code_review_service: _MODEL_OLLAMA → get_model("ollama","code_review")
- image_analysis_service: _MODEL → get_model("ollama","image_analysis")
- decision_manager: nemoclaw + playbook_draft 兩處 → get_model()
- embedding_service: get_embedding_service() factory → get_model("ollama","embedding")
- knowledge_service: OllamaEmbeddingService(model=...) → get_model()
所有模型名稱現在統一由 models.json 管理,修改模型只需改一個檔案。
LOGBOOK 更新:D1 完成 + B2 已完成確認
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 20:45:53 +08:00 |
|
OG T
|
82e1c05df8
|
fix(review): Code Review C1/C2/I2/M2 修補
CD Pipeline / build-and-deploy (push) Has been cancelled
C1 drift_interpreter: 寫死 192.168.0.111 → settings.OLLAMA_URL
違反 feedback_frontend_internal_ip_ban 鐵律(後端 service 層同樣禁止寫死內網 IP)
C2 km_conversion_service: BUG-004 補同步 Redis Working Memory vectorized 欄位
原修復只更新 DB,Redis incident:{id} JSON 的 vectorized 未同步
→ 審計查 Redis 仍顯示 False,fly-wheel 閉環指標仍不準
修復:DB 更新後 GET → JSON patch vectorized=True → SET(保留原 TTL)
I2 decision_manager: _ALERTNAME_KEYWORDS HostHighDiskUsage→HostOutOfDiskSpace
+ 補 DockerContainerExited
+ fallback 路徑加 debug log
M2 decision_manager: import json as _json 從 for 迴圈移至方法頂部
docs: ADR-072 新增 Code Review 發現與技術債記錄
2026-04-11 Claude Sonnet 4.6 Asia/Taipei
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 20:36:59 +08:00 |
|
OG T
|
e447f97616
|
fix(telegram): 接通 classify_notification + 修復 HostBackupFailed 亂送按鈕
三個問題同時修復:
1. classify_notification() 死程式碼接通
- _push_decision_to_telegram() 現在先呼叫 classify_notification()
- TYPE-1 (純資訊) → send_info_notification(),無按鈕
- TYPE-4D (Config Drift) → send_drift_card()
- 其餘 TYPE-2/3/4 → send_approval_card()(原有按鈕)
- decision_state + auto_executed 從呼叫端注入 proposal_data
2. alert_rules.yaml 補 host_backup_failed 規則
- HostBackupFailed / VeleroBackupFailed / VeleroBackupNotRun → NO_ACTION
- 不再走 generic_fallback → 不再產生 kubectl rollout restart deployment/backup
3. _verify_k8s_deployment_exists() 主機層告警不再保守放行
- Host*/Docker*/Backup*/Velero*/SSH* 前綴告警 → K8s MCP 不可用時 return False
- _auto_execute() 收到 NO_ACTION 或空 kubectl_command → 早退,不執行
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 20:35:48 +08:00 |
|
OG T
|
5aa0244c9a
|
fix(aiops): ADR-072 P1 Bug 修復 — BUG-004/005/006
CD Pipeline / build-and-deploy (push) Has been cancelled
BUG-004 KM vectorization 108/112 = False:
km_conversion_service: KM entry 建立後(embedding 已背景觸發),
補寫 incidents.vectorized = True,飛輪閉環(ADR-068)學習指標正常
BUG-005 15 ready decisions 無人審核:
decision_manager: 新增 resend_stale_ready_tokens(),
掃描 Redis decision:* key,找出 state=ready 且 dedup_key 過期的 token,
重新推送 Telegram 審核卡片
main.py: lifespan startup 排程 resend_stale_ready_tokens()(asyncio.create_task 非阻塞)
BUG-006 outcome/verification_result 全 null:
_push_auto_repair_result: Telegram 推送前先寫入
incidents.outcome + incidents.verification_result 到 DB
2026-04-11 Claude Sonnet 4.6 Asia/Taipei
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 20:24:41 +08:00 |
|
OG T
|
2185e1755c
|
fix(aiops): ADR-072 P0 Bug 修復 — BUG-001/002/003
CD Pipeline / build-and-deploy (push) Has started running
BUG-001 drift_interpreter: nvidia_provider 已重構為 NvidiaProviderResult 物件(非 4-tuple)
→ 改用 Ollama httpx 直接呼叫 qwen2.5:7b-instruct,繞過 nvidia_provider
→ 消除所有 K8s config drift 告警的 "too many values to unpack" 永久失敗
BUG-002 deployment_name="unknown": 主機層告警(HostHighCpuLoad 等)無 component/job/pod label
→ _auto_execute() 新增 _resolve_target_from_k8s() 補救
→ K8s MCP kubectl get pods 動態查詢受影響 Pod,去掉 hash suffix 得到 deployment name
BUG-003 無效 deployment 通過 safety guard:
→ _auto_execute() safety guard 通過後加入 _verify_k8s_deployment_exists() 存在性確認
→ K8s 中找不到 deployment/pod → 拒絕執行,寫入 DecisionToken.error
→ K8s MCP 不可用時保守放行(不阻塞主流程)
2026-04-11 Claude Sonnet 4.6 Asia/Taipei
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 20:20:39 +08:00 |
|
OG T
|
f3236338a5
|
fix(security): Code Review P0+P1+P2 全修補 — MCP Phase 2b-3 + decision_manager
CD Pipeline / build-and-deploy (push) Has been cancelled
P0: decision_manager _fetch_metrics_snapshot 參數型別錯誤
- prom._instant_query(str) → prom._instant_query({"query": str})
- 結果解析 r.get("status")=="success" → r.get("result", [])
P1: prometheus_provider — alertname PromQL injection 防範
- 新增 _RE_SAFE_ALERTNAME 白名單正則
P1: decision_manager — kubectl action 危險字元注入防範
- 新增 _ALLOWED_KUBECTL_PATTERN 白名單,非法指令格式直接拒絕
P1: decision_manager — 6 個 asyncio.create_task() GC 風險
- 新增 _background_tasks: set + _fire_and_forget() helper
- 所有 bare create_task 改用 _fire_and_forget
P1: ssh_provider — Group B 寫入工具強制需要 known_hosts
- known_hosts 未設定或檔案不存在時拒絕執行,防 MITM
P2: sentry_provider — query 語意白名單驗證
- 新增 _RE_SAFE_SENTRY_QUERY,拒絕含特殊字元的 query
P2: argocd_provider — verify=False 改為 ARGOCD_VERIFY_TLS 環境變數開關
- 新增 _tls_verify() helper,預設 false(self-signed cert)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 20:10:33 +08:00 |
|
OG T
|
7eb49f9c20
|
feat(mcp-phase4c): AI 動態規則生成 — 新 alertname 自動產 Playbook 草稿
CD Pipeline / build-and-deploy (push) Failing after 8m29s
_generate_playbook_draft_if_new():
- Playbook 無命中時非同步觸發(不阻塞決策主流程)
- 先用 semantic_search(threshold=0.92) 確認 KM 無同名 Playbook
- 呼叫 qwen2.5:7b-instruct (Ollama 188) 生成五段結構化草稿
(症狀/根因/診斷步驟/修復動作/驗收條件)
- 寫入 KnowledgeEntry(type=PLAYBOOK, status=DRAFT, source=AI_EXTRACTED)
- 寫入 AlertOperationLog PLAYBOOK_DRAFT_CREATED 事件
- 失敗靜默 debug log
完成 MCP Phase 4 全三項:
4a NemoClaw second opinion (信心 < 0.7)
4b K8s 狀態快照 k8s_state_after
4c AI 動態 Playbook 草稿生成
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 09:16:39 +08:00 |
|
OG T
|
0fa3b35a1c
|
feat(mcp-phase4b): 自動修復後抓 K8s Pod 狀態寫入 k8s_state_after
CD Pipeline / build-and-deploy (push) Failing after 24s
_push_auto_repair_result() 成功後:
- 呼叫 K8sProvider.kubectl_get(pods, label=app=<service>)
- 結果截斷 500 字寫入 incidents.k8s_state_after
- km_conversion_service._build_content() 已支援顯示此欄位
- 失敗靜默 debug log,不阻塞主流程
完成 KM 三段資料閉環: 症狀(labels) + 情境(metrics_before) + 動作(action) + 效果(metrics_after + k8s_state_after)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 09:15:31 +08:00 |
|
OG T
|
f3ee577f9d
|
feat(mcp-phase4a): NemoClaw second opinion — 信心 < 0.7 觸發 deepseek-r1:14b 複審
CD Pipeline / build-and-deploy (push) Has been cancelled
- _nemoclaw_second_opinion(): 呼叫 Ollama 188 deepseek-r1:14b 做獨立推理
- 解析 <think>...</think> CoT 格式,只取正文
- 30s timeout,失敗靜默降級
- 輸出截斷 300 字
- _dual_engine_analyze(): LLM 信心 < 0.7 時非同步觸發 second opinion
- 結果附加到 proposal_data["advisory_note"]
- _push_decision_to_telegram(): advisory_note 以 NemoClaw bot 身分追加訊息
- 格式: "NemoClaw 第二意見 (信心=0.xx)"
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 09:14:54 +08:00 |
|
OG T
|
1ec19656b5
|
feat(adr071-ij): TYPE-2 指標快照卡片 + KM 三段資料整合
CD Pipeline / build-and-deploy (push) Failing after 8m17s
Deploy Alert Rules / Deploy Prometheus Alert Rules (push) Successful in 36s
Ansible Lint / lint (push) Has been cancelled
ADR-071-I: decision_manager 執行前後各抓一次 Prometheus metrics
- _fetch_metrics_snapshot(): 依 alertname 選擇 CPU/Mem/Disk/Restart 查詢
- _format_metrics_delta(): 輸出 "CPU 92%→23% | Mem 78%→45%" 格式
- _push_auto_repair_result(): metrics_after 寫 DB + TYPE-2 卡片顯示 delta
- _auto_execute(): metrics_before 在執行前寫 DB(完成閉環)
ADR-071-J: km_conversion_service._build_content() 使用精簡 delta 格式
- 從 metrics_before/after 產生人讀 delta(CPU/Mem/Disk/重啟次數)
- 附加 k8s_state_after(若有)
- 格式: 症狀 + 根因 + 動作 + 效果數字(症狀→情境→動作→效果)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 03:09:35 +08:00 |
|
OG T
|
68a3858ae4
|
fix(auto_execute): 守衛加入 target==alertname 檢查,防止 LLM 把告警名稱當 deployment 名稱
CD Pipeline / build-and-deploy (push) Successful in 13m33s
HostHighCpuLoad 等主機告警,NemoTron Tool Calling 可能把
alertname 填入 deployment_name,導致執行
'kubectl rollout restart deployment HostHighCpuLoad'。
新增守衛: _target == _alertname 時拒絕執行並通知人工介入。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-11 01:13:24 +08:00 |
|
OG T
|
a4d655ea7f
|
fix(auto_execute): 安全守衛 — 拒絕執行含 unknown 或未解析 placeholder 的 action
CD Pipeline / build-and-deploy (push) Successful in 19m7s
E2E Health Check / e2e-health (push) Successful in 43s
主機層告警(HostHighCpuLoad、DockerContainerUnhealthy 等)沒有對應
K8s deployment 名稱,affected_services=[],導致 _target='unknown',
執行 'kubectl rollout restart deployment unknown' 這種無意義命令。
修復: 替換後若 action 仍含 'unknown' 或 <...>/{...} 格式,
直接拒絕執行並通知人工介入,不允許帶 placeholder 的命令上線。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-10 23:57:17 +08:00 |
|
OG T
|
f8926bb70a
|
ci: 觸發 CD — decision_manager 修復標記
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-10 22:12:56 +08:00 |
|
OG T
|
e5f1541d69
|
fix(auto_execute): 替換 action 中的 <deployment_name>/{target}/{namespace} placeholder
CD Pipeline / build-and-deploy (push) Failing after 24s
Nemotron tool calling 生成 <deployment_name> 佔位符未替換
auto_execute 前統一替換所有 {target}/{namespace}/<xxx> 格式
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-10 22:00:19 +08:00 |
|
OG T
|
71f0dbf2b5
|
fix(auto_execute): ApprovalRequest 補齊 description/requested_by/required_signatures
CD Pipeline / build-and-deploy (push) Has been cancelled
3 validation errors 導致 auto_execute_failed
補上所有必填欄位,required_signatures=0 表示自動核准不需簽核
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-10 21:59:52 +08:00 |
|
OG T
|
167e115a6d
|
feat(phase31): Log 異常摘要觸發點 — 告警後 NemoTron 發 log summary
CD Pipeline / build-and-deploy (push) Failing after 2m44s
_send_log_summary: 取 Pod log → deepseek-r1:14b 分析 → NemoTron 發到群組
觸發點: _push_decision_to_telegram 送完審批卡後異步執行
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-10 16:07:56 +08:00 |
|
OG T
|
1483218bab
|
feat(approval): 批准/拒絕後立即回應 Telegram + 持久化 message_id 到 DB
CD Pipeline / build-and-deploy (push) Successful in 13m9s
問題:按下 TG 批准/拒絕按鈕後完全沒有任何回應,使用者不知道是否成功。
Telegram message_id 只存 Redis 24h TTL,過期後無法追蹤。
修正:
- approval_records 加 telegram_message_id / telegram_chat_id 欄位(已 ALTER TABLE)
- approval_db.update_telegram_message() — 持久化 message_id 到 DB
- decision_manager: 發送告警卡片後同時寫 Redis + DB
- telegram_gateway._notify_approval_result() — 批准/拒絕後:
1. editMessageReplyMarkup 移除批准/拒絕按鈕,保留資訊按鈕
2. sendMessage reply_to 在原訊息下回覆狀態行
3. fallback: send_notification 發新訊息
- _handle_group_command: chat_id 改為 _chat_id 消除 IDE lint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-09 18:19:31 +08:00 |
|
OG T
|
d8c2969341
|
feat(telegram): AI 鏈路透明化 — 告警訊息顯示 OpenClaw + Tool Calling 模型/後端
CD Pipeline / build-and-deploy (push) Successful in 12m12s
- nemotron.py: 偵測 OllamaToolProvider vs NvidiaProvider,記錄 tool_model/tool_backend
- openclaw.py: 傳播 nemotron_tool_model/nemotron_tool_backend 到 proposal
- decision_manager.py: 從 proposal_data 提取並傳給 send_approval_card()
- telegram_gateway.py: TelegramMessage 新增兩個欄位,format_with_nemotron 顯示
"🔧 Tool Calling: llama3.1:8b (Ollama 本機)" 或 "NVIDIA 雲端"
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-09 15:05:16 +08:00 |
|
OG T
|
4f80ba38c0
|
feat: 告警狀態變更在原訊息延續 (方案 B)
CD Pipeline / build-and-deploy (push) Successful in 12m28s
**telegram_gateway.py**
- 新增 append_incident_update(incident_id, status_line)
- 從 Redis tg_msg:{id} 取 message_id
- editMessageReplyMarkup: 移除 Row1(批准/拒絕/靜默),保留 Row2(詳情/重診/歷史)
- sendMessage reply_to_message_id: 在原訊息下方追加狀態行
- 找不到 message_id 回傳 False(呼叫方自行 fallback)
**decision_manager.py**
- _push_decision_to_telegram: send_approval_card 後存 tg_msg:{id}=message_id (TTL 24h)
- _push_auto_repair_result: 改用 append_incident_update,找不到 message_id 才 fallback 新訊息
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-09 14:21:33 +08:00 |
|
OG T
|
2554ac1e60
|
fix: E2E test 告警識別 + 自動修復結果 Telegram 通知
CD Pipeline / build-and-deploy (push) Has been cancelled
**alert_rule_engine.py**
- _matches() 加入 instance_prefix 匹配(最高優先)
- match_rule() 傳入 instance label 至 _matches
- 用途: e2e-final-* / e2e-test-* instance 可被 YAML 規則識別
**alert_rules.yaml**
- 新增 e2e_smoke_test 規則 (priority=120)
- alertname: E2E_SMOKE_TEST / instance_prefix: e2e-final- / e2e-test- / test-host
- suggested_action: NO_ACTION,顯示「告警鏈路驗證成功」
**decision_manager.py**
- _auto_execute() 成功後發 Telegram 結果通知 ✅
- _auto_execute() 失敗後發 Telegram 失敗通知 ❌
- 新增 _push_auto_repair_result() 函數
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-09 14:16:15 +08:00 |
|
OG T
|
b66263ad36
|
fix(decision_manager): resolved Incident 不重送 Telegram
CD Pipeline / build-and-deploy (push) Has started running
dedup TTL 10分鐘過期後,已 resolve 的 Incident 仍被重新推送
加入狀態檢查,resolved/closed 直接跳過
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-09 12:00:39 +08:00 |
|
OG T
|
9361fd1fa7
|
fix(decision_manager): action 不應 strip_placeholders 避免截斷 deployment name
CD Pipeline / build-and-deploy (push) Has been cancelled
_strip_placeholders 移除 <...> 導致 kubectl rollout restart deployment/<name>
變成 kubectl rollout restart deployment/,Telegram 顯示建議指令不完整
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-09 11:45:33 +08:00 |
|