Skip to main content

Crate cordance_doctrine

Crate cordance_doctrine 

Source
Expand description

Doctrine consumer. Reads 0ryant/engineering-doctrine and indexes by directory. Never re-classifies prose — only filenames and paths.

Source-of-truth: engineering-doctrine/doctrine/SEMANTIC_INDEX.md.

§Golden path

use camino::Utf8PathBuf;

let root = Utf8PathBuf::from("../engineering-doctrine");
let index = cordance_doctrine::load_doctrine(&root).expect("load doctrine");

println!("doctrine pinned at: {:?}", index.commit);
for entry in &index.principles {
    println!("principle: {} ({})", entry.topic, entry.path);
}

With network fallback (when the sibling clone is absent, performs a hardened shallow HTTPS clone into an operator-trusted cache — dirs::cache_dir()/cordance/doctrine/<hash>/<head-sha>/, never inside the target repo):

let root = Utf8PathBuf::from("../engineering-doctrine");
let index = cordance_doctrine::load_doctrine_with_fallback(
    &root,
    "https://github.com/0ryant/engineering-doctrine",
    None,
    Some("auto"),
).expect("doctrine loaded (sibling or fallback clone)");

Structs§

DoctrineEntry
DoctrineIndex

Enums§

DoctrineError

Functions§

load_doctrine
Load and index the engineering-doctrine repository at root.
load_doctrine_or_default
Load doctrine, returning an empty index on any error rather than propagating.
load_doctrine_or_fallback
Like load_doctrine_with_fallback but returns an empty index instead of propagating any error. Logs a warning when the fallback fails.
load_doctrine_with_fallback
Load doctrine from root on disk. If root does not exist, clone fallback_repo (shallow, depth=1) into cache_dir and load from there.