diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index ca9a07663..b41619796 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -259,6 +259,8 @@ jobs: ;; docs/runbooks/HOST-RUNAWAY-PROCESS-AIOPS-PLAYBOOK.md) ;; + docs/awooop/TELEGRAM-INCIDENT-NOTIFICATION-MODEL.md) + ;; docs/workplans/2026-06-04-reboot-cold-start-backup-recovery-workplan.md) ;; docs/workplans/2026-07-02-commander-inserted-requirements-priority-ledger.md) @@ -429,6 +431,8 @@ jobs: ;; apps/api/src/services/platform_operator_service.py) ;; + apps/api/src/services/telegram_alert_ai_automation_matrix.py) + ;; apps/api/src/services/telegram_gateway.py) ;; apps/api/tests/test_agent_replay_normalizer.py) @@ -503,6 +507,8 @@ jobs: ;; apps/api/tests/test_awoooi_priority_work_order_readback_api.py) ;; + apps/api/tests/test_telegram_alert_ai_automation_matrix_api.py) + ;; apps/api/tests/e2e_network_test.py) ;; apps/api/tests/test_p0_cicd_baseline_source_readiness_api.py) @@ -831,6 +837,7 @@ jobs: src/services/p0_cicd_baseline_source_readiness.py \ src/services/product_awoooi_manifest_standard.py \ src/services/platform_operator_service.py \ + src/services/telegram_alert_ai_automation_matrix.py \ src/services/telegram_gateway.py python3.11 -m py_compile \ ../../scripts/reboot-recovery/dr-escrow-evidence-checklist.py \ @@ -916,6 +923,7 @@ jobs: tests/test_iwooos_security_operating_system.py \ tests/test_awoooi_production_deploy_readback_blocker.py \ tests/test_awoooi_priority_work_order_readback_api.py \ + tests/test_telegram_alert_ai_automation_matrix_api.py \ tests/e2e_network_test.py::TestHMACVerification::test_valid_hmac_signature \ tests/test_p0_cicd_baseline_source_readiness_api.py \ tests/test_product_awoooi_manifest_standard_api.py \ diff --git a/docs/LOGBOOK.md b/docs/LOGBOOK.md index e63921959..417afdf52 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -1,3 +1,17 @@ +## 2026-07-02 — 18:35 CIR-P0-TG-001 Telegram matrix CD profile 修正 + +**完成內容**: +- Gitea CD `#4412` 讀回:`f237b2545 feat(telegram): expose AI automation matrix` 的 tests job 失敗點是 `BLOCKER b5_docker_socket_unavailable`,不是 Telegram matrix 測試失敗;原因是新 `telegram_alert_ai_automation_matrix.py` / test 與 Telegram 模型文件尚未納入 controlled-runtime profile,導致 CD 走 full/B5。 +- 已將 `docs/awooop/TELEGRAM-INCIDENT-NOTIFICATION-MODEL.md`、`apps/api/src/services/telegram_alert_ai_automation_matrix.py`、`apps/api/tests/test_telegram_alert_ai_automation_matrix_api.py` 加入 `.gitea/workflows/cd.yaml` changed-file allowlist、controlled-runtime `py_compile` 與 focused pytest 清單。 +- `ops/runner/test_cd_controlled_runtime_profile.py` 新增 regression,確保 Telegram alert AI automation matrix 後續不會再因 metadata/API readback patch 落到 B5 Docker socket 路徑。 + +**本地驗證結果**: +- `DATABASE_URL=postgresql+asyncpg://test:test@localhost/test PYTHONPATH=apps/api python3.11 -m pytest ops/runner/test_cd_controlled_runtime_profile.py apps/api/tests/test_telegram_alert_ai_automation_matrix_api.py -q -p no:cacheprovider`:`47 passed`。 +- `python3.11 -m py_compile ops/runner/test_cd_controlled_runtime_profile.py`、`git diff --check`:通過。 + +**仍維持**: +- 未使用 GitHub / `gh` / GitHub API;未讀 secret / runner token / `.env` / raw sessions / SQLite / auth;未觸發 workflow;未重啟主機 / VM / Docker / Nginx / K3s / DB / firewall;未寫 production DB。 + ## 2026-07-02 — 18:25 P0-006 scorecard / workbench runtime freshness readback 分層 **完成內容**: diff --git a/ops/runner/test_cd_controlled_runtime_profile.py b/ops/runner/test_cd_controlled_runtime_profile.py index 0bd18b5e7..a0c198f6a 100644 --- a/ops/runner/test_cd_controlled_runtime_profile.py +++ b/ops/runner/test_cd_controlled_runtime_profile.py @@ -185,6 +185,19 @@ def test_log_controlled_writeback_consumer_apply_stays_on_controlled_runtime_pro assert source in text +def test_telegram_alert_ai_automation_matrix_stays_on_controlled_runtime_profile() -> None: + text = _workflow_text() + expected_sources = [ + "docs/awooop/TELEGRAM-INCIDENT-NOTIFICATION-MODEL.md)", + "apps/api/src/services/telegram_alert_ai_automation_matrix.py)", + "apps/api/tests/test_telegram_alert_ai_automation_matrix_api.py)", + "src/services/telegram_alert_ai_automation_matrix.py", + "tests/test_telegram_alert_ai_automation_matrix_api.py", + ] + for source in expected_sources: + assert source in text + + def test_cd_requires_production_deploy_readback_after_rollout() -> None: text = _workflow_text() assert "apps/api/tests/test_awoooi_production_deploy_readback_blocker.py)" in text