> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memvid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Crash harness

> Prove WAL recovery and timeline integrity

The memvid-core Dev Steps require a crash harness that runs 1 000 cycles of mutate/crash/recover with zero data loss.

### Harness expectations

* Randomly ingest frames, call `commit()` at varied intervals
* Kill the process mid-commit to leave partial WAL writes
* Restart, let `Memvid::open()` replay the WAL, and assert:
  * `frame_count` matches expectations
  * `timeline()` returns ordered timestamps (verifies Time Index Track persisted)
  * Checksums match (header, TOC, time index)

### Sample assertion

```rust theme={null}
use std::num::NonZeroU64;
use memvid_core::{Memvid, TimelineQuery};

let mut mv = Memvid::open(path).unwrap();
let stats = mv.stats().unwrap();
assert_eq!(stats.frame_count, expected_frames);
let timeline = mv
    .timeline(
        TimelineQuery::builder()
            .limit(NonZeroU64::new(100).unwrap())
            .build(),
    )
    .unwrap();
assert!(timeline.windows(2).all(|w| w[0].timestamp <= w[1].timestamp));
```

> **Performance target** - `open_and_recover_latency` must stay below 250 ms, even when replaying WAL entries (Security & Performance Architecture).
