fix(awooop): exclude audit-only ops from repair quality
This commit is contained in:
@@ -61,7 +61,7 @@ def test_truth_status_marks_no_action_approval_as_manual_required() -> None:
|
||||
def test_truth_status_does_not_treat_no_action_audit_as_execution() -> None:
|
||||
status = _truth_status(
|
||||
incident={"incident_id": "INC-1", "status": "RESOLVED"},
|
||||
approvals=[{"status": "APPROVED", "action": "未知操作 | NO_ACTION"}],
|
||||
approvals=[{"status": "EXECUTION_SUCCESS", "action": "未知操作 | NO_ACTION"}],
|
||||
evidence_rows=[{"sensors_attempted": 8, "sensors_succeeded": 6}],
|
||||
automation_ops=[
|
||||
{
|
||||
@@ -71,6 +71,11 @@ def test_truth_status_does_not_treat_no_action_audit_as_execution() -> None:
|
||||
"output_reason": "NO_ACTION",
|
||||
"output_action": "未知操作 | NO_ACTION",
|
||||
},
|
||||
{
|
||||
"operation_type": "ansible_candidate_matched",
|
||||
"status": "dry_run",
|
||||
"output_not_used_reason": "Ansible check-mode is not wired yet",
|
||||
},
|
||||
],
|
||||
drift=None,
|
||||
drift_repeat_count=0,
|
||||
@@ -279,7 +284,7 @@ def test_automation_quality_marks_no_action_without_execution() -> None:
|
||||
def test_automation_quality_ignores_no_action_audit_rows_as_execution() -> None:
|
||||
quality = build_automation_quality(
|
||||
incident={"incident_id": "INC-1", "status": "RESOLVED"},
|
||||
approvals=[{"status": "APPROVED", "action": "未知操作 | NO_ACTION"}],
|
||||
approvals=[{"status": "EXECUTION_SUCCESS", "action": "未知操作 | NO_ACTION"}],
|
||||
evidence_rows=[{"sensors_attempted": 8, "sensors_succeeded": 6}],
|
||||
automation_ops=[
|
||||
{
|
||||
@@ -289,6 +294,11 @@ def test_automation_quality_ignores_no_action_audit_rows_as_execution() -> None:
|
||||
"output_reason": "NO_ACTION",
|
||||
"output_action": "未知操作 | NO_ACTION",
|
||||
},
|
||||
{
|
||||
"operation_type": "ansible_candidate_matched",
|
||||
"status": "dry_run",
|
||||
"output_not_used_reason": "Ansible check-mode is not wired yet",
|
||||
},
|
||||
],
|
||||
auto_repair_executions=[],
|
||||
gateway_mcp_summary={"total": 8},
|
||||
@@ -300,9 +310,10 @@ def test_automation_quality_ignores_no_action_audit_rows_as_execution() -> None:
|
||||
|
||||
gates = {row["name"]: row["status"] for row in quality["gates"]}
|
||||
assert quality["verdict"] == "manual_required_no_action"
|
||||
assert quality["facts"]["automation_operation_records"] == 1
|
||||
assert quality["facts"]["automation_operation_records"] == 2
|
||||
assert quality["facts"]["effective_execution_records"] == 0
|
||||
assert quality["facts"]["noop_operation_records"] == 1
|
||||
assert quality["facts"]["audit_only_operation_records"] == 1
|
||||
assert gates["execution_recorded"] == "missing"
|
||||
assert gates["verification_recorded"] == "not_applicable"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user