feat(drift+target): P0.1+P0.2+P0.3 三修 — drift 分頁分類 + AI 推薦 + target 追 trace
統帥三問決議:全做;AI 推薦 0.85 門檻純顯示不自動;先查 aol 再修 ## RCA: awoooi-service 失敗來源 - /api/v1/aiops/kpi 顯示過去 24h 有 1 筆 playbook_executed actor=approval_execution status=failed - grep codebase: 無任何程式碼寫死 awoooi-service(只有歷史 comment) - 最可能源: alert_rule_engine._extract_vars 從 labels.service 取值當 Deployment 名 - cf5050c/4f2e122(2026-04-18)已修 NEMOTRON 幻覺雙路徑;本次修第三條路徑 ## 修復 ### P0.3a alert_rule_engine._extract_vars - labels.service 降級:-service 結尾先剝 suffix 視為 base name - match_rule 回傳新增 target_source 欄位追 trace - 下次 awoooi-service 復發可直接看來源(label.service(stripped) 等) ### P0.3c approval_execution._log_aol_started.input - 補 parsed_target/operation/namespace 欄位 - 未來 aol 查 failed 可直接看 target,無需推敲 ### P0.1 telegram_gateway._send_drift_diff_detail - 分頁(10 項/頁)取代一次洗版 30 項 - header 3 桶分類計數: 人工高風險 / 一般修改 / K8s 自動 - 底部 ⬅️/➡️ 分頁按鈕(callback: drift_view_page:{report_id}_{page}) - security_interceptor INFO_ACTIONS 加 drift_view_page 白名單 ### P0.2 drift_narrator recommendation - LLM prompt 加 recommendation 欄位(action/confidence/reason) - action ∈ {adopt, revert, ignore, investigate} - 卡片頂部顯示「🎯 AI 建議:⏪ 回滾 (85%) — reason」 - LLM 失敗走 _fallback_recommendation(規則式依 intent 對應) - 卡片 diff_summary 上限 500 → 1500 字容納推薦 + narrative + items - 統帥指令:純顯示不自動執行(門檻 0.85 保留未來) ## 驗證 - 90 個 pytest test 全過(drift + rule_engine + approval_execution) - 5 檔 AST syntax check 過 ## 下次驗收 1. 下次 drift 觸發 → 卡片頂部有「🎯 AI 建議」 2. drift_view 按下 → 3 桶分類 header + ⬅️/➡️ 3. awoooi-service 若復發 → automation_operation_log.input.parsed_target 直接查 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -435,7 +435,9 @@ class TelegramSecurityInterceptor:
|
||||
- 格式二: {action, incident_id, is_info_action: True}
|
||||
"""
|
||||
# 2026-04-01 Claude Code (ADR-050): 支援 read-only info actions (2-part format)
|
||||
INFO_ACTIONS = {"detail", "reanalyze", "history"}
|
||||
# 2026-04-20 P0.1 ogt + Claude Opus 4.7: drift_view_page 納入 INFO_ACTIONS
|
||||
# payload 格式: drift_view_page:{report_id}_{page}(底線分隔,不跟冒號衝突)
|
||||
INFO_ACTIONS = {"detail", "reanalyze", "history", "drift_view_page"}
|
||||
parts = callback_data.split(":")
|
||||
if len(parts) == 2 and parts[0] in INFO_ACTIONS:
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user