feat(adr-071): 告警通知四類型第一批 B/C/E/F/G/H 全實作
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
Type Sync Check / check-type-sync (push) Failing after 1m7s

ADR-071-B: classify_notification() — 五型分類器 (TYPE-1/2/3/4/4D)
ADR-071-C: send_info_notification() — TYPE-1 純資訊無按鈕卡片
ADR-071-E: _build_inline_keyboard() — 依 alert_category 動態組合 TYPE-3 按鈕
ADR-071-F: send_drift_card() — TYPE-4D Config Drift 卡片 + Diff 截斷
ADR-071-G: km_conversion_service.py — Incident RESOLVED 自動轉 KM
ADR-071-H: handle_manual_fix_done() — TYPE-4 手動修復 Bot 對話閉環

前批已完成: ADR-071-A (DB Migration) + ADR-071-D (狀態機守衛)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-11 02:24:20 +08:00
parent 45b13f1d7c
commit 325b3851b5
4 changed files with 894 additions and 22 deletions

View File

@@ -439,6 +439,16 @@ class Incident(BaseModel):
description="是否已向量化到 Vector DB (Semantic Memory)",
)
# ADR-071-A: 告警通知四類型 + 全生命週期 DB 記錄 (2026-04-11 Claude Sonnet 4.6)
notification_type: str | None = Field(None, description="通知類型 TYPE-1/2/3/4/4D")
alert_category: str | None = Field(None, description="告警類別 k8s_workload/database/host_resource/...")
context_bundle: dict | None = Field(None, description="MCP 情報收集快照(執行前)")
metrics_before: dict | None = Field(None, description="指標快照執行前Prometheus MCP")
metrics_after: dict | None = Field(None, description="指標快照執行後Prometheus MCP")
verification_result: dict | None = Field(None, description="執行驗證結果K8s MCP watch_rollout")
manual_fix_steps: str | None = Field(None, description="手動修復步驟TYPE-4 使用者輸入)")
manual_fix_by: str | None = Field(None, description="手動修復執行者")
# [首席架構師] 移除 json_encoders (Pydantic v2 已 deprecated),原生序列化輸出格式與 .isoformat() 一致 v1.1 2026-04-01 Asia/Taipei
# 2026-04-01 Claude Code: 舊 Redis 資料相容性 - outcome 可能存為字串 "resolved"