# Repository, persistence, and recovery ## Layout ```text . ├── .epoch current epoch, build version, global tag map └── epoch/ ├── 0/epochinfo.json complete epoch-0 world snapshot ├── 1/epochinfo.json complete epoch-1 world snapshot └── … ``` `.epoch` is JSON despite having no extension. Each snapshot stores its ID, random seed, tags, summary, and arrays of events, characters, towns, calamities, and blockers. The full world is duplicated per epoch. Entity commands edit the current snapshot directly. `epoch next` creates a new snapshot; `epoch switch` only changes the current pointer. `epoch reset` deletes later directories. This is not yet Git-equivalent: there is no working tree/index separation, reflog, locking, atomic multi-file transaction, or built-in undelete. ## Safety and recovery Keep the directory in Git or copy it before important changes: ```bash git init git add .epoch epoch/ git commit -m "backup Epoch Forge world" ``` To revisit prior data without deleting the future: ```bash efo epoch log efo epoch switch 0 efo status ``` Back up before `epoch reset`; Epoch Forge cannot recover its deleted folders. For corruption, stop mutating, copy the complete directory, and restore from a known-good backup. `epoch fsck` is not usable in 0.1.0. The config records a writer version, but automatic migrations and unknown-field retention are not implemented. The intended compatibility policy is that newer supported binaries migrate without data loss, format changes provide preview and backup, and future custom fields survive round trips. Current work is tracked in [the roadmap](roadmap.md).