from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]


def require(path: Path, snippet: str) -> None:
    text = path.read_text(encoding="utf-8")
    if snippet not in text:
        raise SystemExit(f"{path.relative_to(ROOT)} missing {snippet!r}")


def main() -> None:
    roadmap = ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md"
    persistence = ROOT / "Docs" / "PersistenceDesignDocument.md"
    networking = ROOT / "Docs" / "MultiplayerNetworkingDesign.md"

    require(roadmap, "[x] Add corpse/backpack placeholder if needed.")
    require(roadmap, "no physical")
    require(roadmap, "corpse/backpack actor is needed for the 0.1.J MVP respawn loop")
    require(roadmap, "persistent, server-owned, interaction-gated death-recovery record")
    require(persistence, "the MVP death/respawn loop does not spawn a physical corpse or")
    require(persistence, "death event id/location")
    require(networking, "does not spawn a corpse/backpack container in 0.1.J")
    require(networking, "server-owned, interaction-gated")

    print("PASS: corpse/backpack MVP decision is documented.")


if __name__ == "__main__":
    main()
