#!/usr/bin/env python3
"""Verify learning accessibility rules are documented."""

from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]
DOC = ROOT / "Docs" / "KnowledgeAndSkillFoundation.md"
ROADMAP = ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md"

REQUIRED = {
    DOC: [
        "## Learning Accessibility Rules",
        "Hints:",
        "Retries:",
        "Readable wording:",
        "No hard lockout from basic survival:",
        "Non-punitive practice paths:",
        "Accessibility rule:",
    ],
    ROADMAP: [
        "[x] Define accessibility rules for the learning system: hints, retries, readable wording, no hard lockout from basic survival, and non-punitive practice paths.",
    ],
}


def main() -> None:
    missing: list[str] = []
    for path, snippets in REQUIRED.items():
        text = path.read_text(encoding="utf-8")
        for snippet in snippets:
            if snippet not in text:
                missing.append(f"{path.relative_to(ROOT)} missing {snippet!r}")
    if missing:
        raise SystemExit("FAILED: " + "; ".join(missing))
    print("OK: learning accessibility rules are documented.")


if __name__ == "__main__":
    main()
