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
@@ -19,7 +19,7 @@ use crate::error::StoreError;
|
||||
use crate::format::JournalFormat;
|
||||
use crate::journal::{GENESIS_PREV, JournalLine};
|
||||
use crate::store::{
|
||||
Attachment, BLOBS_DIR, DB_FILE, JOURNAL_FILE, Reconciliation, Statement, Store, Subject,
|
||||
Attachment, BLOBS_DIR, JOURNAL_FILE, Reconciliation, Statement, Store, Subject,
|
||||
apply_line_to_sqlite, compare_projections, projection_rows, query_attachment_links,
|
||||
query_attachments, query_reconciliations, query_statements, read_attachment_bytes,
|
||||
replay_line_into_ledger,
|
||||
@@ -292,7 +292,8 @@ impl Snapshot {
|
||||
/// by the concurrency test, 2026-10-13, as a false "differs").
|
||||
pub fn check_disk(&self) -> DiskCheck {
|
||||
use rusqlite::OpenFlags;
|
||||
let path = self.data_dir.join(DB_FILE);
|
||||
// The file this version's writer keeps (store::database_in_use).
|
||||
let path = crate::store::database_in_use(&self.data_dir);
|
||||
if !path.exists() {
|
||||
return DiskCheck::Missing;
|
||||
}
|
||||
@@ -374,7 +375,7 @@ impl Snapshot {
|
||||
|
||||
/// `file:` URI for `path`, read-only and immutable (sqlite.org/uri.html):
|
||||
/// every byte outside the unreserved set is percent-encoded.
|
||||
fn immutable_uri(path: &Path) -> String {
|
||||
pub(crate) fn immutable_uri(path: &Path) -> String {
|
||||
let mut out = String::from("file:");
|
||||
for b in path.to_string_lossy().bytes() {
|
||||
if b.is_ascii_alphanumeric() || b"/-_.~".contains(&b) {
|
||||
|
||||
Reference in new issue
Block a user