- Defined in
memvid-core/src/io/time_index.rs - Uses
TIME_INDEX_MAGIC = MVTIheader followed by entry count and(timestamp, frame_id)tuples Memvid::commit()sorts buffered entries, writes them immediately before the TOC, calculates A BLAKE3 checksum, and updatesToc.time_indexStats.has_time_indexsurfaces to CLI and SDKs to show readiness
Query behavior
- CLI/SDK builds a
TimelineQueryspecifyingstart_ts,end_ts, and optional limit - Core memory-maps the track and binary-searches for the first entry ≥
start_ts - It iterates sequentially until
end_tsor limit is reached, returningTimelineEntrystructs referencing the canonical frames
Repair commands
memvid doctor --file demo.mv2 --rebuild-time-index rebuilds the track from frame metadata, as mandated by the Golden Test Pack (CLI-009). The report lists action plans, severity, and status codes defined in DoctorReport/DoctorActionDetail.
Testing - The crash harness and determinism suite must validate timeline queries after every recovery scenario to ensure the track was correctly replayed from the WAL.