docs(logbook): 記錄 Telegram 重複告警修復 [skip ci]
This commit is contained in:
@@ -1,3 +1,31 @@
|
||||
## 2026-06-11|P0 Telegram 重複告警靜音第二波修復
|
||||
|
||||
**背景**:第一波已修復 Alertmanager 缺少 `project_id` 導致 RLS fail-closed、告警被 degraded accepted no-retry 吃掉的主斷點。後續正式 logs 又確認另一條靜音路徑:同一指紋第一次告警進入背景 AI 分析後,第二次同指紋告警會被 `alertmanager_llm_inflight_suppressed` 擋下,只記錄 DB event,不送 Telegram,使用者仍會感覺「告警完全沒有出現」。
|
||||
|
||||
**完成內容:**
|
||||
- `notify_converged_alert_recurrence()` 新增 `recurrence_stage="llm_inflight"`,產生「告警仍在發生:AI 分析中」文案。
|
||||
- Alertmanager webhook 在 `try_acquire_alertmanager_llm_lock()` 未取得鎖時,除了記錄 `llm_inflight_suppressed` timeline event,也排程節流 Telegram recurrence notice。
|
||||
- 同一指紋仍保留 30 分鐘 Redis 去重,不改成每次洗版;Redis 不可用時維持 milestone fallback。
|
||||
- 訊息仍明確寫出「不是新的自動修復授權」,不提高 runtime gate、不啟動 repair。
|
||||
|
||||
**驗證與正式站證據:**
|
||||
- 本地:`DATABASE_URL='postgresql+asyncpg://test:test@localhost/test' python -m pytest apps/api/tests/test_alert_converged_recurrence.py apps/api/tests/test_alertmanager_project_context.py apps/api/tests/test_alertmanager_rule_bypass.py apps/api/tests/test_cicd_alertmanager_mapping.py -q`:`28 passed`。
|
||||
- 本地:`python -m py_compile apps/api/src/api/v1/webhooks.py apps/api/src/services/converged_alert_recurrence_notifier.py apps/api/src/services/telegram_gateway.py apps/api/src/main.py` 通過。
|
||||
- 本地:`git diff --check`、`source-control-owner-response-guard.py`、`security-mirror-progress-guard.py` 通過。
|
||||
- Code commit:`65a727a2 fix(api): notify repeated alerts during AI analysis`。
|
||||
- Deploy marker:`7897e923 chore(cd): deploy 65a727a [skip ci]`。
|
||||
- Gitea CD run `2653`:Success。
|
||||
- Production image:`192.168.0.110:5000/awoooi/api:65a727a23c09e7ee1d887745e4857c90e040a09b`,`awoooi-api` rollout 成功,副本 `2/2`。
|
||||
- Production health:`/api/v1/health` 回傳 `healthy`、`environment=prod`、`mock_mode=false`。
|
||||
- 正式 Alertmanager smoke:同一指紋連發兩次 `CodexTGInflightLogSmoke`,第一次回傳 `告警已排入背景分析`,第二次回傳 `告警已由同指紋背景 AI 分析處理中,已排程節流再通知`。
|
||||
- Production log 證據:`alertmanager_llm_inflight_suppressed` 後接 `converged_alert_recurrence_sent`,`recurrence_stage=llm_inflight`、`sent_count=2`、`mirrored_to_private=true`。
|
||||
|
||||
**完成度與邊界:**
|
||||
- Alertmanager → Telegram outbound 主鏈路:`100%`,已覆蓋新告警、既有 approval 收斂重複告警、AI 分析中重複告警三條路徑。
|
||||
- TG 監控治理長期項:`85%`;下一步仍需處理 `/api/v1/telegram/health` 顯示 `polling_active=false` 的互動面風險,以及 dashboard / metrics 等非 Alertmanager route 的 `project_id` warning。
|
||||
- 本階段沒有呼叫 `logOut`、沒有讀取或輸出 Telegram token / Secret payload、沒有 SSH、沒有 active scan、沒有修改 Alertmanager rule / receiver、沒有重啟服務、沒有執行 auto repair;smoke 明確維持 `auto_repair=false`。
|
||||
- IwoooS 整體仍維持 `64%`;active runtime gate 仍為 `0`;owner response received / accepted 仍為 `0 / false`。
|
||||
|
||||
## 2026-06-11|IwoooS 高價值配置 Owner Packet 前台只讀接入
|
||||
|
||||
**背景**:P0.3 已能從高價值配置 Gate 產生 canonical owner response packet 草案。本階段把 packet 草案接到 production `/zh-TW/iwooos`,讓 Nginx、workflow、secret、agent-bounty runtime 等高價值配置控管狀態能在前台被看見,同時明確維持 request / received / accepted / runtime gate 全部為 0,避免把「可見」誤讀為「已授權」。
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
| 項目 | 目前值 |
|
||||
|------|--------|
|
||||
| 工作視窗 | IwoooS / AWOOOI 資安治理 P0 |
|
||||
| 本次乾淨 worktree | `/private/tmp/awoooi-p1-106-offsite-escrow-readiness-20260605` |
|
||||
| 本次分支 | `codex/p1-305-velero-minio-freshness` |
|
||||
| 最新觀察到的 `gitea/main` | `44c09c3b chore(cd): deploy 67940d6 [skip ci]` |
|
||||
| 本次乾淨 worktree | `/private/tmp/awoooi-tg-alert-recurrence-p0-20260611` |
|
||||
| 本次分支 | detached HEAD on `gitea/main` |
|
||||
| 最新觀察到的 `gitea/main` | `7897e923 chore(cd): deploy 65a727a [skip ci]` |
|
||||
| 最新 P0 Telegram 告警鏈路基準 | code `65a727a2`、deploy marker `7897e923`、CD `2653`;Alertmanager 重複告警在 AI 分析中已節流送出 TG,production log `converged_alert_recurrence_sent`、`sent_count=2` |
|
||||
| 最新 P2-D0 繁中文案基準 | code `cd2275a2`、deploy marker `1920bd08`、code-review `2565`、CD `2564` |
|
||||
| 最新 P2-D1 本地掃描基準 | `VISIBLE_LITERAL_TARGET_SCAN_OK files=221`;全站 TS / TSX 中文 literal 盤點 `35` 檔 / `752` 行;註解語氣 backlog `32` 筆 |
|
||||
| 最新 P2-D1 正式部署基準 | code `f9bf8a28`、deploy marker `879b0a36`、CD `2578`、code-review `2579` |
|
||||
@@ -47,6 +48,7 @@
|
||||
| Frontend design system / visual grammar | 維持 `60%` | 否 | 本輪只推進 IwoooS 頁面資訊架構與圖表排序,不宣稱全站設計系統完成 |
|
||||
| P2 全站繁中治理 D0+D1+D2 註解語氣 / AIOps sample / Code Review 候選分類 / AwoooP Runs fallback | `53%` | 只限高風險可見 literal、盤點、註解語氣、AIOps 範例資料命名、Code Review route i18n 與 AwoooP Runs fallback readability | D0 已清 messages 高風險殘留;D1 已掃 `apps/web/src` 字串 literal 並修正高風險可見 / bundle 文案;D2 已清 `apps/web/src` 內部稱謂註解、AIOps sample/mock 命名、Code Review 可見文案搬進 `codeReview` namespace,並清理 Runs / Callback / Source Flow fallback 可見殘留。全站 hardcoded TSX 可見 literal 仍需後續分批搬遷 |
|
||||
| AI Agent automation inventory UX / readability | 本地 `100%`;正式站 `100%` | 否 | 治理頁已把 P1-002 後資料重排為決策指揮摘要、決策支援六因子覆蓋率與 Gitea / Runner 缺口矩陣;這是可讀性與決策支援 slice,不調高 backlog `78%`、IwoooS `64%`、S4.9 gate 或 active runtime gate |
|
||||
| Telegram 監控告警 outbound 主鏈路 | `100%`;治理長期項 `85%` | 否 | 已修復 Alertmanager tenant context、既有 approval 收斂告警 recurrence、AI 分析中重複告警 recurrence;但 Telegram long polling health 仍顯示 `polling_active=false`,互動面風險需後續處理,不調高 runtime gate |
|
||||
|
||||
## 2. P0 工作拆解與優先順序
|
||||
|
||||
@@ -65,6 +67,7 @@
|
||||
| P0-3 | AwoooP 同步封包 | 100% | 已送至 AwoooP 平行工作 thread `019e9154-7d5e-7b72-85be-c9d97e43ecc9`;後續仍需每次推版前重新 fetch / fast-forward | 本文件、thread send readback、mirror checklist readback |
|
||||
| P0-4 | production live sanity 節點 | 100% | desktop / mobile / 展開區塊 / overflow / action href 檢查已完成 | Playwright production sanity 通過 |
|
||||
| P0-5 | LOGBOOK 與完成度更新 | 100% | D2 comments-only、D2 AIOps sample、D2 Code Review 候選分類與 D2 AwoooP Runs fallback 皆已回填;可見 / bundle 變更皆已補 local / production desktop + mobile smoke | `docs/LOGBOOK.md` readback |
|
||||
| P0-6 | Telegram 監控告警靜音修復 | outbound 主鏈路 100%;治理長期項 85% | Alertmanager 缺 project context、既有 approval 收斂告警靜音、AI 分析中重複告警靜音皆已修復並正式 smoke;下一步處理 `polling_active=false` 與非 Alertmanager route project context warning | API health、Telegram health、API pod Alertmanager smoke、production logs `converged_alert_recurrence_sent` |
|
||||
|
||||
## 3. S4.9 Owner Response Gate 規範
|
||||
|
||||
|
||||
Reference in New Issue
Block a user