Expand description
Taking a game folder back to a restore point, for a user handed a bad
package who wants yesterday back: whatever they had configured then, and
none of the files the bad package added. See DESIGN.md “Restore scene”.
Every run writes a point holding the ledger as it was before it, plus the files it replaced; this module reads them back, plans the way to one and carries that plan out through the engine’s own steps. Three rules:
- The plan is a value, computed before anything moves, so the preview the user approves and the work done cannot disagree.
- Never make it worse. A package that cannot be put back is left as it is, and nothing is removed unless what replaces it is ready.
- Restore the provenance, not just the bytes. The snapshot’s per-file
prioris what stops a later uninstall deleting a file the user always had.
Modules§
Structs§
- Changes
- What the run that followed a point did, counted for the list of points.
- Plan
- What restoring to a point would do, shown as the preview and then carried out unchanged.
- Point
- One restore point, named by the UTC stamp of the run that followed it.
- Prepared
- Everything read and checked before the first file moves, as
engine::preflightdoes for an install. - PutBack
- One package the restore has to put back.
Functions§
- changes
afteris the next point’s snapshot, or the live ledger for the newest point.- execute
- Carries out a restore, opening a restore point of its own first, so a restore to the wrong point can be undone like any other run.
- human_
time - A point’s name as a person reads a date,
2026-10-27 12:11. - ledger_
after - The ledger once
planhas been carried out,failednaming what could not be put back after all. - payloads_
in_ use - The payload digests this folder’s ledger and every restore point name: what a sweep of the cache must keep beyond what its index names, since a restore rolls back to an older payload the index has moved past.
- picks
- Per single-pick category, the package the restored state holds in it, which is what the game’s configuration step needs to make it the user’s pick again.
- plan
- What it takes to make
livelook liketarget. - points
- Every readable restore point in a game folder, newest first.
- prepare
- Finds a missing or damaged payload, an unwritable folder, too little room or a running game while the folder is still untouched.
- read
- The point called
name, orNonewhen it has no readable snapshot.
Type Aliases§
- Snapshot
- The packages a ledger held at one moment, keyed as the ledger keys them.