diff --git a/docs/LOGBOOK.md b/docs/LOGBOOK.md index 94c4fb6b..7d3ca07a 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -1,3 +1,35 @@ +## 2026-06-27 — 22:51 AwoooP controlled automation copy guard 進 main + +**背景**:上一段已把正式 AwoooP Approvals / Runs / Work Items / Alerts HTML payload 中殘留的舊 manual gate 語意清零;本段不是再做文案文件,而是把防回歸規則寫成 repo guard,避免 `待人工決策`、`阻塞與人工閘門`、`人工接手`、`manual gate`、`owner review` 等語意再次回到低 / 中 / 高風險流程。 + +**完成內容**: +- 新增 `scripts/security/awooop-controlled-automation-copy-guard.py`,read-only 掃描 AwoooP routes 與 zh-TW / en messages,禁止舊 manual / default-human gate 字串回流。 +- guard 要求正式 copy 保留 controlled automation 新語意:`待 AI 受控決策`、`阻塞與 AI 受控隊列`、`AI 處置包與工作項`、`受控執行邊界`、`受控授權閘門`、`controlled gate`、`controlled review`。 +- guard 同時鎖定 `/zh-TW/awooop/alerts` 必須存在並導向 `#ai-alert-card-delivery-readback`,避免 Alerts smoke 退回 404。 +- `scripts/security/security-mirror-progress-guard.py` 已串接 AwoooP controlled automation copy guard。 +- 新增 `apps/api/tests/test_awooop_controlled_automation_copy_guard.py`,把 guard 納入 pytest 防線。 + +**本地驗證結果**: +- `python3 scripts/security/awooop-controlled-automation-copy-guard.py --root .`:`AWOOOP_CONTROLLED_AUTOMATION_COPY_GUARD_OK`。 +- `python3 -m py_compile scripts/security/awooop-controlled-automation-copy-guard.py scripts/security/security-mirror-progress-guard.py apps/api/tests/test_awooop_controlled_automation_copy_guard.py`:通過。 +- `DATABASE_URL=sqlite:///test.db PYTHONPATH=apps/api python3.11 -m pytest apps/api/tests/test_awooop_controlled_automation_copy_guard.py -q`:`1 passed`。 +- `python3 scripts/security/security-mirror-progress-guard.py --root .`:`SECURITY_MIRROR_PROGRESS_GUARD_OK`。 +- `git diff --check`:通過。 + +**Gitea / CI 狀態**: +- guard commit:`219fc3835 test(awooop): guard controlled automation copy`。 +- rebase 當下 `gitea-ssh/main=0e2e8057c` 已包含 `219fc3835`;本 LOGBOOK commit 會再推進 main head。 +- `code-review.yaml #3710` 因較新的 main push 被取消;最新 head `0040a595a` 的 `code-review.yaml #3712` 成功,`ansible-lint.yml #3711` 成功。 +- `cd.yaml #3709` 是 `219fc3835` 被後續 push supersede 後的舊 run;本段 guard / test 變更不在 CD path filter 內,不需要新的 deploy marker 才能生效於 repo 防線。 + +**production readback 邊界**: +- 產品 runtime 仍由上一段 deploy marker `f98aaa8ee chore(cd): deploy a2733fd [skip ci]` 覆蓋的 AwoooP copy 清理提供。 +- 重新讀回 Approvals / Runs / Work Items / Alerts:HTTP `200`,舊詞 hit count 皆為 `0`;Alerts final URL 仍回 `/zh-TW/awooop/runs`。 +- 本段未做 host / Docker / systemd / Nginx / firewall / K8s / DB / Wazuh runtime 寫操作,未讀 secret,未 force push。 + +**下一步**: +- 後續若再改 AwoooP / IwoooS approval 類 copy,必須先跑 `python3 scripts/security/awooop-controlled-automation-copy-guard.py --root .` 與 `python3 scripts/security/security-mirror-progress-guard.py --root .`,避免把 manual gate 當作 low / medium / high 的預設終局。 + ## 2026-06-27 — 22:28 AwoooP manual gate payload residue 正式清零 **背景**:正式 `/zh-TW/awooop/approvals`、Runs、Work Items 的 HTML payload 仍因 Next / i18n namespace 序列化帶出 IwoooS 舊文案 `人工閘門`,每頁各命中 32 次;`/zh-TW/awooop/alerts` 也回 404。這會讓 AwoooP 看起來仍把人工 gate 當作 low / medium / high 的預設終局。