from pathlib import Path

from core.models import AgentConfig
from core.serialization import dump_data, load_data


def test_yaml_round_trip(tmp_path: Path) -> None:
    path = tmp_path / "agent.yaml"
    config = AgentConfig(
        name="arch",
        role="Architect",
        description="desc",
        system_prompt="prompt",
        input_schema_description="in",
        output_schema_description="out",
        input_schema={"type": "object"},
        output_schema={
            "type": "object",
            "properties": {"response": {"type": "string"}},
            "required": ["response"],
        },
    )

    dump_data(path, config.model_dump())

    loaded = load_data(path)

    assert loaded["name"] == "arch"
