1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// Copyright (c) 2026 2youg1 and the sprawling contributors
//! Durable Ledger adapter: jsonl segments, tail-truncation recovery,
//! direction-aware version refusal, group commit.
//!
//! Contract owned here:
//! - bytes come from `EventRecord::canonical_line` verbatim plus `\n`;
//! this module owns seq/prev assignment and the fsync schedule, nothing
//! about the byte shape.
//! - `append_all` is one durability barrier per wave: `Ok` means every
//! line is written and synced; on `Err` the in-memory state has not
//! advanced, torn bytes are the next open's tail recovery, and the
//! handle refuses every later wave until that open (`barrier`).
//! - open never rewrites while browsing: the version probe fires before
//! any repair; only the last segment is ever truncated, and only at a
//! torn boundary.
//! - time is a parameter (`now` feeds the `log_truncated` record); this
//! module never samples a clock (determinism rule 2).
//!
//! The `Vfs` seam this reaches disk through is crate-internal on
//! purpose (`crate::vfs`): std fs and FaultFs are its two adapters, and
//! it never enters a public signature — `JsonlLedger` hides it behind
//! `Box<dyn Vfs>`.
//!
//! Specified by `crates/storage/spec/Jsonl.lean` §8-1.
pub use first_line;
pub use segment_file_name;
pub use ;
pub use ;
pub use ;
pub use ;
pub use claimed_seq;
pub use ;