mirror of
https://github.com/block/buzz.git
synced 2026-11-01 23:11:58 +00:00
GAP 1: Add store_recovery_failed guard at top of mutate_store — returns Err immediately if the boot recovery flag is set, blocking all journaled mutations after a recovery failure. GAP 2: recover_interrupted_file_commits now returns usize (unresolved commit count) instead of (). Every skip branch increments the counter; lib.rs sets store_recovery_failed and early-returns when count > 0 OR Err — unresolved commits are no longer log-and-proceed. GAP 3: Extract run_recovery_gate(anchor, store_work_closure) — runs file-commit recovery, fails closed on Err or unresolved count > 0, and only then invokes the closure. lib.rs calls it with the migrations entry inside the closure; tests drive the same function. The ordering invariant lives in one place and cannot drift. Tests: test_setup_order_recovery_completes_before_migration_reads_canonical drives run_recovery_gate and asserts the closure sees the repaired canonical; test_recovery_gate_failure_skips_closure_and_returns_err asserts the closure never runs on unresolved recovery; GAP 2 tests assert hash-mismatch and rename-failure scenarios return unresolved count > 0. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>