First Light
README.md
firstlight.persist
The run's durable memory, in the world's runtime data under firstlight/.
require("firstlight.persist").
Persisted sections of Rules.state: run, body, hut, stores,
journal — one leaf each (firstlight/run, firstlight/body, ...).
Persist.load()— read the saved sections over the blackboard and restore the clock fromrun.elapsed. Returns whether a save existed.Persist.save(reason?)— write every section now.Persist.markDirty()— ask for a save at the next throttle window.Persist.tick(dt)— per frame; flushes a marked or detected change every few seconds (a store or structural value written straight onto the blackboard is detected by fingerprint).Persist.ensureSeed()— chooserun.seedonce per world and save it.Persist.hasSave(),Persist.wipe().