feat(smoke): monitor pchome verifier receipt closeout
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
This commit is contained in:
@@ -107,10 +107,10 @@ def test_system_metrics_exports_scheduled_health_summary():
|
||||
Gauge,
|
||||
{
|
||||
"summary": {
|
||||
"ok": 18,
|
||||
"ok": 19,
|
||||
"warning": 1,
|
||||
"critical": 0,
|
||||
"total": 19,
|
||||
"total": 20,
|
||||
"primary_human_gate_count": 0,
|
||||
"writes_database_count": 0,
|
||||
},
|
||||
@@ -131,6 +131,7 @@ def test_system_metrics_exports_scheduled_health_summary():
|
||||
{"key": "pchome_auto_policy_signed_receipt_closeout", "status": "ok"},
|
||||
{"key": "pchome_auto_policy_signed_receipt_evidence_intake", "status": "ok"},
|
||||
{"key": "pchome_auto_policy_detached_verification_evidence_validation", "status": "ok"},
|
||||
{"key": "pchome_auto_policy_verifier_receipt_closeout", "status": "ok"},
|
||||
{"key": "sitewide_ui_ux_agent", "status": "ok"},
|
||||
{"key": "sitewide_visual_qa", "status": "ok"},
|
||||
],
|
||||
@@ -138,7 +139,7 @@ def test_system_metrics_exports_scheduled_health_summary():
|
||||
)
|
||||
|
||||
output = generate_latest(registry).decode("utf-8")
|
||||
assert 'momo_ai_automation_scheduled_health_summary_total{status="ok"} 18.0' in output
|
||||
assert 'momo_ai_automation_scheduled_health_summary_total{status="ok"} 19.0' in output
|
||||
assert 'momo_ai_automation_scheduled_health_summary_total{status="warning"} 1.0' in output
|
||||
assert (
|
||||
'momo_ai_automation_scheduled_health_family_status{family="ai_automation_smoke",status="ok"} 1.0'
|
||||
@@ -204,6 +205,10 @@ def test_system_metrics_exports_scheduled_health_summary():
|
||||
'momo_ai_automation_scheduled_health_family_status{family="pchome_auto_policy_detached_verification_evidence_validation",status="ok"} 1.0'
|
||||
in output
|
||||
)
|
||||
assert (
|
||||
'momo_ai_automation_scheduled_health_family_status{family="pchome_auto_policy_verifier_receipt_closeout",status="ok"} 1.0'
|
||||
in output
|
||||
)
|
||||
assert (
|
||||
'momo_ai_automation_scheduled_health_family_status{family="sitewide_ui_ux_agent",status="ok"} 1.0'
|
||||
in output
|
||||
|
||||
@@ -696,6 +696,82 @@ def _auto_policy_detached_verification_evidence_validation_history_check(status=
|
||||
}
|
||||
|
||||
|
||||
def _auto_policy_verifier_receipt_closeout_history_check(status="ok"):
|
||||
return {
|
||||
"name": "PChome auto-policy verifier receipt closeout",
|
||||
"status": status,
|
||||
"summary": "PChome auto-policy verifier receipt closeout 已自動完成",
|
||||
"details": {
|
||||
"policy": (
|
||||
"read_only_pchome_growth_auto_policy_db_apply_authorization_"
|
||||
"verifier_receipt_closeout"
|
||||
),
|
||||
"result": "DB_APPLY_AUTHORIZATION_VERIFIER_RECEIPT_CLOSEOUT_READY",
|
||||
"verifier_receipt_closeout_ready_count": 1,
|
||||
"verifier_receipt_closeout_check_count": 12,
|
||||
"verifier_receipt_closeout_pass_count": 12,
|
||||
"verifier_receipt_closeout_waiting_count": 0,
|
||||
"detached_verification_evidence_validation_ready_count": 1,
|
||||
"detached_verification_evidence_validation_check_count": 12,
|
||||
"signed_receipt_evidence_intake_ready_count": 1,
|
||||
"signed_receipt_evidence_intake_check_count": 12,
|
||||
"verifier_receipt_closeout_boundary_count": 1,
|
||||
"verifier_receipt_evidence_handoff_count": 1,
|
||||
"required_external_receipt_evidence_count": 10,
|
||||
"external_receipt_acceptance_gate_count": 8,
|
||||
"verifier_receipt_field_count": 12,
|
||||
"verifier_receipt_acceptance_gate_count": 10,
|
||||
"verifier_receipt_evidence_handoff_field_count": 12,
|
||||
"verifier_receipt_handoff_acceptance_gate_count": 10,
|
||||
"detached_verification_evidence_field_count": 12,
|
||||
"detached_verification_acceptance_gate_count": 10,
|
||||
"operator_held_secret_boundary_count": 1,
|
||||
"post_apply_verifier_required_count": 1,
|
||||
"same_run_truth_required_count": 1,
|
||||
"writes_script_count": 0,
|
||||
"writes_artifact_count": 0,
|
||||
"reads_secret_count": 0,
|
||||
"executes_script_count": 0,
|
||||
"executes_migration_count": 0,
|
||||
"executes_endpoint_count": 0,
|
||||
"executes_sql_count": 0,
|
||||
"writes_database_count": 0,
|
||||
"signs_database_apply_authorization_count": 0,
|
||||
"primary_human_gate_count": 0,
|
||||
"manual_review_required_count": 0,
|
||||
"manual_review_mode": "exception_only",
|
||||
"payload_source": "local_contract_fixture",
|
||||
"execute_fetch": True,
|
||||
"outbound_network": False,
|
||||
"business_data_source": False,
|
||||
"secret_reference_mode": "external_runtime_reference_only",
|
||||
"requires_detached_signature_verification": True,
|
||||
"detached_signature_verification_performed": False,
|
||||
"verifier_receipt_persisted": False,
|
||||
"external_signed_authorization_receipt_required_in_future": True,
|
||||
"external_signed_authorization_receipt_included": False,
|
||||
"signed_authorization_receipt_included": False,
|
||||
"signature_material_included": False,
|
||||
"ready_for_database_apply_now": False,
|
||||
"issues_database_apply_authorization": False,
|
||||
"signs_database_apply_authorization": False,
|
||||
"secret_material_included": False,
|
||||
"secret_material_required_in_preview": False,
|
||||
"accepts_plaintext_secret": False,
|
||||
"ready_for_future_verifier_receipt_closeout": True,
|
||||
"can_enter_future_database_apply_authorization_verifier_handoff": True,
|
||||
"verifier_receipt_evidence_handoff_ready": True,
|
||||
"ready_for_future_verifier_receipt_evidence_handoff": True,
|
||||
"permits_future_database_apply_authorization_verifier_handoff": True,
|
||||
"persists_verifier_receipt": False,
|
||||
"performs_detached_signature_verification": False,
|
||||
"next_machine_action": (
|
||||
"continue_to_pchome_auto_policy_database_apply_authorization_verifier_handoff_lane"
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_event_router_smoke_reports_queued_deliveries(tmp_path, monkeypatch):
|
||||
from services import ai_automation_metrics as metrics
|
||||
from services import ai_automation_smoke_service as smoke
|
||||
@@ -745,6 +821,7 @@ def test_collect_ai_automation_smoke_uses_worst_status(monkeypatch):
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_signed_receipt_closeout_check", lambda: smoke._check("auto-policy signed receipt closeout", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_signed_receipt_evidence_intake_check", lambda: smoke._check("auto-policy signed receipt evidence intake", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_detached_verification_evidence_validation_check", lambda: smoke._check("auto-policy detached verification evidence validation", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_verifier_receipt_closeout_check", lambda: smoke._check("auto-policy verifier receipt closeout", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_ai_surface_html_readback_check", lambda: smoke._check("surface", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_sitewide_ui_ux_agent_check", lambda: smoke._check("sitewide", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_sitewide_visual_qa_check", lambda: smoke._check("visual", "ok", "ok"))
|
||||
@@ -752,7 +829,7 @@ def test_collect_ai_automation_smoke_uses_worst_status(monkeypatch):
|
||||
result = smoke.collect_ai_automation_smoke(record_history=False)
|
||||
|
||||
assert result["status"] == "critical"
|
||||
assert result["summary"] == {"ok": 22, "warning": 1, "critical": 1, "total": 24}
|
||||
assert result["summary"] == {"ok": 23, "warning": 1, "critical": 1, "total": 25}
|
||||
|
||||
|
||||
def test_pchome_controlled_apply_drift_monitor_reports_verified_zero_drift(monkeypatch):
|
||||
@@ -2596,6 +2673,87 @@ def test_pchome_auto_policy_detached_verification_evidence_validation_reports_bo
|
||||
)
|
||||
|
||||
|
||||
def test_pchome_auto_policy_verifier_receipt_closeout_reports_handoff_no_persist():
|
||||
from services import ai_automation_smoke_service as smoke
|
||||
|
||||
result = smoke._pchome_auto_policy_verifier_receipt_closeout_check()
|
||||
|
||||
assert result["status"] == "ok"
|
||||
assert result["details"]["result"] == (
|
||||
"DB_APPLY_AUTHORIZATION_VERIFIER_RECEIPT_CLOSEOUT_READY"
|
||||
)
|
||||
assert result["details"]["verifier_receipt_closeout_pass_count"] == 12
|
||||
assert result["details"]["verifier_receipt_closeout_check_count"] == 12
|
||||
assert (
|
||||
result["details"][
|
||||
"detached_verification_evidence_validation_check_count"
|
||||
]
|
||||
== 12
|
||||
)
|
||||
assert result["details"]["signed_receipt_evidence_intake_check_count"] == 12
|
||||
assert result["details"]["verifier_receipt_closeout_boundary_count"] == 1
|
||||
assert result["details"]["verifier_receipt_evidence_handoff_count"] == 1
|
||||
assert result["details"]["verifier_receipt_field_count"] == 12
|
||||
assert result["details"]["verifier_receipt_acceptance_gate_count"] == 10
|
||||
assert result["details"]["verifier_receipt_evidence_handoff_field_count"] == 12
|
||||
assert result["details"]["verifier_receipt_handoff_acceptance_gate_count"] == 10
|
||||
assert result["details"]["required_external_receipt_evidence_count"] == 10
|
||||
assert result["details"]["external_receipt_acceptance_gate_count"] == 8
|
||||
assert result["details"]["detached_verification_evidence_field_count"] == 12
|
||||
assert result["details"]["detached_verification_acceptance_gate_count"] == 10
|
||||
assert result["details"]["payload_source"] == "local_contract_fixture"
|
||||
assert result["details"]["machine_fetch_evidence_source"] == "local_schema_fixture"
|
||||
assert result["details"]["outbound_network"] is False
|
||||
assert result["details"]["business_data_source"] is False
|
||||
assert result["details"]["primary_human_gate_count"] == 0
|
||||
assert result["details"]["manual_review_required_count"] == 0
|
||||
assert result["details"]["reads_secret_count"] == 0
|
||||
assert result["details"]["executes_script_count"] == 0
|
||||
assert result["details"]["executes_sql_count"] == 0
|
||||
assert result["details"]["writes_database_count"] == 0
|
||||
assert result["details"]["signs_database_apply_authorization_count"] == 0
|
||||
assert result["details"]["secret_reference_mode"] == "external_runtime_reference_only"
|
||||
assert result["details"]["requires_detached_signature_verification"] is True
|
||||
assert result["details"]["detached_signature_verification_performed"] is False
|
||||
assert result["details"]["verifier_receipt_persisted"] is False
|
||||
assert (
|
||||
result["details"]["external_signed_authorization_receipt_required_in_future"]
|
||||
is True
|
||||
)
|
||||
assert result["details"]["external_signed_authorization_receipt_included"] is False
|
||||
assert result["details"]["signed_authorization_receipt_included"] is False
|
||||
assert result["details"]["signature_material_included"] is False
|
||||
assert result["details"]["ready_for_database_apply_now"] is False
|
||||
assert result["details"]["issues_database_apply_authorization"] is False
|
||||
assert result["details"]["signs_database_apply_authorization"] is False
|
||||
assert result["details"]["secret_material_included"] is False
|
||||
assert result["details"]["secret_material_required_in_preview"] is False
|
||||
assert result["details"]["accepts_plaintext_secret"] is False
|
||||
assert result["details"]["ready_for_future_verifier_receipt_closeout"] is True
|
||||
assert (
|
||||
result["details"][
|
||||
"can_enter_future_database_apply_authorization_verifier_handoff"
|
||||
]
|
||||
is True
|
||||
)
|
||||
assert result["details"]["verifier_receipt_evidence_handoff_ready"] is True
|
||||
assert (
|
||||
result["details"]["ready_for_future_verifier_receipt_evidence_handoff"]
|
||||
is True
|
||||
)
|
||||
assert (
|
||||
result["details"][
|
||||
"permits_future_database_apply_authorization_verifier_handoff"
|
||||
]
|
||||
is True
|
||||
)
|
||||
assert result["details"]["persists_verifier_receipt"] is False
|
||||
assert result["details"]["performs_detached_signature_verification"] is False
|
||||
assert result["details"]["next_machine_action"] == (
|
||||
"continue_to_pchome_auto_policy_database_apply_authorization_verifier_handoff_lane"
|
||||
)
|
||||
|
||||
|
||||
def test_collect_ai_automation_smoke_persists_recent_history(tmp_path, monkeypatch):
|
||||
from services import ai_automation_smoke_service as smoke
|
||||
|
||||
@@ -2623,6 +2781,7 @@ def test_collect_ai_automation_smoke_persists_recent_history(tmp_path, monkeypat
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_signed_receipt_closeout_check", lambda: smoke._check("auto-policy signed receipt closeout", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_signed_receipt_evidence_intake_check", lambda: smoke._check("auto-policy signed receipt evidence intake", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_detached_verification_evidence_validation_check", lambda: smoke._check("auto-policy detached verification evidence validation", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_verifier_receipt_closeout_check", lambda: smoke._check("auto-policy verifier receipt closeout", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_ai_surface_html_readback_check", lambda: smoke._check("surface", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_sitewide_ui_ux_agent_check", lambda: smoke._check("sitewide", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_sitewide_visual_qa_check", lambda: smoke._check("visual", "ok", "ok"))
|
||||
@@ -2681,7 +2840,7 @@ def test_scheduled_automation_health_summary_reads_history_without_side_effects(
|
||||
json.dumps({
|
||||
"generated_at": datetime.now().isoformat(timespec="seconds"),
|
||||
"status": "ok",
|
||||
"summary": {"ok": 24, "warning": 0, "critical": 0, "total": 24},
|
||||
"summary": {"ok": 25, "warning": 0, "critical": 0, "total": 25},
|
||||
"checks": [
|
||||
{
|
||||
"name": "PChome 受控落地 drift monitor",
|
||||
@@ -2709,6 +2868,7 @@ def test_scheduled_automation_health_summary_reads_history_without_side_effects(
|
||||
_auto_policy_signed_receipt_closeout_history_check(),
|
||||
_auto_policy_signed_receipt_evidence_intake_history_check(),
|
||||
_auto_policy_detached_verification_evidence_validation_history_check(),
|
||||
_auto_policy_verifier_receipt_closeout_history_check(),
|
||||
{
|
||||
"name": "AI surface HTML readback",
|
||||
"status": "ok",
|
||||
@@ -2770,7 +2930,7 @@ def test_scheduled_automation_health_summary_reads_history_without_side_effects(
|
||||
)
|
||||
assert summary["policy"] == "read_only_ai_automation_scheduled_health_summary"
|
||||
assert summary["status"] == "ok"
|
||||
assert summary["summary"]["total"] == 21
|
||||
assert summary["summary"]["total"] == 22
|
||||
assert summary["summary"]["primary_human_gate_count"] == 0
|
||||
assert summary["summary"]["writes_database_count"] == 0
|
||||
assert pchome_family["status"] == "ok"
|
||||
@@ -3677,6 +3837,155 @@ def test_scheduled_automation_health_summary_reads_history_without_side_effects(
|
||||
]
|
||||
is False
|
||||
)
|
||||
verifier_receipt_closeout_family = next(
|
||||
item for item in summary["families"]
|
||||
if item["key"] == "pchome_auto_policy_verifier_receipt_closeout"
|
||||
)
|
||||
assert verifier_receipt_closeout_family["status"] == "ok"
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"verifier_receipt_closeout_pass_count"
|
||||
]
|
||||
== 12
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"detached_verification_evidence_validation_check_count"
|
||||
]
|
||||
== 12
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"verifier_receipt_evidence_handoff_count"
|
||||
]
|
||||
== 1
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"verifier_receipt_evidence_handoff_field_count"
|
||||
]
|
||||
== 12
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"verifier_receipt_handoff_acceptance_gate_count"
|
||||
]
|
||||
== 10
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"required_external_receipt_evidence_count"
|
||||
]
|
||||
== 10
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"external_receipt_acceptance_gate_count"
|
||||
]
|
||||
== 8
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"]["payload_source"]
|
||||
== "local_contract_fixture"
|
||||
)
|
||||
assert verifier_receipt_closeout_family["details"]["outbound_network"] is False
|
||||
assert verifier_receipt_closeout_family["details"]["business_data_source"] is False
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"]["primary_human_gate_count"]
|
||||
== 0
|
||||
)
|
||||
assert verifier_receipt_closeout_family["details"]["reads_secret_count"] == 0
|
||||
assert verifier_receipt_closeout_family["details"]["writes_database_count"] == 0
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"signs_database_apply_authorization_count"
|
||||
]
|
||||
== 0
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"requires_detached_signature_verification"
|
||||
]
|
||||
is True
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"detached_signature_verification_performed"
|
||||
]
|
||||
is False
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"]["verifier_receipt_persisted"]
|
||||
is False
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"external_signed_authorization_receipt_included"
|
||||
]
|
||||
is False
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"signed_authorization_receipt_included"
|
||||
]
|
||||
is False
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"]["signature_material_included"]
|
||||
is False
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"]["signs_database_apply_authorization"]
|
||||
is False
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"]["secret_material_included"]
|
||||
is False
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"]["accepts_plaintext_secret"]
|
||||
is False
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"ready_for_future_verifier_receipt_closeout"
|
||||
]
|
||||
is True
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"can_enter_future_database_apply_authorization_verifier_handoff"
|
||||
]
|
||||
is True
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"verifier_receipt_evidence_handoff_ready"
|
||||
]
|
||||
is True
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"ready_for_future_verifier_receipt_evidence_handoff"
|
||||
]
|
||||
is True
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"permits_future_database_apply_authorization_verifier_handoff"
|
||||
]
|
||||
is True
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"]["persists_verifier_receipt"]
|
||||
is False
|
||||
)
|
||||
assert (
|
||||
verifier_receipt_closeout_family["details"][
|
||||
"performs_detached_signature_verification"
|
||||
]
|
||||
is False
|
||||
)
|
||||
surface_family = next(
|
||||
item for item in summary["families"]
|
||||
if item["key"] == "ai_surface_html_readback"
|
||||
@@ -3711,7 +4020,7 @@ def test_scheduled_automation_health_summary_can_use_current_smoke_without_recor
|
||||
current_smoke = {
|
||||
"generated_at": "2026-07-02T12:00:00",
|
||||
"status": "critical",
|
||||
"summary": {"ok": 23, "warning": 0, "critical": 1, "total": 24},
|
||||
"summary": {"ok": 24, "warning": 0, "critical": 1, "total": 25},
|
||||
"checks": [
|
||||
{
|
||||
"name": "PChome 受控落地 drift monitor",
|
||||
@@ -3733,6 +4042,7 @@ def test_scheduled_automation_health_summary_can_use_current_smoke_without_recor
|
||||
_auto_policy_signed_receipt_closeout_history_check(),
|
||||
_auto_policy_signed_receipt_evidence_intake_history_check(),
|
||||
_auto_policy_detached_verification_evidence_validation_history_check(),
|
||||
_auto_policy_verifier_receipt_closeout_history_check(),
|
||||
{
|
||||
"name": "AI surface HTML readback",
|
||||
"status": "ok",
|
||||
@@ -3788,7 +4098,7 @@ def test_scheduled_automation_health_summary_falls_back_to_visual_qa_artifact(tm
|
||||
json.dumps({
|
||||
"generated_at": datetime.now().isoformat(timespec="seconds"),
|
||||
"status": "ok",
|
||||
"summary": {"ok": 22, "warning": 0, "critical": 0, "total": 22},
|
||||
"summary": {"ok": 23, "warning": 0, "critical": 0, "total": 23},
|
||||
"checks": [],
|
||||
}, ensure_ascii=False) + "\n",
|
||||
encoding="utf-8",
|
||||
@@ -3864,6 +4174,11 @@ def test_scheduled_automation_health_summary_falls_back_to_visual_qa_artifact(tm
|
||||
"_pchome_auto_policy_detached_verification_evidence_validation_check",
|
||||
lambda: _auto_policy_detached_verification_evidence_validation_history_check(),
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
smoke,
|
||||
"_pchome_auto_policy_verifier_receipt_closeout_check",
|
||||
lambda: _auto_policy_verifier_receipt_closeout_history_check(),
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
surface_service,
|
||||
"build_sitewide_visual_qa_readback",
|
||||
@@ -3912,7 +4227,7 @@ def test_scheduled_automation_health_summary_route_returns_compact_payload(tmp_p
|
||||
json.dumps({
|
||||
"generated_at": datetime.now().isoformat(timespec="seconds"),
|
||||
"status": "ok",
|
||||
"summary": {"ok": 24, "warning": 0, "critical": 0, "total": 24},
|
||||
"summary": {"ok": 25, "warning": 0, "critical": 0, "total": 25},
|
||||
"checks": [],
|
||||
}, ensure_ascii=False) + "\n",
|
||||
encoding="utf-8",
|
||||
@@ -3988,6 +4303,11 @@ def test_scheduled_automation_health_summary_route_returns_compact_payload(tmp_p
|
||||
"_pchome_auto_policy_detached_verification_evidence_validation_check",
|
||||
lambda: _auto_policy_detached_verification_evidence_validation_history_check(),
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
smoke,
|
||||
"_pchome_auto_policy_verifier_receipt_closeout_check",
|
||||
lambda: _auto_policy_verifier_receipt_closeout_history_check(),
|
||||
)
|
||||
|
||||
app = Flask(__name__)
|
||||
with app.test_request_context(
|
||||
@@ -4224,6 +4544,8 @@ def test_surface_html_readback_check_is_part_of_ai_smoke(monkeypatch):
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_signed_receipt_preflight_check", lambda: smoke._check("auto-policy signed receipt preflight", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_signed_receipt_closeout_check", lambda: smoke._check("auto-policy signed receipt closeout", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_signed_receipt_evidence_intake_check", lambda: smoke._check("auto-policy signed receipt evidence intake", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_detached_verification_evidence_validation_check", lambda: smoke._check("auto-policy detached verification evidence validation", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_pchome_auto_policy_verifier_receipt_closeout_check", lambda: smoke._check("auto-policy verifier receipt closeout", "ok", "ok"))
|
||||
monkeypatch.setattr(smoke, "_sitewide_visual_qa_check", lambda: smoke._check(
|
||||
"Sitewide visual QA readback",
|
||||
"ok",
|
||||
@@ -4245,7 +4567,7 @@ def test_surface_html_readback_check_is_part_of_ai_smoke(monkeypatch):
|
||||
item for item in result["checks"]
|
||||
if item["name"] == "Sitewide visual QA readback"
|
||||
)
|
||||
assert result["summary"]["total"] == 24
|
||||
assert result["summary"]["total"] == 25
|
||||
assert surface_check["status"] == "ok"
|
||||
assert surface_check["details"]["checked_surface_count"] == 10
|
||||
assert sitewide_check["status"] == "ok"
|
||||
|
||||
Reference in New Issue
Block a user