from fastapi.testclient import TestClient

from src.main import app


def test_get_ai_agent_report_runtime_dry_run_api():
    client = TestClient(app)
    response = client.get("/api/v1/agents/agent-report-runtime-dry-run")

    assert response.status_code == 200
    data = response.json()
    assert data["schema_version"] == "ai_agent_report_runtime_dry_run_v1"
    assert data["program_status"]["current_task_id"] == "P2-403M"
    assert data["program_status"]["next_task_id"] == "P2-403N"
    assert data["program_status"]["overall_completion_percent"] == 91
    assert data["dry_run_truth"]["no_write_dry_run_package_ready"] is True
    assert data["dry_run_truth"]["production_delivery_enabled"] is False
    assert data["dry_run_truth"]["telegram_gateway_queue_write_enabled"] is False
    assert data["dry_run_truth"]["telegram_bot_api_call_enabled"] is False
    assert data["dry_run_truth"]["ai_runtime_worker_enabled"] is False
    assert data["dry_run_truth"]["medium_low_auto_worker_enabled"] is False
    assert data["rollups"]["dry_run_artifact_count"] == 5
    assert data["rollups"]["gateway_queue_draft_count"] == 3
    assert data["rollups"]["readback_verifier_case_count"] == 4
    assert data["rollups"]["agent_role_count"] == 3
    assert data["rollups"]["operator_checkpoint_count"] == 6
    assert data["rollups"]["live_report_delivery_count"] == 0
    assert data["rollups"]["telegram_gateway_queue_write_count"] == 0
    assert data["rollups"]["telegram_bot_api_call_count"] == 0
    assert data["rollups"]["production_write_count"] == 0
