feat(auto-repair): 打通自動修復閉環 (ADR-058)
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
Type Sync Check / check-type-sync (push) Failing after 53s

問題: 告警鏈路從未呼叫 auto_repair_service,機制完全死路
修正:
1. webhooks.py: alertmanager_webhook 建立 Incident 後觸發 _try_auto_repair_background
2. playbook.py: is_high_quality 門檻降低 (冷啟動期)
   - success_count: 10 → 3
   - success_rate: 95% → 80%
3. tests: test_evaluate_not_high_quality 更新為新門檻

流程: Alertmanager → API → Incident → evaluate → P2以下+高品質Playbook → 自動執行 → Telegram通知

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-05 22:08:08 +08:00
parent 9629367bc2
commit 5499169996
3 changed files with 107 additions and 6 deletions

View File

@@ -189,7 +189,7 @@ class TestAutoRepairService:
affected_services=["test-service"],
),
repair_steps=[],
success_count=5, # < 10
success_count=2, # < 3 (冷啟動門檻 2026-04-05)
failure_count=0,
)
mock_playbook_service.add_playbook(playbook)