from __future__ import annotations

from fastapi.testclient import TestClient

from src.main import app


def test_release_verifier_owner_review_packet_endpoint() -> None:
    client = TestClient(app)

    response = client.get("/api/v1/agents/agent-result-capture-release-verifier-owner-review-packet")

    assert response.status_code == 200
    payload = response.json()
    assert payload["schema_version"] == "ai_agent_result_capture_release_verifier_owner_review_packet_v1"
    assert payload["program_status"]["current_task_id"] == "P2-137"
    assert payload["program_status"]["next_task_id"] == "P2-138"
    assert payload["program_status"]["overall_completion_percent"] == 100
    assert payload["program_status"]["runtime_authority"] == "result_capture_release_verifier_owner_review_packet_only_no_live_write"
    assert payload["rollups"]["owner_review_packet_count"] == 5
    assert payload["rollups"]["verifier_review_packet_count"] == 5
    assert payload["rollups"]["rollback_owner_review_packet_count"] == 5
    assert payload["rollups"]["maintenance_window_review_hold_count"] == 5
    assert payload["rollups"]["live_apply_owner_review_hold_count"] == 5
    assert payload["rollups"]["blocked_owner_review_transition_count"] == 6
    assert payload["rollups"]["operator_action_count"] == 5
    assert payload["rollups"]["owner_release_authorized_count"] == 0
    assert payload["rollups"]["owner_review_approved_count"] == 0
    assert payload["rollups"]["release_authorization_granted_count"] == 0
    assert payload["rollups"]["release_authorization_pass_count"] == 0
    assert payload["rollups"]["gateway_queue_write_count"] == 0
    assert payload["rollups"]["telegram_send_count"] == 0
    assert payload["rollups"]["production_write_count"] == 0
