cordance-advise 0.1.1

Cordance advisory engine. Deterministic doctrine checks against project state.
Documentation
//! Rule library. Each rule:
//!  - cites a specific doctrine file path
//!  - has a deterministic check (no LLM, no heuristics)
//!  - produces zero or more `AdviseFinding`s

use cordance_core::advise::AdviseFinding;
use cordance_core::pack::CordancePack;

/// A single deterministic advisory rule.
/// Every rule must cite a specific doctrine file path.
pub trait AdviseRule: Send + Sync {
    /// Machine-readable identifier, e.g. `"R-build-1"`.
    fn id(&self) -> &'static str;
    /// Path to the doctrine file that defines this rule.
    /// Must be a real path under `engineering-doctrine/doctrine/`.
    fn doctrine_anchor(&self) -> &'static str;
    /// Run the rule. Returns zero or more findings.
    fn check(&self, pack: &CordancePack) -> Vec<AdviseFinding>;
}

/// All registered v0 rules.
#[must_use]
pub fn all_rules() -> Vec<Box<dyn AdviseRule>> {
    vec![
        Box::new(build::RBuild1),
        Box::new(secrets::RSecrets1),
        Box::new(supply::RSupply1),
        Box::new(secure::RSecure1),
        Box::new(docs::RDocs1),
        Box::new(contracts::RContracts1),
        Box::new(trunk::RTrunk1),
        Box::new(observe::RObserve1),
        Box::new(naming::RNaming1),
        Box::new(adr_readme::RAdrReadme1),
        Box::new(changelog::RChangelog1),
        Box::new(schema_version::RSchemaVersion1),
        Box::new(gitignore::RGitignore1),
        Box::new(license::RLicense1),
    ]
}

pub mod adr_readme;
pub mod build;
pub mod changelog;
pub mod contracts;
pub mod docs;
pub mod gitignore;
pub mod license;
pub mod naming;
pub mod observe;
pub mod schema_version;
pub mod secrets;
pub mod secure;
pub mod supply;
pub mod trunk;