docs(logbook): 記錄全產品 Code Review Gate 正式驗證 [skip ci]
This commit is contained in:
@@ -31,7 +31,42 @@
|
||||
- Telegram Bot / TG 群組契約:`50% -> 52%`;no-send / no-new-bypass audit event 已可視化,實發仍 `0%`。
|
||||
|
||||
**邊界**:本段沒有 owner response accepted、沒有 audit DB write、沒有 timeline write、沒有 KM write、沒有 PlayBook trust update、沒有 Gateway queue write、沒有 Telegram send、沒有 Bot API call、沒有 receipt production write、沒有 production write、沒有 secret read、沒有 paid API call、沒有 host write、沒有 kubectl action、沒有 destructive operation、沒有 runtime worker、沒有 action button。P2-410 UI 是可視化與證據讀回,不是 runtime 授權。
|
||||
## 2026-06-19|P2-111 全產品 Code Review 防木馬 Gate 正式完成
|
||||
|
||||
**背景**:統帥要求所有網站、專案與產品每次推版前 / 後都要有 Code Review 機制,避免程式碼被植入木馬;同時要求專業評估 ElephantAlpha、Aider 與主流 AI / supply-chain 工具如何納入。既有 `code-review.yaml` 主要保護 AWOOOI main push,尚未把 Tenants 全域產品資產、Aider 事件、供應鏈漂移、AI reviewer 分工、推版後 verifier 與 owner gate 收斂成同一張可讀回 Gate。
|
||||
|
||||
**完成內容**:
|
||||
- 新增 `docs/schemas/product_code_review_gate_v1.schema.json` 與 `docs/evaluations/product_code_review_gate_2026-06-19.json`。
|
||||
- 新增 `apps/api/src/services/product_code_review_gate.py` 與 `GET /api/v1/agents/product-code-review-gate`。
|
||||
- 新增 `apps/api/tests/test_product_code_review_gate.py` 與 `apps/api/tests/test_product_code_review_gate_api.py`。
|
||||
- `/zh-TW/code-review` 新增 `全產品 Code Review / 防木馬 Gate` 區塊,串起 Tenants 全域資產、推版前 Gate、推版後 Gate、AI reviewer lanes 與主流工具候選。
|
||||
- P2-111 固定產品 / 專案範圍 `16`、網站入口至少 `31`、source candidate repo `10`、推版前 Gate `8`、推版後 Gate `6`、AI reviewer `5`、主流工具候選 `9`、owner review required `9`、critical gap `6`、blocked runtime action `17`、active write gate `0`、action button `0`。
|
||||
- AI reviewer 分工固定為 Hermes 證據 / KM draft、OpenClaw 規則 / 供應鏈仲裁、ElephantAlpha 高風險只讀 review、NemoTron replay / no-write 分析、Aider approved patch draft;Aider 不 auto-merge、不自動改 production code。
|
||||
- 主流工具候選納入 CodeQL、Semgrep、Gitleaks、OSV-Scanner、Trivy、OpenSSF Scorecard、SLSA、Sigstore / cosign、CodeRabbit / Snyk;本輪只做候選與 Gate readback,不安裝外部 GitHub App、不啟用付費 API、不改 workflow secret。
|
||||
- 追加 `00553e69 ci(cd): 修正 Docker build lock 空鎖自清`,修正 Gitea CD Docker build lock 對 ISO `CreatedAt` 解析失敗時無法自清、導致部署卡滿等待的問題。
|
||||
- 追加 `68f70f7c fix(web): 修正 Code Review Gate 手機溢出`,讓推版前 / 推版後 Gate 與工具 lane 在 390px 手機寬度下不再被英文 gate name 撐出水平溢位。
|
||||
|
||||
**驗證**:
|
||||
- 本地:`DATABASE_URL='postgresql+asyncpg://ci:ci@localhost/ci' PYTHONPATH=apps/api PYTHONFAULTHANDLER=1 pytest apps/api/tests/test_product_code_review_gate.py apps/api/tests/test_product_code_review_gate_api.py apps/api/tests/test_awooop_tenant_asset_inventory.py -q`:`10 passed`。
|
||||
- 本地:`python3 -m py_compile apps/api/src/services/product_code_review_gate.py apps/api/src/api/v1/agents.py` 通過。
|
||||
- 本地:P2-111 schema / snapshot / zh-TW / en messages JSON parse 通過;i18n key mirror `missing_en=0 / missing_zh=0 / type_diff=0`。
|
||||
- 本地:`git diff --check`、`git diff --cached --check`、`SOURCE_CONTROL_OWNER_RESPONSE_GUARD_OK`、`SECURITY_MIRROR_PROGRESS_GUARD_OK` 通過。
|
||||
- 本地限制:此臨時 worktree 缺 `apps/web/node_modules` / `tsc`,`pnpm --filter @awoooi/web typecheck` 無法本機執行;正式判定以 Gitea clean env code-review / CD 補足。
|
||||
- Gitea:`code-review #3229` 成功;首輪 CD `#3228` 因後續 main push 取消;`6f0a5f26` 觸發 CD `#3238` 成功,deploy marker `38e60192 chore(cd): deploy 6f0a5f2 [skip ci]`;手機溢出修正 `68f70f7c` 的 code-review `#3240` 成功、CD `#3239` 成功,deploy marker `46addb45 chore(cd): deploy 68f70f7 [skip ci]`。
|
||||
- Production health:`/api/v1/health` 回 `healthy / prod / mock_mode=false`。
|
||||
- Production API:`/api/v1/agents/product-code-review-gate` 回 `schema_version=product_code_review_gate_v1`、current `P2-111`、next `P2-112`、completion `100`、products `16`、routes `31`、pre / post `8 / 6`、AI reviewers `5`、tools `9`、write / action `0 / 0`、`runtime_execution_allowed=false`、`aider_auto_patch_allowed=false`。
|
||||
- Production browser smoke:`/zh-TW/code-review?_v=46addb45-product-code-review-desktop` desktop `1440x1000` 與 `/zh-TW/code-review?_v=46addb45-product-code-review-mobile` mobile `390x844` 均可見 P2-111、P2-112、推版前、推版後、CodeQL、Semgrep、Gitleaks、OSV-Scanner、SLSA、Sigstore、ElephantAlpha、Aider 與操作入口;`console error=0`、錯誤文字 `0`、內部工作片語 `0`。
|
||||
- Production browser smoke:desktop `clientWidth=1434 / scrollWidth=1434 / horizontalOverflow=false`;mobile `clientWidth=384 / scrollWidth=384 / horizontalOverflow=false`;`product-code-review-gate`、`product-code-review-matrix`、`product-code-review-prepost-gates`、`product-code-review-tool-lanes` 四個 test id 均存在。
|
||||
- 截圖:`/tmp/awoooi-product-code-review-desktop-46addb45.png`、`/tmp/awoooi-product-code-review-mobile-46addb45.png`。
|
||||
|
||||
**完成度同步**:
|
||||
- P2-111 全產品 Code Review 防木馬 Gate:本地 `100%`、正式 API `100%`、正式 desktop / mobile `100%`。
|
||||
- 全產品推版前 / 後 Code Review 治理 readback:`0% -> 62%`;本輪完成資產範圍、Gate read model、AI reviewer 分工、主流工具候選與正式頁面,但尚未把所有外部專案 repo workflow 全部改成 enforced blocking gate。
|
||||
- Supply-chain / anti-trojan maturity:`28% -> 44%`;已完成 CodeQL / Semgrep / Gitleaks / OSV / Trivy / Scorecard / SLSA / Sigstore / CodeRabbit / Snyk 候選與 owner gate,實際外部掃描器啟用仍需 owner approval。
|
||||
- Aider / ElephantAlpha 整合成熟度:`15% -> 35%`;已明確分工與 no-write 邊界,下一步才是把 Aider approved patch receipt、ElephantAlpha high-risk scorecard 接入 Work Items / Approvals。
|
||||
- IwoooS headline 仍維持 `64%`,active runtime gate 仍 `0`。
|
||||
|
||||
**邊界**:本段沒有啟用外部掃描服務、沒有安裝 GitHub App、沒有呼叫付費 AI reviewer、沒有讀 secret、沒有修改 workflow secret、沒有 auto-merge、沒有自動 deploy 授權、沒有 Aider 自動改 code、沒有 ElephantAlpha 寫入、沒有 production write、沒有 Telegram send、沒有 Gateway queue write、沒有 host probe、沒有 registry push、沒有 artifact signing 實作、沒有 runtime gate、沒有 action button。P2-111 是全產品 Code Review 防木馬 Gate 的 readback / owner review 基線,不是所有產品 repo 已被強制阻擋或外部安全掃描已啟用。
|
||||
## 2026-06-19|P2-410 AI Agent action audit ledger 本地 API 完成
|
||||
|
||||
**背景**:P2-408 已把中 / 低風險候選、dry-run verifier、rollback proof 與高風險分流固定成只讀合約;P2-409 已把 high / critical、Telegram / Gateway / Bot API、host / kubectl、secret / paid provider 與報表缺口工作項固定進 Owner Review Queue。但若沒有一份 action audit ledger,AI Agent 後續每次分類、拒收、轉人工、no-send 預覽與 runtime 阻擋都會停留在畫面或文件敘述,無法成為可驗證、可回放、可被 verifier receipt gate 接手的事件模板。
|
||||
|
||||
@@ -5223,3 +5223,21 @@ Trigger commit `f5cd37b7` 與 deploy marker `0ba92357` 已把 governance UI 的
|
||||
- 精準 API / service tests `9 passed`,web typecheck 通過。
|
||||
|
||||
**裁決:** P3-009 把 110 CPU runaway automation 從「工程機制已存在」提升成「產品可觀測閉環」。這仍不是 runtime 自動修復啟用;真正 remediation 仍須 owner approval、maintenance window、evidence ref、dry-run、post-check 與 KM / PlayBook / Verifier 回寫。
|
||||
|
||||
### 2026-06-19 01:30 (台北) — §8 / P2-111 — 全產品 Code Review 防木馬 Gate 正式上線
|
||||
|
||||
**觸發**:統帥要求所有網站、專案與產品每次推版前 / 後都要建立 Code Review 機制,防止木馬植入;同時要求專業評估 ElephantAlpha、Aider 與主流 AI / supply-chain 工具如何進入審查鏈路。舊 `code-review.yaml` 只保護 AWOOOI main push,尚未把 Tenants 全域資產、Aider 事件、供應鏈漂移、推版後 verifier 與 owner gate 收斂成產品級 Gate。
|
||||
|
||||
**已推進:**
|
||||
- 新增 `product_code_review_gate_v1` schema / committed snapshot / API service / API tests。
|
||||
- 新增 `GET /api/v1/agents/product-code-review-gate`,將 Tenants 全域資產與 Code Review Gate read model 串成同一份只讀合約。
|
||||
- `/zh-TW/code-review` 新增全產品推版前 / 推版後 Gate 視覺區塊,顯示產品範圍、網站入口、source candidate repo、pre/post deploy gates、AI reviewer lanes 與 mainstream tool lanes。
|
||||
- P2-111 固定產品 / 專案 `16`、網站入口至少 `31`、source candidate repo `10`、pre-deploy gate `8`、post-deploy gate `6`、AI reviewer `5`、mainstream tool `9`、owner review required `9`、critical gap `6`、blocked runtime action `17`、write/action `0/0`。
|
||||
- AI reviewer 分工固定:Hermes 負責證據與 KM draft、OpenClaw 負責規則與 supply-chain 仲裁、ElephantAlpha 負責高風險只讀 review、NemoTron 負責 replay / no-write 分析、Aider 只作 approved patch draft 與 test receipt,不 auto-merge。
|
||||
- 主流工具候選固定:CodeQL、Semgrep、Gitleaks、OSV-Scanner、Trivy、OpenSSF Scorecard、SLSA、Sigstore / cosign、CodeRabbit / Snyk;本輪只做候選與 owner gate,不啟用外部 scanner、不安裝 GitHub App、不呼叫付費 API。
|
||||
- 補 CD Docker build lock ISO `CreatedAt` 解析與空鎖自清,避免 deploy 卡在不可解析 lock;再補 `/zh-TW/code-review` mobile overflow 修正,確保 390px 手機寬度水平溢位 `0`。
|
||||
- 正式部署:feature commit `4a14860c`、CD lock fix `00553e69`、deploy trigger `6f0a5f26`、mobile overflow fix `68f70f7c`、deploy marker `46addb45 chore(cd): deploy 68f70f7 [skip ci]`。
|
||||
- Production API readback:`product_code_review_gate_v1`、current `P2-111`、next `P2-112`、completion `100`、products `16`、routes `31`、pre/post `8/6`、AI reviewers `5`、tools `9`、write/action `0/0`、`runtime_execution_allowed=false`、`aider_auto_patch_allowed=false`。
|
||||
- Production browser smoke:desktop `1440x1000`、mobile `390x844` 均可見 P2-111、P2-112、推版前、推版後、CodeQL、Semgrep、Gitleaks、OSV-Scanner、SLSA、Sigstore、ElephantAlpha、Aider;console error `0`、錯誤文字 `0`、內部工作片語 `0`、horizontal overflow `0`。
|
||||
|
||||
**裁決:** P2-111 把全產品 Code Review / 防木馬 Gate 從「想法」推到正式 API 與 UI readback,但仍不是外部掃描器啟用、GitHub App 安裝、付費 AI reviewer 呼叫、workflow secret 變更、auto-merge、Aider 自動改 code、ElephantAlpha 寫入、production write、Telegram send、Gateway queue write、host probe、registry push、artifact signing 或 runtime gate。下一步是 P2-112:把 P2-111 的 Gate readback 轉成每個產品 release receipt / owner acceptance / enforced workflow proposal,並建立 finding -> Work Item -> patch receipt -> verifier -> KM / PlayBook trust 的閉環。
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
| 項目 | 目前值 |
|
||||
|------|--------|
|
||||
| 工作視窗 | IwoooS / AWOOOI 資安治理 P0 |
|
||||
| 本次乾淨 worktree | `/private/tmp/awoooi-iwooos-notification-egress-20260619` |
|
||||
| 本次分支 | `codex/iwooos-notification-egress-20260619`;推送時使用一般 push,不 force push |
|
||||
| 最新觀察到的 `gitea/main` | `f390cddb feat(agents): 新增高風險 owner review queue`;P2-410 action audit ledger 目前為本地 schema / snapshot / API / tests 完成,正式 deploy marker 與 production readback 待推送後驗證 |
|
||||
| 本次乾淨 worktree | `/private/tmp/awoooi-code-review-governance-20260619` |
|
||||
| 本次分支 | `codex/code-review-governance-20260619`;推送時使用一般 push,不 force push |
|
||||
| 最新觀察到的 `gitea/main` | `46624123 feat(web): 顯示 P2-410 action audit ledger`;P2-111 全產品 Code Review 防木馬 Gate 已正式部署並完成 desktop / mobile smoke,P2-410 action audit ledger 已納入 governance UI projection;P2-111 的最新正式部署 marker 仍為 `46addb45` |
|
||||
| 最新 P0 Telegram 告警 / 批准執行真相鏈基準 | code `32e4beca`、deploy marker `717b5870`、code-review `2658`、CD `2657`;no-action approval 不再觸發 executor,可執行修復 approval 會寫入 `auto_repair_executions`、KM 與 verifier |
|
||||
| 最新 P0 Telegram no-action 人工處置包基準 | code `cd928852`、deploy marker `9181cc0e`、code-review `2666`;正式部署 tree 已包含 no-action 人工處置包、`處置包 / 重診 / 歷史 / 靜默 / 真相鏈 / Runs` 鍵盤、production pod render / keyboard smoke |
|
||||
| 最新 P0 MCP evidence / PlayBook 修復候選基準 | code `cc614023`、D1 blocker clarity `47d677ac`、D2 manual draft package `febe9ecf`、D3 draft work item `e8d5eafb`、D4 work item detail panel `e8a5bac5`、D5 coverage gap contract 本地完成;目前 production deploy marker 仍為 `985a2cfe` 的 D4 Work Items detail panel,D5 尚待推送 / 部署驗證。正式部署 tree 經 production pod smoke 與 Work Items browser smoke 確認可由 MCP evidence + approved PlayBook trust 產生 medium approval candidate、綁定預配置 approval id、不外露 preallocated metadata,且通用兜底 / 診斷型 PlayBook 不會被誤當修復命令;若缺安全修復候選,Telegram 人工處置包會顯示阻擋原因、下一步、PlayBook 草案欄位與 AwoooP 修復候選草案工作項,工作項頁會顯示 PlayBook 草案處置板、必填欄位、阻擋原因、下一步與 Runs / 審批連結;D5 讓 blocked result 進一步輸出服務 coverage gap、blocking stage、必收 MCP evidence refs 與 PlayBook template fields |
|
||||
@@ -19,6 +19,7 @@
|
||||
| 最新 P2-D2 註解語氣基準 | code `6ccdf199`、deploy marker `2857da80`、CD `2580`、code-review `2581`;`apps/web/src` 內部稱謂殘留 `32 → 0`;D1 高風險詞命中 `0` |
|
||||
| 最新 P2-D2 AIOps 範例資料基準 | code `d5ce17c7`、deploy marker `305b8175`;AIOps sample/mock 字串、GenUI 測試語氣與 `sampleBadge` 已正式驗證 |
|
||||
| 最新 P2-D2 Code Review 候選分類基準 | code `292cfec9`、deploy marker `4cfe5ff7`、CD `2586`、code-review `2587`;Code Review route 可見文案已搬到 `codeReview` i18n namespace,四類候選分類與人工批准流程已正式驗證 |
|
||||
| 最新 P2-111 全產品 Code Review 防木馬 Gate 基準 | code `4a14860c`、CD lock 修正 `00553e69`、deploy trigger `6f0a5f26`、mobile overflow fix `68f70f7c`、deploy marker `46addb45`;正式 API `product_code_review_gate_v1` 顯示產品 `16`、網站入口 `31`、source candidate repo `10`、推版前 Gate `8`、推版後 Gate `6`、AI reviewer `5`、主流工具候選 `9`、write/action `0/0`;`/zh-TW/code-review` desktop / mobile 已驗證 `horizontalOverflow=0` |
|
||||
| 最新 P2-D2 AwoooP Runs fallback 文案基準 | code `7f6028c3`、deploy marker `bf016e91`、CD `2590`、code-review `2591`;Runs / Callback / Source Flow fallback 文案已正式驗證 |
|
||||
| 最新 AwoooP Tenants 全域產品資產台帳 D1 基準 | code `fef94df8`、deploy marker `180a6543`、code-review `2967`、CD `2966`;正式 API 顯示產品 / 專案 `16`、網站 / 服務入口 `31`、source-control candidate repo `10`,已納入 `2026fifa.wooo.work`、WOOO Open Design、n8n、Grist、Vault、Ollama、Monitor 與 AWOOOI API / AIOps 服務入口;owner response / runtime gate / action button 仍 `0` |
|
||||
| 最新 P0 Public Gateway / DNS TLS / K8s 配置控管基準 | P0-15 `5068654d` live conf 匯出請求包、P0-16 `f856df1c` redacted export 收件預檢、P0-17 `762f73a6` rendered diff / nginx gate 草稿、P0-19 `551d8144` DNS / TLS / certbot owner confirmation request 草稿、P0-20 `e8876c45` K8s / ArgoCD manifest repo-only 清冊、P0-21 `e8de19d7` K8s / ArgoCD owner request draft;本輪新增 P0-24 Public Gateway owner response acceptance 只讀帳本、P0-25 K8s / ArgoCD owner response acceptance 只讀帳本與 P0-27 DNS / TLS / certbot owner response acceptance 只讀帳本;Public Gateway 四段固定 requests / candidates `3`、C0 `2`、owner response acceptance fields `12`、reviewer checks `12`、outcome lanes `7`,DNS / TLS 固定 owner confirmation requests `4`、C0 `4`,DNS / TLS owner response acceptance 固定 candidates `4`、C0 `4`、owner fields `13`、reviewer checks `13`、outcome lanes `7`、blocked actions `20`,K8s manifest 固定 files `49`、C0 `36`、YAML `45`、kinds `20`,K8s owner request 固定 drafts `4`、C0 `3`,K8s owner response acceptance 固定 candidates `4`、C0 `3`、reviewer checks `12`、outcome lanes `7`;request sent、owner response received / accepted、redacted export received / accepted、raw conf stored、rendered diff ready、`nginx -t`、reload、DNS query、TLS probe、certbot renew、ArgoCD API read、ArgoCD sync、kubectl action、route smoke、runtime gate、action button 全部 `0` |
|
||||
@@ -58,6 +59,7 @@
|
||||
| IwoooS P2 首屏 UX / 資安圖表 | 本地階段 `100%`;正式站 `100%`;本輪前端發佈 `100%` | 否 | 首屏已精簡成摘要、資安網圖、拓樸圖譜、決策閘門與矩陣;S4.9 與長證據改為展開式。這只完成 P2 視覺 / 資訊架構 slice,不調高 IwoooS 整體 64% |
|
||||
| Frontend design system / visual grammar | 維持 `60%` | 否 | 本輪只推進 IwoooS 頁面資訊架構與圖表排序,不宣稱全站設計系統完成 |
|
||||
| P2 全站繁中治理 D0+D1+D2 註解語氣 / AIOps sample / Code Review 候選分類 / AwoooP Runs fallback | `53%` | 只限高風險可見 literal、盤點、註解語氣、AIOps 範例資料命名、Code Review route i18n 與 AwoooP Runs fallback readability | D0 已清 messages 高風險殘留;D1 已掃 `apps/web/src` 字串 literal 並修正高風險可見 / bundle 文案;D2 已清 `apps/web/src` 內部稱謂註解、AIOps sample/mock 命名、Code Review 可見文案搬進 `codeReview` namespace,並清理 Runs / Callback / Source Flow fallback 可見殘留。全站 hardcoded TSX 可見 literal 仍需後續分批搬遷 |
|
||||
| 全產品推版前 / 後 Code Review 防木馬 Gate | readback / owner review 基線 `62%`;P2-111 本地 / 正式 API / desktop / mobile `100%` | 是,僅限全產品資產範圍、推版前後 Gate read model、AI reviewer 分工、主流工具候選、正式頁面與 mobile overflow 修正 | P2-111 已把 Tenants 全域產品資產、Gitea code-review、供應鏈漂移、Aider 事件、ElephantAlpha 高風險審查與主流工具候選收斂成 `/api/v1/agents/product-code-review-gate` 與 `/zh-TW/code-review`;目前仍不代表所有外部產品 repo workflow 已 enforced、不代表外部 scanner / paid AI reviewer 已啟用、不代表 auto-merge 或 runtime gate 開啟 |
|
||||
| AI Agent automation inventory UX / readability | 本地 `100%`;正式站 `100%` | 否 | 治理頁已把 P1-002 後資料重排為決策指揮摘要、決策支援六因子覆蓋率與 Gitea / Runner 缺口矩陣;這是可讀性與決策支援 slice,不調高 backlog `78%`、IwoooS `64%`、S4.9 gate 或 active runtime gate |
|
||||
| Knowledge Base KM 自動化掌控台 / 資產沉澱可視化 | 本地 `100%`;正式站 desktop / mobile `100%` | 是,僅限 KM governance readback、Owner Review queue、資產沉澱總帳與 Work Items 接續入口 | `/zh-TW/knowledge-base` 已把 `KM 自動化掌控台` 前移到首屏,直接顯示 stale ratio `98.8%`、stale KM `1,900`、Owner Review `10`、`ready 10 / blocked 0`、已寫回 `1`、治理流程圖與 `KM / PlayBook / 腳本 / 排程 / Verifier` 五類沉澱狀態;不寫 KM、不提升 PlayBook trust、不批次完成 owner review、不開 runtime gate |
|
||||
| Observability AI 自動化資產與訊號總帳 | 本地 `100%`;正式站 desktop / mobile `100%` | 是,僅限主機 / 專案 / 網站 / 服務 / 監控訊號 / KM / PlayBook / Verifier / SRE 路由 readback | `/zh-TW/observability` 已把 `AI 自動化資產與訊號總帳` 前移到首屏,6 張卡顯示全域資產、監控訊號、服務健康、KM / PlayBook / Verifier、SRE 戰情室、Runtime Gate;總帳區操作入口 `0`,不 live probe、不 reload、不改規則、不發 Telegram、不套用修復 |
|
||||
|
||||
Reference in New Issue
Block a user