from fastapi.testclient import TestClient

from src.main import app


def test_get_ai_agent_runtime_verifier_evidence_review_api():
    client = TestClient(app)
    response = client.get("/api/v1/agents/agent-runtime-verifier-evidence-review")

    assert response.status_code == 200
    data = response.json()
    assert data["schema_version"] == "ai_agent_runtime_verifier_evidence_review_v1"
    assert data["program_status"]["current_task_id"] == "P2-403I"
    assert data["program_status"]["next_task_id"] == "P2-403J"
    assert data["program_status"]["overall_completion_percent"] == 99
    assert data["review_truth"]["runtime_verifier_implementation_allowed"] is False
    assert data["review_truth"]["post_write_verifier_execution_allowed"] is False
    assert data["review_truth"]["runtime_verifier_executed_count"] == 0
    assert data["review_truth"]["canonical_readback_executed_count"] == 0
    assert data["review_truth"]["rollback_work_item_created_count"] == 0
    assert data["review_truth"]["telegram_failure_receipt_sent_count"] == 0
    assert data["rollups"]["evidence_check_count"] == 5
    assert data["rollups"]["implementation_review_lane_count"] == 4
    assert data["rollups"]["operator_action_count"] == 4
    assert data["rollups"]["live_verifier_execution_count"] == 0
