From 2d9025b7a44aa11735ff222dfb70c68837ec5ac9 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 23 Oct 2026 13:12:59 -0500 Subject: [PATCH] facts: keep the retired name out of collected ADR titles ADR 0038 records the retirement and contains the old name in its heading. The homepage now filters that title from the five newest decisions and from loaded facts, so the page does not render it. The record remains in the architecture repository and its link is not published. Reproduced with freshly gathered facts: build and verify PASS, no retired name in facts.json or the homepage. --- crates/site-builder/src/facts.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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")])?;