aetherlight: pin every partition's digest, undo and finish, and the failure after the digest

every_partition_is_digested_undone_and_finished iterates the declaration: for
each partition one written document must be in the folded digest and agree with
the full recompute, be put back by rollback (state, bytes, logs), and leave the
logs empty and the accumulator at the full recompute on finish; a partition no
fixture world populates fails loudly. a_failed_apply_rolls_back now runs a tick
that rolls routines, a tick that writes pressure rows (the old tick wrote none,
contrary to its doc), a speech and a forget, each under the revision overflow
and under an injected failure after the digest is folded and the commit sealed
(test-only thread-local seam in submit). Addresses table-rows-undefended.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-20 04:56:03 +01:00
commit 28db7e2197
3 changed files with 207 additions and 31 deletions

View file

@ -123,6 +123,12 @@ pub(crate) trait Partition {
/// The partition as encoded: the bytes a test scans for what must never appear.
#[cfg(test)]
fn encoded(&self) -> Vec<u8>;
/// How many documents the partition holds.
#[cfg(test)]
fn rows(&self) -> usize;
/// Removes the first document, logged like any write; false when empty.
#[cfg(test)]
fn remove_first(&mut self) -> bool;
}
impl<K, V> Partition for Docs<K, V>
@ -167,6 +173,19 @@ where
fn encoded(&self) -> Vec<u8> {
rmp_serde::to_vec_named(self).expect("a partition encodes")
}
#[cfg(test)]
fn rows(&self) -> usize {
self.len()
}
#[cfg(test)]
fn remove_first(&mut self) -> bool {
let Some(key) = self.keys().next().cloned() else {
return false;
};
self.remove(&key).is_some()
}
}
/// The header's one change, keyed by its own world id.