feat(code-review): ADR-020 全自動修復政策 — 拆掉 CRITICAL/HIGH HITL 閘門
All checks were successful
CD Pipeline / deploy (push) Successful in 2m23s

post-deploy code review pipeline 改為「任何 finding 一律觸發 AiderHeal」,
局部覆寫 ADR-012 L3 HITL(不影響 schema migration / 流量切換 /
customer-facing 廣播 / AIOps prod SSH 等其他 L3 場景)。安全網改為
Git revert + Gitea CI/CD 健康檢查 + 主開關 CODE_REVIEW_AUTO_FIX_ENABLED。

實作:
  • _ea_orchestrate / _guard_ea_decision / rule fallback 三條路徑統一為
    has_findings AND AUTO_FIX_ENABLED → auto_fix=true
  • _guard 強制 LLM 即使回 auto_fix=False 也升級為 true(核心保證)
  • CODE_REVIEW_AUTO_FIX_ENABLED 預設 false → true
  • Telegram 文案移除「需人工審查」,改顯示主開關狀態
  • action_plan status pending_review → auto_disabled(語意對齊)
  • aider_heal_executor 標頭 ADR-014 → ADR-020、補「直推 main」分支策略

文件:
  • 新增 docs/adr/ADR-020-code-review-full-autoheal.md
  • ADR-012 加 Note 行反向引用 ADR-020
  • README 索引收錄

測試:tests/test_code_review_pipeline_security.py 反轉 HITL 期望,
新增 5 case(含 LLM 降級被 guard 拒絕、LLM human_review_needed=true 被改 false)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
OoO
2026-05-02 23:44:01 +08:00
parent b5a2b09445
commit 6cad59f83e
7 changed files with 203 additions and 34 deletions

View File

@@ -183,8 +183,10 @@ INITIAL_ADMIN_PASSWORD=your_initial_admin_password_here
# 不設則所有 /bot/api/* 端點拒絕請求
BOT_API_TOKEN=your_bot_api_token_here
# [填] Post-deploy AI code review pipeline 自動修復開關
CODE_REVIEW_AUTO_FIX_ENABLED=false
# [填] Post-deploy AI code review pipeline 自動修復開關
# ADR-020 規定預設 true任何 finding 一律自動觸發 AiderHeal安全網=Git+CI/CD 回滾)
# 僅在需要短期關閉自動修復鏈時設為 false
CODE_REVIEW_AUTO_FIX_ENABLED=true
# [選填] 僅本機開發可設 true正式環境不得允許不安全 internal webhook
MOMO_ALLOW_INSECURE_INTERNAL_WEBHOOK_FOR_DEV=false