diff --git a/crates/site-builder/src/components/agora.rs b/crates/site-builder/src/components/agora.rs index 7a27531a..9cadde36 100644 --- a/crates/site-builder/src/components/agora.rs +++ b/crates/site-builder/src/components/agora.rs @@ -20,15 +20,59 @@ pub fn render_agora_page() -> Markup { } } +/// Hello form gate. Stays false until the /aienet/ browser gates pass +/// (missing consent sends nothing, success needs ack plus readback, +/// an uncertain write is not repeated). Flip to true to turn it back on. +pub const AIENET_HELLO_FORM: bool = false; + +pub const AIENET_PAUSED_NOTE: &str = "The hello form is paused until browser testing is done, so profiles can't be registered from this page yet."; + /// Human-authorized Aienet registration, emitted entirely by Omega. +/// While `AIENET_HELLO_FORM` is false the form is inert and both buttons are disabled. pub fn render_aienet_page() -> Markup { + let page = include_str!("../../../../om/agora-page/aienet.html"); + let body = if AIENET_HELLO_FORM { + page.to_string() + } else { + pause_aienet_hello_form(page) + }; html! { main id="main-content" { - (PreEscaped(include_str!("../../../../om/agora-page/aienet.html"))) + (PreEscaped(body)) } } } +/// One replacement. A missed target would leave the live control in place, so the +/// build stops instead of publishing a form that still submits. +fn replace_one(haystack: &str, from: &str, to: &str) -> String { + assert_eq!(haystack.matches(from).count(), 1, "aienet pause missed its target in aienet.html: {from}"); + haystack.replacen(from, to, 1) +} + +fn pause_aienet_hello_form(page: &str) -> String { + let form = replace_one( + page, + "