feat: the window and the server say each new state in words; a proof cut short is made again; the proof does not mistake the books' own recovery for a changed head

- books ahead of the folder (as after a restore from an older backup) offer a
  new backup set beside the old one, at the person's request: books.back_up_now
  new_set, back-up --new-set, a button in the Backups window
- a key file lost from a sealed destination stops backups and asks for the
  passphrase; plain is written only after an explicit removal, which the record
  keeps (a damaged record falls back to what the folder itself holds)
- a restore that is not of the newest backup says so first, in the warning
  colour, with both dates and how many backups it passes over
- a folder a sync service keeps (or may) is said in plain words at set-up and
  in the window: one computer only, kept offline, a second computer its own
- a drill that finds only an older whole backup fails in words
- a manifest whose proof was cut short is marked unproven and proven by the
  next backup, even one with nothing new; a saved backup file is proven whole
  before it is given its name
- the proof compares the journal its pieces make with the head the manifest
  records before the books open, and lets opening add only after it
- the restore tests are split from backups.rs to keep each under a minute; the
  clone-of-an-old-git-backup test builds the working tree without git

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 20:07:38 -07:00
1 parent 9ac47a3f10
commit 344b3b4abe
21 files changed
+2346 -690

No files matched your search

+15 -2
View File
@@ -8,8 +8,8 @@
use super::cut::Cut;
use super::io::{Fill, Put, PutKind, SetIo};
use super::read::Set;
use super::write::{Written, write_into_set};
use super::read::{Found, Set, verify_found};
use super::write::{Written, proof_scratch, write_into_set};
use super::{BackupError, Ctx};
use std::collections::BTreeSet;
use std::io::Read;
@@ -173,6 +173,19 @@ pub fn save_file(
.finish()
.map_err(|e| BackupError::Io(std::io::Error::other(e).kind()))?;
file.sync_all()?;
// Read back as a restore would read it, and proven whole (every
// piece re-hashed, the chain replayed, the books opened), before it
// is given its name: a file by that name is a backup that proved.
let reader = Set {
io: open(&aside, ctx)?,
keys: key.map(|k| k.keys()),
ctx: ctx.clone(),
};
let found = Found::of(reader, key.cloned(), cut.book());
let scratch = proof_scratch(cut)?;
let proven = verify_found(&found, &scratch, ctx);
let _ = std::fs::remove_dir_all(&scratch);
proven?;
Ok(written)
});
match result {