This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AgrarianGameArchive/Scripts/verify_save_recovery_plan.py
2026-05-18 19:40:13 -07:00

43 lines
1.3 KiB
Python

from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
EXPECTED = {
ROOT / "Docs" / "Ops" / "PersistenceSaveRecoveryPlan.md": [
"Saved/SaveGames/AgrarianMVP.sav",
"Saved/SaveGames/Backups",
"Copy the current `AgrarianMVP.sav` aside with a `.suspect` suffix.",
"Copy that backup to `Saved/SaveGames/AgrarianMVP.sav`.",
"There is no automated save-file validation tool yet.",
],
ROOT / "Docs" / "PersistenceDesignDocument.md": [
"`Docs/Ops/PersistenceSaveRecoveryPlan.md`",
"preserve the suspect save",
"restore the newest timestamped",
],
ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md": [
"[x] Add recovery plan for corrupted save.",
"`Docs/Ops/PersistenceSaveRecoveryPlan.md`",
"current MVP limitations",
],
}
def main() -> None:
missing = []
for path, snippets in EXPECTED.items():
text = path.read_text(encoding="utf-8")
for snippet in snippets:
if snippet not in text:
missing.append(f"{path.relative_to(ROOT)}: {snippet}")
if missing:
raise RuntimeError("Save recovery plan verification failed: " + "; ".join(missing))
print("PASS: corrupted-save recovery plan is documented.")
if __name__ == "__main__":
main()