P3: the books' format moves only with the owner's go-ahead (D-39)
Books an update could write a newer format for open on their old format and are asked at every open; anything needing a new feature is refused until the owner agrees with the passphrase, after a verified backup that includes the keys. New books start on the current format. Each projection schema has its own database file, so an older version still opens the books until the owner agrees. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
This commit is contained in:
62 files changed
+5309
-628
No files matched your search
@@ -85,12 +85,15 @@ const SETTINGS: &str = "[company]\nname = \"Old Books Co\"\nfiscal_year_start =
|
||||
|
||||
/// [`SETTINGS`] journaled into the books in `dir`, as the server adopts a
|
||||
/// settings file, unless they already keep their own (P1's books): the
|
||||
/// viewer reads settings only from the journal (plan 3.6).
|
||||
/// viewer reads settings only from the journal (plan 3.6). As adoption
|
||||
/// does, the books move to this version's journal format first (an
|
||||
/// adopted copy is new books of this version).
|
||||
fn write_settings(dir: &Path) {
|
||||
let mut store = ledger_store::Store::open(&dir.join("books-data")).unwrap();
|
||||
if store.ledger().settings().is_journaled() {
|
||||
return;
|
||||
}
|
||||
store.upgrade_format().unwrap();
|
||||
let import =
|
||||
ledger_config::codec::import(SETTINGS, None, store.ledger().settings(), "USD").unwrap();
|
||||
store
|
||||
|
||||
Reference in new issue
Block a user