48226add

By: ValentinHirschi <valentin.hirschi@gmail.com>

R-B2 fix: surface checkpoint I/O errors; never record a storage stop as a batch result

Astra gate R-B2 findings (3) and (4) on rb 54d9812d4:

- spill.rs: a failed or short trace write cuts ops.bin back to the flushed
  ops and fails the spill for good (every later flush / sync / finish
  refuses), so a retried append can never duplicate a partial prefix; a
  failed fdatasync is never retried. Errors name the file. A kept trace that
  no saved state covers yet is emptied, so a restart starts afresh.
- ordered_reduction/mod.rs: resume_save_parts separates "cannot be saved"
  (soft, as before) from trace write / sync errors, which are now hard
  errors (checkpoint_failed) at the in-phase, phase-end and final saves:
  raised before another key is dispatched or a low-disk pause is claimed;
  the previous state.bin and its trace prefix stay usable.
- resume.rs: write_atomic fsyncs the state before the rename and the
  directory after it (the trace prefix it covers is synced first).
  storage_stop / take_resume_storage_stop record pauses, checkpoint and
  spill (trace, dictionary) I/O errors, refused resumes and test stops.
- p5l_library reduce-files: a storage stop writes no chunk output (the chunk
  stays retryable) and exits 3; p_key_batch stops the batch with status 3.
- Tests: short-write and failed-sync spill unit tests; e2e witnesses
  (partial write, state write failure, persistent sync ENOSPC, batch
  pause / sync failure and retry) in engine-line/rb2fix/e2e.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub
configure