//! The total door, demonstrated: the same release passed twice — once with //! all four gates satisfied (certified), once with one gate failed (refused, //! with the gate named). There is no third outcome. //! //! Run: `cargo run -p joule-code-release --example release` use ed25519_dalek::SigningKey; use joule_code_release::{certify, Gate, GateOutcome, ReleaseRequest, ALG_ED25519}; fn request(certifier: &SigningKey, build_ok: bool) -> ReleaseRequest { ReleaseRequest { alg: ALG_ED25519, subject: "settlement batch writer".into(), artifact: "build:9f2c…".into(), spec: "blake3:1a7e…".into(), outcomes: vec![ GateOutcome::contract(true, "sha2-256:deadbeef"), GateOutcome::attested_build(build_ok, "build:9f2c…"), // (spec-coverage and review outcomes would be derived from real // Coverage / Approval verdicts; shown here as their satisfied form) GateOutcome { gate: Gate::SpecCoverage, satisfied: true, evidence: "blake3:1a7e…".into() }, GateOutcome { gate: Gate::Review, satisfied: true, evidence: "blake3:op-44".into() }, ], certifier: certifier.verifying_key().to_bytes(), } } fn main() { let key = SigningKey::from_bytes(&[7u8; 32]); println!("— all four gates satisfied —"); match certify(request(&key, true), &key).unwrap() { Ok(cert) => { let id = cert.verify().unwrap(); println!(" CERTIFIED · release {} · vouches for {}", id.as_str(), cert.request.artifact); for o in &cert.request.outcomes { println!(" ✓ {:<18} {}", o.gate.label(), o.evidence); } } Err(refusal) => println!(" {refusal}"), } println!("\n— same release, the build gate fails —"); match certify(request(&key, false), &key).unwrap() { Ok(_) => println!(" CERTIFIED (should not happen)"), Err(refusal) => println!(" {refusal}\n → the artifact does not exist as far as production is concerned."), } }