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

@ -935,6 +935,13 @@ impl From<journal::JournalError> for KernelError {
}
}
// Test seam: when set on this thread, `submit` fails after it has folded the
// digest and sealed the commit, the last point before the world is kept.
#[cfg(test)]
thread_local! {
static INJECT_FAILURE_AFTER_DIGEST: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
}
struct WorldKernel {
state: WorldState,
journal: journal::WorldJournal,
@ -1085,6 +1092,10 @@ impl WorldKernel {
digest: String::new(),
};
commit.digest = commit_digest(&commit)?;
#[cfg(test)]
if INJECT_FAILURE_AFTER_DIGEST.get() {
return Err(KernelError::Invariant("injected failure after the digest".into()));
}
Ok((commit, accumulator))
})();
let (commit, accumulator) = match sealed {
@ -9264,7 +9275,7 @@ mod clock_tests {
TickMinutes::new(value).expect("a valid span")
}
fn clock_kernel(title: &str) -> (WorldKernel, Clockwork, WorldSnapshot) {
pub(crate) fn clock_kernel(title: &str) -> (WorldKernel, Clockwork, WorldSnapshot) {
let mut kernel = WorldKernel::create(creation(title),
&auth_principal(owner()),
)