Code Review 發現 2 個 Critical + 2 個 Important 問題: Critical: - rule.id 語意為「規則識別符」,與 incident_type 命名空間不同,不可混用 移除 rule_id fallback 路徑,YAML 匹配無 incident_type 時 fall through 靜態 dict - get_incident_type() 關鍵路徑無測試覆蓋 新增 test_get_incident_type.py:11 測試、4 類別(靜態/YAML優先/YAML錯誤/custom)全過 Important: - ALERTNAME_TO_TYPE deferred import 移至模組頂層(無 circular 風險) - alert_types.py TODO 過期 → 更新為 I1 整合後正確說明 技術債記錄:NetworkPolicy ArgoCD egress ClusterIP 10.43.16.201/32 需 ArgoCD 重裝後更新 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 新增 src/constants/__init__.py + alert_types.py - ALERTNAME_TO_TYPE 常數(56 筆)從 webhooks.py 內聯 dict 遷移至模組 - webhooks.py 改用 ALERTNAME_TO_TYPE.get(alertname, "custom") - TODO I1: 下 Sprint 整合 ADR-064 Rule Engine 動態推斷(此為中間狀態) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>