Expand description
Cortex adapter. Emits cordance-cortex-receipt-v1-candidate JSON only.
ADR 0005: Cordance never writes to the cortex repo or runtime. It produces a receipt; the operator hands the receipt to Cortex via Cortex’s own acceptance flow.
Every receipt’s AuthorityBoundary is constructed via
AuthorityBoundary::candidate_only(), which sets every authority-grant
flag to false. Receipts re-validate through validate_invariants()
on the deserialise path so a tampered JSON that flips a flag is caught
even if serde accepts it.
§Golden path
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: Some("v3.1.1-axiom".into()),
},
sources: vec![],
doctrine_pins: vec![],
targets: PackTargets::all(),
outputs: vec![],
source_lock: SourceLock::empty(),
advise: AdviseReport::empty(),
residual_risk: vec!["claim_ceiling=candidate".into()],
};
let receipt = cordance_cortex::build_receipt(&pack).expect("build receipt");
receipt.validate_invariants().expect("invariants hold");
let json = serde_json::to_string_pretty(&receipt).expect("serialise");
println!("{json}");Modules§
- builder
- Receipt builder — produces a
cordance-cortex-receipt-v1-candidatefrom a compiledCordancePack. - validator
- Structural validator for
CortexReceiptV1Candidate.
Enums§
Functions§
- build_
receipt - Build a candidate receipt from a compiled pack.
- safe_
boundary - Quick check: a fresh
AuthorityBoundary::candidate_only()is always safe.