diff --git a/.gitignore b/.gitignore index fd3d6d2..5cc7694 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.crumb.local +/target +/dist +/facts.json diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..baf68ff --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,170 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "maud" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df518b75016b4289cdddffa1b01f2122f4a49802c93191f3133f6dc2472ebcaa" +dependencies = [ + "itoa", + "maud_macros", +] + +[[package]] +name = "maud_macros" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa453238ec218da0af6b11fc5978d3b5c3a45ed97b722391a2a11f3306274e18" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "site-builder" +version = "0.2.0" +dependencies = [ + "maud", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..3183fd0 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +members = ["crates/site-builder"] +resolver = "2" diff --git a/README.md b/README.md index f7cd892..32e6d70 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,50 @@ # interplane.io -Source of the static website for [INTERPLANE](https://github.com/aien-dev/interplane): one -self-contained HTML page, no framework, no analytics or tracking scripts. - -- `index.html`: the whole page. Its styles are inline and its hero image is embedded as base64 WebP. - One small inline script drives the results tabs, the token bars and the copy button for the clone - command. The page loads the IBM Plex fonts from Google Fonts (`fonts.googleapis.com`, - `fonts.gstatic.com`), so a visitor's browser contacts Google. That is its only external request. - The footer still says "Draft marketing page ... not yet live", although interplane.io already - serves this page. -- `public/style.css`: light and dark styles from the earlier version of the page. The current - `index.html` does not link it. - -All figures on the page come from `aien-dev/interplane` at commit 9aff24a (STATUS.md, ROADMAP.md, -docs/REPORT-0.1.md, bench/PROTOCOL-0.2.md, bench/runs/qual-20261004T2207Z/summary.md, qualification reports). -Update them when those files change. They are a snapshot: `aien-dev/interplane` has moved on since -(ROADMAP.md there records 0.2 and 0.3 as closed, while the page's roadmap section still shows 0.2 in -progress and 0.3 specified). - -## Hosting: hub Pi - -The site is served from the house server ("hub", a Raspberry Pi), not from GitHub Pages. This repository -holds the source only; it has no Pages workflow and no CNAME file. Deploying means copying `index.html` -and `public/` into the web root on the hub and serving it for `interplane.io` and `www.interplane.io`. -DNS for the domain (registered and hosted at Gandi) points at the hub; the orchestrator handles both. +Source of the website for [INTERPLANE](https://github.com/aien-dev/interplane), the open +interoperability protocol between AI models and agent runtimes. + +The page is not written by hand. A small Rust program, `crates/site-builder`, reads the protocol +repository's public record on GitHub (STATUS.md, ROADMAP.md, the stage reports, the latest tag, +the open proposals and the Spark judge's verdict for the current commit of main), writes those +facts to `facts.json`, and renders the page from Rust source plus that file. Every figure on the +page names the commit it was read at and links to it. The editorial copy lives in +`crates/site-builder/src/page.rs`. + +## Rules the page keeps + +`site-builder verify` refuses a build that breaks any of these: + +- no scripts, no outside fonts, no trackers; the only requests a visitor's browser makes are to interplane.io; +- no em or en dashes; +- the pinned commit of the protocol repository is on the page; +- the Spark verdict is shown as it is (PASS, FAIL, RUNNING or NO VERDICT), never summarised; +- no mention of the removed Python SDK and no "draft" footer. + +## Build + +``` +cargo build --release -p site-builder +target/release/site-builder facts # needs `gh` logged in; writes facts.json +target/release/site-builder build dist # renders dist/index.html, copies public/, facts.json +target/release/site-builder verify dist +``` + +`cargo test -p site-builder` renders a sample page and runs the same rules against it. + +## Hosting and automation + +The site is served by the house server ("hub", a Raspberry Pi) behind nginx, not by GitHub Pages. +`scripts/sync-to-hub.sh` runs from cron on the Spark once an hour: it fast-forwards a clean clone +of this repository, rebuilds, refreshes the facts (keeping the last good facts if GitHub is +unreachable), verifies, and copies the result to the hub only when something changed. It skips a +run while the Spark's quiet flag is held. Its log is under `~/.local/share/interplane-site/`. + +## Files + +- `crates/site-builder/`: the generator (facts, page, verify). +- `public/style.css`: the one stylesheet; light and dark follow the reader's system setting. +- `public/hero.webp`: the hero illustration. +- `scripts/sync-to-hub.sh`: the hourly deploy. ## License diff --git a/crates/site-builder/Cargo.toml b/crates/site-builder/Cargo.toml new file mode 100644 index 0000000..64f2331 --- /dev/null +++ b/crates/site-builder/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "site-builder" +version = "0.2.0" +edition = "2021" +description = "Builds interplane.io from Rust source and facts read from the protocol repository" +license = "AGPL-3.0-or-later" +publish = false + +[dependencies] +maud = "0.26" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" + +[[bin]] +name = "site-builder" +path = "src/main.rs" diff --git a/crates/site-builder/src/facts.rs b/crates/site-builder/src/facts.rs new file mode 100644 index 0000000..cbec50c --- /dev/null +++ b/crates/site-builder/src/facts.rs @@ -0,0 +1,488 @@ +//! Facts read from the protocol repository's public record on GitHub. `site-builder facts` +//! writes them to `facts.json`; `site-builder build` renders them. Nothing in this file is +//! typed by hand: every value names the commit it was read at, so the page can link to it. + +use std::path::Path; +use std::process::Command; + +use serde::{Deserialize, Serialize}; + +/// The protocol repository. GitHub follows the rename, so this name keeps working. +pub const PROTOCOL_REPO: &str = "aien-dev/interplane"; + +/// The commit status context under which the Spark judge posts its verdict. +pub const SPARK_STATUS_CONTEXT: &str = "AIEN Verification (Spark)"; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct Pin { + /// The repository as GitHub names it today. + pub full_name: String, + pub url: String, + /// The commit of main every fact below was read at. + pub sha: String, + pub committed_at: String, + pub commit_title: String, + pub latest_tag: String, + pub license: String, + pub description: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct StatusCounts { + pub rows: usize, + pub qualified: usize, + pub conformant: usize, + pub tested: usize, + pub implemented: usize, + pub specified: usize, + pub other: usize, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct Conformance { + pub passed: u32, + pub total: u32, + pub note: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct Stage { + pub version: String, + pub layer: String, + pub goal: String, + /// `closed`, `next`, `reported`, or `planned`. + pub state: String, + /// `PASS`, `FAIL`, or empty when no gate verdict is recorded. + pub verdict: String, + pub closed_on: String, + /// The report for this stage, when one exists. + pub report_url: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct Report { + pub name: String, + pub title: String, + pub headline: String, + pub url: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct Merge { + pub number: u64, + pub title: String, + pub merged_at: String, + pub url: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct Receipt { + /// `success`, `failure`, `pending`, or `none`. + pub state: String, + pub description: String, + pub target_url: String, + pub updated_at: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct Facts { + pub generated_at: String, + pub pin: Pin, + pub status: StatusCounts, + pub conformance: Option, + pub stages: Vec, + pub next_stage: String, + pub reports: Vec, + pub open_issues: u64, + pub open_prs: u64, + pub last_merge: Option, + pub receipt: Receipt, +} + +impl Facts { + pub fn load(path: &Path) -> Result { + let text = std::fs::read_to_string(path).map_err(|e| format!("{}: {e}", path.display()))?; + serde_json::from_str(&text).map_err(|e| format!("{} is not a facts file: {e}", path.display())) + } + + pub fn save(&self, path: &Path) -> Result<(), String> { + let text = serde_json::to_string_pretty(self).map_err(|e| e.to_string())?; + std::fs::write(path, text + "\n").map_err(|e| format!("{}: {e}", path.display())) + } + + /// A link into the pinned commit of the protocol repository. + pub fn blob(&self, path: &str) -> String { + format!("{}/blob/{}/{}", self.pin.url, self.pin.sha, path) + } +} + +fn gh(args: &[&str]) -> Result { + let out = Command::new("gh").arg("api").args(args).output().map_err(|e| format!("gh api: {e}"))?; + if !out.status.success() { + return Err(format!("gh api {}: {}", args.join(" "), String::from_utf8_lossy(&out.stderr).trim())); + } + serde_json::from_slice(&out.stdout).map_err(|e| format!("gh api {}: bad JSON: {e}", args.join(" "))) +} + +fn gh_text(full: &str, path: &str, sha: &str) -> Result { + let out = Command::new("gh") + .args(["api", "-H", "Accept: application/vnd.github.raw+json", &format!("repos/{full}/contents/{path}?ref={sha}")]) + .output() + .map_err(|e| format!("gh api: {e}"))?; + if !out.status.success() { + return Err(format!("gh api {path}@{sha}: {}", String::from_utf8_lossy(&out.stderr).trim())); + } + Ok(String::from_utf8_lossy(&out.stdout).into_owned()) +} + +fn s(v: &serde_json::Value, key: &str) -> String { + v.get(key).and_then(|x| x.as_str()).unwrap_or("").to_string() +} + +fn ptr(v: &serde_json::Value, path: &str) -> String { + v.pointer(path).and_then(|x| x.as_str()).unwrap_or("").to_string() +} + +pub fn gather() -> Result { + let repo = gh(&[format!("repos/{PROTOCOL_REPO}").as_str()])?; + let full = s(&repo, "full_name"); + let url = s(&repo, "html_url"); + let commit = gh(&[format!("repos/{full}/commits/main").as_str()])?; + let sha = s(&commit, "sha"); + let tags = gh(&[format!("repos/{full}/tags?per_page=1").as_str()])?; + let pin = Pin { + full_name: full.clone(), + url: url.clone(), + sha: sha.clone(), + committed_at: ptr(&commit, "/commit/committer/date"), + commit_title: ptr(&commit, "/commit/message").lines().next().unwrap_or("").to_string(), + latest_tag: tags.get(0).map(|t| s(t, "name")).unwrap_or_default(), + license: ptr(&repo, "/license/spdx_id"), + description: s(&repo, "description"), + }; + + let status_md = gh_text(&full, "STATUS.md", &sha)?; + let status = status_counts(&status_md); + let conformance = conformance_row(&status_md); + + let roadmap_md = gh_text(&full, "ROADMAP.md", &sha)?; + let docs = gh(&[format!("repos/{full}/contents/docs?ref={sha}").as_str()])?; + let report_names: Vec = docs + .as_array() + .map(|a| a.iter().map(|d| s(d, "name")).filter(|n| n.starts_with("REPORT-") && n.ends_with(".md")).collect()) + .unwrap_or_default(); + let mut reports = Vec::new(); + for name in &report_names { + let text = gh_text(&full, &format!("docs/{name}"), &sha)?; + reports.push(Report { + name: name.clone(), + title: text.lines().find(|l| l.starts_with("# ")).map(|l| l[2..].trim().to_string()).unwrap_or_else(|| name.clone()), + headline: headline(&text), + url: format!("{url}/blob/{sha}/docs/{name}"), + }); + } + let (stages, next_stage) = stages(&roadmap_md, &reports); + + let pulls_open = gh(&[format!("repos/{full}/pulls?state=open&per_page=100").as_str()])?; + let open_prs = pulls_open.as_array().map(|a| a.len() as u64).unwrap_or(0); + let open_issues = repo.get("open_issues_count").and_then(|n| n.as_u64()).unwrap_or(0).saturating_sub(open_prs); + let pulls_closed = gh(&[format!("repos/{full}/pulls?state=closed&sort=updated&direction=desc&per_page=30").as_str()])?; + let last_merge = pulls_closed.as_array().and_then(|a| { + a.iter().filter(|p| !s(p, "merged_at").is_empty()).max_by(|a, b| s(a, "merged_at").cmp(&s(b, "merged_at"))).map(|p| Merge { + number: p.get("number").and_then(|n| n.as_u64()).unwrap_or(0), + title: s(p, "title"), + merged_at: s(p, "merged_at"), + url: s(p, "html_url"), + }) + }); + + // The Spark judge's verdict for this commit, never the hosted bridge check run. + let combined = gh(&[format!("repos/{full}/commits/{sha}/status").as_str()])?; + let receipt = combined + .get("statuses") + .and_then(|a| a.as_array()) + .and_then(|a| a.iter().filter(|r| s(r, "context") == SPARK_STATUS_CONTEXT).max_by(|a, b| s(a, "updated_at").cmp(&s(b, "updated_at")))) + .map(|st| Receipt { + state: match s(st, "state").as_str() { + "success" => "success".to_string(), + "failure" | "error" => "failure".to_string(), + _ => "pending".to_string(), + }, + description: public_description(&s(st, "description")), + target_url: { + let t = s(st, "target_url"); + if t.is_empty() { format!("{url}/commit/{sha}") } else { t } + }, + updated_at: s(st, "updated_at"), + }) + .unwrap_or(Receipt { + state: "none".to_string(), + description: "The Spark has not published a verdict for this commit yet.".to_string(), + target_url: String::new(), + updated_at: String::new(), + }); + + Ok(Facts { + generated_at: now_utc(), + pin, + status, + conformance, + stages, + next_stage, + reports, + open_issues, + open_prs, + last_merge, + receipt, + }) +} + +/// Splits a Markdown table row into trimmed cells. +fn cells(line: &str) -> Vec { + let t = line.trim(); + if !t.starts_with('|') { + return Vec::new(); + } + t.trim_matches('|').split('|').map(|c| c.trim().to_string()).collect() +} + +fn is_separator(row: &[String]) -> bool { + !row.is_empty() && row.iter().all(|c| !c.is_empty() && c.chars().all(|ch| ch == '-' || ch == ':')) +} + +/// Counts STATUS.md rows by the strongest status word in the Rust column. +pub fn status_counts(md: &str) -> StatusCounts { + let mut c = StatusCounts { rows: 0, qualified: 0, conformant: 0, tested: 0, implemented: 0, specified: 0, other: 0 }; + let mut in_table = false; + for line in md.lines() { + let row = cells(line); + if row.len() < 2 { + in_table = false; + continue; + } + if row[0] == "Component" { + in_table = true; + continue; + } + if !in_table || is_separator(&row) { + continue; + } + c.rows += 1; + let rust = row[1].to_lowercase(); + if rust.contains("qualified") { + c.qualified += 1; + } else if rust.contains("conformant") { + c.conformant += 1; + } else if rust.contains("tested") { + c.tested += 1; + } else if rust.contains("implemented") || rust.contains("running") { + c.implemented += 1; + } else if rust.contains("specified") { + c.specified += 1; + } else { + c.other += 1; + } + } + c +} + +/// The "Conformance runner" row: `passed/total` from its fixtures column. +pub fn conformance_row(md: &str) -> Option { + for line in md.lines() { + let row = cells(line); + if row.len() >= 4 && row[0].starts_with("Conformance runner") { + let fx = &row[3]; + let (a, b) = fx.split_once('/')?; + let passed: u32 = a.trim().parse().ok()?; + let total: u32 = b.trim().chars().take_while(|c| c.is_ascii_digit()).collect::().parse().ok()?; + return Some(Conformance { passed, total, note: fx.clone() }); + } + } + None +} + +/// The first "**Headline: ...**" line of a report, without the Markdown bold marks. +pub fn headline(md: &str) -> String { + let mut out = String::new(); + let mut collecting = false; + for line in md.lines() { + if !collecting { + if let Some(rest) = line.trim_start().strip_prefix("**Headline:") { + collecting = true; + out.push_str(rest.trim()); + } + continue; + } + if line.trim().is_empty() { + break; + } + out.push(' '); + out.push_str(line.trim()); + } + // Keep the headline sentence only; the rest of the paragraph is detail. + let one = out.replace("**", ""); + let one = one.trim().to_string(); + match one.find(". ") { + Some(i) => one[..=i].to_string(), + None => one, + } +} + +/// Roadmap stages from the version table, with their state from the "closed" headings and +/// the last "Next:" line. +pub fn stages(md: &str, reports: &[Report]) -> (Vec, String) { + let mut stages: Vec = Vec::new(); + let mut in_table = false; + for line in md.lines() { + let row = cells(line); + if row.len() < 4 { + in_table = false; + continue; + } + if row[0] == "Version" { + in_table = true; + continue; + } + if !in_table || is_separator(&row) { + continue; + } + stages.push(Stage { + version: row[0].clone(), + layer: row[1].clone(), + goal: row[3].clone(), + state: "planned".to_string(), + verdict: String::new(), + closed_on: String::new(), + report_url: String::new(), + }); + } + let mut next = String::new(); + for line in md.lines() { + let t = line.trim(); + if let Some(rest) = t.strip_prefix("## ") { + // e.g. "0.3 closed (2026-10-05): gate PASS" + let mut words = rest.split_whitespace(); + let v = words.next().unwrap_or(""); + if words.next() == Some("closed") { + if let Some(st) = stages.iter_mut().find(|s| s.version == v) { + st.state = "closed".to_string(); + st.closed_on = rest.find('(').and_then(|a| rest[a + 1..].find(')').map(|b| rest[a + 1..a + 1 + b].to_string())).unwrap_or_default(); + let upper = rest.to_uppercase(); + st.verdict = if upper.contains("PASS") { + "PASS".to_string() + } else if upper.contains("FAIL") { + "FAIL".to_string() + } else { + String::new() + }; + } + } + } + if let Some(rest) = t.strip_prefix("Next: **") { + next = rest.split("**").next().unwrap_or("").trim_end_matches('.').to_string(); + } + } + for st in stages.iter_mut() { + if let Some(r) = reports.iter().find(|r| r.name == format!("REPORT-{}.md", st.version)) { + st.report_url = r.url.clone(); + if st.state == "planned" { + st.state = "reported".to_string(); + } + } + if !next.is_empty() && next.starts_with(&st.version) && st.state != "closed" { + st.state = "next".to_string(); + } + } + (stages, next) +} + +/// The Spark writes its verdict line followed by the bundle path on its own disk. The verdict +/// is public; the path is not useful to anyone else, so it is cut off here. +pub fn public_description(raw: &str) -> String { + let cut = raw.find(": bundle ").or_else(|| raw.find(" bundle /")).unwrap_or(raw.len()); + raw[..cut].trim().to_string() +} + +pub fn now_utc() -> String { + let out = Command::new("date").args(["-u", "+%Y-%m-%dT%H:%M:%SZ"]).output(); + match out { + Ok(o) if o.status.success() => String::from_utf8_lossy(&o.stdout).trim().to_string(), + _ => "unknown".to_string(), + } +} + +/// `2026-10-16T09:30:35Z` to `16 Oct 2026`. Anything else is returned unchanged. +pub fn short_date(ts: &str) -> String { + const MONTHS: [&str; 12] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + let date = ts.split('T').next().unwrap_or(ts); + let parts: Vec<&str> = date.split('-').collect(); + if parts.len() != 3 { + return ts.to_string(); + } + let (y, m, d) = (parts[0], parts[1].parse::().unwrap_or(0), parts[2].parse::().unwrap_or(0)); + if !(1..=12).contains(&m) || d == 0 { + return ts.to_string(); + } + format!("{d} {} {y}", MONTHS[m - 1]) +} + +#[cfg(test)] +mod tests { + use super::*; + + const STATUS: &str = "# STATUS\n\n| Component | Rust | Python | Fixtures | Notes |\n|---|---|---|---|---|\n| Core schemas | specified | specified | validated | x |\n| Lenshift qwen35 | conformant, qualified | conformant | 10 | |\n| Probe | qualified | qualified | - | |\n| Adapter | tested | - | 3 | |\n| Conformance runner | implemented | implemented | 106/106 (verdicts identical) | `--dump` |\n| Reproducibility pins | - | - | - | see docs |\n\nAfter.\n"; + + const ROADMAP: &str = "# roadmap\n\n| Version | Layer | Builds | Goal |\n|---|---|---|---|\n| 0.1 | Reality | a | Prove it |\n| 0.2 | Capability | b | Minimum tools |\n| 0.3 | Trust | c | Keep the line |\n| 0.4 | Execution | d | Multi-round |\n| 0.5 | Qualification | e | Measured claims |\n\n## 0.2 closed (2026-10-04): gate FAIL recorded\n\ntext\n\n## 0.3 closed (2026-10-05): gate PASS\n\ntext\n\nNext: **0.4 Execution**.\n"; + + #[test] + fn counts_status_rows_by_strongest_word() { + let c = status_counts(STATUS); + assert_eq!(c.rows, 6); + assert_eq!(c.qualified, 2); + assert_eq!(c.conformant, 0); + assert_eq!(c.tested, 1); + assert_eq!(c.implemented, 1); + assert_eq!(c.specified, 1); + assert_eq!(c.other, 1); + } + + #[test] + fn reads_the_conformance_row() { + let c = conformance_row(STATUS).unwrap(); + assert_eq!((c.passed, c.total), (106, 106)); + } + + #[test] + fn reads_stage_states_from_headings() { + let reports = vec![Report { name: "REPORT-0.1.md".into(), title: "r".into(), headline: "h".into(), url: "u".into() }]; + let (st, next) = stages(ROADMAP, &reports); + assert_eq!(next, "0.4 Execution"); + let by = |v: &str| st.iter().find(|s| s.version == v).unwrap().clone(); + assert_eq!(by("0.1").state, "reported"); + assert_eq!(by("0.2").state, "closed"); + assert_eq!(by("0.2").verdict, "FAIL"); + assert_eq!(by("0.3").verdict, "PASS"); + assert_eq!(by("0.3").closed_on, "2026-10-05"); + assert_eq!(by("0.4").state, "next"); + assert_eq!(by("0.5").state, "planned"); + } + + #[test] + fn headline_keeps_the_first_sentence_without_bold() { + let md = "# r\n\n**Headline: every offline gate of the pre-registered 0.3 protocol PASSED** (P, X;\nthresholds fixed). More.\n\n## Observed\n"; + assert_eq!(headline(md), "every offline gate of the pre-registered 0.3 protocol PASSED (P, X; thresholds fixed)."); + assert_eq!(headline("no headline here"), ""); + } + + #[test] + fn public_description_drops_the_bundle_path() { + assert_eq!(public_description("PASS 12 gates: bundle /home/x/y"), "PASS 12 gates"); + assert_eq!(public_description("PASS"), "PASS"); + } + + #[test] + fn short_date_reads_rfc3339() { + assert_eq!(short_date("2026-10-16T09:30:35Z"), "16 Oct 2026"); + assert_eq!(short_date("nope"), "nope"); + } +} diff --git a/crates/site-builder/src/main.rs b/crates/site-builder/src/main.rs new file mode 100644 index 0000000..5610e99 --- /dev/null +++ b/crates/site-builder/src/main.rs @@ -0,0 +1,221 @@ +//! interplane.io site builder. +//! +//! ```text +//! site-builder facts [facts.json] read the protocol repository, write the facts file +//! site-builder build [dist] [facts.json] render the page and copy public/ into dist +//! site-builder verify [dist] refuse a page that breaks the site rules +//! ``` +//! +//! The page is rendered from Rust source plus the facts file. No scripts, no outside fonts, no +//! trackers, no em or en dashes, and no figure that does not resolve to a record in the +//! protocol repository. + +mod facts; +mod page; + +use std::fs; +use std::path::{Path, PathBuf}; +use std::process::ExitCode; + +use facts::Facts; + +fn copy_dir(src: &Path, dst: &Path) -> std::io::Result<()> { + fs::create_dir_all(dst)?; + for entry in fs::read_dir(src)? { + let entry = entry?; + let to = dst.join(entry.file_name()); + if entry.file_type()?.is_dir() { + copy_dir(&entry.path(), &to)?; + } else { + fs::copy(entry.path(), &to)?; + } + } + Ok(()) +} + +fn build(dist: &Path, facts_path: &Path) -> Result<(), String> { + let facts = Facts::load(facts_path)?; + fs::create_dir_all(dist).map_err(|e| format!("{}: {e}", dist.display()))?; + let html = page::render(&facts); + fs::write(dist.join("index.html"), &html).map_err(|e| e.to_string())?; + copy_dir(Path::new("public"), &dist.join("public")).map_err(|e| format!("public/: {e}"))?; + fs::copy(facts_path, dist.join("facts.json")).map_err(|e| e.to_string())?; + fs::write(dist.join("robots.txt"), format!("User-agent: *\nAllow: /\nSitemap: {}sitemap.xml\n", page::SITE_URL)).map_err(|e| e.to_string())?; + fs::write( + dist.join("sitemap.xml"), + format!( + "\n\n {}{}\n\n", + page::SITE_URL, + facts.generated_at.split('T').next().unwrap_or("") + ), + ) + .map_err(|e| e.to_string())?; + println!("built {} ({} bytes) from {}@{}", dist.join("index.html").display(), html.len(), facts.pin.full_name, &facts.pin.sha[..12.min(facts.pin.sha.len())]); + Ok(()) +} + +/// The site rules, enforced on the rendered output so a copy change cannot slip past them. +pub fn verify_html(html: &str, css: &str) -> Vec { + let mut problems = Vec::new(); + let mut need = |cond: bool, msg: &str| { + if !cond { + problems.push(msg.to_string()); + } + }; + need(!html.contains('\u{2014}'), "em dash in index.html"); + need(!html.contains('\u{2013}'), "en dash in index.html"); + need(!css.contains('\u{2014}') && !css.contains('\u{2013}'), "dash in style.css"); + need(!html.contains("INTERPLANE: "), "missing title"); + need(html.contains("og:title"), "missing og:title"); + for host in ["googletagmanager", "google-analytics", "plausible", "cloudflareinsights", "umami"] { + need(!html.contains(host), &format!("tracker host {host} in index.html")); + } + let mut depth: i64 = 0; + for ch in css.chars() { + match ch { + '{' => depth += 1, + '}' => depth -= 1, + _ => {} + } + if depth < 0 { + break; + } + } + need(depth == 0, "style.css braces do not balance"); + problems +} + +fn verify(dist: &Path) -> Result<(), String> { + let html = fs::read_to_string(dist.join("index.html")).map_err(|e| format!("index.html: {e}"))?; + let css = fs::read_to_string(dist.join("public/style.css")).map_err(|e| format!("public/style.css: {e}"))?; + let facts = Facts::load(&dist.join("facts.json"))?; + let mut problems = verify_html(&html, &css); + if !dist.join("public/hero.webp").exists() { + problems.push("public/hero.webp missing from dist".to_string()); + } + // The hand-copied receipt figures must agree with the STATUS row they come from. + let status_md_hint = format!("{} -> {} tools, {}% fewer", page::RECEIPT_TOOLS_BEFORE, page::RECEIPT_TOOLS_AFTER, page::RECEIPT_CUT_PERCENT); + if !html.contains(&facts.pin.sha) { + problems.push("the pinned commit is not on the page".to_string()); + } + if facts.receipt.state == "success" && !html.contains(">PASS<") { + problems.push("a passing verdict is not shown as PASS".to_string()); + } + if facts.receipt.state == "failure" && !html.contains(">FAIL<") && !html.contains(">BLOCKED<") { + problems.push("a failing verdict is not shown as FAIL or BLOCKED".to_string()); + } + if problems.is_empty() { + println!("verified {} ({} bytes); receipt figures: {status_md_hint}", dist.join("index.html").display(), html.len()); + Ok(()) + } else { + Err(problems.join("\n")) + } +} + +fn main() -> ExitCode { + let args: Vec = std::env::args().skip(1).collect(); + let mode = args.first().map(String::as_str).unwrap_or("build"); + let result = match mode { + "facts" => { + let out = PathBuf::from(args.get(1).map(String::as_str).unwrap_or("facts.json")); + facts::gather().and_then(|f| { + let r = f.save(&out); + if r.is_ok() { + println!("facts: {}@{} tag {} receipt {} -> {}", f.pin.full_name, &f.pin.sha[..12.min(f.pin.sha.len())], f.pin.latest_tag, f.receipt.state, out.display()); + } + r + }) + } + "build" => build(Path::new(args.get(1).map(String::as_str).unwrap_or("dist")), Path::new(args.get(2).map(String::as_str).unwrap_or("facts.json"))), + "verify" => verify(Path::new(args.get(1).map(String::as_str).unwrap_or("dist"))), + other => Err(format!("unknown mode {other}; use facts, build or verify")), + }; + match result { + Ok(()) => ExitCode::SUCCESS, + Err(e) => { + eprintln!("site-builder {mode}: {e}"); + ExitCode::FAILURE + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use facts::*; + + fn sample() -> Facts { + Facts { + generated_at: "2026-10-16T17:00:00Z".into(), + pin: Pin { + full_name: "aien-dev/interplane".into(), + url: "https://github.com/aien-dev/interplane".into(), + sha: "83df0f074b2c0000000000000000000000000000".into(), + committed_at: "2026-10-16T09:30:35Z".into(), + commit_title: "ci: enroll interplane in the Spark verification pipeline (#109)".into(), + latest_tag: "v0.3.0".into(), + license: "Apache-2.0".into(), + description: "d".into(), + }, + status: StatusCounts { rows: 40, qualified: 4, conformant: 12, tested: 10, implemented: 2, specified: 1, other: 11 }, + conformance: Some(Conformance { passed: 106, total: 106, note: "106/106".into() }), + stages: vec![ + Stage { version: "0.1".into(), layer: "Reality".into(), goal: "Prove".into(), state: "reported".into(), verdict: String::new(), closed_on: String::new(), report_url: "https://x/REPORT-0.1.md".into() }, + Stage { version: "0.3".into(), layer: "Trust".into(), goal: "Keep".into(), state: "closed".into(), verdict: "PASS".into(), closed_on: "2026-10-05".into(), report_url: "https://x/REPORT-0.3.md".into() }, + Stage { version: "0.4".into(), layer: "Execution".into(), goal: "Multi".into(), state: "next".into(), verdict: String::new(), closed_on: String::new(), report_url: String::new() }, + ], + next_stage: "0.4 Execution".into(), + reports: vec![Report { name: "REPORT-0.3.md".into(), title: "INTERPLANE 0.3 report".into(), headline: "every offline gate PASSED.".into(), url: "https://x/REPORT-0.3.md".into() }], + open_issues: 2, + open_prs: 1, + last_merge: Some(Merge { number: 109, title: "ci: enroll".into(), merged_at: "2026-10-16T09:30:36Z".into(), url: "https://x/pull/109".into() }), + receipt: Receipt { state: "success".into(), description: "PASS 7 gates".into(), target_url: "https://x/commit/83df".into(), updated_at: "2026-10-16T10:00:00Z".into() }, + } + } + + #[test] + fn rendered_page_passes_the_site_rules() { + let html = page::render(&sample()); + let css = fs::read_to_string(concat!(env!("CARGO_MANIFEST_DIR"), "/../../public/style.css")).expect("public/style.css"); + let problems = verify_html(&html, &css); + assert!(problems.is_empty(), "{problems:?}"); + assert!(html.contains(">PASS<")); + assert!(html.contains("83df0f074b2c")); + assert!(html.contains("106 of 106")); + assert!(html.contains("v0.3.0")); + } + + #[test] + fn failing_verdict_is_red_and_honest() { + let mut f = sample(); + f.receipt.state = "failure".into(); + f.receipt.description = "BLOCKED NOT_RUN PIPELINE_CONFIG_CHANGED".into(); + let html = page::render(&f); + assert!(html.contains("pill bad")); + assert!(html.contains(">BLOCKED<"), "a run the judge did not run says BLOCKED, not FAIL"); + assert!(html.contains("BLOCKED NOT_RUN PIPELINE_CONFIG_CHANGED")); + f.receipt.description = "BLOCKED FAIL PREFILL-E2E-2:rc_nonzero".into(); + let html = page::render(&f); + assert!(html.contains(">FAIL<"), "a failed gate says FAIL even when the bundle is also blocked"); + } + + #[test] + fn no_verdict_is_said_plainly() { + let mut f = sample(); + f.receipt = Receipt { state: "none".into(), description: "The Spark has not published a verdict for this commit yet.".into(), target_url: String::new(), updated_at: String::new() }; + let html = page::render(&f); + assert!(html.contains(">NO VERDICT<")); + assert!(html.contains("not published a verdict")); + } +} diff --git a/crates/site-builder/src/page.rs b/crates/site-builder/src/page.rs new file mode 100644 index 0000000..bffca75 --- /dev/null +++ b/crates/site-builder/src/page.rs @@ -0,0 +1,304 @@ +//! The one page of interplane.io. Editorial copy lives here in Rust; every figure comes from +//! `Facts` (read from the protocol repository at a pinned commit) or from a constant below that +//! names the report it was read from. + +use maud::{html, Markup, DOCTYPE}; + +use crate::facts::{short_date, Facts}; + +pub const TITLE: &str = "INTERPLANE"; +pub const TAGLINE: &str = "The open boundary between AI models and the programs that act for them."; +pub const DESCRIPTION: &str = "INTERPLANE is an open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority."; +pub const SITE_URL: &str = "https://interplane.io/"; +pub const SITE_REPO: &str = "https://github.com/aien-dev/interplane.io"; + +/// The 0.1 receipt, read from docs/REPORT-0.1.md ("Selection" section) at the pinned commit. +/// Only the report path is cited on the page; the numbers below are copied from it by hand and +/// checked by `verify` against the facts file's STATUS row for CrossAxis Select. +pub const RECEIPT_TOOLS_BEFORE: u32 = 71; +pub const RECEIPT_TOOLS_AFTER: u32 = 9; +pub const RECEIPT_TOKENS_BEFORE: u32 = 15_846; +pub const RECEIPT_TOKENS_AFTER: u32 = 1_674; +pub const RECEIPT_CUT_PERCENT: &str = "89"; +pub const RECEIPT_REPORT_PATH: &str = "docs/REPORT-0.1.md"; + +pub struct Module { + pub name: &'static str, + pub question: &'static str, + pub answer: &'static str, + pub spec: &'static str, +} + +/// The modules, in the order a call crosses the boundary. +pub const MODULES: [Module; 7] = [ + Module { name: "Core", question: "What crosses the line?", answer: "The shared vocabulary: capabilities, requests, results, traces and the canonical byte form every digest is computed over.", spec: "spec/CORE.md" }, + Module { name: "Lenshift", question: "What did the model actually say?", answer: "Reads each model's native tool-call dialect into one form. An incomplete or ambiguous call is rejected, never guessed.", spec: "spec/LENSHIFT.md" }, + Module { name: "CrossAxis", question: "Which tools does this task need?", answer: "Selects the few tools a task needs from a runtime's catalog, so a small local model is not buried under schemas it will never use.", spec: "spec/CROSSAXIS.md" }, + Module { name: "Crossveil", question: "Who is allowed to act?", answer: "Tracks where every piece of text came from. Content a model read on the web cannot grant authority, and an effect it asks for while untrusted text is in view is held for a person.", spec: "spec/CROSSVEIL.md" }, + Module { name: "Probe", question: "What does this model and backend really support?", answer: "Live probes that measure a model, backend and runtime combination instead of trusting its documentation.", spec: "spec/PROBE.md" }, + Module { name: "Vectorveil", question: "How do bytes travel?", answer: "The transport envelope. Specified; the implementation belongs to the 0.4 Execution stage.", spec: "spec/VECTORVEIL.md" }, + Module { name: "RelayLine", question: "How does a long call stream?", answer: "Streaming, cancellation and continuation. The contract is written; the implementation belongs to 0.4.", spec: "spec/RELAYLINE.md" }, +]; + +fn number(n: u32) -> String { + let s = n.to_string(); + let mut out = String::new(); + for (i, ch) in s.chars().enumerate() { + if i > 0 && (s.len() - i) % 3 == 0 { + out.push('\u{202f}'); + } + out.push(ch); + } + out +} + +fn head(facts: &Facts) -> Markup { + html! { + head { + meta charset="utf-8"; + meta name="viewport" content="width=device-width, initial-scale=1"; + title { (TITLE) ": " (TAGLINE) } + meta name="description" content=(DESCRIPTION); + meta property="og:title" content=(TITLE); + meta property="og:description" content=(DESCRIPTION); + meta property="og:type" content="website"; + meta property="og:url" content=(SITE_URL); + meta property="og:image" content={ (SITE_URL) "public/hero.webp" }; + meta name="color-scheme" content="light dark"; + meta name="generator" content={ "site-builder at " (facts.pin.full_name) "@" (&facts.pin.sha[..12.min(facts.pin.sha.len())]) }; + link rel="canonical" href=(SITE_URL); + link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='6' fill='%23101317'/%3E%3Crect x='6' y='15' width='20' height='2' fill='%23f2a93b'/%3E%3C/svg%3E"; + link rel="stylesheet" href="public/style.css"; + link rel="alternate" type="application/json" href="facts.json" title="Facts behind this page"; + } + } +} + +fn verdict_class(state: &str) -> &'static str { + match state { + "success" => "ok", + "failure" => "bad", + "pending" => "wait", + _ => "none", + } +} + +/// The word in the verdict pill. The Spark reports a blocked run (for example a pipeline +/// configuration change that needs an operator run) as a failing status; the page says BLOCKED +/// for those so a reader does not take it for a failed test. +pub fn verdict_word(receipt: &crate::facts::Receipt) -> &'static str { + match receipt.state.as_str() { + "success" => "PASS", + "failure" if receipt.description.starts_with("BLOCKED") && receipt.description.contains("NOT_RUN") => "BLOCKED", + "failure" => "FAIL", + "pending" => "RUNNING", + _ => "NO VERDICT", + } +} + +fn hero(facts: &Facts) -> Markup { + let release = if facts.pin.latest_tag.is_empty() { "unreleased".to_string() } else { facts.pin.latest_tag.clone() }; + html! { + header class="hero" { + div class="hero-text" { + p class="kicker" { "Open protocol" " " span class="dot" {} " " (release) " " span class="dot" {} " " (facts.pin.license) } + h1 { (TITLE) } + p class="tagline" { (TAGLINE) } + p class="lede" { + "A model can say what it wants done. Only the program running it decides what happens. INTERPLANE is the written agreement between the two sides, with a test suite that checks every implementation the same way." + } + p class="actions" { + a class="button primary" href=(facts.pin.url) { "Read the source" } + a class="button" href=(facts.blob("spec/CORE.md")) { "Read the specification" } + a class="button" href="#status" { "See the current state" } + } + } + figure class="hero-art" { + img src="public/hero.webp" width="1536" height="1024" alt="Two machined metal plates held apart by struts, with a single luminous amber plane stretched between them: the INTERPLANE layer between a model and a runtime." loading="eager"; + } + } + } +} + +fn problem() -> Markup { + html! { + section class="prose" id="why" { + h2 { "The problem it fixes" } + p { "Every local model speaks its own tool-calling dialect. Every agent program has its own tools, approvals and memory. Today each pair is wired by hand, and the wiring is where the authority leaks: a model reads a web page that contains an instruction, repeats it as a tool call, and the program obeys because nothing in between remembered where the text came from." } + p { "INTERPLANE puts a named, tested layer there. It belongs to neither side. A runtime keeps its own policy and execution; a model keeps its own dialect. The protocol only standardises what crosses between them, and makes that crossing measurable." } + blockquote { "Models express intent. Runtimes retain authority. INTERPLANE defines the boundary between them." } + } + } +} + +fn modules(facts: &Facts) -> Markup { + html! { + section id="modules" { + h2 { "Seven modules, one line" } + p class="section-lede" { "Each module answers one question a call has to pass on its way from a model to an effect in the world." } + ol class="modules" { + @for m in MODULES.iter() { + li { + h3 { (m.name) } + p class="question" { (m.question) } + p { (m.answer) } + a class="spec" href=(facts.blob(m.spec)) { "Specification" } + } + } + } + } + } +} + +fn receipt(facts: &Facts) -> Markup { + html! { + section id="receipt" class="receipt" { + h2 { "One measured result" } + p class="section-lede" { "From the 0.1 readiness report. A real Qwen3.5-9B model on Ollama, one task, the runtime's full tool catalog against the tools CrossAxis selected." } + div class="receipt-grid" { + div class="cell" { span class="big" { (RECEIPT_TOOLS_BEFORE) " to " (RECEIPT_TOOLS_AFTER) } span class="label" { "tools offered for the task" } } + div class="cell" { span class="big" { (number(RECEIPT_TOKENS_BEFORE)) " to " (number(RECEIPT_TOKENS_AFTER)) } span class="label" { "first-turn prompt tokens, model reported" } } + div class="cell" { span class="big" { (RECEIPT_CUT_PERCENT) "% fewer" } span class="label" { "prompt tokens before the model says a word" } } + } + p class="fine" { + "Fewer tokens is the cost side only. The same stage later asked whether a small model keeps its capability with fewer tools, pre-registered the thresholds, and recorded the answer: the 0.2 gate " + strong { "failed" } + ". Both results are in the repository, with the raw runs. " + a href=(facts.blob(RECEIPT_REPORT_PATH)) { "Read the 0.1 report" } + "." + } + } + } +} + +fn status(facts: &Facts) -> Markup { + let c = &facts.status; + html! { + section id="status" class="status" { + h2 { "Current state" } + p class="section-lede" { + "Read from the protocol repository at commit " + a href={ (facts.pin.url) "/commit/" (facts.pin.sha) } { code { (&facts.pin.sha[..12.min(facts.pin.sha.len())]) } } + " (" (short_date(&facts.pin.committed_at)) "). This page is rebuilt every hour from that record and nothing here is typed by hand." + } + div class="verdict" { + span class={ "pill " (verdict_class(&facts.receipt.state)) } { (verdict_word(&facts.receipt)) } + span class="verdict-text" { + "Spark verification of this commit: " (facts.receipt.description) + @if !facts.receipt.target_url.is_empty() { " " a href=(facts.receipt.target_url) { "Receipt" } } + } + } + div class="stages" { + h3 { "Roadmap" } + ol class="stage-list" { + @for st in &facts.stages { + li class={ "stage " (st.state) } { + span class="version" { (st.version) } + span class="layer" { (st.layer) } + span class="goal" { (st.goal) } + span class="state" { + @match st.state.as_str() { + "closed" => { + "closed " (short_date(&st.closed_on)) + @if !st.verdict.is_empty() { ", gate " strong class=(if st.verdict == "PASS" { "ok" } else { "bad" }) { (st.verdict) } } + } + "next" => "next", + "reported" => "closed, report below", + _ => "planned", + } + @if !st.report_url.is_empty() { " " a href=(st.report_url) { "Report" } } + } + } + } + } + @if !facts.next_stage.is_empty() { p class="fine" { "Next stage: " strong { (facts.next_stage) } "." } } + } + div class="status-grid" { + div class="cell" { + h3 { "Components" } + p { "STATUS.md tracks " strong { (c.rows) } " rows for the Rust implementation." } + ul class="counts" { + li { strong { (c.qualified) } " qualified against a real model or backend" } + li { strong { (c.conformant) } " conformant to the shared fixtures" } + li { strong { (c.tested) } " tested" } + li { strong { (c.implemented) } " implemented or running" } + li { strong { (c.specified) } " specified only" } + } + @if let Some(conf) = &facts.conformance { + p { "Conformance runner: " strong { (conf.passed) " of " (conf.total) } " cases, verdicts byte-identical to the recorded reference." } + } + a href=(facts.blob("STATUS.md")) { "Full status table" } + } + div class="cell" { + h3 { "Activity" } + ul class="counts" { + li { "Latest change: " a href={ (facts.pin.url) "/commit/" (facts.pin.sha) } { (facts.pin.commit_title) } } + @if let Some(m) = &facts.last_merge { + li { "Last merged proposal: " a href=(m.url) { "#" (m.number) " " (m.title) } " (" (short_date(&m.merged_at)) ")" } + } + li { strong { (facts.open_prs) } " open proposals, " strong { (facts.open_issues) } " open issues" } + li { "Latest release: " strong { (if facts.pin.latest_tag.is_empty() { "none".to_string() } else { facts.pin.latest_tag.clone() }) } } + } + a href={ (facts.pin.url) "/pulls" } { "Proposals" } " " span class="dot" {} " " a href={ (facts.pin.url) "/issues" } { "Issues" } + } + } + div class="reports" { + h3 { "Reports, in their own words" } + p class="section-lede" { "Every stage closes with a pre-registered gate and a report that states the result whether it passed or failed." } + ul class="report-list" { + @for r in &facts.reports { + li { + a href=(r.url) { (r.title) } + @if !r.headline.is_empty() { span class="headline" { " " (r.headline) } } + } + } + } + } + p class="fine" { + "Generated " (facts.generated_at) ". The data behind this section is published as " + a href="facts.json" { "facts.json" } "." + } + } + } +} + +fn get_started(facts: &Facts) -> Markup { + html! { + section id="start" class="prose" { + h2 { "Try it in a minute, offline" } + p { "No model, no GPU, no network. A scripted model fetches a page that carries an injected instruction, then asks to send an email, write a file and append a note. The reference pipeline denies the email and the write, holds the note for a person, and executes none of them." } + pre { code { "git clone " (facts.pin.url) ".git\ncd interplane/rust\ncargo run -q -p interplane-crossveil --example offline" } } + p { "To connect your own program, read " a href=(facts.blob("docs/WRITING-AN-ADAPTER.md")) { "Writing an adapter" } " and run its to-do list example. The conformance suite then checks your adapter the same way it checks the reference." } + } + } +} + +fn footer(facts: &Facts) -> Markup { + html! { + footer { + p { "INTERPLANE is developed in the open by " a href="https://github.com/aien-dev" { "aien-dev" } " as part of " a href="https://www.aienos.com/" { "AIEN" } ". Protocol and reference implementation: " (facts.pin.license) ". " a href=(SITE_REPO) { "This site" } " is built by a small Rust program from the repository's public record; no scripts, no outside fonts, no trackers." } + } + } +} + +pub fn render(facts: &Facts) -> String { + let page = html! { + (DOCTYPE) + html lang="en" { + (head(facts)) + body { + a class="skip" href="#main" { "Skip to content" } + (hero(facts)) + main id="main" { + (problem()) + (modules(facts)) + (receipt(facts)) + (status(facts)) + (get_started(facts)) + } + (footer(facts)) + } + } + }; + page.into_string() +} diff --git a/index.html b/index.html deleted file mode 100644 index fa9fe13..0000000 --- a/index.html +++ /dev/null @@ -1,724 +0,0 @@ - - - - - - - - - INTERPLANE — the layer between model and runtime - - - - - - -
- - - -
-

An open protocol for local & self-hosted AI

-

The layer between the model and everything it can touch.

-

- A model proposes. A runtime disposes. Today the two are wired together ad hoc — every agent - framework invents its own tool format, its own permission story, its own way of hoping the - model behaves. INTERPLANE standardizes what crosses between them: the model sees - only the tools the task needs, the runtime keeps every authority decision, and each run - leaves a receipt that can be checked. -

- - -
- Two machined metal plates held apart by struts, with a single luminous amber plane stretched between them — the INTERPLANE layer between a model and a runtime. -
- MODEL SIDE — UNTRUSTED - THE PLANE - RUNTIME SIDE — AUTHORITATIVE -
-
- -
-
-
−89.4%
-
First-turn prompt tokens on a real task: 15,846 down to 1,674, same correct answer
-
-
-
71 → 9
-
Tools exposed to the model, selected deterministically from the full catalog
-
-
-
14/14
-
Probe checks passed on llama.cpp and SGLang, verified by two independent probes
-
-
-
2×
-
Implementations — Rust and Python — producing byte-identical conformance verdicts
-
-
-
- -
-
01

Neither side's property

-

INTERPLANE belongs to neither the model side nor the runtime side. Runtimes keep their own tools, policy, approvals, memory, and execution. INTERPLANE standardizes only what crosses — and makes it measurable.

-
-
- TENSION / A -

Catalogs are too big for small models

-

A 71-tool catalog costs a small local model most of its first-turn context before it has done any work. Bigger prompts, slower turns, worse choices.

-
-
- TENSION / B -

Model output is not permission

-

A well-formed tool call proves the request is understandable, never that it is authorized. Frameworks that blur that line hand the model keys it should never hold.

-
-
- TENSION / C -

Claims are rarely measured

-

“Works with your model” usually means someone ran it once. Capability claims need a protocol, a pre-registered gate, and a published result — pass or fail.

-
-
-
- -
-
02

How a request crosses

-

Three parties, one direction of authority. The model can ask for anything; only the runtime can say yes.

-
-
- Model side -

The model proposes

-

It emits a tool call in whatever dialect it speaks. That output is treated as untrusted content, never as an instruction to execute.

-
- -
- INTERPLANE -

The plane translates & trims

-

Lenshift parses the dialect. CrossAxis exposes only the tools the task needs. Vectorveil wraps the request in a canonical envelope.

-
- -
- Runtime side -

The runtime decides

-

Crossveil carries the request to the runtime's own policy engine. It approves, denies, or asks a human. A denial retried is a denial again.

-
-
-
- -
-
03

Measured, not promised

-

Every number on this page comes from the repository's own published reports. Gates are registered before the run — and published either way.

- -
- - -
- -
- GOAL MET -

The same task, a fraction of the prompt

-

One Qwen3.5 task run over a 71-tool catalog, with and without CrossAxis selecting the tool set. Both runs reached the correct answer, and a second independent run reproduced the selection and the reduction.

-
-
-
Full catalogevery tool in the prompt
-
-
15,846
-
-
-
CrossAxis Select9 tools, chosen deterministically
-
-
1,674
-
-
-

First-turn prompt tokens, Qwen3.5-9B on Ollama 0.34.0. Full method and receipts: the 0.1 readiness report.

-
- - - -
-
- Ollama0.34.0 -
13 / 14
-

One unsupported check: Ollama's OpenAI path consumes the model's text-form tool call. Identical verdicts from the Rust and Python probes.

-
-
- llama.cppb11398 -
14 / 14
-

All probe checks pass for Qwen3.5-9B.

-
-
- SGLang0.5.20 -
14 / 14
-

All probe checks pass in both the Python probe and the Rust probe.

-
-
-
- -
-
04

The parts of the plane

-

Seven components, each with one job. Status labels say plainly what is implemented, what is specified, and what is still only a contract.

-
-
- Interplane Probe -

Measures what an OpenAI-compatible endpoint can actually do — before you trust a word of its documentation.

- SHIPPED -
-
- Lenshift -

Parsers for each model's tool-call dialect, plus result renderers. Speaks openai and qwen35 today; the ajax slot is reserved. It parses — it never executes.

- SHIPPED -
-
- CrossAxis -

Explicit, versioned capability mapping with a deterministic selector: given the catalog and the task, it picks the minimum tool set and records a before-and-after receipt.

- SHIPPED -
-
- Crossveil -

The authority-boundary contract: two runtime callbacks, a lifecycle with fail-closed invariants, and explicit trust classes between content, intent, and authority.

- SHIPPED -
-
- Bench -

The benchmark harness: a paired runner and analyzer that compare a full tool catalog against a CrossAxis selection under a pre-registered protocol.

- SHIPPED -
-
- RelayLine -

The event vocabulary for multi-round exchanges — the words both sides use across a long conversation. A contract so far; transport comes with 0.4.

- CONTRACT ONLY -
-
- Vectorveil -

The envelope and its canonical JSON form — the sealed container a request crosses in. Envelope defined; no transport framework yet, by design.

- ENVELOPE ONLY -
-
-
- -
-
-
05

Security, in one paragraph

-

The model side is untrusted. That is not a warning label; it is the load-bearing assumption every component is built on.

-
-
—Lenshift never executes. Parsing a request confers nothing.
-
—CrossAxis never grants. Selecting a smaller tool set reduces exposure; it is not a permission.
-
—A valid envelope means “structurally understandable,” never “authorized.”
-
—The runtime decides, through its own policy engine — and a denial never becomes an authorization by retrying.
-
-
-
- -
-
06

Where it goes next

-

Four layers, in order. Each has to earn the next.

-
-
- 0.2Capability - Give small local models the minimum tools required — without making them less capable. The expansion failure above is the open problem here. - IN PROGRESS -
-
- 0.3Trust - Preserve the line between content, model intent, and runtime authority. - SPECIFIED -
-
- 0.4Execution - Multi-round execution without losing the boundary. - SPECIFIED -
-
- 0.5Qualification - Measured, reproducible model and backend claims anyone can re-run. - SPECIFIED -
-
-
- -
-

Run it against your own endpoint

-

INTERPLANE is open source — Apache-2.0 core, AGPL-3.0 adapters. Clone it, point the Probe at the model you actually run, and read the receipt. If the numbers don't hold on your machine, the repository wants to know.

-
- $git clone https://github.com/aien-dev/interplane - -
- -
- -
- INTERPLANE — an AIEN project. Spec and reports in the repository; STATUS.md there is the authority on what is implemented, tested, or only specified. - Draft marketing page for interplane.io — not yet live. -
- -
- - - - diff --git a/public/hero.webp b/public/hero.webp new file mode 100644 index 0000000..173a479 Binary files /dev/null and b/public/hero.webp differ diff --git a/public/style.css b/public/style.css index fe6fb6a..e7d2d06 100644 --- a/public/style.css +++ b/public/style.css @@ -1,18 +1,135 @@ -:root{--bg:#fff;--fg:#1a1d21;--muted:#566070;--line:#d9dee5;--accent:#0b5fa5;--card:#f5f7fa;--bad:#a4261d;--ok:#1b6e3a} -@media (prefers-color-scheme:dark){:root{--bg:#101317;--fg:#e6e9ee;--muted:#9aa4b2;--line:#2a313b;--accent:#6db3f2;--card:#171b21;--bad:#ff8a80;--ok:#7bd89a}} -*{box-sizing:border-box} -body{margin:0;background:var(--bg);color:var(--fg);font:17px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif} -main,header,footer{max-width:46rem;margin:0 auto;padding:0 16px} -header{padding-top:3rem} -h1{font-size:2.4rem;margin:0 0 .5rem;letter-spacing:.02em} -h2{font-size:1.35rem;margin:2.5rem 0 .6rem;border-top:1px solid var(--line);padding-top:1.5rem} -a{color:var(--accent)} -.rule{font-size:1.2rem;margin:1rem 0;padding:.8rem 1rem;border-left:4px solid var(--accent);background:var(--card)} -.muted{color:var(--muted)} -dl{margin:0}dt{font-weight:600;margin-top:.8rem}dd{margin:0} -.wrap{overflow-x:auto} -table{border-collapse:collapse;width:100%;font-size:.95rem} -th,td{text-align:left;padding:.4rem .6rem;border-bottom:1px solid var(--line);vertical-align:top} -.pass{color:var(--ok);font-weight:600}.fail{color:var(--bad);font-weight:600} -code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.9em;background:var(--card);padding:.05em .3em;border-radius:3px} -footer{margin-top:3rem;padding-bottom:3rem;border-top:1px solid var(--line);padding-top:1rem;font-size:.9rem;color:var(--muted)} +/* interplane.io: one stylesheet, system fonts only, light and dark from the reader's setting. */ +:root { + --bg: #fbfaf7; + --bg-raised: #ffffff; + --fg: #1a1c20; + --muted: #5b6270; + --line: #e2ded6; + --accent: #b86e0a; + --accent-ink: #7a4705; + --plane: #f2a93b; + --ok: #1e6f3d; + --bad: #a32b22; + --wait: #7a5a00; + --code-bg: #f1eee8; + --shadow: 0 1px 2px rgba(20, 20, 30, 0.06), 0 12px 32px rgba(20, 20, 30, 0.06); + color-scheme: light dark; +} +@media (prefers-color-scheme: dark) { + :root { + --bg: #101317; + --bg-raised: #171b21; + --fg: #e8e9ec; + --muted: #9ba3b0; + --line: #2a313b; + --accent: #f2a93b; + --accent-ink: #ffd089; + --plane: #f2a93b; + --ok: #7bd89a; + --bad: #ff8a80; + --wait: #f0c674; + --code-bg: #1d222a; + --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35); + } +} +* { box-sizing: border-box; } +html { scroll-behavior: smooth; } +body { + margin: 0; + background: var(--bg); + color: var(--fg); + font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + -webkit-font-smoothing: antialiased; +} +a { color: var(--accent-ink); text-decoration-color: var(--line); text-underline-offset: 3px; } +a:hover { text-decoration-color: currentColor; } +code, pre { font: 0.92em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } +pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; } +h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; } +h2 { font-size: 1.75rem; margin-top: 0; } +h3 { font-size: 1.15rem; } +p { margin: 0 0 1em; } +strong.ok { color: var(--ok); } +strong.bad { color: var(--bad); } +.skip { position: absolute; left: -999px; top: 8px; background: var(--bg-raised); padding: 8px 12px; border-radius: 8px; } +.skip:focus { left: 16px; z-index: 10; } +.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); vertical-align: middle; } + +/* Width and rhythm */ +main, footer, .hero { max-width: 68rem; margin: 0 auto; padding: 0 16px; } +main > section { padding: 56px 0; border-top: 1px solid var(--line); } +main > section:first-child { border-top: 0; } +.prose { max-width: 44rem; } +.section-lede { color: var(--muted); max-width: 44rem; margin-bottom: 2em; } +.fine { color: var(--muted); font-size: 0.92rem; } + +/* Hero */ +.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 56px; } +.kicker { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; margin-bottom: 1.2em; } +.hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); letter-spacing: 0.06em; margin-bottom: 0.3em; } +.hero h1::after { content: ""; display: block; width: 4.5rem; height: 4px; background: var(--plane); margin-top: 0.4em; border-radius: 2px; } +.tagline { font-size: 1.35rem; line-height: 1.35; font-weight: 600; max-width: 30ch; } +.lede { color: var(--muted); max-width: 52ch; } +.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.6em; } +.button { display: inline-block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); color: var(--fg); text-decoration: none; font-weight: 600; font-size: 0.95rem; } +.button:hover { border-color: var(--accent); } +.button.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); } +.hero-art { margin: 0; } +.hero-art img { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: var(--shadow); } + +/* Problem */ +blockquote { margin: 1.6em 0 0; padding: 0 0 0 18px; border-left: 4px solid var(--plane); font-size: 1.15rem; font-weight: 600; line-height: 1.4; } + +/* Modules */ +.modules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; counter-reset: module; } +.modules li { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; padding: 20px 20px 16px; position: relative; counter-increment: module; } +.modules li::before { content: counter(module, decimal-leading-zero); position: absolute; top: 18px; right: 20px; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; } +.modules h3 { margin-bottom: 0.2em; } +.modules .question { color: var(--accent-ink); font-weight: 600; margin-bottom: 0.6em; } +.modules p { font-size: 0.97rem; } +.modules .spec { font-size: 0.9rem; } + +/* Receipt */ +.receipt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 1.4em; } +.cell { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; padding: 20px; } +.big { display: block; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; } +.label { display: block; color: var(--muted); font-size: 0.92rem; margin-top: 6px; } + +/* Status */ +.verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-raised); margin-bottom: 28px; } +.pill { font-weight: 800; font-size: 0.85rem; letter-spacing: 0.08em; padding: 4px 10px; border-radius: 999px; color: #fff; } +.pill.ok { background: var(--ok); } +.pill.bad { background: var(--bad); } +.pill.wait { background: var(--wait); } +.pill.none { background: var(--muted); } +.verdict-text { flex: 1 1 20rem; } +.stages { margin-bottom: 28px; } +.stage-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg-raised); } +.stage { display: grid; grid-template-columns: 4rem 9rem 1fr 15rem; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: baseline; } +.stage:first-child { border-top: 0; } +.stage .version { font-weight: 700; } +.stage .layer { font-weight: 600; } +.stage .goal { color: var(--muted); font-size: 0.95rem; } +.stage .state { font-size: 0.92rem; text-align: right; } +.stage.next .state { color: var(--accent-ink); font-weight: 600; } +.stage.planned { color: var(--muted); } +.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 28px; } +.counts { margin: 0 0 1em; padding-left: 1.1em; } +.counts li { margin-bottom: 4px; } +.report-list { margin: 0; padding-left: 1.1em; } +.report-list li { margin-bottom: 10px; } +.report-list .headline { color: var(--muted); } + +/* Footer */ +footer { padding: 32px 16px 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; } + +@media (max-width: 820px) { + body { font-size: 16px; } + .hero { grid-template-columns: 1fr; padding-top: 32px; gap: 24px; } + .hero-art { order: -1; } + main > section { padding: 40px 0; } + .stage { grid-template-columns: 3.5rem 1fr; } + .stage .goal { grid-column: 1 / -1; } + .stage .state { grid-column: 1 / -1; text-align: left; } + .big { font-size: 1.6rem; } +} diff --git a/scripts/sync-to-hub.sh b/scripts/sync-to-hub.sh new file mode 100644 index 0000000..bd580cc --- /dev/null +++ b/scripts/sync-to-hub.sh @@ -0,0 +1,71 @@ +#!/bin/sh +# scripts/sync-to-hub.sh: rebuild interplane.io from the protocol repository's public record and +# copy the result to the web server on the hub Pi. Runs from cron on the Spark once an hour. +# +# REPO clean clone of aien-dev/interplane.io on branch main (default ~/workspace/web/interplane.io-live) +# HUB ssh host that serves the site (default hub) +# WEBDIR document root on HUB (default /var/www/interplane.io) +# LOGDIR where this script keeps its log and the last facts file (default ~/.local/share/interplane-site) +# +# Rules: never run while the Spark quiet flag is held (chip runs own the machine then); never build +# a dirty checkout; if the facts step fails, rebuild from the last good facts so the site still +# follows a source change; refuse to publish a page that fails `site-builder verify`. +set -eu + +REPO=${REPO:-"$HOME/workspace/web/interplane.io-live"} +HUB=${HUB:-hub} +WEBDIR=${WEBDIR:-/var/www/interplane.io} +LOGDIR=${LOGDIR:-"$HOME/.local/share/interplane-site"} +mkdir -p "$LOGDIR" +LOG="$LOGDIR/sync.log" +stamp() { date -u +%Y-%m-%dT%H:%M:%SZ; } +say() { printf '%s %s\n' "$(stamp)" "$*" | tee -a "$LOG"; } + +if command -v quietlock >/dev/null 2>&1 && ! quietlock check >/dev/null 2>&1; then + say "skip: Spark quiet flag held" + exit 0 +fi + +if [ ! -d "$REPO/.git" ]; then + say "clone into $REPO" + git clone -q https://github.com/aien-dev/interplane.io.git "$REPO" +fi +cd "$REPO" +if [ -n "$(git status --porcelain)" ]; then + say "refuse: $REPO is not clean" + exit 2 +fi +git fetch -q origin main +git checkout -q main +git merge -q --ff-only origin/main +HEAD=$(git rev-parse --short=12 HEAD) + +export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$REPO/target}" +cargo build -q --release -p site-builder +BIN="$CARGO_TARGET_DIR/release/site-builder" + +if "$BIN" facts "$LOGDIR/facts.json" >>"$LOG" 2>&1; then + say "facts refreshed" +else + if [ -s "$LOGDIR/facts.json" ]; then + say "facts step failed; building with the last good facts" + else + say "facts step failed and no earlier facts exist; nothing published" + exit 3 + fi +fi + +rm -rf "$LOGDIR/dist" +"$BIN" build "$LOGDIR/dist" "$LOGDIR/facts.json" >>"$LOG" 2>&1 +"$BIN" verify "$LOGDIR/dist" >>"$LOG" 2>&1 || { say "refuse: verify failed for $HEAD"; exit 4; } + +NEW=$(cat "$LOGDIR/dist/index.html" "$LOGDIR/dist/facts.json" | cksum | cut -d' ' -f1) +OLD=$(cat "$LOGDIR/published.cksum" 2>/dev/null || echo none) +if [ "$NEW" = "$OLD" ]; then + say "unchanged ($HEAD); nothing to publish" + exit 0 +fi + +rsync -a --delete --exclude '.well-known' "$LOGDIR/dist/" "$HUB:$WEBDIR/" >>"$LOG" 2>&1 +echo "$NEW" >"$LOGDIR/published.cksum" +say "published site $HEAD to $HUB:$WEBDIR"