fix(api): prefer latest repair terminal truth
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m45s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m45s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -889,6 +889,35 @@ def test_automation_quality_marks_verified_auto_repair() -> None:
|
||||
assert quality["blockers"] == []
|
||||
|
||||
|
||||
def test_latest_verified_repair_supersedes_historical_failed_apply() -> None:
|
||||
quality = build_automation_quality(
|
||||
incident={
|
||||
"incident_id": "INC-REPAIRED-AFTER-FAILURE",
|
||||
"status": "RESOLVED",
|
||||
"verification_result": "success",
|
||||
},
|
||||
approvals=[],
|
||||
evidence_rows=[{"sensors_attempted": 3, "sensors_succeeded": 3}],
|
||||
automation_ops=[
|
||||
{"operation_type": "ansible_apply_executed", "status": "success"},
|
||||
{"operation_type": "ansible_apply_executed", "status": "failed"},
|
||||
],
|
||||
auto_repair_executions=[
|
||||
{"id": "repair-new", "success": True, "playbook_id": "pb-v5"},
|
||||
{"id": "repair-old", "success": False, "playbook_id": "pb-v4"},
|
||||
],
|
||||
gateway_mcp_summary={"total": 3},
|
||||
legacy_mcp_summary={"total": 0},
|
||||
outbound_rows=[{"message_id": "m-success"}],
|
||||
km_entries=[{"id": "km-success"}],
|
||||
timeline_events=[{"id": "tl-success"}],
|
||||
)
|
||||
|
||||
assert quality["verdict"] == "auto_repaired_verified"
|
||||
assert quality["facts"]["latest_auto_repair_success"] is True
|
||||
assert quality["blockers"] == []
|
||||
|
||||
|
||||
def test_automation_quality_marks_degraded_auto_repair_verification() -> None:
|
||||
quality = build_automation_quality(
|
||||
incident={
|
||||
|
||||
Reference in New Issue
Block a user