metrale_governance/lib.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2
3//! 2026-09-26: The pull-request journey ledger: one append-only JSONL file per
4//! pull request, `governance/pr-<n>.jsonl`, recording gate verdicts,
5//! lifecycle states, classifier opinions and measurements.
6//!
7//! Owner: metrale-governance.
8//! Invariants:
9//! - This crate writes only by appending a line to a journey file.
10//! - Readers deduplicate by [`Event::identity`], which leaves out the
11//! timestamp, so a file's content is a grow-only set: `.gitattributes`
12//! declares `governance/*.jsonl merge=union`.
13//! - The crate does not depend on the bench gate. The gate check reads a
14//! journey only to print the advisory intent; its exit code is computed from
15//! the gate verdicts alone.
16//!
17//! [`materialize`] builds an in-memory graph from a journey; the JSONL is the
18//! only form that is committed.
19
20pub mod event;
21pub mod ledger;
22
23#[cfg(test)]
24#[path = "ledger_tests.rs"]
25mod ledger_tests;
26
27pub use event::{Event, EventKind, Verdict};
28pub use ledger::{Journey, append, materialize, read_all};