pub fn recover_last_seq(events_path: &Path) -> Result<u64>Expand description
Read the last seq from events.jsonl, or 0 if empty/missing.
Tolerates:
- lines larger than any fixed buffer (
node.reportpayloads can be 10s of KB perdesign.md§1.4) — we scan backwards in chunks for the previous\n. - a crash-truncated final line lacking a trailing
\n— that partial tail is discarded and recovery uses the last complete record.
Caller must already hold the run’s RunLock for correctness against
concurrent appenders.