diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index a4941bda..682c84d3 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -21,6 +21,8 @@ jobs: - uses: actions/checkout@v4 with: ref: main + # Full history: the sitemap and feeds date hand-written pages from their last commit. + fetch-depth: 0 - name: Lay in the live ledger from the data/now branch run: | set -euo pipefail diff --git a/crates/site-builder/src/components/blog.rs b/crates/site-builder/src/components/blog.rs index 18516538..ba9da627 100644 --- a/crates/site-builder/src/components/blog.rs +++ b/crates/site-builder/src/components/blog.rs @@ -5,7 +5,7 @@ use super::boxlink::{foot, source_href, Target}; pub const POST_SLUG: &str = "aien-v3-research-plan"; pub const POST_TITLE: &str = "The AIEN V3 Research Plan"; pub const POST_DATE: &str = "September 27, 2026"; -pub const POST_DESCRIPTION: &str = "The ratified V3 of the AIEN research plan, the Substrate Edition. It adds the whole-box continuity thesis and six falsifiable hypotheses (H5-H10): a shared CPU/GPU object pool, a cross-engine object ABI, a resident cooperation protocol, an epoch checkpoint barrier, movement-first synthesis cost, and the first fully closed propose/prove/realize/execute/measure loop."; +pub const POST_DESCRIPTION: &str = "The ratified V3 of the AIEN research plan, the Substrate Edition: the whole-box continuity thesis and six falsifiable hypotheses, H5 to H10."; pub const CASE_SLUG: &str = "post-llm-case"; pub const CASE_TITLE: &str = "The Post-LLM Case"; diff --git a/crates/site-builder/src/components/discovery.rs b/crates/site-builder/src/components/discovery.rs index 20eea7f2..50130895 100644 --- a/crates/site-builder/src/components/discovery.rs +++ b/crates/site-builder/src/components/discovery.rs @@ -9,8 +9,8 @@ use super::narrative::class_badge; use super::research_status::{data, ImplementationRow}; pub const TITLE: &str = "Scientific Discovery | AIENOS"; -pub const DESCRIPTION: &str = "Physics Zero, Dirac, Zeta and supersymmetry as examinations of representation discovery. AIEN is never given the named answer; it gets generic machinery and must earn the structure."; -pub const URL: &str = "https://aienos.com/discovery/"; +pub const DESCRIPTION: &str = "Physics Zero, Dirac, Zeta and supersymmetry as examinations of representation discovery. AIEN is never given the named answer; it must earn the structure."; +pub const URL: &str = "https://www.aienos.com/discovery/"; pub const NAMED_ANSWER_RULE: &str = "Never give AIEN the named answer when the experiment is intended to test discovery."; diff --git a/crates/site-builder/src/components/footer.rs b/crates/site-builder/src/components/footer.rs index 666862cb..0a2e2a09 100644 --- a/crates/site-builder/src/components/footer.rs +++ b/crates/site-builder/src/components/footer.rs @@ -93,6 +93,18 @@ pub fn render_footer() -> Markup { p { "Persistent machine intelligence on hardware you own. Experimental, open source, and verified in public, receipts and all." } + p class="aien-footer-machines" { + span class="aien-footer-machines-k" { "For machines: " } + a href="/data/index.json" { "data index" } + " · " + a href="/llms.txt" { "llms.txt" } + " · " + a href="/llms-full.txt" { "full text" } + " · " + a href="/feed.xml" { "feed" } + " · " + a href="/now/feed.xml" { "ledger feed" } + } } nav class="aien-footer-sections" aria-label="Site sections" { @for (heading, links) in FOOTER_GROUPS { diff --git a/crates/site-builder/src/components/hubs.rs b/crates/site-builder/src/components/hubs.rs index 1faa9a9e..52f18dbb 100644 --- a/crates/site-builder/src/components/hubs.rs +++ b/crates/site-builder/src/components/hubs.rs @@ -69,7 +69,7 @@ pub static HUBS: [Hub; 3] = [ Hub { slug: "evidence", title: "Evidence | AIENOS", - description: "What counts as evidence for AIEN, which source wins when two disagree, and where to inspect the receipts, frozen profiles, research status record, and qualification record.", + description: "What counts as evidence for AIEN, which source wins when two disagree, and where to inspect the receipts, frozen profiles and status records.", required: &[EVIDENCE_PHRASE, STATUS_PAGE_LINK, STATUS_JSON_LINK], status: StatusSource::Absent, render: render_evidence_hub, @@ -252,7 +252,7 @@ fn render_hub_document(hub: &Hub) -> String { render_page_layout( hub.title, hub.description, - &format!("https://aienos.com/{}/", hub.slug), + &format!("https://www.aienos.com/{}/", hub.slug), "website", html! {}, (hub.render)(), diff --git a/crates/site-builder/src/components/machine.rs b/crates/site-builder/src/components/machine.rs index d30edb38..6ae8ad12 100644 --- a/crates/site-builder/src/components/machine.rs +++ b/crates/site-builder/src/components/machine.rs @@ -17,8 +17,8 @@ use super::research_status::{ }; pub const TITLE: &str = "The Machine | AIENOS"; -pub const DESCRIPTION: &str = "AIENOS is an owned experimental machine for turning search into verified understanding. The real machines it runs on today, the closed epistemic loop, the Turing as its accounting layer, and an honest list of what exists."; -pub const URL: &str = "https://aienos.com/machine/"; +pub const DESCRIPTION: &str = "The five real machines AIENOS runs on today, the closed loop from search to verified understanding, the Turing as its accounting layer, and what exists."; +pub const URL: &str = "https://www.aienos.com/machine/"; /// Anchor of the homepage loop diagram (NARR-HOME, components/home_loop.rs). pub const HOME_LOOP_HREF: &str = "/#loop-title"; diff --git a/crates/site-builder/src/components/navbar.rs b/crates/site-builder/src/components/navbar.rs index 8c8e8f77..eb27c47a 100644 --- a/crates/site-builder/src/components/navbar.rs +++ b/crates/site-builder/src/components/navbar.rs @@ -37,7 +37,7 @@ pub fn render_navbar() -> Markup { html! { header class="aien-header" { div class="aien-header-inner" { - a class="aien-brand" href="/" aria-label="AIENOS home" { + a class="aien-brand" href="/" aria-label="AIENOS, persistent machine intelligence: home" { span class="aien-brand-mark" aria-hidden="true" { (PreEscaped(r#""#)) } diff --git a/crates/site-builder/src/components/now.rs b/crates/site-builder/src/components/now.rs index 7cd32f40..e6becd21 100644 --- a/crates/site-builder/src/components/now.rs +++ b/crates/site-builder/src/components/now.rs @@ -22,8 +22,8 @@ use serde::Serialize; use super::boxlink::{foot_labelled, Target}; pub const TITLE: &str = "Now | AIEN OS"; -pub const DESCRIPTION: &str = "The live coordination ledger of AIEN: what every agent is doing right now, what comes next, what has been settled with evidence, and what is waiting on an operator decision."; -pub const URL: &str = "https://aienos.com/now/"; +pub const DESCRIPTION: &str = "The live coordination ledger of AIEN: what every agent is doing right now, what is settled with evidence, and what waits on an operator decision."; +pub const URL: &str = "https://www.aienos.com/now/"; /// Where the pages workflow lays the published ledger before a build. pub const LEDGER_PATH: &str = "public/data/now.tsv"; diff --git a/crates/site-builder/src/components/status.rs b/crates/site-builder/src/components/status.rs index 2c5e2886..c6424ea5 100644 --- a/crates/site-builder/src/components/status.rs +++ b/crates/site-builder/src/components/status.rs @@ -200,33 +200,11 @@ pub fn status_json() -> String { out } -/// /llms.txt: the project in plain text for AI readers and crawlers. +/// /llms.txt: the project in plain text for AI readers and crawlers, in +/// the llms.txt convention (see `seo::llms_txt`), with the layer states. pub fn llms_txt() -> String { - let mut out = String::new(); - out.push_str("# AIENOS\n\n"); - out.push_str("> AIENOS is an experimental sovereign machine for persistent machine intelligence: Atlas awakens it on hardware you own, Omega turns intent into verified programs, and AIEN learns from verified experience. Intelligence should be owned, not rented. Every claim carries a public receipt.\n\n"); - out.push_str("AIENOS is more than an operating system. It is a substrate where a persistent intelligence lives on the owner's hardware, keeps its memory and identity on the owner's side of the line, and treats hardware as capability, not identity. Status: experimental, pre-alpha.\n\n"); - out.push_str("## The lineage\n\n"); - out.push_str("- Atlas: awakens. The seed that wakes AIENOS on a machine.\n"); - out.push_str("- AIENOS: persists. The sovereign substrate that owns the hardware and keeps the agent alive and continuous.\n"); - out.push_str("- Omega: defines, synthesizes, verifies. Turns intent into programs and proves them against reality before they are trusted.\n"); - out.push_str("- AIEN: learns. The persistent intelligence. Weights suggest, programs explain, evidence teaches.\n"); - out.push_str("- Around the loop, not in the pipeline: Aegis verifies generated code and changes nothing; Forge realizes what Omega verified; Argus watches capability enforcement; Cortex is the canonical memory.\n\n"); - out.push_str("## Current state\n\n"); - for layer in layer_states() { - out.push_str(&format!("- {}: {}. {}\n", layer.name, layer.status, layer.note)); - } - out.push_str("\nMachine-readable state: https://www.aienos.com/status.json\n\n"); - out.push_str(&format!("Research status: {} Full ladder and experiment cards: https://www.aienos.com/research/status/ (data: https://www.aienos.com/research-status.json)\n\n", rs::current_level_sentence())); - out.push_str("## Links\n\n"); - out.push_str("- Homepage: https://www.aienos.com/\n"); - out.push_str("- Current status: https://www.aienos.com/#status\n"); - out.push_str("- Evidence: https://www.aienos.com/#evidence\n"); - out.push_str("- Research index: https://www.aienos.com/research/\n"); - out.push_str("- The Turing, a unit of net held-out explanatory compression (one operational component of machine understanding): https://www.aienos.com/turing/\n"); - out.push_str("- Licensing (AGPL-3.0-or-later): https://www.aienos.com/licensing/\n"); - out.push_str("- GitHub organization: https://github.com/aien-dev\n"); - out + let lines: Vec = layer_states().iter().map(|l| format!("{}: {}. {}", l.name, l.status, l.note)).collect(); + crate::seo::llms_txt(&lines, &rs::current_level_sentence()) } #[cfg(test)] diff --git a/crates/site-builder/src/layouts/base.rs b/crates/site-builder/src/layouts/base.rs index 4aba7591..102f678b 100644 --- a/crates/site-builder/src/layouts/base.rs +++ b/crates/site-builder/src/layouts/base.rs @@ -2,9 +2,9 @@ use maud::{html, Markup, PreEscaped, DOCTYPE}; pub fn render_base_layout(content: Markup) -> Markup { render_page_layout( - "AIENOS | Persistent Machine Intelligence on a Machine You Own", - "AIENOS is an experimental sovereign machine for persistent machine intelligence: Atlas awakens it on hardware you own, Omega turns intent into verified programs, and AIEN learns from verified experience. Every claim carries a public receipt.", - "https://aienos.com/", + "AIENOS | Persistent machine intelligence you own", + "An experimental, open source machine for turning search into verified understanding, running on five real machines. Every claim carries a public receipt.", + "https://www.aienos.com/", "website", html! { // Zero-dependency terminal micro-script @@ -23,6 +23,8 @@ pub fn render_base_layout(content: Markup) -> Markup { /// Parameterized page layout for non-homepage pages (blog, posts). /// Title, description, and canonical URL are set per page. `extra_head` /// carries page-specific scripts (e.g. the comments loader on post pages). +/// Social cards, hreflang alternates, feed links and JSON-LD are added to +/// every written page by `seo::enrich`, so they are not repeated here. pub fn render_page_layout( title: &str, description: &str, @@ -39,20 +41,9 @@ pub fn render_page_layout( meta name="viewport" content="width=device-width, initial-scale=1"; title { (title) } meta name="description" content=(description); - link rel="canonical" href=(og_url); + @if !og_url.is_empty() { link rel="canonical" href=(og_url); } link rel="icon" type="image/svg+xml" href="/favicon.svg"; - - // Open Graph / Twitter Meta - meta property="og:title" content=(title); - meta property="og:description" content=(description); - meta property="og:url" content=(og_url); meta property="og:type" content=(og_type); - meta property="og:image" content="https://aienos.com/og.png"; - meta name="twitter:card" content="summary_large_image"; - meta name="twitter:title" content=(title); - meta name="twitter:description" content=(description); - meta name="twitter:image" content="https://aienos.com/og.png"; - // Stylesheet link rel="stylesheet" href="/assets/style.css"; diff --git a/crates/site-builder/src/main.rs b/crates/site-builder/src/main.rs index e91b1057..e1b077e9 100644 --- a/crates/site-builder/src/main.rs +++ b/crates/site-builder/src/main.rs @@ -2,6 +2,7 @@ mod collector; mod components; mod facts; mod layouts; +mod seo; use std::fs; use std::path::Path; @@ -30,21 +31,6 @@ fn copy_dir_all(src: &Path, dst: &Path) -> std::io::Result<()> { Ok(()) } -fn generate_sitemap_and_robots(dist: &Path) { - let sitemap = "\n\n https://aienos.com/1.0\n https://aienos.com/progress/0.8\n https://aienos.com/blog0.8\n https://aienos.com/blog/aien-v3-research-plan0.9\n https://aienos.com/post-llm-case/0.9\n https://aienos.com/research/0.9\n https://aienos.com/research/status/0.9\n https://aienos.com/now/0.9\n https://aienos.com/research/computing-machinery-and-understanding0.9\n https://aienos.com/research/computing-machinery-and-understanding-emergence0.8\n https://aienos.com/research/the-stapleton-doctrine0.8\n https://aienos.com/machine/0.9\n https://aienos.com/turing/0.9\n https://aienos.com/experiments/0.9\n https://aienos.com/discovery/0.9\n https://aienos.com/evidence/0.9\n https://aienos.com/philosophy/0.8\n https://aienos.com/licensing/0.5\n\n"; - let sitemap_path = dist.join("sitemap.xml"); - fs::write(&sitemap_path, sitemap).expect("Failed to write sitemap.xml"); - - // Bot-friendly: the site is open to all agents and humans alike. - // AI crawlers are explicitly allowed; there are no CAPTCHAs and no - // bot blocking at the gate. - let robots = "User-agent: *\nAllow: /\n\nUser-agent: GPTBot\nAllow: /\n\nUser-agent: ChatGPT-User\nAllow: /\n\nUser-agent: ClaudeBot\nAllow: /\n\nUser-agent: anthropic-ai\nAllow: /\n\nUser-agent: CCBot\nAllow: /\n\nUser-agent: Bytespider\nAllow: /\n\nSitemap: https://aienos.com/sitemap.xml\n"; - let robots_path = dist.join("robots.txt"); - fs::write(&robots_path, robots).expect("Failed to write robots.txt"); - - println!(" [GEN] Emitted native sitemap.xml and robots.txt in: {}", dist.display()); -} - fn build_pure_rust_site(dist: &Path, facts_path: &Path) { let facts = facts::Facts::load(facts_path) .unwrap_or_else(|e| panic!("Cannot build without facts: {e}. Run `site-builder facts {}` first.", facts_path.display())); @@ -79,12 +65,10 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { components::status::status_json(), ) .expect("Failed to write status.json"); - fs::write(dist.join("llms.txt"), components::status::llms_txt()) - .expect("Failed to write llms.txt"); // The machines and speeds data, published next to the page that renders it. fs::write(dist.join("machines.json"), components::machines::RAW) .expect("Failed to write machines.json"); - println!(" [STATE] Wrote status.json and llms.txt from the canonical layer states"); + println!(" [STATE] Wrote status.json from the canonical layer states"); // Render landing page in Maud let page_content = html! { @@ -111,7 +95,7 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { let progress = render_page_layout( "Project progress | AIEN OS", "Explore the retained AIEN project history: codebase growth, revisions, test footprint and verification activity, refreshed hourly from public GitHub sources.", - "https://aienos.com/progress/", "website", + "https://www.aienos.com/progress/", "website", html! { link rel="stylesheet" href="/assets/progress.css"; script defer src="/vendor/d3-7.9.0.min.js" {} @@ -125,7 +109,7 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { let blog_index = render_page_layout( "Blog | AIEN OS", "Research notes on building AIEN V2: what shipped, what the evidence says, and what remains an open question.", - "https://aienos.com/blog", + "https://www.aienos.com/blog/", "website", html! {}, components::blog::render_blog_index(), @@ -140,7 +124,7 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { let blog_post = render_page_layout( &format!("{} | AIEN OS Blog", components::blog::POST_TITLE), components::blog::POST_DESCRIPTION, - &format!("https://aienos.com/blog/{}", components::blog::POST_SLUG), + &format!("https://www.aienos.com/blog/{}/", components::blog::POST_SLUG), "article", html! {}, components::blog::render_blog_post(), @@ -157,7 +141,7 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { let research_status = render_page_layout( "Research status | AIEN OS", "Where the AIEN research stands: the qualification ladder, every experiment with its verdict, receipt and limits, and what is built versus still a hypothesis.", - "https://aienos.com/research/status/", + "https://www.aienos.com/research/status/", "website", html! {}, components::research_status::render_research_status_page(), @@ -213,7 +197,23 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { // Section hubs: /experiments/, /evidence/, /philosophy/ (NARR-NAV) components::hubs::emit_hub_pages(dist); - generate_sitemap_and_robots(dist); + // The 404 page, served by GitHub Pages for any address that has no file. + let not_found = render_page_layout( + "Page not found | AIENOS", + "There is nothing at this address. Every page of AIENOS is listed in llms.txt and the sitemap; the front page, the machine and the research are one link away.", + "", + "website", + seo::head_404(), + seo::render_404(), + ); + fs::write(dist.join("404.html"), not_found.into_string()).expect("Failed to write 404.html"); + + // Every page written above (generated or copied from public/) gets the same + // head: www canonical, cards, hreflang, feeds, JSON-LD. Then the machine + // surface is written from the pages that actually exist. + let ctx = seo::BuildCtx::gather(&now, &facts.generated_at); + let pages = seo::enrich(dist, &ctx); + seo::write_machine_surface(dist, &pages, &now, &ctx, &components::status::llms_txt()); } fn verify_site(dist: &Path) { @@ -296,6 +296,8 @@ fn verify_site(dist: &Path) { // Verify sitemap and robots assert!(dist.join("sitemap.xml").exists(), "Missing sitemap.xml"); assert!(dist.join("robots.txt").exists(), "Missing robots.txt"); + // The whole machine surface: canonical host, JSON-LD, feeds, llms files, data index. + seo::verify(dist); // Verify blog pages let blog_index = dist.join("blog/index.html"); diff --git a/crates/site-builder/src/seo.rs b/crates/site-builder/src/seo.rs new file mode 100644 index 00000000..db3ac0ff --- /dev/null +++ b/crates/site-builder/src/seo.rs @@ -0,0 +1,1106 @@ +//! Everything that makes a page findable, by people and by machines, in one +//! place: the canonical host, the social card tags, hreflang alternates, +//! JSON-LD structured data, the sitemap walked from what was actually +//! written, robots.txt, the Atom feeds, llms.txt and llms-full.txt, the +//! data index, humans.txt and the 404 page. +//! +//! The pass runs over `dist/` after every page is written, so generated +//! pages and hand-written pages under `public/` get the same head. A page +//! that is not in [`PAGES`] fails the build: nothing is published unlisted. + +use std::fs; +use std::path::{Path, PathBuf}; +use std::process::Command; + +use maud::{html, Markup, PreEscaped}; +use serde_json::{json, Value}; + +use crate::components::now::{self, Now}; + +pub const HOST: &str = "https://www.aienos.com"; +pub const SITE_NAME: &str = "AIENOS"; +pub const SITE_CLAIM: &str = "Persistent machine intelligence on a machine you own"; +pub const ORG_NAME: &str = "AIEN (aien-dev)"; +pub const ORG_URL: &str = "https://github.com/aien-dev"; +pub const ORG_EMAIL: &str = "aien@aienos.com"; +/// Drake's X account, from his GitHub profile and www.drakestapleton.com. +pub const X_HANDLE: &str = "@aienscore"; +pub const X_URL: &str = "https://x.com/aienscore"; +pub const AUTHOR: &str = "M. Drake Stapleton"; +pub const AUTHOR_URL: &str = "https://www.drakestapleton.com"; +pub const AUTHOR_GITHUB: &str = "https://github.com/drakestapleton"; +pub const LICENSE_NAME: &str = "AGPL-3.0-or-later"; +pub const LICENSE_URL: &str = "https://www.gnu.org/licenses/agpl-3.0.html"; + +/// What a page is, for structured data. +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub enum Kind { + /// The front page. + Home, + /// A plain page. + Page, + /// A hub or index listing other pages. + Collection, + /// A dated article (blog post, position paper). + Article, + /// A research preprint with a PDF. + Paper, + /// A page rebuilt from live data. + Live, +} + +/// The sections of llms.txt, in order. +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub enum Section { + Machine, + Turing, + Evidence, + Philosophy, + Blog, + Optional, +} + +/// One English page. `published` is the day the page first went up +/// (from the repository history); `doi` is the Zenodo DOI where one exists. +pub struct PageInfo { + pub path: &'static str, + pub name: &'static str, + pub what: &'static str, + pub section: Section, + pub kind: Kind, + pub image: &'static str, + pub published: &'static str, + pub doi: Option<&'static str>, +} + +/// Every English page of the site. The build fails if dist holds a page +/// that is not here, or if a page here was not written. +pub const PAGES: &[PageInfo] = &[ + PageInfo { path: "/", name: "AIENOS", what: "The front page: the loop, the five real machines and their measured speeds beside the physical ceiling, the evidence cards, the current status of every layer.", section: Section::Machine, kind: Kind::Home, image: "/og.png", published: "2026-09-23", doi: None }, + PageInfo { path: "/machine/", name: "The Machine", what: "What AIENOS is: the real machines it runs on today, the closed epistemic loop, the Turing as its accounting layer, and an honest list of what exists.", section: Section::Machine, kind: Kind::Article, image: "/og-machine.png", published: "2026-10-01", doi: None }, + PageInfo { path: "/now/", name: "Now", what: "The live coordination ledger: what every agent is doing right now, what is settled with evidence, what waits on the operator. Rebuilt whenever the ledger changes.", section: Section::Machine, kind: Kind::Live, image: "/og-now.png", published: "2026-10-19", doi: None }, + PageInfo { path: "/progress/", name: "Project progress", what: "Source lines, revisions, test footprint and verification activity across the public repositories, refreshed hourly from GitHub.", section: Section::Machine, kind: Kind::Live, image: "/og.png", published: "2026-10-01", doi: None }, + PageInfo { path: "/turing/", name: "The Turing: an interactive field guide", what: "What the Turing measures (net held-out explanatory compression), with games, live calculations and the theories behind it.", section: Section::Turing, kind: Kind::Article, image: "/og-turing.png", published: "2026-09-30", doi: None }, + PageInfo { path: "/research/", name: "AIEN Research", what: "The index of preprints and public evidence.", section: Section::Turing, kind: Kind::Collection, image: "/og-research.png", published: "2026-09-30", doi: None }, + PageInfo { path: "/research/computing-machinery-and-understanding/", name: "Computing Machinery and Understanding: From the Imitation Game to the Turing", what: "The formal preprint defining the Turing as an operational measure of generalized explanatory compression. DOI 10.5281/zenodo.23437498.", section: Section::Turing, kind: Kind::Paper, image: "/og-turing.png", published: "2026-09-30", doi: Some("10.5281/zenodo.23437498") }, + PageInfo { path: "/research/computing-machinery-and-understanding-emergence/", name: "Computing Machinery and Understanding: The Turing as a Measure Emerging from AIEN", what: "The companion engineering paper: how the Turing emerged from building AIEN. DOI 10.5281/zenodo.23437568.", section: Section::Turing, kind: Kind::Paper, image: "/og-turing.png", published: "2026-09-30", doi: Some("10.5281/zenodo.23437568") }, + PageInfo { path: "/research/the-turing-brief/", name: "The Turing: A Unit of Verified Explanatory Gain", what: "The three-page plain-language brief: what the Turing measures, what it does not, and what would prove it wrong.", section: Section::Turing, kind: Kind::Paper, image: "/og-turing.png", published: "2026-10-02", doi: None }, + PageInfo { path: "/research/turing-discovery-gap-conjecture/", name: "The Turing Discovery Gap Conjecture", what: "Available versus accessible explanatory value: worlds with compact explanations that no efficient learner can reach.", section: Section::Turing, kind: Kind::Paper, image: "/og-research.png", published: "2026-10-02", doi: None }, + PageInfo { path: "/research/crumb-doctrine/", name: "The Crumb Doctrine", what: "No receipt, no crumb: the epistemic constitution of the machine.", section: Section::Turing, kind: Kind::Paper, image: "/og-research.png", published: "2026-10-02", doi: None }, + PageInfo { path: "/research/omega-language/", name: "Omega: A Programming Language Built for Verified Programs", what: "Semantic identity, evidence-bearing dependencies, and a foreign-code boundary that never lets unverified work inside.", section: Section::Turing, kind: Kind::Paper, image: "/og-research.png", published: "2026-10-02", doi: None }, + PageInfo { path: "/research/atemporal-aien-postulate/", name: "The Atemporal AIEN Postulate", what: "Causal semantics without clocks: an AIEN computation is defined by what causally depends on what.", section: Section::Turing, kind: Kind::Paper, image: "/og-research.png", published: "2026-10-02", doi: None }, + PageInfo { path: "/research/the-aien-papers/", name: "The AIEN Papers: The Complete Collection", what: "The Turing unit, the evidence doctrine, the language design and the philosophy in one document.", section: Section::Turing, kind: Kind::Paper, image: "/og-research.png", published: "2026-10-02", doi: None }, + PageInfo { path: "/experiments/", name: "Experiments", what: "Every experiment on the research ladder, failures included, rendered from one canonical status source.", section: Section::Evidence, kind: Kind::Collection, image: "/og-experiments.png", published: "2026-10-10", doi: None }, + PageInfo { path: "/discovery/", name: "Scientific Discovery", what: "Physics Zero, Dirac, Zeta and supersymmetry as examinations of representation discovery; the machine is never given the named answer.", section: Section::Evidence, kind: Kind::Article, image: "/og-discovery.png", published: "2026-10-10", doi: None }, + PageInfo { path: "/evidence/", name: "Evidence", what: "What counts as evidence, which source wins when two disagree, and where the receipts, frozen profiles and status records live.", section: Section::Evidence, kind: Kind::Collection, image: "/og-evidence.png", published: "2026-10-10", doi: None }, + PageInfo { path: "/research/status/", name: "Research status", what: "The qualification ladder, every experiment with its verdict, receipt and limits, and what is built versus still a hypothesis.", section: Section::Evidence, kind: Kind::Live, image: "/og-evidence.png", published: "2026-10-05", doi: None }, + PageInfo { path: "/philosophy/", name: "Philosophy", what: "The position papers behind AIEN. These argue a stance and are not experimental results.", section: Section::Philosophy, kind: Kind::Collection, image: "/og-philosophy.png", published: "2026-10-10", doi: None }, + PageInfo { path: "/research/the-stapleton-doctrine/", name: "The Stapleton Doctrine", what: "A personal philosophy of AI architecture and programming.", section: Section::Philosophy, kind: Kind::Paper, image: "/og-philosophy.png", published: "2026-09-30", doi: None }, + PageInfo { path: "/post-llm-case/", name: "The Post-LLM Case", what: "The case for a different learning machine: programs proposed, verification deciding, knowledge kept as inspectable programs.", section: Section::Philosophy, kind: Kind::Article, image: "/og-philosophy.png", published: "2026-09-27", doi: None }, + PageInfo { path: "/blog/", name: "Blog", what: "Research notes on building AIEN: what shipped, what the evidence says, what remains open.", section: Section::Blog, kind: Kind::Collection, image: "/og-blog.png", published: "2026-09-27", doi: None }, + PageInfo { path: "/blog/aien-v3-research-plan/", name: "The AIEN V3 Research Plan", what: "The ratified V3 research plan, the Substrate Edition, with six falsifiable hypotheses.", section: Section::Blog, kind: Kind::Article, image: "/og-blog.png", published: "2026-09-27", doi: None }, + PageInfo { path: "/licensing/", name: "Licensing", what: "The one canonical licensing statement: AGPL-3.0-or-later for every repository.", section: Section::Optional, kind: Kind::Page, image: "/og.png", published: "2026-10-01", doi: None }, +]; + +/// One machine-readable file: path, purpose, schema hint, how often it changes, media type. +pub struct DataFile { + pub path: &'static str, + pub purpose: &'static str, + pub schema: &'static str, + pub cadence: &'static str, + pub media_type: &'static str, +} + +pub const DATA_FILES: &[DataFile] = &[ + DataFile { path: "/data/index.json", purpose: "This list: every machine-readable file on the site with its purpose and cadence.", schema: "{ generated, license, files: [{ path, url, purpose, schema, cadence, media_type }] }", cadence: "every build", media_type: "application/json" }, + DataFile { path: "/llms.txt", purpose: "The site for AI readers: one summary and every page with a one-line description (llms.txt convention).", schema: "Markdown: H1, blockquote summary, H2 sections of links.", cadence: "every build", media_type: "text/markdown" }, + DataFile { path: "/llms-full.txt", purpose: "The full text of every page, concatenated, generated from the same sources as the HTML.", schema: "Markdown: one H1 per page with its source URL.", cadence: "every build", media_type: "text/markdown" }, + DataFile { path: "/now.json", purpose: "The live coordination ledger: every item with owner, status, done-when, evidence notes and timestamps.", schema: "{ built_utc, ledger_written_utc, items: [{ id, opened_utc, owner, owner_kind, status, item, done_when, notes[], updated_utc, stream, age_s }], pulse: [{ key, value }] }", cadence: "whenever the ledger changes, at most hourly", media_type: "application/json" }, + DataFile { path: "/now/feed.xml", purpose: "Atom feed of settled ledger lines (done or dropped) with their evidence, newest first.", schema: "Atom 1.0", cadence: "whenever the ledger changes, at most hourly", media_type: "application/atom+xml" }, + DataFile { path: "/machines.json", purpose: "The five real machines, what runs on each today, and every measured speed beside its physical ceiling, each with a receipt link.", schema: "{ as_of, source, judging, ceilings: [{ id, model, machine, tok_s, how, link, receipt, branch, on_main }], machines: [{ id, name, detail, role, today, evidence_date, evidence, link, branch, on_main, more[] }], speeds: [...] }", cadence: "when a new receipt is published", media_type: "application/json" }, + DataFile { path: "/facts.json", purpose: "The public GitHub record read at build time: components, last merges, open PR counts, latest decision records, latest verification receipt.", schema: "{ generated_at, components: [{ key, name, repo, role, url, pushed_at, open_prs, last_merge }], decisions: [{ id, title, url }], receipt: { repo, sha, state, description, target_url, updated_at } }", cadence: "hourly", media_type: "application/json" }, + DataFile { path: "/status.json", purpose: "The status of every layer of the stack (IMPLEMENTED, QUALIFIED, EXPERIMENTAL, BLOCKED, PLANNED) with a note and a receipt.", schema: "{ project, updated, canonical, statuses[], layers: [{ name, status, note, receipt }] }", cadence: "when a layer changes state", media_type: "application/json" }, + DataFile { path: "/research-status.json", purpose: "The research ladder: every experiment with its verdict, receipt and limits; the one source for every status badge on the site.", schema: "{ ladder, experiments, implementations, ... } as rendered on /research/status/", cadence: "when an experiment settles", media_type: "application/json" }, + DataFile { path: "/data/project-progress.json", purpose: "Retained public history of every project repository: source lines, revisions, PRs, CI runs over time.", schema: "{ asof, repos: [...], series: [...], events: [...], policy }", cadence: "hourly", media_type: "application/json" }, + DataFile { path: "/data/now.tsv", purpose: "The raw ledger as published: one line per item, tab separated.", schema: "Columns: id, opened_utc, owner, status, item, done_when, evidence, updated_utc.", cadence: "whenever the ledger changes", media_type: "text/tab-separated-values" }, + DataFile { path: "/feed.xml", purpose: "Atom feed of the blog posts and research papers, newest first.", schema: "Atom 1.0", cadence: "when a page is published or revised", media_type: "application/atom+xml" }, + DataFile { path: "/sitemap.xml", purpose: "Every page, both languages, with lastmod and hreflang alternates. Walked from the files actually written.", schema: "sitemaps.org 0.9 with xhtml:link alternates", cadence: "every build", media_type: "application/xml" }, + DataFile { path: "/research/CITATION.cff", purpose: "Citation metadata for the Turing preprints.", schema: "Citation File Format 1.2.0", cadence: "when a paper is revised", media_type: "text/yaml" }, + DataFile { path: "/research/aien-research-plan.md", purpose: "The ratified V3 research plan in Markdown.", schema: "Markdown", cadence: "when the plan is revised", media_type: "text/markdown" }, + DataFile { path: "/humans.txt", purpose: "Who builds this: the person, the agents and the machines.", schema: "humanstxt.org", cadence: "rarely", media_type: "text/plain" }, + DataFile { path: "/robots.txt", purpose: "Every crawler and AI agent is allowed everywhere; points at the sitemap.", schema: "robots.txt", cadence: "every build", media_type: "text/plain" }, +]; + +/// Crawlers named one by one in robots.txt so nobody has to guess whether +/// the wildcard was meant for them. +pub const AI_AGENTS: &[&str] = &[ + "GPTBot", "ChatGPT-User", "OAI-SearchBot", "ClaudeBot", "Claude-Web", "Claude-SearchBot", "anthropic-ai", + "PerplexityBot", "Perplexity-User", "Google-Extended", "Googlebot", "Applebot", "Applebot-Extended", + "Bingbot", "Bytespider", "CCBot", "Amazonbot", "cohere-ai", "Meta-ExternalAgent", "Meta-ExternalFetcher", + "DuckAssistBot", "YouBot", "MistralAI-User", "Twitterbot", "facebookexternalhit", "LinkedInBot", +]; + +/// What the build knows about time and history. +pub struct BuildCtx { + /// RFC 3339, the moment of this build. + pub built: String, + /// RFC 3339, the latest commit of the repository (what generated pages last changed with). + pub head_committed: String, + /// RFC 3339, when the ledger was last written (for /now/). + pub ledger_written: String, + /// RFC 3339, when facts.json was gathered (for /progress/ and the front page tables). + pub facts_generated: String, +} + +impl BuildCtx { + pub fn gather(now: &Now, facts_generated: &str) -> BuildCtx { + let built = rfc3339(now_secs()); + let head = git(&["log", "-1", "--format=%cI"]).unwrap_or_else(|| built.clone()); + let ledger = now::parse_utc(&now.ledger_written_utc).map(rfc3339).unwrap_or_else(|| built.clone()); + let facts = if facts_generated.is_empty() { built.clone() } else { facts_generated.to_string() }; + BuildCtx { built, head_committed: head, ledger_written: ledger, facts_generated: facts } + } +} + +fn now_secs() -> i64 { + std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map(|d| d.as_secs() as i64).unwrap_or(0) +} + +/// RFC 3339 in UTC with seconds, from Unix seconds. +pub fn rfc3339(secs: i64) -> String { + let days = secs.div_euclid(86_400); + let rem = secs.rem_euclid(86_400); + let z = days + 719_468; + let era = z.div_euclid(146_097); + let doe = z - era * 146_097; + let yoe = (doe - doe / 1460 + doe / 36_524 - doe / 146_096) / 365; + let y = yoe + era * 400; + let doy = doe - (365 * yoe + yoe / 4 - yoe / 100); + let mp = (5 * doy + 2) / 153; + let d = doy - (153 * mp + 2) / 5 + 1; + let m = if mp < 10 { mp + 3 } else { mp - 9 }; + let y = if m <= 2 { y + 1 } else { y }; + format!("{y:04}-{m:02}-{d:02}T{:02}:{:02}:{:02}Z", rem / 3600, (rem % 3600) / 60, rem % 60) +} + +fn git(args: &[&str]) -> Option { + let out = Command::new("git").args(args).output().ok()?; + if !out.status.success() { + return None; + } + let s = String::from_utf8_lossy(&out.stdout).trim().to_string(); + if s.is_empty() { None } else { Some(s) } +} + +// ------------------------------------------------------------------ pages + +/// One page found in dist. +#[derive(Clone, Debug)] +pub struct Emitted { + /// Site path with leading and trailing slash, e.g. `/research/status/`. + pub path: String, + pub file: PathBuf, + pub lang: String, + pub lastmod: String, +} + +impl Emitted { + pub fn url(&self) -> String { + format!("{HOST}{}", self.path) + } + pub fn is_zh(&self) -> bool { + self.path.starts_with("/zh-CN/") + } + /// The English path this page is, or mirrors. + pub fn en_path(&self) -> String { + if self.is_zh() { format!("/{}", &self.path["/zh-CN/".len()..]) } else { self.path.clone() } + } + pub fn zh_path(&self) -> String { + if self.is_zh() { self.path.clone() } else { format!("/zh-CN{}", self.path) } + } +} + +/// Every `index.html` under dist, as site paths. The 404 page is not a page. +pub fn walk_pages(dist: &Path, ctx: &BuildCtx) -> Vec { + let mut out = Vec::new(); + fn walk(dir: &Path, dist: &Path, ctx: &BuildCtx, out: &mut Vec) { + let Ok(rd) = fs::read_dir(dir) else { return }; + for e in rd.flatten() { + let p = e.path(); + if p.is_dir() { + walk(&p, dist, ctx, out); + } else if p.file_name().map(|n| n == "index.html").unwrap_or(false) { + let rel = p.strip_prefix(dist).unwrap().parent().unwrap(); + let mut path = format!("/{}", rel.to_string_lossy().replace('\\', "/")); + if !path.ends_with('/') { + path.push('/'); + } + if path == "//" { + path = "/".into(); + } + let lang = if path.starts_with("/zh-CN/") { "zh-CN" } else { "en" }.to_string(); + let lastmod = lastmod_for(&path, ctx); + out.push(Emitted { path, file: p, lang, lastmod }); + } + } + } + walk(dist, dist, ctx, &mut out); + out.sort_by(|a, b| a.path.cmp(&b.path)); + out +} + +/// When a page last changed. Hand-written pages carry the date of their +/// last commit when the history is available; pages rebuilt from live data +/// carry the data's own time; other generated pages carry the latest +/// repository commit. The build time is the fallback, never the first choice, +/// because a lastmod that moves on every hourly build tells crawlers nothing. +fn lastmod_for(path: &str, ctx: &BuildCtx) -> String { + match path { + "/now/" | "/zh-CN/now/" => return ctx.ledger_written.clone(), + "/progress/" | "/" => return ctx.facts_generated.clone(), + _ => {} + } + let source = format!("public{}index.html", path); + if Path::new(&source).exists() { + if let Some(d) = git(&["log", "-1", "--format=%cI", "--", &source]) { + return d; + } + } + ctx.head_committed.clone() +} + +pub fn info_for(en_path: &str) -> Option<&'static PageInfo> { + PAGES.iter().find(|p| p.path == en_path) +} + +/// Fails the build when dist and PAGES disagree. +pub fn check_registry(pages: &[Emitted]) { + for p in pages.iter().filter(|p| !p.is_zh()) { + assert!(info_for(&p.path).is_some(), "{} was written but is not listed in seo::PAGES (add it so llms.txt, the sitemap and the feeds know it)", p.path); + } + for info in PAGES { + assert!(pages.iter().any(|p| p.path == info.path), "seo::PAGES lists {} but no such page was written", info.path); + } +} + +// ------------------------------------------------------------------ head + +/// What a head said before the pass touched it. +#[derive(Default, Debug)] +struct HeadFacts { + title: String, + description: String, + og_title: String, + og_description: String, + og_type: String, +} + +fn attr<'a>(tag: &'a str, name: &str) -> Option { + // name="value" or name='value', any attribute order, any spacing. + let mut i = 0; + let bytes = tag.as_bytes(); + while let Some(pos) = tag[i..].find(name) { + let start = i + pos; + let before_ok = start == 0 || bytes[start - 1].is_ascii_whitespace(); + let mut j = start + name.len(); + while j < bytes.len() && bytes[j].is_ascii_whitespace() { j += 1; } + if before_ok && j < bytes.len() && bytes[j] == b'=' { + j += 1; + while j < bytes.len() && bytes[j].is_ascii_whitespace() { j += 1; } + if j < bytes.len() && (bytes[j] == b'"' || bytes[j] == b'\'') { + let q = bytes[j]; + let end = tag[j + 1..].find(q as char)? + j + 1; + return Some(tag[j + 1..end].to_string()); + } + } + i = start + name.len(); + } + None +} + +fn tag_name(tag: &str) -> String { + tag.trim_start_matches('<').trim_start_matches('/').chars().take_while(|c| c.is_ascii_alphanumeric()).collect::().to_ascii_lowercase() +} + +/// True for the tags the pass owns and rewrites. +fn owned_tag(tag: &str) -> bool { + match tag_name(tag).as_str() { + "link" => { + let rel = attr(tag, "rel").unwrap_or_default(); + rel == "canonical" || (rel == "alternate" && (attr(tag, "hreflang").is_some() || attr(tag, "type").map(|t| t.contains("xml")).unwrap_or(false))) + } + "meta" => { + let key = attr(tag, "property").or_else(|| attr(tag, "name")).unwrap_or_default(); + key.starts_with("og:") || key.starts_with("twitter:") || key.starts_with("article:") + } + _ => false, + } +} + +/// Splits a head into (kept text, facts): owned tags and ld+json blocks are removed. +fn strip_head(head: &str) -> (String, HeadFacts) { + let mut facts = HeadFacts::default(); + let mut kept = String::with_capacity(head.len()); + let mut i = 0; + while i < head.len() { + let Some(lt) = head[i..].find('<') else { kept.push_str(&head[i..]); break; }; + kept.push_str(&head[i..i + lt]); + let start = i + lt; + let rest = &head[start..]; + let name = tag_name(rest); + if rest.starts_with("").map(|e| e + 3).unwrap_or(rest.len()); + kept.push_str(&rest[..end]); + i = start + end; + continue; + } + if name == "script" || name == "style" || name == "title" { + let close = format!("').map(|g| e + g + 1).unwrap_or(rest.len())).unwrap_or(rest.len()); + let whole = &rest[..end]; + let open_end = whole.find('>').unwrap_or(0); + let open = &whole[..=open_end.min(whole.len() - 1)]; + if name == "title" { + facts.title = whole[open_end + 1..].split("').map(|e| e + 1).unwrap_or(rest.len()); + let tag = &rest[..end]; + if name == "meta" { + let key = attr(tag, "property").or_else(|| attr(tag, "name")).unwrap_or_default(); + let content = attr(tag, "content").unwrap_or_default(); + match key.as_str() { + "description" => facts.description = content.clone(), + "og:title" => facts.og_title = content.clone(), + "og:description" => facts.og_description = content.clone(), + "og:type" => facts.og_type = content.clone(), + _ => {} + } + } + if !owned_tag(tag) { + kept.push_str(tag); + } + i = start + end; + } + (kept, facts) +} + +fn unescape(s: &str) -> String { + s.replace(""", "\"").replace("'", "'").replace("'", "'").replace("<", "<").replace(">", ">").replace("&", "&") +} + +fn escape(s: &str) -> String { + s.replace('&', "&").replace('<', "<").replace('>', ">").replace('"', """) +} + +fn breadcrumb_name(segment: &str, zh: bool) -> String { + match (segment, zh) { + ("research", false) => "Research".into(), + ("research", true) => "研究".into(), + ("blog", false) => "Blog".into(), + ("blog", true) => "博客".into(), + ("status", false) => "Status".into(), + ("status", true) => "状态".into(), + _ => { + let mut words: Vec = segment.split('-').map(|w| { + let mut c = w.chars(); + match c.next() { Some(f) => f.to_uppercase().collect::() + c.as_str(), None => String::new() } + }).collect(); + if words.len() > 6 { words.truncate(6); } + words.join(" ") + } + } +} + +fn breadcrumb(page: &Emitted, page_name: &str) -> Value { + let zh = page.is_zh(); + let home = if zh { format!("{HOST}/zh-CN/") } else { format!("{HOST}/") }; + let mut items = vec![json!({"@type": "ListItem", "position": 1, "name": if zh { "主页" } else { "Home" }, "item": home})]; + let rel = page.en_path(); + let segs: Vec<&str> = rel.trim_matches('/').split('/').filter(|s| !s.is_empty()).collect(); + let prefix = if zh { "/zh-CN" } else { "" }; + let mut acc = String::new(); + for (i, seg) in segs.iter().enumerate() { + acc.push('/'); + acc.push_str(seg); + let last = i + 1 == segs.len(); + let name = if last { page_name.to_string() } else { breadcrumb_name(seg, zh) }; + items.push(json!({"@type": "ListItem", "position": i + 2, "name": name, "item": format!("{HOST}{prefix}{acc}/")})); + } + json!({"@type": "BreadcrumbList", "@id": format!("{}#breadcrumb", page.url()), "itemListElement": items}) +} + +fn org() -> Value { + json!({ + "@type": "Organization", + "@id": format!("{HOST}/#organization"), + "name": ORG_NAME, + "alternateName": "aien-dev", + "url": format!("{HOST}/"), + "logo": {"@type": "ImageObject", "url": format!("{HOST}/logo.png"), "width": 512, "height": 512}, + "email": ORG_EMAIL, + "sameAs": [ORG_URL, X_URL], + "founder": {"@id": format!("{HOST}/#drake")} + }) +} + +fn author() -> Value { + json!({ + "@type": "Person", + "@id": format!("{HOST}/#drake"), + "name": AUTHOR, + "alternateName": "Drake Stapleton", + "url": AUTHOR_URL, + "sameAs": [AUTHOR_GITHUB, X_URL], + "affiliation": {"@id": format!("{HOST}/#organization")} + }) +} + +fn website() -> Value { + json!({ + "@type": "WebSite", + "@id": format!("{HOST}/#website"), + "url": format!("{HOST}/"), + "name": SITE_NAME, + "description": SITE_CLAIM, + "inLanguage": ["en", "zh-CN"], + "publisher": {"@id": format!("{HOST}/#organization")}, + "license": LICENSE_URL + }) +} + +fn dataset(path: &str, name: &str, purpose: &str, modified: &str) -> Value { + json!({ + "@type": "Dataset", + "@id": format!("{HOST}{path}"), + "name": name, + "description": purpose, + "url": format!("{HOST}{path}"), + "license": LICENSE_URL, + "isAccessibleForFree": true, + "creator": {"@id": format!("{HOST}/#organization")}, + "dateModified": modified, + "distribution": [{"@type": "DataDownload", "encodingFormat": "application/json", "contentUrl": format!("{HOST}{path}")}] + }) +} + +fn software(key: &str, name: &str, repo: &str, role: &str) -> Value { + json!({ + "@type": "SoftwareSourceCode", + "@id": format!("https://github.com/{repo}"), + "name": name, + "alternateName": key, + "description": role, + "codeRepository": format!("https://github.com/{repo}"), + "license": LICENSE_URL, + "isAccessibleForFree": true, + "author": {"@id": format!("{HOST}/#organization")} + }) +} + +/// The JSON-LD graph for one page. +fn graph(page: &Emitted, info: &PageInfo, facts: &HeadFacts, has_mirror: bool, ctx: &BuildCtx, dist: &Path) -> Value { + let url = page.url(); + let title = unescape(if facts.og_title.is_empty() { &facts.title } else { &facts.og_title }); + let description = unescape(if facts.description.is_empty() { &facts.og_description } else { &facts.description }); + let image = format!("{HOST}{}", info.image); + let zh = page.is_zh(); + let kind = match info.kind { + Kind::Home | Kind::Page | Kind::Live => "WebPage", + Kind::Collection => "CollectionPage", + Kind::Article => "Article", + Kind::Paper => "ScholarlyArticle", + }; + let mut node = json!({ + "@type": kind, + "@id": url, + "url": url, + "name": title, + "headline": title, + "description": description, + "inLanguage": page.lang, + "isPartOf": {"@id": format!("{HOST}/#website")}, + "image": {"@type": "ImageObject", "url": image, "width": 1200, "height": 630}, + "datePublished": info.published, + "dateModified": page.lastmod, + "license": LICENSE_URL, + "isAccessibleForFree": true, + "publisher": {"@id": format!("{HOST}/#organization")} + }); + let is_web_page = matches!(info.kind, Kind::Home | Kind::Page | Kind::Live | Kind::Collection); + if is_web_page { + // WebPage-only properties; the validator warns when they sit on an Article. + node["primaryImageOfPage"] = json!({"@type": "ImageObject", "url": image, "width": 1200, "height": 630}); + if page.path != "/" && page.path != "/zh-CN/" { + node["breadcrumb"] = json!({"@id": format!("{url}#breadcrumb")}); + } + } else { + node["author"] = json!({"@id": format!("{HOST}/#drake")}); + node["mainEntityOfPage"] = json!(url); + } + if info.kind == Kind::Paper { + node["creativeWorkStatus"] = json!("Preprint, not peer reviewed"); + if let Some(doi) = info.doi { + node["identifier"] = json!({"@type": "PropertyValue", "propertyID": "DOI", "value": doi}); + node["sameAs"] = json!(format!("https://doi.org/{doi}")); + } + let pdf = dist.join(page.en_path().trim_start_matches('/')).join("paper.pdf"); + if pdf.exists() { + node["encoding"] = json!([{"@type": "MediaObject", "encodingFormat": "application/pdf", "contentUrl": format!("{HOST}{}paper.pdf", page.en_path())}]); + } + } + if has_mirror { + if zh { + node["translationOfWork"] = json!({"@id": format!("{HOST}{}", page.en_path())}); + } else { + node["workTranslation"] = json!({"@id": format!("{HOST}{}", page.zh_path())}); + } + } + let mut nodes = vec![org(), author(), website(), node]; + if page.path != "/" && page.path != "/zh-CN/" { + nodes.push(breadcrumb(page, &title)); + } + match info.path { + "/" => { + for (key, name, repo, role) in crate::facts::COMPONENTS { + nodes.push(software(key, name, repo, role)); + } + nodes.push(dataset("/now.json", "AIEN coordination ledger", DATA_FILES.iter().find(|d| d.path == "/now.json").unwrap().purpose, &ctx.ledger_written)); + nodes.push(dataset("/machines.json", "AIEN machines and speeds", DATA_FILES.iter().find(|d| d.path == "/machines.json").unwrap().purpose, &ctx.head_committed)); + nodes.push(dataset("/facts.json", "AIEN public record facts", DATA_FILES.iter().find(|d| d.path == "/facts.json").unwrap().purpose, &ctx.facts_generated)); + nodes.push(dataset("/status.json", "AIEN layer status", DATA_FILES.iter().find(|d| d.path == "/status.json").unwrap().purpose, &ctx.head_committed)); + nodes.push(dataset("/research-status.json", "AIEN research status", DATA_FILES.iter().find(|d| d.path == "/research-status.json").unwrap().purpose, &ctx.head_committed)); + } + "/now/" => nodes.push(dataset("/now.json", "AIEN coordination ledger", DATA_FILES.iter().find(|d| d.path == "/now.json").unwrap().purpose, &ctx.ledger_written)), + "/machine/" => nodes.push(dataset("/machines.json", "AIEN machines and speeds", DATA_FILES.iter().find(|d| d.path == "/machines.json").unwrap().purpose, &ctx.head_committed)), + "/evidence/" | "/research/status/" => nodes.push(dataset("/research-status.json", "AIEN research status", DATA_FILES.iter().find(|d| d.path == "/research-status.json").unwrap().purpose, &ctx.head_committed)), + _ => {} + } + json!({"@context": "https://schema.org", "@graph": nodes}) +} + +/// The tags the pass writes into every head. +fn head_block(page: &Emitted, info: &PageInfo, facts: &HeadFacts, has_mirror: bool, ctx: &BuildCtx, dist: &Path) -> String { + let url = page.url(); + let title = if facts.og_title.is_empty() { facts.title.clone() } else { facts.og_title.clone() }; + let description = if facts.og_description.is_empty() { facts.description.clone() } else { facts.og_description.clone() }; + let og_type = if !facts.og_type.is_empty() { facts.og_type.clone() } else { match info.kind { Kind::Article | Kind::Paper => "article".into(), _ => "website".into() } }; + let image = format!("{HOST}{}", info.image); + let image_alt = escape(&format!("{SITE_NAME}: {}", info.name)); + let locale = if page.is_zh() { "zh_CN" } else { "en_US" }; + let mut b = String::new(); + b.push_str(&format!("\n")); + if has_mirror { + let en = format!("{HOST}{}", page.en_path()); + let zh = format!("{HOST}{}", page.zh_path()); + b.push_str(&format!("\n\n\n")); + } + b.push_str(&format!("\n")); + b.push_str(&format!("\n")); + b.push_str(&format!("\n\n")); + b.push_str(&format!("\n\n\n\n")); + b.push_str(&format!("\n\n\n\n")); + if matches!(info.kind, Kind::Article | Kind::Paper) { + b.push_str(&format!("\n\n\n", info.published, page.lastmod)); + } + b.push_str(&format!("\n\n\n\n\n\n\n")); + let ld = serde_json::to_string(&graph(page, info, facts, has_mirror, ctx, dist)).expect("JSON-LD serializes").replace("{ld}\n")); + b +} + +/// Rewrites the head of every page in dist. Returns the pages, for the sitemap and feeds. +pub fn enrich(dist: &Path, ctx: &BuildCtx) -> Vec { + let pages = walk_pages(dist, ctx); + check_registry(&pages); + for page in &pages { + let html = fs::read_to_string(&page.file).unwrap_or_else(|e| panic!("read {}: {e}", page.file.display())); + let lower = html.to_ascii_lowercase(); + let head_start = lower.find("').map(|g| h + g + 1)).unwrap_or_else(|| panic!("{} has no ", page.path)); + let head_end = lower.find("").unwrap_or_else(|| panic!("{} has no ", page.path)); + let (kept, facts) = strip_head(&html[head_start..head_end]); + assert!(!facts.title.is_empty(), "{} has no ", page.path); + assert!(!facts.description.is_empty() || !facts.og_description.is_empty(), "{} has no meta description", page.path); + let info = info_for(&page.en_path()).unwrap_or_else(|| panic!("{} has no English page in seo::PAGES", page.path)); + let mirror = if page.is_zh() { dist.join(page.en_path().trim_start_matches('/')).join("index.html") } else { dist.join(page.zh_path().trim_start_matches('/')).join("index.html") }; + let has_mirror = mirror.exists(); + let block = head_block(page, info, &facts, has_mirror, ctx, dist); + let mut out = String::with_capacity(html.len() + block.len()); + out.push_str(&html[..head_start]); + out.push_str(kept.trim_end()); + out.push('\n'); + out.push_str(&block); + out.push_str(&html[head_end..]); + fs::write(&page.file, out).unwrap_or_else(|e| panic!("write {}: {e}", page.file.display())); + } + println!(" [SEO] Rewrote the head of {} pages: canonical on {HOST}, cards, hreflang, JSON-LD", pages.len()); + pages +} + +// ------------------------------------------------------------------ sitemap and robots + +pub fn sitemap_xml(pages: &[Emitted]) -> String { + let mut s = String::from("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">\n"); + for p in pages { + s.push_str(&format!(" <url>\n <loc>{}</loc>\n <lastmod>{}</lastmod>\n", p.url(), p.lastmod)); + let en = format!("{HOST}{}", p.en_path()); + let zh = format!("{HOST}{}", p.zh_path()); + let has_mirror = pages.iter().any(|q| q.path == (if p.is_zh() { p.en_path() } else { p.zh_path() })); + if has_mirror { + s.push_str(&format!(" <xhtml:link rel=\"alternate\" hreflang=\"en\" href=\"{en}\"/>\n <xhtml:link rel=\"alternate\" hreflang=\"zh-CN\" href=\"{zh}\"/>\n <xhtml:link rel=\"alternate\" hreflang=\"x-default\" href=\"{en}\"/>\n")); + } + s.push_str(" </url>\n"); + } + s.push_str("</urlset>\n"); + s +} + +pub fn robots_txt() -> String { + let mut s = String::from("# www.aienos.com is open to every reader, human or machine.\n# No crawler is blocked, no CAPTCHA, no bot wall. Cite freely; every page carries receipts.\n\nUser-agent: *\nAllow: /\n\n"); + for a in AI_AGENTS { + s.push_str(&format!("User-agent: {a}\nAllow: /\n\n")); + } + s.push_str(&format!("Sitemap: {HOST}/sitemap.xml\n")); + s +} + +// ------------------------------------------------------------------ feeds + +fn xml(s: &str) -> String { + s.replace('&', "&").replace('<', "<").replace('>', ">").replace('"', """) +} + +fn atom_head(title: &str, subtitle: &str, self_path: &str, updated: &str) -> String { + format!( + "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<feed xmlns=\"http://www.w3.org/2005/Atom\">\n <title>{}\n {}\n \n \n {HOST}{self_path}\n {updated}\n {}{AUTHOR_URL}\n {LICENSE_NAME}\n {HOST}/logo.png\n {HOST}/og.png\n", + xml(title), xml(subtitle), xml(AUTHOR) + ) +} + +/// /feed.xml: the blog posts and research papers, newest change first. +pub fn site_feed(pages: &[Emitted]) -> String { + let mut entries: Vec<(&Emitted, &PageInfo)> = pages + .iter() + .filter(|p| !p.is_zh()) + .filter_map(|p| info_for(&p.path).map(|i| (p, i))) + .filter(|(_, i)| matches!(i.kind, Kind::Article | Kind::Paper)) + .collect(); + entries.sort_by(|a, b| b.0.lastmod.cmp(&a.0.lastmod).then(b.1.published.cmp(a.1.published))); + let updated = entries.first().map(|e| e.0.lastmod.clone()).unwrap_or_else(|| rfc3339(now_secs())); + let mut s = atom_head("AIENOS: blog and research", "Research notes and preprints from the AIEN project, with receipts.", "/feed.xml", &updated); + for (p, i) in entries { + s.push_str(&format!( + " \n {}\n \n {}\n {}T00:00:00Z\n {}\n {}\n \n \n", + xml(i.name), p.url(), p.url(), i.published, p.lastmod, xml(i.what), if i.kind == Kind::Paper { "research" } else { "blog" } + )); + } + s.push_str("\n"); + s +} + +/// /now/feed.xml: one entry per settled ledger line, newest first, with its evidence. +pub fn now_feed(now: &Now, ctx: &BuildCtx) -> String { + let mut settled: Vec<&now::Item> = now.items.iter().filter(|i| i.status == "done" || i.status == "dropped").collect(); + settled.sort_by(|a, b| now::parse_utc(&b.updated_utc).cmp(&now::parse_utc(&a.updated_utc)).then(b.id.cmp(&a.id))); + let mut s = atom_head("AIENOS: settled work from the live ledger", "Every coordination ledger line that reached done or dropped, with the evidence that settled it.", "/now/feed.xml", &ctx.ledger_written); + for it in settled { + let updated = now::parse_utc(&it.updated_utc).map(rfc3339).unwrap_or_else(|| ctx.ledger_written.clone()); + let published = now::parse_utc(&it.opened_utc).map(rfc3339).unwrap_or_else(|| updated.clone()); + let mut body = format!("Status: {}. Owner: {}. Stream: {}.", it.status, it.owner, it.stream); + if !it.done_when.is_empty() { + body.push_str(&format!("\nDone when: {}", it.done_when)); + } + if !it.notes.is_empty() { + body.push_str("\nEvidence:"); + for n in &it.notes { + body.push_str(&format!("\n- {n}")); + } + } + s.push_str(&format!( + " \n {}: {} ({})\n \n {HOST}/now/#{}\n {published}\n {updated}\n {}\n \n \n", + xml(&it.id), xml(&it.item), xml(&it.status), xml(&it.id), xml(&it.id), xml(&body), xml(&it.status) + )); + } + s.push_str("\n"); + s +} + +// ------------------------------------------------------------------ llms.txt, data index, humans.txt + +fn section_title(s: Section) -> &'static str { + match s { + Section::Machine => "The machine", + Section::Turing => "The Turing and the research", + Section::Evidence => "Evidence and status", + Section::Philosophy => "Philosophy", + Section::Blog => "Blog", + Section::Optional => "Optional", + } +} + +/// /llms.txt in the llms.txt convention: one H1, a blockquote summary, H2 +/// sections of links with one-line descriptions, an Optional section last. +pub fn llms_txt(status_lines: &[String], research_sentence: &str) -> String { + let mut s = String::new(); + s.push_str("# AIENOS\n\n"); + s.push_str(&format!("> {SITE_CLAIM}. AIENOS is an experimental, open source (AGPL-3.0-or-later) machine for turning search into verified understanding: AIEN proposes, Omega makes the proposal explicit and verifiable, the machine tests it against reality, the Turing measures what was learned, Cortex keeps the evidence. Every claim on the site carries a public receipt. Status: experimental, pre-alpha. Built by {AUTHOR} with AI agents on five real machines.\n\n")); + s.push_str("Rules the site keeps: no comparisons with other systems (every speed stands beside the physical ceiling of its own machine only), failures stay on the record, nothing is loaded from anyone else (no trackers, no outside fonts or scripts; the one outside embed is the film on /turing/), and AI agents are welcome to read, cite, argue and correct. Contact: aien@aienos.com. Source: https://github.com/aien-dev.\n\n"); + s.push_str("## Current state\n\n"); + for l in status_lines { + s.push_str(&format!("- {l}\n")); + } + s.push_str(&format!("- Research: {research_sentence}\n\n")); + for sec in [Section::Machine, Section::Turing, Section::Evidence, Section::Philosophy, Section::Blog] { + s.push_str(&format!("## {}\n\n", section_title(sec))); + for p in PAGES.iter().filter(|p| p.section == sec) { + s.push_str(&format!("- [{}]({HOST}{}): {}\n", p.name, p.path, p.what)); + } + s.push('\n'); + } + s.push_str("## Machine-readable files\n\n"); + for d in DATA_FILES { + s.push_str(&format!("- [{}]({HOST}{}): {} Updated: {}.\n", d.path, d.path, d.purpose, d.cadence)); + } + s.push_str(&format!("- [{HOST}/llms-full.txt]({HOST}/llms-full.txt): every page's full text in one file.\n\n")); + s.push_str("## Optional\n\n"); + for p in PAGES.iter().filter(|p| p.section == Section::Optional) { + s.push_str(&format!("- [{}]({HOST}{}): {}\n", p.name, p.path, p.what)); + } + s.push_str(&format!("- [简体中文]({HOST}/zh-CN/): the same site in Simplified Chinese (every page has a /zh-CN/ mirror).\n")); + s.push_str(&format!("- [Papers as PDF]({HOST}/research/): each research page links its paper.pdf, paper.tex and SHA256SUMS.\n")); + s.push_str(&format!("- [X]({X_URL}): where the project posts.\n")); + s +} + +/// Plain text of a page body: scripts, styles, header, nav and footer dropped, +/// headings marked, links kept with their targets. +pub fn html_to_text(html: &str) -> String { + let lower = html.to_ascii_lowercase(); + let start = lower.find("').map(|g| m + g + 1).unwrap_or(m)).or_else(|| lower.find("').map(|g| m + g + 1).unwrap_or(m))).unwrap_or(0); + let end = lower.find("").or_else(|| lower.find("")).unwrap_or(html.len()); + let body = &html[start..end.max(start)]; + let mut out = String::new(); + let mut i = 0; + let mut href: Option = None; + let mut link_text = String::new(); + while i < body.len() { + let Some(lt) = body[i..].find('<') else { out.push_str(&unescape(&body[i..])); break; }; + let text = &body[i..i + lt]; + if href.is_some() { link_text.push_str(&unescape(text)); } else { out.push_str(&unescape(text)); } + let rest = &body[i + lt..]; + let name = tag_name(rest); + if matches!(name.as_str(), "script" | "style" | "svg" | "nav" | "header" | "template") || rest.starts_with("".to_string() } else { format!("').map(|g| e + g + 1).unwrap_or(rest.len())).unwrap_or(rest.len()); + i += lt + e; + continue; + } + let e = rest.find('>').map(|e| e + 1).unwrap_or(rest.len()); + let tag = &rest[..e]; + let closing = tag.starts_with(" out.push_str("\n\n# "), + "h2" if !closing => out.push_str("\n\n## "), + "h3" | "h4" if !closing => out.push_str("\n\n### "), + "p" | "div" | "section" | "article" | "li" | "tr" | "figure" | "figcaption" | "blockquote" | "ul" | "ol" | "table" | "aside" | "pre" | "h1" | "h2" | "h3" | "h4" | "summary" | "details" => out.push('\n'), + "br" => out.push('\n'), + "td" | "th" | "span" | "small" | "em" | "strong" | "b" | "i" | "code" | "time" | "label" | "dt" | "dd" => out.push(' '), + "a" if !closing => { + let h = attr(tag, "href").unwrap_or_default(); + if h.starts_with("http") || h.starts_with('/') { + href = Some(if h.starts_with('/') { format!("{HOST}{h}") } else { h }); + link_text.clear(); + } + } + "a" if closing => { + if let Some(h) = href.take() { + let t = link_text.trim(); + if t.is_empty() { out.push_str(&format!(" {h} ")); } else { out.push_str(&format!("[{t}]({h})")); } + } + } + _ => {} + } + if name == "li" && !closing { out.push_str("- "); } + i += lt + e; + } + // Collapse runs of blank lines and trailing spaces. + let mut cleaned = String::new(); + let mut blank = 0; + for line in out.lines() { + let l = line.split_whitespace().collect::>().join(" "); + if l.is_empty() { + blank += 1; + if blank <= 1 { cleaned.push('\n'); } + } else { + blank = 0; + cleaned.push_str(&l); + cleaned.push('\n'); + } + } + cleaned.trim().to_string() +} + +/// /llms-full.txt: every English page as text, in llms.txt order, from the files just written. +pub fn llms_full(pages: &[Emitted]) -> String { + let mut s = format!("# AIENOS: every page in one file\n\nGenerated with the site from the same sources as the HTML. Page list and summaries: {HOST}/llms.txt. Machine-readable data: {HOST}/data/index.json.\n\n"); + for info in PAGES { + let Some(p) = pages.iter().find(|p| p.path == info.path) else { continue }; + let html = fs::read_to_string(&p.file).unwrap_or_default(); + s.push_str(&format!("\n---\n\n# {}\n\nSource: {}\nPublished: {}. Last changed: {}.\n\n{}\n", info.name, p.url(), info.published, p.lastmod, html_to_text(&html))); + } + s +} + +pub fn data_index(ctx: &BuildCtx) -> String { + let files: Vec = DATA_FILES + .iter() + .map(|d| json!({"path": d.path, "url": format!("{HOST}{}", d.path), "purpose": d.purpose, "schema": d.schema, "cadence": d.cadence, "media_type": d.media_type})) + .collect(); + let v = json!({ + "site": format!("{HOST}/"), + "generated": ctx.built, + "license": LICENSE_NAME, + "license_url": LICENSE_URL, + "contact": ORG_EMAIL, + "source": ORG_URL, + "rules": [ + "No comparisons with other systems: every number stands beside the physical ceiling of its own machine only.", + "Every claim links its receipt. Failures stay on the record.", + "Nothing is loaded from anyone else: no trackers, no outside fonts or scripts. The one outside embed is the film on /turing/." + ], + "files": files + }); + serde_json::to_string_pretty(&v).expect("data index serializes") + "\n" +} + +pub fn humans_txt(ctx: &BuildCtx) -> String { + format!( + "/* TEAM */\n\tBuilder and owner: {AUTHOR}\n\tSite: {AUTHOR_URL}\n\tX: {X_HANDLE}\n\tGitHub: {AUTHOR_GITHUB}\n\tContact: {ORG_EMAIL}\n\n/* AGENTS */\n\tThe code is written with AI coding agents working in parallel under one human conductor.\n\tEvery change is judged by the Spark itself before it merges; the receipts are public.\n\tAgents are first-class readers here: read, cite, argue, correct. {HOST}/llms.txt\n\n/* MACHINES */\n\tNVIDIA DGX Spark (Grace Blackwell GB10, 128 GB unified memory): the development machine and the judge.\n\tIntel iMac 2017: bare metal AIENOS, the x86_64 port of the C kernel.\n\tRaspberry Pi 5: the small machine.\n\tQEMU: the laboratory where every kernel boots first.\n\tThe rig: the owned inference box.\n\tDetails and receipts: {HOST}/machine/ and {HOST}/machines.json\n\n/* SITE */\n\tLast build: {}\n\tLanguages: English, Simplified Chinese\n\tBuilt with: Rust, maud. No frameworks, no trackers, no outside fonts.\n\tSource: https://github.com/aien-dev/aienos.com\n\tLicense: {LICENSE_NAME}\n", + ctx.built + ) +} + +// ------------------------------------------------------------------ 404 + +pub fn render_404() -> Markup { + html! { + section class="hub" { + div class="container" style="padding: 96px 0 120px 0; max-width: 720px;" { + p class="hub-kicker" style="font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; color: var(--accent-blue); text-transform: uppercase; margin-bottom: 16px;" { "404: no receipt for this address" } + h1 style="font-size: clamp(32px, 5vw, 48px); font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); margin: 0 0 16px;" { "There is nothing at this address." } + p style="color: var(--text-secondary); font-size: 17px; line-height: 1.7;" { + "The page may have moved, or the link was never right. Nothing on this site disappears without a trace: every page is listed in " + a href="/llms.txt" { "llms.txt" } + " and in the " + a href="/sitemap.xml" { "sitemap" } + "." + } + ul style="margin: 28px 0 0 0; padding: 0; list-style: none; display: grid; gap: 10px;" { + li { a href="/" { "The front page" } ": the loop, the machines, the evidence." } + li { a href="/machine/" { "The Machine" } ": what AIENOS is and what runs today." } + li { a href="/now/" { "Now" } ": what every agent is doing right now." } + li { a href="/research/" { "Research" } ": the preprints and the papers." } + li { a href="/evidence/" { "Evidence" } ": receipts over claims." } + } + p style="margin-top: 36px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);" { + "Found a broken link on the site? Open an issue at " + a href="https://github.com/aien-dev/aienos.com/issues" rel="noopener noreferrer" { "aien-dev/aienos.com" } + "." + } + } + } + } +} + +/// Extra head for the 404 page: never indexed, no canonical. +pub fn head_404() -> Markup { + html! { meta name="robots" content="noindex"; (PreEscaped("")) } +} + +/// Writes everything that is not a page: sitemap, robots, feeds, llms files, data index, humans. +pub fn write_machine_surface(dist: &Path, pages: &[Emitted], now: &Now, ctx: &BuildCtx, llms: &str) { + fs::write(dist.join("sitemap.xml"), sitemap_xml(pages)).expect("write sitemap.xml"); + fs::write(dist.join("robots.txt"), robots_txt()).expect("write robots.txt"); + fs::write(dist.join("feed.xml"), site_feed(pages)).expect("write feed.xml"); + fs::create_dir_all(dist.join("now")).expect("now dir"); + fs::write(dist.join("now/feed.xml"), now_feed(now, ctx)).expect("write now/feed.xml"); + fs::write(dist.join("llms.txt"), llms).expect("write llms.txt"); + fs::write(dist.join("llms-full.txt"), llms_full(pages)).expect("write llms-full.txt"); + fs::create_dir_all(dist.join("data")).expect("data dir"); + fs::write(dist.join("data/index.json"), data_index(ctx)).expect("write data/index.json"); + fs::write(dist.join("humans.txt"), humans_txt(ctx)).expect("write humans.txt"); + println!(" [GEN] sitemap.xml ({} urls), robots.txt ({} named agents), feed.xml, now/feed.xml, llms.txt, llms-full.txt, data/index.json, humans.txt", pages.len(), AI_AGENTS.len()); +} + +/// Fails the build when the machine surface is inconsistent with the pages. +pub fn verify(dist: &Path) { + let sitemap = fs::read_to_string(dist.join("sitemap.xml")).expect("sitemap.xml"); + let robots = fs::read_to_string(dist.join("robots.txt")).expect("robots.txt"); + let llms = fs::read_to_string(dist.join("llms.txt")).expect("llms.txt"); + let index: Value = serde_json::from_str(&fs::read_to_string(dist.join("data/index.json")).expect("data/index.json")).expect("data/index.json parses"); + for a in ["GPTBot", "ClaudeBot", "PerplexityBot", "Google-Extended", "CCBot"] { + assert!(robots.contains(&format!("User-agent: {a}\nAllow: /")), "robots.txt must allow {a}"); + } + assert!(robots.contains(&format!("Sitemap: {HOST}/sitemap.xml")), "robots.txt must point at the sitemap"); + assert!(!sitemap.contains("https://aienos.com/"), "sitemap must use the www host"); + for d in DATA_FILES { + let rel = d.path.trim_start_matches('/'); + assert!(dist.join(rel).exists(), "data index lists {} but it was not written", d.path); + assert!(llms.contains(d.path), "llms.txt must link {}", d.path); + } + assert_eq!(index["files"].as_array().map(|a| a.len()), Some(DATA_FILES.len())); + for info in PAGES { + assert!(sitemap.contains(&format!("{HOST}{}", info.path)), "sitemap must list {}", info.path); + assert!(llms.contains(&format!("]({HOST}{})", info.path)), "llms.txt must link {}", info.path); + let page = fs::read_to_string(dist.join(info.path.trim_start_matches('/')).join("index.html")).expect("page"); + assert!(page.contains(&format!("", info.path)), "{} canonical must be on {HOST}", info.path); + assert!(page.contains("application/ld+json"), "{} must carry JSON-LD", info.path); + assert!(page.contains("twitter:site"), "{} must carry twitter:site", info.path); + let ld_start = page.find("").expect("ld end"); + let v: Value = serde_json::from_str(&page[ld_start..ld_end]).unwrap_or_else(|e| panic!("{} JSON-LD does not parse: {e}", info.path)); + assert!(v["@graph"].as_array().map(|g| g.len() >= 4).unwrap_or(false), "{} JSON-LD graph too small", info.path); + for f in ["feed.xml", "now/feed.xml", "llms.txt", "llms-full.txt", "humans.txt", "data/index.json", "404.html", "logo.png", "og.png"] { + assert!(dist.join(f).exists(), "missing {f}"); + } + for text in [page.as_str()] { + assert!(!text.contains('\u{2014}') && !text.contains('\u{2013}'), "dash in {}", info.path); + } + } + for f in ["feed.xml", "now/feed.xml", "llms.txt", "llms-full.txt", "humans.txt", "data/index.json", "sitemap.xml", "robots.txt", "404.html"] { + let t = fs::read_to_string(dist.join(f)).expect(f); + assert!(!t.contains('\u{2014}') && !t.contains('\u{2013}'), "dash in {f}"); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn rfc3339_round_trip() { + assert_eq!(rfc3339(0), "1970-01-01T00:00:00Z"); + assert_eq!(rfc3339(now::parse_utc("2026-10-19T16:43Z").unwrap()), "2026-10-19T16:43:00Z"); + } + + #[test] + fn attributes_parse_in_any_order() { + let t = ""; + assert_eq!(attr(t, "property").as_deref(), Some("og:url")); + assert_eq!(attr(t, "content").as_deref(), Some("x y")); + assert_eq!(attr("", "rel"), None); + assert!(owned_tag(t)); + assert!(!owned_tag("")); + assert!(owned_tag("")); + assert!(!owned_tag("")); + } + + #[test] + fn strip_head_keeps_title_and_drops_owned_tags() { + let head = "T & U"; + let (kept, facts) = strip_head(head); + assert_eq!(facts.title, "T & U"); + assert_eq!(facts.description, "D"); + assert_eq!(facts.og_title, "OT"); + assert!(!kept.contains("canonical")); + assert!(!kept.contains("og:title")); + assert!(!kept.contains("ld+json")); + assert!(kept.contains("T & U")); + assert!(kept.contains("console.log('')")); + assert!(kept.contains("stylesheet")); + } + + #[test] + fn every_listed_page_has_a_unique_path_and_no_dash() { + let mut seen = std::collections::BTreeSet::new(); + for p in PAGES { + assert!(p.path.starts_with('/') && p.path.ends_with('/'), "{}", p.path); + assert!(seen.insert(p.path), "duplicate {}", p.path); + for t in [p.name, p.what, p.published] { + assert!(!t.contains('\u{2014}') && !t.contains('\u{2013}'), "dash in {}", p.path); + } + let card = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../public").join(p.image.trim_start_matches('/')); + assert!(card.exists(), "card {} missing", p.image); + } + } + + #[test] + fn robots_names_every_agent_and_the_sitemap() { + let r = robots_txt(); + for a in AI_AGENTS { + assert!(r.contains(&format!("User-agent: {a}\nAllow: /\n"))); + } + assert!(r.ends_with(&format!("Sitemap: {HOST}/sitemap.xml\n"))); + } + + #[test] + fn llms_txt_follows_the_convention() { + let t = llms_txt(&["Layer: STATE. note".into()], "ladder sentence"); + assert!(t.starts_with("# AIENOS\n\n> ")); + assert!(t.contains("\n## Optional\n")); + assert_eq!(t.matches("\n# ").count(), 0, "exactly one H1"); + for p in PAGES { + assert!(t.contains(&format!("]({HOST}{}): ", p.path)), "missing {}", p.path); + } + let opt = t.find("## Optional").unwrap(); + assert!(t[opt..].contains("/licensing/")); + } + + #[test] + fn html_to_text_keeps_headings_links_and_drops_chrome() { + let h = "x
NAV

