from copy import deepcopy
from typing import Any


def base_state() -> dict[str, Any]:
    return {
        "input_context": {"project": "AI governance training", "country": "Kazakhstan"},
        "draft_versions": [
            {"version_id": "toc_v1", "sequence": 1, "section": "toc", "content": {}},
            {"version_id": "logframe_v1", "sequence": 2, "section": "logframe", "content": {}},
        ],
        "toc_validation": {"valid": True, "errors": [], "schema_name": "GenericTOC"},
    }


def state_with_updates(**updates: Any) -> dict[str, Any]:
    state = deepcopy(base_state())
    state.update(updates)
    return state
