Skip to main content

agentmux_srv/backend/storage/filestore/
mod.rs

1// Copyright 2025, Command Line Inc.
2// Copyright 2025-2026, AgentMux Corp.
3// SPDX-License-Identifier: Apache-2.0
4
5//! FileStore: file storage with write-through cache + background flusher.
6//! Port of Go's pkg/filestore/blockstore.go, blockstore_cache.go, blockstore_dbops.go.
7//!
8//! - Separate SQLite DB from Store (matching Go).
9//! - 64KB parts for efficient partial reads/writes.
10//! - Write-through cache with periodic flush (5s default).
11//! - Background flusher via `tokio::spawn` + `tokio::time::interval`.
12
13mod cache;
14mod checkpointer;
15mod core;
16mod counter;
17mod ijson;
18mod lines;
19mod offset_ops;
20mod replace;
21mod types;
22mod zone_txn;
23#[cfg(test)]
24mod tests;
25#[cfg(test)]
26mod tests_atomic;
27#[cfg(test)]
28mod tests_counter;
29#[cfg(test)]
30mod tests_replace;
31#[cfg(test)]
32mod tests_readers;
33
34#[allow(unused_imports)]
35pub use core::{FileStore, DEFAULT_FLUSH_SECS, MAX_CACHE_BYTES};
36pub use types::{FileMeta, FileOpts, MuxFile};
37#[allow(unused_imports)] // the memory record (SPEC_MEMORY_FOLLOWS_THE_AGENT M3)
38pub use zone_txn::ZoneTxn;
39pub(crate) use lines::is_blank_line;
40#[allow(unused_imports)] // consumed by the transcript writers in 5a-3
41pub use counter::{normalized_records, AppendPos, Counted, CountedAppend, LineState};
42#[allow(unused_imports)]
43pub use replace::{DerivedSnapshot, DerivedView, SnapshotFile, SnapshotReader};