pub fn report(index: &Index, ledger: &Ledger) -> RulesReportExpand description
Join every rule of the index with the tree and the ledger, and decide, per rule, what the repository can honestly say.
The git comparison is done once per distinct recorded commit and shared by every rule
that recorded against it, as crate::evidence::report does — the two derivations read
the same ledger and must not disagree about what a commit’s diff is.
use majordomus_cli::rules::report;
use majordomus_cli::evidence::Ledger;
use majordomus_cli::synthetic::SyntheticRepository;
let repo = SyntheticRepository::small().unwrap();
let ledger = Ledger::load(repo.root()).unwrap();
let r = report(&repo.index().unwrap(), &ledger);
assert_eq!(r.coverage.rules, repo.shape.rules);
assert!(r.satisfied(), "the synthetic rules are advisory and owe no proof");