1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Deterministic doctrine checks. Every finding cites a specific doctrine
//! file path. No prose interpretation; no LLM.
//!
//! Each rule targets a specific doctrine principle
//! (`doctrine/principles/<name>.md`) and includes that path as the
//! `doctrine_anchor` on every finding it emits. Severity is one of
//! `Info` / `Warning` / `Error`, with a concrete `remediation` string.
//!
//! # Golden path
//!
//! ```no_run
//! use cordance_core::advise::AdviseReport;
//! use cordance_core::lock::SourceLock;
//! use cordance_core::pack::{CordancePack, PackTargets, ProjectIdentity};
//! use cordance_core::schema;
//!
//! let pack = CordancePack {
//! schema: schema::CORDANCE_PACK_V1.into(),
//! project: ProjectIdentity {
//! name: "my-project".into(),
//! repo_root: ".".into(),
//! kind: "rust-workspace".into(),
//! host_os: "linux".into(),
//! axiom_pin: None,
//! },
//! sources: vec![],
//! doctrine_pins: vec![],
//! targets: PackTargets::all(),
//! outputs: vec![],
//! source_lock: SourceLock::empty(),
//! advise: AdviseReport::empty(),
//! residual_risk: vec![],
//! };
//!
//! let report = cordance_advise::run_all(&pack).expect("advise");
//! for finding in &report.findings {
//! println!(
//! "[{:?}] {} — see {}",
//! finding.severity, finding.summary, finding.doctrine_anchor,
//! );
//! }
//! ```
use AdviseReport;
use CordancePack;
/// Run all deterministic rules over a pack and return the consolidated report.