from fastapi.testclient import TestClient

from src.main import app


def test_get_ai_agent_owner_approved_learning_dry_run_api():
    client = TestClient(app)
    response = client.get("/api/v1/agents/agent-owner-approved-learning-dry-run")

    assert response.status_code == 200
    data = response.json()
    assert data["schema_version"] == "ai_agent_owner_approved_learning_dry_run_v1"
    assert data["program_status"]["current_task_id"] == "P2-403F"
    assert data["program_status"]["next_task_id"] == "P2-403G"
    assert data["dry_run_truth"]["owner_approval_received_count"] == 0
    assert data["dry_run_truth"]["dry_run_preview_generated_count"] == 0
    assert data["dry_run_truth"]["km_write_allowed"] is False
    assert data["rollups"]["live_write_count_total"] == 0
