aetherlight: a commit of another schema generation is refused by name

A v1 export is well-formed, so it is not corruption: open now returns
UnsupportedSchema{found, supported} from the one schema judge, asked of every
commit before its other fields are believed, instead of CorruptJournal at
genesis. The test asserts the version in the error for a v1 chain and a later
commit of another generation. Addresses v1-refusal-unnamed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-20 04:48:56 +01:00
commit 415ac9208b
2 changed files with 48 additions and 10 deletions

View file

@ -916,14 +916,22 @@ pub enum KernelError {
Serialization(String),
#[error("world journal is corrupt: {0}")]
CorruptJournal(String),
/// A well-formed export written under another commit schema generation
/// (a v1 save): not corrupt, but not readable by this build.
#[error("export commit schema {found} is not the supported {supported}")]
UnsupportedSchema { found: String, supported: &'static str },
#[error("private reducer invariant failed: {0}")]
Invariant(String),
}
impl From<journal::JournalError> for KernelError {
fn from(error: journal::JournalError) -> Self {
let journal::JournalError::Corrupt(detail) = error;
Self::CorruptJournal(detail)
match error {
journal::JournalError::Corrupt(detail) => Self::CorruptJournal(detail),
journal::JournalError::UnsupportedSchema { found, supported } => {
Self::UnsupportedSchema { found, supported }
}
}
}
}