diff --git a/docs/LOGBOOK.md b/docs/LOGBOOK.md index 172abc76a..37629e077 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -1,3 +1,88 @@ +## 2026-05-20|T108 Alerts 顯示 Execution / Ansible / PlayBook 證據 + +**觸發**: + +- T107 已把 MCP Gateway / Legacy / Tool 明細打到 incident card,但告警是否真正進入修復執行器、Ansible 是否被納入、PlayBook 是否只是候選或真的執行,仍然需要進 truth-chain API 才看得到。 +- 統帥先前指出 Ansible 沒有被完整發揮;若前端只顯示「修復 1」或「操作 1」,仍無法分辨 `ansible_candidate_matched`、`check_mode`、`apply`、`not_used_reason`。 + +**修正**: + +- `GET /api/v1/platform/status-chain` 新增 read-only `execution` section: + - `operation_total`、latest operation type / status / actor / action / executor + - PlayBook id / path + - Ansible considered、record_total、candidate_count、not_used_reason、latest operation/status/playbook/check_mode、candidate_playbooks +- `IncidentCard` 新增 `執行明細`: + - Executor + - Operation / status + - Ansible 已納入或未使用原因 + - PlayBook path / candidate basename +- zh-TW / en i18n 補齊 execution detail 文案;`AwoooPStatusChain` TypeScript contract 同步新增 `execution` 欄位。 + +**邊界**: + +- 本輪仍是 read-only visibility,不把 Ansible 接成 apply executor,不改 approval / execution / auto-repair 狀態機。 +- 顯示 `Ansible 已納入` 只代表 truth-chain 有 Ansible audit/candidate/check-mode evidence;是否能自動 apply 仍必須看 approval、dry-run、verification 與 rollback gate。 + +**Local / production verification**: + +```text +python3 -m py_compile platform_operator_service.py test_awooop_operator_timeline_labels.py + -> pass +DATABASE_URL=postgresql+asyncpg://test:test@localhost/test pytest tests/test_awooop_operator_timeline_labels.py -q + -> 35 passed +ruff check platform_operator_service.py test_awooop_operator_timeline_labels.py --select F,E9,I + -> pass +node JSON parse zh-TW/en messages + -> i18n json ok +pnpm --dir apps/web exec tsc --noEmit --pretty false + -> pass +pnpm --dir apps/web exec next lint --file incident-card.tsx --file status-chain.tsx + -> exit 0 +NEXT_PUBLIC_API_URL=https://awoooi.wooo.work pnpm --dir apps/web run build + -> compiled successfully, 90/90 static pages +Local Playwright mock execution detail + -> incident-execution-evidence=50, Executor ansible, Operation ansible_check_mode_executed, PlayBook 188-ai-web.yml +Production /api/v1/platform/status-chain?incident_id=INC-20260520-4D1124 + -> execution.operation_total=1 + -> latest_operation_type=ansible_candidate_matched + -> latest_status=dry_run + -> latest_executor=ansible + -> Ansible considered=true, record_total=1, candidate_count=4 + -> candidate_playbooks include 110-devops.yml, 188-ai-web.yml, nginx-sync.yml +Production Playwright https://awoooi.wooo.work/zh-TW/alerts + -> incident-execution-evidence=50 + -> examples show Ansible unused reason or candidate PlayBook basename + -> pageErrors=0, consoleErrors=0 + -> screenshot /tmp/awoooi-t108-execution-detail-production.png +``` + +**Gitea deploy / smoke**: + +```text +Code commit: + d4573cd0 feat(awooop): expose execution evidence on incidents + +Deploy marker: + f79e6718 chore(cd): deploy d4573cd [skip ci] + +Gitea Actions: + 1929 Code Review -> success in 17s + 1928 CD -> success in 9m11s +``` + +**目前整體進度**: + +- 首頁資料可信度:約 99.9%。 +- Alerts 完整清單可追蹤性:約 99.95%。 +- 前端 AI 自動化管理介面同步:約 99.97%。 +- AwoooP 告警可觀測鏈:約 99.92%。 +- MCP / 自建 MCP 使用證據可見性:約 99.6%。 +- Execution / Ansible / PlayBook 證據可見性:約 99.3%。 +- MCP Gateway enforcement 可驗證性:約 96.5%。 +- Ansible 自動執行成熟度:約 82%,因為 production 多數仍是 candidate / dry-run / not-used evidence,尚未全面 apply。 +- 低風險自動修復閉環:約 95.3%。 +- 完整 AI 自動化管理產品化:約 99.35%。 + ## 2026-05-20|T107 Alerts 顯示 MCP Gateway / Legacy / Tool 明細 **觸發**: diff --git a/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md b/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md index 249a468fc..61cf297ab 100644 --- a/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md +++ b/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md @@ -2442,6 +2442,14 @@ Phase 6 完成後 - 邊界:T107 是 evidence visibility,不強制所有 MCP 走 Gateway、不新增 MCP 執行、不改 incident / approval / execution / auto-repair 狀態機。若 Gateway=0、Legacy>0,代表該事件仍有治理路徑未統一技術債,不可宣稱 Gateway enforcement 完成。 - 目前進度更新:首頁資料可信度約 99.9%;Alerts 完整清單可追蹤性約 99.9%;前端 AI 自動化管理介面同步約 99.96%;AwoooP 告警可觀測鏈約 99.9%;MCP / 自建 MCP 使用證據可見性約 99.6%;MCP Gateway enforcement 可驗證性約 96.5%;低風險自動修復閉環約 95.2%;完整 AI 自動化管理產品化約 99.3%。 +**T108 Alerts 顯示 Execution / Ansible / PlayBook 證據(2026-05-20 台北)**: +- 觸發:T107 讓 MCP 感官路徑可見,但修復執行器仍是黑盒;Operator 仍無法在 Alerts card 上分辨 Ansible 是 candidate / check-mode / apply,或只是有 catalog hint 但 not used。 +- 修正:`GET /api/v1/platform/status-chain` 新增 read-only `execution` section,包含 latest operation type/status/actor/action/executor、PlayBook ids/paths、Ansible considered/record_total/candidate_count/not_used_reason/latest check-mode/candidate playbooks。`IncidentCard` 顯示 `執行明細:Executor / Operation / Ansible / PlayBook`。 +- 驗證:後端 `py_compile` pass;status-chain 單測 `35 passed`;ruff `F/E9/I` pass;i18n JSON ok;web typecheck pass;targeted lint exit 0;production build 90/90 static pages。Local Playwright mock execution detail 確認 50 張 card 顯示 `Executor ansible`、`ansible_check_mode_executed`、`188-ai-web.yml`。 +- Production / CI:`d4573cd0 feat(awooop): expose execution evidence on incidents` 已推 Gitea main;deploy marker `f79e6718 chore(cd): deploy d4573cd [skip ci]`。Actions:#1929 Code Review success 17s、#1928 CD success 9m11s。Production `status-chain?incident_id=INC-20260520-4D1124` 回 `latest_operation_type=ansible_candidate_matched`、`latest_status=dry_run`、`latest_executor=ansible`、Ansible considered=true、record_total=1、candidate_count=4,candidate playbooks include `110-devops.yml`、`188-ai-web.yml`、`nginx-sync.yml`。Production Alerts Playwright 確認 `incident-execution-evidence=50`,範例顯示 Ansible not-used reason 或 candidate PlayBook basename,pageErrors=0 / consoleErrors=0。 +- 邊界:T108 是 execution visibility,不把 Ansible 接成 apply executor、不新增 auto-repair 權限、不改 approval / execution / rollback gate。`Ansible 已納入` 只代表 audit/candidate/check-mode evidence,不能解讀成已自動 apply。 +- 目前進度更新:首頁資料可信度約 99.9%;Alerts 完整清單可追蹤性約 99.95%;前端 AI 自動化管理介面同步約 99.97%;AwoooP 告警可觀測鏈約 99.92%;MCP / 自建 MCP 使用證據可見性約 99.6%;Execution / Ansible / PlayBook 證據可見性約 99.3%;MCP Gateway enforcement 可驗證性約 96.5%;Ansible 自動執行成熟度約 82%;低風險自動修復閉環約 95.3%;完整 AI 自動化管理產品化約 99.35%。 + --- ### 2026-04-20 晚 (台北) — C1-C4 全流程串接 — Playbook 鏈路保護(commit de2d34d)