fix(awooop): surface ansible apply proof
This commit is contained in:
@@ -38,6 +38,7 @@ from src.db.base import get_db_context
|
||||
from src.db.models import IncidentRecord, MCPAuditLog
|
||||
from src.services.audit_sink import write_audit
|
||||
from src.services.awooop_approval_token import issue_approval_token, record_approval
|
||||
from src.services.awooop_ansible_audit_service import summarize_ansible_execution
|
||||
from src.services.awooop_truth_chain_service import (
|
||||
_summarize_gateway_mcp,
|
||||
_summarize_mcp,
|
||||
@@ -2922,6 +2923,11 @@ def _status_chain_execution_section(truth_chain: dict[str, Any] | None) -> dict[
|
||||
if isinstance(candidate_catalog.get("candidates"), list)
|
||||
else []
|
||||
)
|
||||
ansible_summary = (
|
||||
ansible.get("summary")
|
||||
if isinstance(ansible.get("summary"), dict)
|
||||
else summarize_ansible_execution([row for row in ansible_records if isinstance(row, dict)])
|
||||
)
|
||||
|
||||
return {
|
||||
"operation_total": len(ops),
|
||||
@@ -2945,10 +2951,26 @@ def _status_chain_execution_section(truth_chain: dict[str, Any] | None) -> dict[
|
||||
"record_total": len(ansible_records),
|
||||
"candidate_count": len(candidates),
|
||||
"not_used_reason": ansible.get("not_used_reason"),
|
||||
"latest_operation_type": latest_ansible.get("operation_type"),
|
||||
"latest_status": latest_ansible.get("status"),
|
||||
"latest_playbook_path": latest_ansible.get("playbook_path"),
|
||||
"latest_check_mode": latest_ansible.get("check_mode"),
|
||||
"check_mode_total": ansible_summary.get("check_mode_total"),
|
||||
"apply_total": ansible_summary.get("apply_total"),
|
||||
"rollback_total": ansible_summary.get("rollback_total"),
|
||||
"pending_check_mode_total": ansible_summary.get("pending_check_mode_total"),
|
||||
"applied_success_total": ansible_summary.get("applied_success_total"),
|
||||
"applied": ansible_summary.get("applied"),
|
||||
"controlled_apply": ansible_summary.get("controlled_apply"),
|
||||
"latest_operation_type": ansible_summary.get("latest_operation_type") or latest_ansible.get("operation_type"),
|
||||
"latest_status": ansible_summary.get("latest_status") or latest_ansible.get("status"),
|
||||
"latest_catalog_id": ansible_summary.get("latest_catalog_id") or latest_ansible.get("catalog_id"),
|
||||
"latest_playbook_path": ansible_summary.get("latest_playbook_path") or latest_ansible.get("playbook_path"),
|
||||
"latest_execution_mode": ansible_summary.get("latest_execution_mode") or latest_ansible.get("execution_mode"),
|
||||
"latest_check_mode": (
|
||||
ansible_summary.get("latest_check_mode")
|
||||
if ansible_summary.get("latest_check_mode") is not None
|
||||
else latest_ansible.get("check_mode")
|
||||
),
|
||||
"latest_returncode": ansible_summary.get("latest_returncode"),
|
||||
"latest_apply_executed": ansible_summary.get("latest_apply_executed"),
|
||||
"approval_source": ansible_summary.get("approval_source"),
|
||||
"candidate_playbooks": [
|
||||
{
|
||||
"catalog_id": item.get("catalog_id"),
|
||||
|
||||
Reference in New Issue
Block a user