feat: notification cooldown dedup for events and problems (notif-31)

Store last notify time by dedup_key/fingerprint, gate dispatch before
channels; config SAC_NOTIFY_*_COOLDOWN_SEC, migration 008.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
PTah
2026-05-29 16:24:01 +10:00
parent 1a70980920
commit 4167687dec
12 changed files with 309 additions and 14 deletions
+1 -1
View File
@@ -237,7 +237,7 @@ Telegram у ssh/RDP использует ту же подпись, что и `di
| rdp.login.failed | `{product}\|{host}\|rdp.failed\|{ip}\|{user}` |
SAC применяет cooldown по `dedup_key` (события, по умолчанию **90 с**) и по `fingerprint` problem (**300 с**). Таблица `notification_cooldown`, env: `SAC_NOTIFY_EVENT_COOLDOWN_SEC`, `SAC_NOTIFY_PROBLEM_COOLDOWN_SEC`. В логах API: `notify cooldown skip`.
---
## 5. Точки встраивания в код агентов
+1 -1
View File
@@ -50,7 +50,7 @@ sudo /opt/sac-deploy.sh
## Следующие шаги (2026-05-29)
1. **Деплой SAC v0.5.0**`sudo /opt/sac-deploy.sh` (миграции **`004``007`**: каналы + глобальное правило)
1. **Деплой SAC v0.5.0**`sudo /opt/sac-deploy.sh` (миграции **`004``008`**: каналы, правило, cooldown)
2. **notif-02** — прогон [testing-e2e-checklist.md](testing-e2e-checklist.md) § «SAC Telegram» на prod
3. **Настройки UI**`/settings`: Telegram `warning+`, кнопка «Проверить Telegram»
4. **RDP 1.2.20-SAC** — NETLOGON + `Deploy-LoginMonitor.ps1` на пилотных хостах
+1 -1
View File
@@ -53,7 +53,7 @@
| ID | Задача |
|----|--------|
| `notif-30` | Шаблон TG ближе к агенту (HTML, поля user/ip/logon_type из `details`) | ✅ `telegram_templates.py`, `parse_mode=HTML` |
| `notif-31` | Cooldown/dedup на уровне SAC (F-NOT-03) — не дублировать problem при burst |
| `notif-31` | Cooldown/dedup на уровне SAC (F-NOT-03) — не дублировать problem при burst |`notification_cooldown`, env 90/300 с |
| `notif-32` | F-NOT-05: daily report из SAC при exclusive (отдельный эпик) |
---