Skip to main content

Crate corpora_engine

Crate corpora_engine 

Source
Expand description

The bus orchestrator and the IO edges: Sources (where records come from), Parser (bytes → records), GraphBuilder, Writer, and the git-backed [RevisionOracle]. All filesystem/VCS access lives here; everything in corpora-core/-rules/-report stays pure.

Re-exports§

pub use engine::Engine;
pub use graph_builder::GraphBuilder;
pub use oracle::GitOracle;
pub use parser::FrontMatterFormat;
pub use parser::Parser;
pub use reporter::FailureReporter;
pub use reporter::Gate;
pub use toml_format::TomlFormat;
pub use source::FsWalk;
pub use source::Source;
pub use source::SourceDriver;
pub use source::VecSource;
pub use writer::Writer;

Modules§

engine
Single-threaded, deterministic FIFO bus. Each event is dispatched to every interested subscriber in registration order; their emissions are collected then appended, so the output is reproducible — the property CI and report --check rely on.
graph_builder
Accumulates Parsed records; on Settled builds the immutable graph and emits GraphBuilt. On Changed it replaces one entry — that’s the whole incremental story (full rebuild for now; see plan §7).
oracle
Git-backed RevisionOracle — the trait lives in corpora-core; this is the IO impl. It shells out to git (no heavy VCS dependency); resolution is git rev-parse.
parser
Bytes → Record. The front-matter format is pluggable; v0 ships a TomlFormat stub so the wiring is real even though parsing lands in plan Phase 2.
reporter
Terminal-side subscribers: Gate prints diagnostics as they flow past (the running tally lives in the engine), and FailureReporter turns ParseFailed into a warning so unparsed files are visible rather than silently dropped.
source
Plugin seam #0 — where records come from. SourceDriver adapts a Source onto the bus: scan on RunStarted, re-discover on Changed.
toml_format
Real TOML front-matter + markdown body parsing (plan Phase 2).
writer
Persists Report artifacts to disk under out_dir. The only place report bytes touch the filesystem — adapters themselves stay pure.