Skip to main content

Module commit_marker

Module commit_marker 

Source
Expand description

Commit Marker Stream Format (§3.5.4 + §3.5.4.1, bd-1hi.23).

The marker stream under ecs/markers/ is the total order of commits in Native mode. It is the authoritative, tamper-evident, seekable commit log.

On-disk encoding: all fixed-width integers are little-endian (§3.5.1). Sizes are byte-exact — never derived from mem::size_of::<T>().

Structs§

CommitMarkerRecord
On-disk commit marker record.
MarkerSegmentHeader
On-disk segment header for the commit marker stream.

Enums§

MarkerError
Errors from marker stream operations.

Constants§

COMMIT_MARKER_RECORD_BYTES
Byte size of CommitMarkerRecord on disk.
MARKERS_PER_SEGMENT
Default number of markers per segment (fixed rotation policy).
MARKER_FORMAT_VERSION
Current format version.
MARKER_SEGMENT_HEADER_BYTES
Byte size of MarkerSegmentHeader on disk.
MARKER_SEGMENT_MAGIC
Magic bytes for a marker segment header: “FSMK”.

Functions§

binary_search_by_time
Binary search for the commit_seq whose commit_time_unix_ns is the greatest value <= target_ns. Returns None if all records are after target_ns.
check_segment_integrity
Analyze a full segment buffer for torn tail conditions.
compute_marker_id
Compute marker_id: Trunc128(BLAKE3("fsqlite:marker:v1" || prefix_bytes)).
next_commit_seq_from_file_len
Compute the next commit_seq from segment file length (crash-safe allocation).
record_offset
Compute the byte offset of a record within a segment file.
recover_valid_prefix
Recover the valid, density-checked prefix of commit markers from a segment.
segment_id_for_commit_seq
Compute which segment a commit_seq falls in (fixed rotation policy).
start_commit_seq_for_segment
Compute the start_commit_seq for a given segment_id.
valid_record_prefix_count
Scan a segment’s record region and return the count of valid (checksum-verified) records from the start. Stops at the first record that fails xxh3 verification.