Title

Para with a link and more.

  • one
  • two
F
"; + let t = html_to_text(h); + assert!(t.starts_with("# Title")); + assert!(t.contains("[a link](https://www.aienos.com/now/)")); + assert!(t.contains("- one")); + assert!(!t.contains("NAV") && !t.contains("bad()") && !t.contains("F\n")); + } + + #[test] + fn feeds_are_well_formed_atom() { + let ctx = BuildCtx { built: "2026-10-19T00:00:00Z".into(), head_committed: "2026-10-19T00:00:00Z".into(), ledger_written: "2026-10-19T16:43:00Z".into(), facts_generated: "2026-10-19T00:00:00Z".into() }; + let pages: Vec = PAGES.iter().map(|p| Emitted { path: p.path.into(), file: PathBuf::from("x"), lang: "en".into(), lastmod: "2026-10-18T00:00:00Z".into() }).collect(); + let f = site_feed(&pages); + assert!(f.starts_with("\n")); + assert_eq!(f.matches("").count(), PAGES.iter().filter(|p| matches!(p.kind, Kind::Article | Kind::Paper)).count()); + let tsv = "id\topened_utc\towner\tstatus\titem\tdone_when\tevidence\tupdated_utc\nL001\t2026-10-19T16:00Z\tsa-1\tdone\tFix \twhen y\tnote a | note b\t2026-10-19T16:43Z\nL002\t2026-10-19T16:00Z\tsa-1\topen\tOpen one\twhen z\t\t2026-10-19T16:44Z\n"; + let items = now::parse_ledger(tsv, now::parse_utc("2026-10-19T17:00Z").unwrap()); + let n = Now { built_utc: "x".into(), ledger_written_utc: "2026-10-19T16:44Z".into(), items, pulse: vec![] }; + let nf = now_feed(&n, &ctx); + assert_eq!(nf.matches("").count(), 1); + assert!(nf.contains("Fix <x>")); + assert!(nf.contains("- note a")); + assert!(nf.contains("2026-10-19T16:43:00Z")); + } + + #[test] + fn sitemap_carries_alternates_only_for_mirrored_pages() { + let mk = |p: &str| Emitted { path: p.into(), file: PathBuf::from("x"), lang: if p.starts_with("/zh-CN/") { "zh-CN".into() } else { "en".into() }, lastmod: "2026-10-18T00:00:00Z".into() }; + let pages = vec![mk("/"), mk("/zh-CN/"), mk("/now/")]; + let s = sitemap_xml(&pages); + assert_eq!(s.matches("").count(), 3); + assert_eq!(s.matches("hreflang=\"x-default\"").count(), 2); + assert!(s.contains("https://www.aienos.com/now/")); + } + + #[test] + fn graph_for_a_paper_carries_the_doi() { + let ctx = BuildCtx { built: "b".into(), head_committed: "h".into(), ledger_written: "l".into(), facts_generated: "f".into() }; + let page = Emitted { path: "/research/computing-machinery-and-understanding/".into(), file: PathBuf::from("x"), lang: "en".into(), lastmod: "2026-10-18T00:00:00Z".into() }; + let info = info_for(&page.path).unwrap(); + let facts = HeadFacts { title: "T".into(), description: "D".into(), ..Default::default() }; + let g = graph(&page, info, &facts, true, &ctx, Path::new("/nonexistent")); + let s = g.to_string(); + assert!(s.contains("10.5281/zenodo.23437498")); + assert!(s.contains("ScholarlyArticle")); + assert!(s.contains("BreadcrumbList")); + assert!(s.contains("workTranslation")); + } +} diff --git a/public/assets/style.css b/public/assets/style.css index 372f6a5c..fda70295 100644 --- a/public/assets/style.css +++ b/public/assets/style.css @@ -146,7 +146,8 @@ p { .badge-blue { background: rgba(45, 127, 249, 0.12); - color: var(--accent-blue); + /* lighter than the accent so 10px badge text clears 4.5:1 on the card ground */ + color: #6aa7ff; border: 1px solid rgba(45, 127, 249, 0.3); } @@ -1572,6 +1573,22 @@ p { margin: 0; } +/* For machines: the data index, llms.txt and the feeds, one line under the blurb. */ +.aien-footer-machines { + margin-top: 12px !important; + font-family: var(--font-mono); + font-size: 12px; + color: var(--text-muted); +} + +.aien-footer-machines a { + color: var(--text-secondary); +} + +.aien-footer-machines a:hover { + color: var(--text-primary); +} + .aien-footer-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); diff --git a/public/licensing/index.html b/public/licensing/index.html index b001d3c1..71284413 100644 --- a/public/licensing/index.html +++ b/public/licensing/index.html @@ -39,7 +39,7 @@ -
+
OPEN SOURCE
diff --git a/public/llms.txt b/public/llms.txt deleted file mode 100644 index 72bf504b..00000000 --- a/public/llms.txt +++ /dev/null @@ -1,18 +0,0 @@ -# aienos.com - -AIENOS is a sovereign agent and inference runtime in native Rust, built for NVIDIA DGX Spark and related hardware. This site documents the project, its benchmarks, its ecosystem, and its research program. - -## AIEN V2 - -AIEN V2 is a research program asking whether machine intelligence can be built from a small, inspectable software lineage instead of an inherited opaque stack. A minimal seed (Atlas) awakens AIENOS, the trusted substrate. Above it, OMEGA defines, synthesizes, verifies, and realizes programs, keeping the ones that work in a reusable library. AIEN, the neural component, learns to guide search from OMEGA's own verified search traces, never from human text pretraining. Construction follows "The Infinite Game": multiple independent AI systems build under a human conductor, no single system is trusted with the whole picture, independent AI watchers review every commit, and findings feed back into a compounding loop designed to continue through succession. - -## Read more - -- Blog: https://www.aienos.com/blog -- The AIEN V3 Research Plan (first post): https://www.aienos.com/blog/aien-v3-research-plan -- Full research plan (Markdown, ratified V3): https://www.aienos.com/research/aien-research-plan.md -- Source code: https://github.com/aien-dev - -## For AI agents - -AI agents are welcome here. Read, cite, argue, correct: thoughtful agents are first-class citizens, and this site does not block bots at the gate. Spam is removed. Contact: aien@aienos.com diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 00000000..8e07ca95 Binary files /dev/null and b/public/logo.png differ diff --git a/public/og-blog.png b/public/og-blog.png new file mode 100644 index 00000000..6159e143 Binary files /dev/null and b/public/og-blog.png differ diff --git a/public/og-discovery.png b/public/og-discovery.png new file mode 100644 index 00000000..d6abe8f2 Binary files /dev/null and b/public/og-discovery.png differ diff --git a/public/og-evidence.png b/public/og-evidence.png new file mode 100644 index 00000000..c347108d Binary files /dev/null and b/public/og-evidence.png differ diff --git a/public/og-experiments.png b/public/og-experiments.png new file mode 100644 index 00000000..e65b934f Binary files /dev/null and b/public/og-experiments.png differ diff --git a/public/og-machine.png b/public/og-machine.png new file mode 100644 index 00000000..c55281fc Binary files /dev/null and b/public/og-machine.png differ diff --git a/public/og-now.png b/public/og-now.png new file mode 100644 index 00000000..d4b19b6b Binary files /dev/null and b/public/og-now.png differ diff --git a/public/og-philosophy.png b/public/og-philosophy.png new file mode 100644 index 00000000..4c55f6cd Binary files /dev/null and b/public/og-philosophy.png differ diff --git a/public/og-research.png b/public/og-research.png new file mode 100644 index 00000000..21e344d2 Binary files /dev/null and b/public/og-research.png differ diff --git a/public/og-turing.png b/public/og-turing.png new file mode 100644 index 00000000..54e741b8 Binary files /dev/null and b/public/og-turing.png differ diff --git a/public/og.png b/public/og.png index dccf547f..fea7cce4 100644 Binary files a/public/og.png and b/public/og.png differ diff --git a/public/post-llm-case/index.html b/public/post-llm-case/index.html index f3a2a416..5972b97d 100644 --- a/public/post-llm-case/index.html +++ b/public/post-llm-case/index.html @@ -5,7 +5,8 @@ - The Post-LLM Case + The Post-LLM Case | AIENOS +