fix(alerts): 補齊處置結果與人工通知契約
Some checks failed
CD Pipeline / tests (push) Failing after 45s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Code Review / ai-code-review (push) Successful in 12s

This commit is contained in:
Your Name
2026-05-31 15:41:09 +08:00
parent 03f2abf576
commit 3d8b395032
14 changed files with 888 additions and 75 deletions

View File

@@ -660,6 +660,8 @@ class ApprovalDBService:
success: bool,
error_message: str | None = None,
execution_kind: str | None = None,
repair_executed: bool | None = None,
repair_attempted: bool | None = None,
) -> None:
"""
更新執行狀態
@@ -691,7 +693,18 @@ class ApprovalDBService:
# 但前台/報表必須能分辨「未執行修復」而非真正 execution success。
metadata = dict(record.extra_metadata or {})
metadata["execution_kind"] = execution_kind
metadata["repair_executed"] = execution_kind != "no_action"
metadata["repair_executed"] = (
repair_executed
if repair_executed is not None
else execution_kind not in {
"no_action",
"diagnostic",
"parse_failed",
"unsupported_action",
}
)
if repair_attempted is not None:
metadata["repair_attempted"] = repair_attempted
record.extra_metadata = metadata
logger.info(