feat(governance): 新增 AI Agent TG canary 批准包
All checks were successful
Code Review / ai-code-review (push) Successful in 11s
CD Pipeline / tests (push) Successful in 1m46s
CD Pipeline / build-and-deploy (push) Successful in 6m39s
CD Pipeline / post-deploy-checks (push) Successful in 2m53s

This commit is contained in:
Your Name
2026-06-16 10:14:23 +08:00
parent 915cbaac0c
commit 44ea892e4f
14 changed files with 2110 additions and 43 deletions

View File

@@ -49,6 +49,31 @@
- 本輪未連 live ArgoCD、未 `kubectl`、未 `helm`、未讀 live Secret、未改 NetworkPolicy / RBAC / NodePort / Ingress / route、未手動 sync、未 patch live manifest、未 active scan、未收 secrets 明文、未 force push。
- 下一優先:收 K8s / ArgoCD owner evidence 與事故後回讀包;同時把 Backup / Restore / Escrow、Monitoring / Alerting / Observability、Public gateway / Nginx、Gitea workflow / runner / deploy secret injection 的 owner evidence gate 往前推,且不得用 route 200、pod up、UI 可見或 CD success 當成資安 runtime 授權。
## 2026-06-16P2-405C AI Agent TG Canary 發送批准包
**背景**P2-405B 已讓治理頁看見 Telegram no-send 訊息預覽、dedup key、receipt expectation 與 canary approval package下一步需要把第一次 TG canary 實發前的人工批准輸入、停止條件、mute / rollback 與回執讀回要求固定成可測試 artifact但不能因「批准包已就緒」就打開 Telegram 實發或 Gateway queue。
**完成項目**
- 新增 `docs/evaluations/ai_agent_professional_task_expansion_2026-06-16_1015_p2_405c.json``current_task_id=P2-405C``next_task_id=P2-405D`、整體完成度 `92%`
- `telegram_runtime_bridge.canary_send_approval_packet` 已固定 `packet_ready=true``approval_required=true``approval_granted=false``status=waiting_explicit_commander_approval`
- Canary 發送批准包要求 7 個統帥 / operator 必填欄位:統帥批准、單一訊息類型、發送時間窗、目標 env ref、mute / rollback plan、receipt readback owner、failure stop condition。
- Canary 發送批准包固定 6 個 eligible message type、6 個停止條件、5 個 mute / rollback 步驟、6 個 receipt readback check所有欄位值維持不可公開顯示。
- 後端 loader / schema / 測試已要求 canary execution flags、Gateway queue write、Bot API call、delivery receipt production write、secret read、paid API 全部維持 `false / 0`
- `/zh-TW/governance?tab=automation-inventory` 的 AI Agent 專業任務卡片已顯示 canary 批准包、批准欄位、停止條件與批准缺口,並把 canary 實發 / queue / Bot API / receipt write 全部納入 live write 計數。
- `zh-TW.json``en.json` 維持繁中鏡像;治理頁不顯示工作視窗對話、未遮罩 runtime payload、機密值或可直接執行的 Telegram 操作。
**本地驗證**
- JSON parse 驗證 `docs/evaluations/ai_agent_professional_task_expansion_2026-06-16_1015_p2_405c.json``docs/schemas/ai_agent_professional_task_expansion_v1.schema.json``apps/web/messages/zh-TW.json``apps/web/messages/en.json` 通過。
- `python3 -m py_compile apps/api/src/services/ai_agent_professional_task_expansion.py apps/api/src/api/v1/agents.py` 通過。
- `DATABASE_URL=postgresql+asyncpg://test:test@localhost/test pytest -q apps/api/tests/test_ai_agent_professional_task_expansion.py apps/api/tests/test_ai_agent_professional_task_expansion_api.py``16 passed`
- `pnpm --filter @awoooi/web typecheck` 通過。
**完成度與邊界**
- AI Agent 專業任務擴展與 Telegram Runtime Bridge`88% -> 92%`
- Telegram no-send preview、dedup、receipt expectation、canary approval package、canary send approval packet皆為 `100%`
- Telegram 實發、Gateway queue write、Bot API call、delivery receipt production write、secret read、paid API、host write、kubectl action、production write 全部仍為 `0 / false`
- 下一步P2-405D 只能在統帥明確提供 canary 發送批准、單一訊息類型、時間窗、目標 env ref 與回執讀回 owner 後,才進入受控 canary delivery gate未批准前不得實發。
## 2026-06-15Docker / systemd / Host Service 事故後回讀 Gate
**背景**110 / 188 類主機服務事故證明Docker daemon、compose、systemd、repair-bot、Ansible、host config backup、port binding、public / admin route、AI provider 與 monitoring 可能互相影響。IwoooS 不能把「容器起來」、「route 200」、「服務健康」或「頁面可見」誤判成主機服務事故已驗收本階段補上 host service post-incident readback plan只建立事故後回讀候選、必填欄位、reviewer checks、outcome lanes、blocked actions 與前台 marker不 SSH、不讀 live host、不碰 Docker / systemd / repair-bot / Ansible / Nginx / firewall、不做 route smoke、不收 secrets 明文。