fix: repair proven unsent sync chain with signed archived receipt
Rust development slice / linux (push) Failing after 7s

This commit is contained in:
2026-11-13 17:43:38 +01:00
parent 998f16fde4
commit 359233c64d
21 changed files with 3030 additions and 30 deletions
@@ -39,6 +39,32 @@ struct Fixture {
boot: TestBoot,
agent_journal: Uuid,
}
#[test]
fn checkpoint_repair_verifies_complete_signed_history_and_detects_removed_predecessor() {
let mut f = Fixture::new();
let mut sync = f.sync();
let first = f.snapshot(&mut sync, 7);
let request = f.request(&first);
let d = f.decision(&first, &request, 7, false);
let signed = f.sign(&d);
sync.apply(&mut f.db, &f.guard, &signed, &request, &f.clock, &f.boot)
.unwrap();
f.clock.now += Duration::seconds(1);
let second = f.snapshot(&mut sync, 7);
let request = f.request(&second);
let d = f.decision(&second, &request, 7, false);
let signed = f.sign(&d);
sync.apply(&mut f.db, &f.guard, &signed, &request, &f.clock, &f.boot)
.unwrap();
verify_checkpoint_repair_history(&f.db, &f.binding, None).unwrap();
f.db.execute(
"DELETE FROM helper_sync_decisions WHERE checkpoint=?1",
[first.checkpoint],
)
.unwrap();
assert!(verify_checkpoint_repair_history(&f.db, &f.binding, None).is_err());
}
impl Drop for Fixture {
fn drop(&mut self) {
let _ = fs::remove_dir_all(&self.dir);