Undoing an edit (lib/post_versions.rb)
Deleting a post was always reversible -- it goes to trash/ and restore brings it back -- but editing one was not, and editing is what happens every day: a paragraph dropped and saved, a round-trip through markdown that could not express something, a paste into the wrong place. So the post as it stood is copied aside immediately before it is overwritten, by whoever is doing the overwriting: PostWriter.write for a re-import, the edit and restore paths in scripts/manage_post.rb for everything a person does by hand.
The store is deliberately plain: content.nosync/versions/<year>/<slug>/, one whole post JSON per file, named for the second it was kept (20260813-174204-118.json) so that sorting the directory is sorting by time and no index has to be maintained. Ten per post; the eleventh drops the oldest, because the newest copy answers "what did this say before I broke it" in nine cases out of ten and an unbounded history of an archive this size is a second archive. PostVersions.move carries the directory into the trash with the post and back out on a restore, or a restored post would come back with amnesia and a deleted one would leave its history orphaned where nothing points at it.
Three deliberate limits. It is not configurable -- a safety net with a switch is off exactly when it is needed, since nobody turns it on before the mistake, which is how this engine treats trash/, the slug-collision abort and the deploy guards too. Its failures are swallowed: a full disk or a read-only directory must not stop somebody saving their writing, and the point of this is to lose less. And it is not git and not a backup -- no branches, no diff between two arbitrary points, and it lives beside the content, so it dies with it. The backup list in Running it still applies.
Only the text is kept, never the media, which is the other half of why the cap is short: a version old enough to name a picture the post no longer has would restore a broken reference. The CLI side of this -- the [v] key, what the list shows and why restoring is itself undoable -- is in Writing.
