feat(agents): route high risk through controlled automation
Some checks failed
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / tests (push) Failing after 1m8s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Ansible / Reboot Recovery Contract / validate (push) Has been cancelled

This commit is contained in:
Your Name
2026-06-26 18:52:19 +08:00
parent 717f0edd33
commit e0a86b6254
65 changed files with 733 additions and 516 deletions

View File

@@ -7,7 +7,7 @@ Runbook Generator - Phase 25 P1 Knowledge Auto-Harvesting
設計原則:
- 非阻塞asyncio.create_task() 呼叫,絕不影響 AutoRepair 主流程
- 失敗靜默:生成失敗只記 log不拋例外
- DRAFT/PUBLISHED成功 → DRAFT需人工審核),失敗 → PUBLISHED直接封鎖
- DRAFT/PUBLISHED成功 → DRAFTAI controlled review queue),失敗 → PUBLISHED直接封鎖
版本: v1.1
建立: 2026-04-04 (台北時區)
@@ -89,9 +89,9 @@ def _section_preview(content: str, title_keyword: str, *, fallback: str) -> str:
def _step_preview(content: str) -> str:
preview = _section_preview(content, "執行", fallback="審核 Runbook 執行步驟")
preview = _section_preview(content, "執行", fallback=" controlled review 的 Runbook 執行步驟")
if any(token in preview for token in ("{host}", "{target}", "Unsupported scheme", "Invalid component name")):
return "含 placeholder 或不支援的執行步驟,需人工修正後才能發布"
return "含 placeholder 或不支援的執行步驟,需 AI 修補 / break-glass 後才能發布"
return _shorten(preview, 120)
@@ -115,7 +115,7 @@ def format_runbook_review_card(
"──────────────────────\n"
f"📋 Incident<code>{_html(incident_id)}</code>\n"
f"🧩 受影響服務:<code>{_html(services)}</code>\n"
"🧠 知識狀態:<b>DRAFT需人工審核</b>\n"
"🧠 知識狀態:<b>DRAFTAI controlled review</b>\n"
f"🗂️ Entry ID<code>{_html(entry_id)}</code>\n\n"
"🧾 <b>內容摘要</b>\n"
f"├ 症狀:{_html(symptom)}\n"