diff --git a/crates/site-builder/src/facts.rs b/crates/site-builder/src/facts.rs index 58c691d5..564d4d7f 100644 --- a/crates/site-builder/src/facts.rs +++ b/crates/site-builder/src/facts.rs @@ -71,7 +71,9 @@ impl Facts { pub fn load(path: &Path) -> Result { let text = std::fs::read_to_string(path) .map_err(|e| format!("cannot read {}: {e} (run `site-builder facts {}` first)", path.display(), path.display()))?; - serde_json::from_str(&text).map_err(|e| format!("{} is not a facts file: {e}", path.display())) + let mut facts: Facts = serde_json::from_str(&text).map_err(|e| format!("{} is not a facts file: {e}", path.display()))?; + facts.decisions.retain(|d| !retired_name(&d.title)); + Ok(facts) } pub fn save(&self, path: &Path) -> Result<(), String> { @@ -109,6 +111,12 @@ fn comparison_title(t: &str) -> bool { .any(|w| l.contains(w)) } +/// The retired name is not rendered, including in an automatically collected +/// decision title. The record remains in the architecture repository. +fn retired_name(t: &str) -> bool { + t.to_ascii_lowercase().contains("aienix") +} + fn now_utc() -> String { // RFC 3339 to the second, without pulling in a time crate. let secs = std::time::SystemTime::now() @@ -192,7 +200,7 @@ pub fn gather() -> Result { }) .unwrap_or_default(); decisions.sort_by(|a, b| b.id.cmp(&a.id)); - decisions.truncate(5); + decisions.truncate(6); // Prefer each record's own heading ("# ADR 0035: Persistent Cognitive Entity Boundary (ALLEN)"). for d in &mut decisions { let raw = Command::new("gh") @@ -212,7 +220,8 @@ pub fn gather() -> Result { } } } - + decisions.retain(|d| !retired_name(&d.title)); + decisions.truncate(5); // The receipt: latest main commit of sovereign-core and its "AIEN Verification" status. let repo = "aien-dev/aien-sovereign-core"; let commit = gh(&[&format!("repos/{repo}/commits/main")])?;