Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienos.com/blob/main/crates/site-builder/src/components/hive.rs # aienos.com Source of www.aienos.com, served from my own hardware Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienos.com / crates / site-builder / src / components / hive.rs` 229 lines ยท 10543 bytes Raw Blame History 1 //! Public live observations, deliberately separate from verified project receipts. 2 //! 3 //! Nothing structural is written here. The whole page skeleton is generated by 4 //! `om/hive-page/hive.om`, a seeded Omega program in program mode that writes the 5 //! markup to stdout; `sh om/hive-page/check.sh` compiles it with the pinned 6 //! compiler and keeps the bytes in `om/hive-page/main.html`. This module embeds 7 //! those bytes unchanged. The Omega edge renderer supplies the board HTML; 8 //! the Omega-generated browser client preserves interactive state while morphing it. 9 use maud::{html, Markup, PreEscaped}; 10 11 pub const TITLE: &str = "The Hive | AienOS"; 12 pub const DESCRIPTION: &str = "Watch the Aien coding agents work in public: real missions, nested agents, exact models and what the agents are saying, live. Learn how to build with AI."; 13 pub const URL: &str = "https://www.aienos.com/hive/"; 14 pub const SOURCE: &str = "https://interplane.io/drakestapleton/aienos.com/blob/main/crates/site-builder/src/components/hive.rs"; 15 16 /// The generated skeleton, byte for byte as `check.sh` wrote it. 17 pub const SKELETON: &str = include_str!("../../../../om/hive-page/main.html"); 18 19 /// The page stylesheet, byte for byte as the build copies it. 20 #[cfg(test)] 21 const HIVE_CSS: &str = include_str!("../../../../public/assets/hive.css"); 22 23 pub fn render_hive_page() -> Markup { 24 debug_assert!( 25 SOURCE.starts_with(crate::forge::FORGE) || crate::forge::valid_repo_link(SOURCE), 26 "the published source pointer must point at the forge or Radicle: {SOURCE}" 27 ); 28 html! { (PreEscaped(SKELETON)) } 29 } 30 31 #[cfg(test)] 32 mod tests { 33 use super::*; 34 use sha2::{Digest, Sha256}; 35 36 fn hex_colour(css: &str) -> Option { 37 let bytes = css.as_bytes(); 38 let mut i = 0; 39 while i < bytes.len() { 40 if bytes[i] == b'#' { 41 let run = bytes[i + 1..].iter().take_while(|b| b.is_ascii_hexdigit()).count(); 42 if run == 3 || run == 6 || run == 8 { 43 return Some(css[i..i + 1 + run].to_string()); 44 } 45 } 46 i += 1; 47 } 48 None 49 } 50 51 #[test] 52 fn the_embedded_skeleton_matches_its_recorded_sha256() { 53 let recorded = include_str!("../../../../om/hive-page/main.html.sha256"); 54 let want = recorded 55 .split_whitespace() 56 .next() 57 .expect("om/hive-page/main.html.sha256 holds a digest"); 58 assert_eq!(want.len(), 64, "main.html.sha256 must hold one sha256 digest"); 59 let got = Sha256::digest(SKELETON.as_bytes()) 60 .iter() 61 .fold(String::new(), |mut acc, byte| { 62 acc.push_str(&format!("{byte:02x}")); 63 acc 64 }); 65 assert_eq!( 66 got, want, 67 "the committed skeleton and its digest disagree; run: sh om/hive-page/check.sh" 68 ); 69 } 70 71 #[test] 72 fn served_scripts_match_their_omega_generated_sha256() { 73 for (name, script, recorded) in [ 74 ( 75 "hive.js", 76 include_bytes!("../../../../public/js/hive.js").as_slice(), 77 include_str!("../../../../om/hive-page/hive.js.sha256"), 78 ), 79 ( 80 "turing-look.js", 81 include_bytes!("../../../../public/js/turing-look.js").as_slice(), 82 include_str!("../../../../om/hive-page/turing-look.js.sha256"), 83 ), 84 ( 85 "hive-fresh.wasm", 86 include_bytes!("../../../../public/wasm/hive-fresh.wasm").as_slice(), 87 include_str!("../../../../public/wasm/hive-fresh.wasm.sha256"), 88 ), 89 ] { 90 let want = recorded.split_whitespace().next().expect("script digest"); 91 assert_eq!(want.len(), 64, "{name} must have a sha256 digest"); 92 let got = format!("{:x}", Sha256::digest(script)); 93 assert_eq!( 94 got, want, 95 "{name} is generated, never hand-edited; run: sh om/hive-page/check.sh" 96 ); 97 } 98 } 99 100 #[test] 101 fn the_skeleton_accepts_edge_rendered_native_branches() { 102 assert!(!SKELETON.contains("