cochranblock 0.1.0

The Cochran Block manual. Index of every Rust crate published under the Unlicense (public domain). The Anti-Founder Manifesto in crate form.
Documentation
// Unlicense - public domain - cochranblock.org
#![doc(html_logo_url = "https://cochranblock.org/cochranblock-hero-logo.svg")]
#![doc(html_favicon_url = "https://cochranblock.org/assets/favicon.svg")]
#![doc(html_root_url = "https://docs.rs/cochranblock")]
#![doc = include_str!("../README.md")]

/// Verify the manual is internally consistent.
///
/// Runs an `exopack` Triple-Sims gate over the catalog of receipts. If every
/// pass agrees the manual is well-formed and the public-domain doctrine
/// holds, returns `Ok(())`. The test is intentionally light - the manual is
/// a directory, not a runtime - but it lets `cargo test -p cochranblock` and
/// downstream auditors confirm the crate did not regress.
pub fn verify() -> Result<(), &'static str> {
    let receipts = catalog();
    if receipts.is_empty() {
        return Err("manual catalog is empty");
    }
    for r in receipts {
        if r.license != "Unlicense" {
            return Err("non-public-domain entry leaked into the manual");
        }
        if r.crate_name.is_empty() {
            return Err("anonymous receipt in catalog");
        }
    }
    Ok(())
}

/// One entry in the manual: a published Cochran Block crate.
#[derive(Debug, Clone, Copy)]
pub struct Receipt {
    /// Crate name as published on crates.io.
    pub crate_name: &'static str,
    /// One-sentence purpose.
    pub purpose: &'static str,
    /// SPDX license identifier. Must be `"Unlicense"` for every catalog row.
    pub license: &'static str,
}

/// The canonical catalog of receipts that this manual documents.
///
/// Updated whenever a new Cochran Block crate is published.
pub const fn catalog() -> &'static [Receipt] {
    &[
        Receipt {
            crate_name: "runsible",
            purpose: "Ansible, reimagined in Rust. 14-crate workspace, ~10ms cold start.",
            license: "Unlicense",
        },
        Receipt {
            crate_name: "r8r",
            purpose: "n8n workflow engine ported to Rust. axum + Leptos/WASM canvas.",
            license: "Unlicense",
        },
        Receipt {
            crate_name: "exopack",
            purpose: "Testing framework with Triple-Sims quality gates.",
            license: "Unlicense",
        },
        Receipt {
            crate_name: "oakilydokily",
            purpose: "Client waiver/resume site with interactive WASM mural.",
            license: "Unlicense",
        },
        Receipt {
            crate_name: "illbethejudgeofthat",
            purpose: "Pro se custody case builder, email-to-PDF pipeline.",
            license: "Unlicense",
        },
        Receipt {
            crate_name: "any-gpu",
            purpose: "Run AI inference on any GPU you already own.",
            license: "Unlicense",
        },
        Receipt {
            crate_name: "deglaze",
            purpose: "Strip Glaze from AI-protected images for downstream analysis.",
            license: "Unlicense",
        },
        Receipt {
            crate_name: "ghost-fabric",
            purpose: "Distributed mesh substrate.",
            license: "Unlicense",
        },
    ]
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn manual_is_well_formed() {
        verify().expect("manual catalog should be internally consistent");
    }

    #[test]
    fn every_entry_is_public_domain() {
        for r in catalog() {
            assert_eq!(r.license, "Unlicense", "non-Unlicense entry: {}", r.crate_name);
        }
    }

    #[test]
    fn exopack_is_pinned() {
        // exopack is the public-domain testing framework Cochran Block ships
        // with every crate. If this compiles, the dep is present and
        // resolvable from crates.io. Triple-Sims doctrine starts here.
        // Reference the crate so the linker keeps the dep edge.
        #[allow(unused_imports)]
        use exopack as _;
    }
}