docs(logbook): record telegram truth chain rollout [skip ci]
This commit is contained in:
@@ -1,3 +1,89 @@
|
||||
## 2026-05-31|Telegram 詳情/歷史接上 Incident 真相鏈
|
||||
|
||||
**背景**:
|
||||
|
||||
- 使用者指出 Telegram 告警卡的 `詳情` / `歷史` 仍容易變成孤立文字,operator 無法從 Telegram 直接知道同一筆 Incident 是否重複、AI 流程跑到哪、是否真的自動修復、是否卡人工,以及 Sentry / SigNoz / MCP / Ansible / KM 證據是否已收斂到前端。
|
||||
- 上一輪已讓 `/zh-TW/alerts?project_id=awoooi&incident_id=...` 顯示同一條 Incident evidence chain;本輪把 Telegram read-only 入口改成優先連到這個 canonical truth-chain。
|
||||
|
||||
**本次調整**:
|
||||
|
||||
- 新增 `apps/api/src/services/awooop_deeplinks.py`:
|
||||
- 統一產生 Alerts truth-chain URL、Runs URL 與 Telegram inline button row。
|
||||
- 按鈕順序固定為 `真相鏈` → `Runs`,保留原本 Runs drill-down,但把 Alerts Incident View 當作第一入口。
|
||||
- `apps/api/src/services/telegram_gateway.py`:
|
||||
- 主告警卡、TYPE-1 info card、approval result info buttons、append incident update、detail/history callback reply 全部改用同一個 truth-chain button row。
|
||||
- `detail:{incident_id}` / `history:{incident_id}` callback 仍維持 read-only,不新增寫入、不觸發修復、不改 nonce。
|
||||
- `apps/api/src/services/approval_execution.py`:
|
||||
- 執行結果回覆也改掛同一列 `真相鏈` / `Runs`,避免審批後只剩 Run list 而看不到 Alerts evidence chain。
|
||||
- `apps/api/tests/test_telegram_message_templates.py`:
|
||||
- 補上 Alerts truth-chain URL、reply markup 按鈕順序、主告警卡 deep link 測試。
|
||||
|
||||
**驗證**:
|
||||
|
||||
```text
|
||||
python3 -m py_compile apps/api/src/services/awooop_deeplinks.py apps/api/src/services/telegram_gateway.py apps/api/src/services/approval_execution.py -> pass
|
||||
git diff --check -> pass
|
||||
python -m ruff check src/services/awooop_deeplinks.py -> pass
|
||||
|
||||
DATABASE_URL=postgresql://test:test@localhost:5432/test PYTHONPATH=apps/api \
|
||||
pytest apps/api/tests/test_telegram_message_templates.py \
|
||||
-k 'awooop or build_inline_keyboard_includes_awooop_deep_link or send_html_line_message' -q
|
||||
-> 15 passed, 37 deselected
|
||||
|
||||
DATABASE_URL=postgresql://test:test@localhost:5432/test PYTHONPATH=. \
|
||||
pytest tests/test_telegram_gateway_llm_buttons.py tests/test_telegram_button_consistency.py tests/test_telegram_adr050.py -q
|
||||
-> 65 passed
|
||||
|
||||
DATABASE_URL=postgresql://test:test@localhost:5432/test PYTHONPATH=apps/api \
|
||||
pytest apps/api/tests/test_approval_execution_no_action.py apps/api/tests/test_approval_execution_auto_approved_finalize.py apps/api/tests/test_operator_outcome.py -q
|
||||
-> 12 passed
|
||||
```
|
||||
|
||||
**Gitea / Production deploy**:
|
||||
|
||||
```text
|
||||
356e4d41 fix(telegram): link incident truth chain from alerts
|
||||
|
||||
Gitea:
|
||||
code-review run 2339 -> success
|
||||
cd run 2338:
|
||||
tests -> success
|
||||
build-and-deploy -> success
|
||||
post-deploy-checks -> cancelled by newer main push dc2679ea (workflow cancel-in-progress)
|
||||
|
||||
Follow-up main:
|
||||
dc2679ea feat(web): promote IwoooS unlock path
|
||||
151cb88c chore(cd): deploy dc2679e [skip ci]
|
||||
dc2679ea includes 356e4d41
|
||||
cd run 2340 -> success
|
||||
|
||||
k8s latest:
|
||||
awoooi-api image = 192.168.0.110:5000/awoooi/api:dc2679ea75cf863bb0a9ba0ae0ea98f82f8ad823
|
||||
awoooi-web image = 192.168.0.110:5000/awoooi/web:dc2679ea75cf863bb0a9ba0ae0ea98f82f8ad823
|
||||
awoooi-worker image = 192.168.0.110:5000/awoooi/api:dc2679ea75cf863bb0a9ba0ae0ea98f82f8ad823
|
||||
awoooi-api/web/worker rollout = successfully rolled out
|
||||
|
||||
production pod verification:
|
||||
incident_truth_chain_button_row("INC-20260530-0DD83C")
|
||||
-> [{"text":"真相鏈","url":"/zh-TW/alerts?project_id=awoooi&incident_id=INC-20260530-0DD83C"},
|
||||
{"text":"Runs","url":"/zh-TW/awooop/runs?project_id=awoooi&incident_id=INC-20260530-0DD83C"}]
|
||||
|
||||
production web:
|
||||
https://awoooi.wooo.work/zh-TW/alerts?project_id=awoooi&incident_id=INC-20260530-0DD83C&_v=dc2679ea -> HTTP 200
|
||||
```
|
||||
|
||||
**進度**:
|
||||
|
||||
```text
|
||||
Telegram/AwoooP/frontend truth-chain visibility: 92%
|
||||
Frontend AI automation management UI: 96%
|
||||
Sentry/SigNoz per-incident visibility: 90%
|
||||
MCP / self-hosted MCP visibility: 97%
|
||||
Ansible / PlayBook visibility: 89%
|
||||
Overall AI automation flywheel: 80%
|
||||
24h full AI Agent auto-repair production claim: 0% (尚未做 24h 無人工介入驗證,不宣稱達成)
|
||||
```
|
||||
|
||||
## 2026-05-31|IwoooS 第一解鎖路徑首層化
|
||||
|
||||
**背景**:
|
||||
|
||||
Reference in New Issue
Block a user