check / check (push) Canceled after 0s
Settings, conventions (posting templates, approval rules, policies, close steps, calendar, mappings, notes), decisions, open items and entry approvals are journal events (journal format 2). Books that keep their settings never read wanderbooks.toml or config.json; the server and the viewer take the vault key from --vault-key-file instead. books.import_settings moves a settings file in once, exactly as the server reads it. Approval rules, when enforced, gate every posting path. Replay refuses what it can't read as newer, never as corrupt. Lean: a record changes no figure. Mutation on the whole diff: every survivor killed by a test but two equivalent (docs/testing.md). The Company page says a late open item is overdue in words, not colour alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
42 lines
1.6 KiB
Rust
42 lines
1.6 KiB
Rust
//! `ledger-store`: durable persistence for the books.
|
|
//!
|
|
//! Three pieces, one job — keep the books safe:
|
|
//!
|
|
//! * [`journal`] — the source of truth. An append-only, hash-chained JSONL
|
|
//! journal. Every state change is an immutable fact, fsync'd on append.
|
|
//! * [`blob`] — the bytes. Content-addressed (SHA-256), immutable,
|
|
//! deduplicated receipt and document storage.
|
|
//! * [`Store`] — the SQLite projection plus the write path. SQLite is the
|
|
//! query engine and is disposable by design: [`Store::rebuild`] drops it
|
|
//! and replays the journal. [`Store::verify`] replays the journal into a
|
|
//! fresh engine and diffs its reports against both the live ledger and
|
|
//! the projection.
|
|
//!
|
|
//! The write path is singular: **validate → journal → mutate → apply**.
|
|
//! Journal first means a failed write leaves nothing behind; a failed
|
|
//! SQLite apply leaves the journal ahead, and the next open heals it via
|
|
//! `last_applied_seq`. There is exactly one writer: `Store` is `!Sync` by
|
|
//! construction (it owns a `rusqlite::Connection`).
|
|
|
|
pub mod blob;
|
|
pub mod error;
|
|
pub mod format;
|
|
pub mod journal;
|
|
pub mod meta;
|
|
pub mod reconcilable;
|
|
pub mod schema;
|
|
pub mod snapshot;
|
|
pub mod store;
|
|
pub mod viewer;
|
|
|
|
pub use blob::BlobStore;
|
|
pub use error::StoreError;
|
|
pub use format::{JournalFormat, SUPPORTED_JOURNAL_FORMAT};
|
|
pub use journal::{GENESIS_PREV, JournalLine, JournalWriter};
|
|
pub use snapshot::{DiskCheck, Snapshot};
|
|
pub use store::{
|
|
Attachment, DB_FILE, DepreciationRun, DisposalPreview, EntryRow, EventRow, JOURNAL_FILE,
|
|
LOCK_FILE, MAX_RECURRING_RUN, PayrollLineInput, Reconciliation, Statement, Store, Subject,
|
|
VerifyReport,
|
|
};
|