Skip to main content

bookspec_checker/
lib.rs

1//! bookspec's checker: the example schema, the rule identifiers, and the
2//! [`Engine`] trait an accounting engine implements (`plan/served.md` P13,
3//! D-34).
4//!
5//! bookspec is a specification first: every rule is stated normatively,
6//! sourced, and demonstrated by concrete examples (`bookspec/examples/`).
7//! This crate is the machine-readable part: [`Example`] is the schema and
8//! its parser, [`mod@rules`] the catalogue (`BS-<area>-<n>`), and [`Engine`]
9//! the only interface a conformance runner needs. The runner lives in
10//! `bookspec-runner`; wanderbooks' adapter is
11//! `crates/ledger-core/tests/bookspec.rs`.
12//!
13//! The crate knows nothing of any engine: no money type, no ledger, no
14//! store. That is what lets a second engine (the GnuCash oracle, later) be
15//! checked by the same examples.
16
17pub mod derive;
18pub mod engine;
19pub mod files;
20pub mod rules;
21pub mod schema;
22
23pub use derive::{Derivation, Derived, derive};
24pub use engine::{Claims, Engine, Refusal, RuleId, RuleIdError, fallback_refusal};
25pub use files::{examples, spec_files};
26pub use rules::{Area, Rule, Status, covered_rules, rule, rule_for_id, rule_for_refusal, rules};
27pub use schema::*;