#!/usr/bin/env python3
"""Verify MVP audio mix buses and defaults are defined."""

from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]
CONFIG = ROOT / "Config" / "AgrarianAudioMixSettings.ini"
DOC = ROOT / "Docs" / "Audio" / "MixSettings.md"
ROADMAP = ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md"

BUS_KEYS = [
    "MasterVolume",
    "AmbientVolume",
    "WeatherVolume",
    "FoleyVolume",
    "FireVolume",
    "WildlifeVolume",
    "UiVolume",
]

BUS_NAMES = [
    "Master",
    "Ambient",
    "Weather",
    "Foley",
    "Fire",
    "Wildlife",
    "UI",
]


def main() -> None:
    config = CONFIG.read_text(encoding="utf-8")
    doc = DOC.read_text(encoding="utf-8")
    roadmap = ROADMAP.read_text(encoding="utf-8")

    missing = []
    for key in BUS_KEYS:
        if key not in config:
            missing.append(f"config missing {key}")

    for name in BUS_NAMES:
        if f"- {name}:" not in doc:
            missing.append(f"mix settings doc missing bus {name}")

    for token in [
        "client presentation defaults",
        "investor builds",
        "MetaSound/SoundClass",
    ]:
        if token not in doc:
            missing.append(f"mix settings doc missing {token!r}")

    if "[x] Add mix settings." not in roadmap:
        missing.append("roadmap item is not checked off")

    if missing:
        raise SystemExit("FAILED: " + "; ".join(missing))

    print("OK: MVP audio mix settings are defined.")


if __name__ == "__main__":
    main()
