legacy_quarantine.rs (2142B)
1 use std::fs; 2 use std::path::Path; 3 4 const DEVIATIONS: &str = include_str!("../../../contracts/architecture/deviations.toml"); 5 const RETIRED_COMPATIBILITY: &str = 6 include_str!("../../../contracts/architecture/retired_compatibility.v1.toml"); 7 const PUBLISH_POLICY: &str = include_str!("../../../contracts/releases/publish_policy.toml"); 8 9 #[test] 10 fn superseded_transport_packages_are_removed_from_release_authority() { 11 let workspace = Path::new(env!("CARGO_MANIFEST_DIR")).join("../.."); 12 let workspace_manifest = 13 fs::read_to_string(workspace.join("Cargo.toml")).expect("workspace manifest"); 14 let approved = PUBLISH_POLICY 15 .split_once("[workspace_classification]") 16 .map(|(publication, _)| publication) 17 .expect("workspace classification"); 18 let private = PUBLISH_POLICY 19 .split_once("private = [") 20 .and_then(|(_, rest)| rest.split_once(']')) 21 .map(|(entries, _)| entries) 22 .expect("private package classification"); 23 24 for package in ["radroots_net", "radroots_nostr_runtime"] { 25 assert!( 26 !workspace 27 .join(format!("crates/{package}/Cargo.toml")) 28 .exists() 29 ); 30 assert!(!workspace_manifest.contains(package)); 31 assert!(!approved.contains(package)); 32 assert!(!private.contains(&format!("\"{package}\""))); 33 assert!(RETIRED_COMPATIBILITY.contains(&format!("id = \"{package}\""))); 34 } 35 } 36 37 #[test] 38 fn closure_record_captures_the_pulled_forward_removal_gates() { 39 for required in [ 40 "id = \"RCRV1-DEV-010\"", 41 "status = \"closed\"", 42 "radroots_nostr_runtime Step 215 deletion and radroots_net Step 313 deletion had not been applied", 43 "Delete radroots_nostr_runtime, its NostrDB runtime adapter, and radroots_net during Step 301 qualification", 44 "historical names remain only in governed specifications, migration evidence, and fail-closed regression assertions", 45 "closure_evidence = [", 46 ] { 47 assert!( 48 DEVIATIONS.contains(required), 49 "transport closure record is missing `{required}`" 50 ); 51 } 52 }