aienos.com
Source of www.aienos.com, served from my own hardware
Brought by drakestapleton
GitHub aien-dev/aienos.com#132 (code only)
Fetch it
curl -fsSL https://interplane.io/drakestapleton/aienos.com/patches/41da2bfaf65087e0.bundle -o 41da2bfaf65087e0.bundle git fetch 41da2bfaf65087e0.bundle refs/pull/132/head
Provenance
github-import 1
aien-dev/aienos.com
132
086859d4c856aac5570d3f001dd096009909335e
{"kind":"github-import","owner":"aien-dev","repo":"aienos.com","number":132,"url":"https://github.com/aien-dev/aienos.com/pull/132","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:38:23Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index 291ed2c..a8fceb3 100644 --- a/.crumb +++ b/.crumb @@ -23,8 +23,8 @@ "purpose": "GitHub automation configuration" }, { - "digest": "a67b554f90b0b3a293d28565fdde155c145e53a4dda2542cd6be215efb194aac", - "last_commit": "37adb76", + "digest": "b44f5e584391b4223f6e4edcb86a79f6a3c8e0ab870220ebad624cfb5fbc37cc", + "last_commit": "863c0fa", "name": "crates", "purpose": "Native Rust website crates" }, @@ -42,7 +42,7 @@ }, { "digest": "7e8d6412f116296354d537f1cf123c33f266e3ef74546b5862a579c077429176", - "last_commit": "65d2b4a", + "last_commit": "0804a19", "name": "om/alpha-page", "purpose": "Seeded Omega alpha landing page and client, with pinned wizard source and real terminal capture" }, @@ -65,8 +65,8 @@ "purpose": "Seeded Omega support page, shared invitation and CSS with deterministic artifact checks" }, { - "digest": "4e0b99a85603ed0df420b6b264141f4172504377ccaa4be8f42c239c95acdf5b", - "last_commit": "dbc8d1c", + "digest": "47f5bd186e43673d3fdf11b3ea370607c1f13d4fd583fa35993b61aed4d2e291", + "last_commit": "863c0fa", "name": "public", "purpose": "Static public website assets" }, @@ -77,15 +77,15 @@ "purpose": "Isolated compute-only Allen tools and versioned glass-pane protocol; temporary host transport ar" } ], - "children_root": "sha256:a668e0a1274a9806e466cbaeee369d572f59f48b03e41600a1d3331af7c08c1b", - "compiled_at": "2026-10-31T02:30:20Z", + "children_root": "sha256:95bad27a3cd93f876a20606bd33f9448176e48b55774e6c5b225ea403e7971ae", + "compiled_at": "2026-10-31T09:45:58Z", "compiler": "crumb-compile/1", - "digest": "sha256:35c5a92d25b02b650d21f7b6f643cb5c5ccef79c0fce37c80b2cd29ac65492e4", + "digest": "sha256:c0a13443bbd9162355e2afa3dc0babb2ac3407f9b3f9b231ccdf05d7f4d7147e", "evidence_files": 6, "evidence_root": "sha256:7fde48972a09dd4b0f7206aca4e313cd02c8cd195ec602e3924e59246c016aa5", - "files": 814, - "generated_at_commit": "dbc8d1cdba74d49904001bec14847596d203368c", - "source_tree": "sha256:505ea20100d51bb4f952b4801f6b13a024dda43afa358ba96746fb9b9402c40c" + "files": 817, + "generated_at_commit": "863c0faa01ef9615fb77bb8f7d38ac43b1e9b143", + "source_tree": "sha256:1a8ab1b7af5ce53f61f5b43d220057facabb0231a7e95623e3d90bccf85f9fb0" }, "progress": { "initial_edits": "Dashboard draft predates explicit Crumb reminder; subsequent integration is claimed and recorded.", diff --git a/AGENTS.md b/AGENTS.md index 17c90a6..bc10e9a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -96,6 +96,7 @@ Open `http://127.0.0.1:8080/` after the preview server starts. GitHub Pages serv - The final shared `components::allen_intro::enrich` pass in `seo::enrich` adds one local consent loader, a native modal dialog and a privacy link to generated, hand-written and translated pages. `404.html` gets the same pass. `/privacy/` stays readable without an automatic modal and provides review and refusal controls. No and Escape persist refusal, with no automatic re-prompt. Stored Yes permits one initialization per document; refusal of an active pixel reloads without it. Local storage holds the choice; a session-storage refusal and `#allen-intro-no` protect reload if persistent storage fails. Storage clearing or another browser resets the choice, not consent. - The generated header is one row at every width (Drake, 2026-10-26): brand, the six sections, one More button (a native `<details class="aien-nav-more">`, no script; it holds every `NAV_SECONDARY` link and the languages, and below 1000px the six sections too, reading Menu), the X contact button and Support. Never add a second row: a new nav entry goes behind More. Contact and X are one thing: the header nav ends with the `aien-nav-reach` group holding only the pressable X button (`a.aien-x-link.aien-x-button`, the X mark, `aria-label` "Contact me on X (@mdrakestapleton)", a plain link to `https://x.com/mdrakestapleton`, no widget or script); there is no separate Contact item in the header. The footer carries the `aien-reach-foot` line (the `/contact/` page, X, `drake@aienos.com`, `/aien/`, GitHub aien-dev), which is where the email stays findable. Generated pages get both from `components::navbar` and `components::footer`. Hand-written English pages carry a copy of the generated header. `seo::enrich` runs `navbar::fold_legacy` (folds an older wrapping nav, as on the `/zh-CN/` pages, into the one-row shape with 更多/菜单) and then `components::contact::enrich` (adds the X button and footer line, Chinese labels on `/zh-CN/`). `contact::verify` fails the build if any HTML page in `dist` lacks the X button or the More button, carries a header `/contact/` link, or lacks the footer line. - CSP coordination: no inline allen-intro scripts. An edge CSP for a page that enables this feature needs `script-src 'self' https://static.ads-twitter.com` and `connect-src` / `img-src` permissions for `https://analytics.twitter.com`, `https://analytics.x.com` and `https://t.co` (in addition to its first-party sources). These are the hosts named by the official loader inspected on 2026-10-26, not a wildcard allowance. CSP permissions are static, not conditional consent: `allen-intro.js` enforces consent before any X load. Do not loosen a no-JS edge board CSP; explicitly exclude that board from enrichment if introduced. `allen-intro.js` is outside the separate Hive/Turing Omega-generation change, by agreement with that lane. +- Every emitted HTML page carries one `<meta http-equiv="Content-Security-Policy">`, added last in `seo::enrich` (and on `404.html`, the `seo::REDIRECTS` stubs and `aien/run.html`) by `components::csp::enrich` and checked by `components::csp::verify` in `verify_site`. Scripts are first-party files only: no inline `<script>` body except `type="application/ld+json"` data, no `on*=` handler, no `javascript:` URL (entity-encoded and whitespace-padded forms included). Put page code in `public/js/<page>.js`; redirect stubs use `/js/redirect.js` with `data-to`. `style-src` keeps `'unsafe-inline'` because every page carries `style=` attributes. Additions are derived from the page: `'wasm-unsafe-eval'` only where a script in `csp::WASM_SCRIPTS` loads (`hive.js`, `allen.js`, `allen-scene.js`), `worker-src blob:` only where a script in `csp::BLOB_WORKER_SCRIPTS` loads (`allen.js`), `frame-src https://www.youtube.com` only where a YouTube embed sits. `verify` reads every page-loaded script and fails when either list disagrees with what the script does. A `srcdoc`, `data:` or `blob:` frame inherits the page policy, so programs Aien writes run in `/aien/run.html` instead: the only page whose policy allows inline scripts, loading only `/js/aien-run.js`, which writes the posted program only inside a sandboxed (opaque-origin) frame and only from its parent. Never frame `srcdoc` with scripts. The `/hive/board/` edge CSP is separate and untouched. - Before publishing a consent change, build `dist`, run `node scripts/test-allen-intro.cjs dist/js/allen-intro.js`, and verify in a real browser with cache disabled and requests observed before navigation: unknown/No/Escape and reload produce no X requests and no `window.twq`; saying hello requests the exact loader and configures `rfrlz` once. Test at mobile width 390, verify modal focus and keyboard dismissal, and run a guard-bypass negative control. Intercepted X requests prove gating, not X ingestion. The public project board and storage of check-ins are deferred pending Drake's storage decision; never collect entries under the pixel consent. - Only after consent, retain the landing URL's `twclid` under browser-local `aien-allen-intro-twclid`; remove it on refusal. Drake chose pixel-only operation; server Conversion API work is deferred until the introduction flow has a backend. The single `eventIds` constant in `allen-intro.js` holds `pageVisit` and `introducedToAllen`, empty until Drake supplies the real IDs. Empty means no custom event. Configured IDs send one visit per consenting document and one introduced-to-Allen event per explicit introduction document, each with its own `crypto.randomUUID()` `conversion_id`. A future backend must forward that exact ID for deduplication, read `X_PIXEL_TOKEN` only from its private environment, and never expose the token in static output. - Hive's shell and browser client are generated by seeded Omega, never written in Rust or hand-edited in `public/js/`. `om/hive-page/check.sh` composes `contract.om`, `hive.om` and `hive-js.om`: stdout emits `main.html`, fd 3 emits `hive.js`. The shared contract owns ids, poll/freshness bounds and the board route; append entries rather than renumbering. `hive.om` owns the section order (`meta`, eight pipe-separated fields), shell controls, aria wiring and bounded panels. `om/hive-render/render.om` owns feed-derived rows, native details, manifests and messages. The browser only DOMParser-parses same-origin `/hive/board/` and morphs keyed nodes in place, preserving native open state, selection, focus, search and scroll. It never renders JSON or constructs feed markup. `turing-look.js` has its separate Omega generator. Commit sources, artifacts and hashes together; run the generation gate twice, site-builder tests and `scripts/test-hive-cosmic.py`. Neither served JS file is hand-edited. diff --git a/README.md b/README.md index 830e92f..e830e5d 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Every built page gets one first-party `/js/allen-intro.js` loader from the final Run `node scripts/test-allen-intro.cjs` (Node's built-in test runner, verification only) alongside the Rust suite and `build dist`. To exercise the built asset use `node scripts/test-allen-intro.cjs dist/js/allen-intro.js`. Browser verification must observe requests before navigation with cache disabled; check absence of X requests and `window.twq` before consent, after No and after reload, then require the exact loader URL and `config('rfrlz')` after saying hello. Check keyboard focus, Escape and mobile width 390. An intercepted loader tests gating, not ingestion by X. Confirm the real deployed pixel separately with [X Pixel Helper](https://chrome.google.com/webstore/detail/twitter-pixel-helper/jepminnlebllinfmkhfbkpckogoiefpd). -No new CSP is installed by this feature. If an edge adds one, the Allen introduction needs `script-src 'self' https://static.ads-twitter.com`; `connect-src` and `img-src` need the first-party origin plus `https://analytics.twitter.com`, `https://analytics.x.com`, and `https://t.co`. The official loader inspected on 2026-10-26 names those endpoints; do not permit all X subdomains. CSP permissions cannot vary after a button click: the first-party script is the consent gate. A separate no-JS board should keep its strict CSP and not receive the allen-intro loader. +Every page carries a Content-Security-Policy meta written by `components::csp` in the site builder: `default-src 'self'`, `script-src 'self' https://static.ads-twitter.com`, and `connect-src` / `img-src` with the first-party origin plus `https://analytics.twitter.com`, `https://analytics.x.com` and `https://t.co`. The official loader inspected on 2026-10-26 names those endpoints; do not permit all X subdomains. CSP permissions cannot vary after a button click: the first-party script is the consent gate. A separate no-JS board should keep its strict CSP and not receive the allen-intro loader. The community board, project links, leave-times and storage of public check-ins are **deferred**, pending Drake's storage decision. Saying hello here consents only to the pixel and publishes no public entry. diff --git a/crates/.crumb b/crates/.crumb index 4ed236a..1d72307 100644 --- a/crates/.crumb +++ b/crates/.crumb @@ -7,21 +7,21 @@ "generated": { "children": [ { - "digest": "0def5f2451680cc4d1529fc2b7ca0002cea72fa7990fabd9aeaab80ca37c2542", - "last_commit": "f06c7cbe", + "digest": "902a3678de5ab886a8cc531ca9e2841b794071812326545e08d7ec783b82b8b4", + "last_commit": "863c0fa", "name": "site-builder", "purpose": "Rust static site generator" } ], - "children_root": "sha256:a7e87dd3804b918d15d74369731f6521efcafbb29fe47828305c69a6e16f0f4d", - "compiled_at": "2026-10-31T02:19:00Z", + "children_root": "sha256:65e5a6a5de556bdb6fa16c2ee484a88c3a79ce4a825f94de80cf9b86dfc42fd6", + "compiled_at": "2026-10-31T09:45:58Z", "compiler": "crumb-compile/1", - "digest": "sha256:a67b554f90b0b3a293d28565fdde155c145e53a4dda2542cd6be215efb194aac", + "digest": "sha256:b44f5e584391b4223f6e4edcb86a79f6a3c8e0ab870220ebad624cfb5fbc37cc", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 70, - "generated_at_commit": "f06c7cbe930f23a91775b0bac491f74d71b78f5a", - "source_tree": "sha256:554c68a188446cecb8c513aa4395189af3fa5ddd74ff9fdf1892459caabdbbd9" + "files": 71, + "generated_at_commit": "863c0faa01ef9615fb77bb8f7d38ac43b1e9b143", + "source_tree": "sha256:87ca6826995ea1edfc4a0a5c49ad6c921062b58fc52002c88860a1286993d4fc" } }, "invariants": [ diff --git a/crates/site-builder/.crumb b/crates/site-builder/.crumb index f91778f..e4878ef 100644 --- a/crates/site-builder/.crumb +++ b/crates/site-builder/.crumb @@ -7,27 +7,27 @@ "generated": { "children": [ { - "digest": "b4019d468ab42a24241f88ce37a48c8682a277ffe519d47c4b9f679501196c6a", - "last_commit": "f06c7cbe", + "digest": "3fa92e8f2cb8648a5d3611aa8470e1bbff9e8ca4f1766e51e1a329ec9ff041b9", + "last_commit": "863c0fa", "name": "src", "purpose": "Page assembly and site build verification" }, { "digest": "eae921a534bcf1dbeace156d677090e93082a521bf5ca66d8810597854066072", - "last_commit": "abb54298", + "last_commit": "abb5429", "name": "templates", "purpose": "Reviewed HTML templates for source-backed pages" } ], - "children_root": "sha256:7bf2983bd8c0c02e718cf5a4cdee3c0dd9f79671e50a6d39f6d40594d3186d84", - "compiled_at": "2026-10-31T02:19:00Z", + "children_root": "sha256:b2b9715714c0ad749d2736d98e3e20ad9d1865eaf64b7603e97211142797defb", + "compiled_at": "2026-10-31T09:45:58Z", "compiler": "crumb-compile/1", - "digest": "sha256:0def5f2451680cc4d1529fc2b7ca0002cea72fa7990fabd9aeaab80ca37c2542", + "digest": "sha256:902a3678de5ab886a8cc531ca9e2841b794071812326545e08d7ec783b82b8b4", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 61, - "generated_at_commit": "f06c7cbe930f23a91775b0bac491f74d71b78f5a", - "source_tree": "sha256:ba469f62d22e1685efbba60fb9988d3c5a043546d97a8cd6bd51cf4fe533a4ce" + "files": 62, + "generated_at_commit": "863c0faa01ef9615fb77bb8f7d38ac43b1e9b143", + "source_tree": "sha256:01b4620fcee05d9d6828f8ad0fa84f74150f84094d468ba4e757c3b17cac3b85" } }, "invariants": [ diff --git a/crates/site-builder/src/.crumb b/crates/site-builder/src/.crumb index 0a1dee8..04cf482 100644 --- a/crates/site-builder/src/.crumb +++ b/crates/site-builder/src/.crumb @@ -10,21 +10,21 @@ "generated": { "children": [ { - "digest": "bc95dd26aa86aaa2aa34550d5d69677efdbbe5e327c64724828f7e5935c6d5c7", - "last_commit": "a9c5dbbc", + "digest": "487afb45a690046e50d56995145e2371f84a5ae4985333fade1b0927efa58142", + "last_commit": "863c0fa", "name": "components", "purpose": "Reusable page content and navigation" } ], - "children_root": "sha256:c473ee517fe150ac3bed3066094ebcf40bb59fe4edaeb818ac7d1d31f6f5b8d1", - "compiled_at": "2026-10-31T02:19:00Z", + "children_root": "sha256:59e1703fcbb7ae7bed002fcd97204451b4442dd662d5beae82f34c5d86f112fb", + "compiled_at": "2026-10-31T09:45:58Z", "compiler": "crumb-compile/1", - "digest": "sha256:b4019d468ab42a24241f88ce37a48c8682a277ffe519d47c4b9f679501196c6a", + "digest": "sha256:3fa92e8f2cb8648a5d3611aa8470e1bbff9e8ca4f1766e51e1a329ec9ff041b9", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 54, - "generated_at_commit": "f06c7cbe930f23a91775b0bac491f74d71b78f5a", - "source_tree": "sha256:306acae62c6d6ffcd81c21476850d7b7bd4f0243346896debe4fc47aa5733ac9" + "files": 55, + "generated_at_commit": "863c0faa01ef9615fb77bb8f7d38ac43b1e9b143", + "source_tree": "sha256:8a3984b9ad8fcdd20678aa18fd705e9f70e14351b8340bff8cd9eddbaed260b8" } }, "invariants": [ diff --git a/crates/site-builder/src/components/.crumb b/crates/site-builder/src/components/.crumb index 94a700e..9f8c510 100644 --- a/crates/site-builder/src/components/.crumb +++ b/crates/site-builder/src/components/.crumb @@ -10,14 +10,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-30T21:57:22Z", + "compiled_at": "2026-10-31T09:45:58Z", "compiler": "crumb-compile/1", - "digest": "sha256:bc95dd26aa86aaa2aa34550d5d69677efdbbe5e327c64724828f7e5935c6d5c7", + "digest": "sha256:487afb45a690046e50d56995145e2371f84a5ae4985333fade1b0927efa58142", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 47, - "generated_at_commit": "06d824b1d063d7cfd2e8a40294f22880e8a7a77d", - "source_tree": "sha256:3d82c8c22a60bd5d68f538ad313f96c408da427b0aec108b69208f552a1b3417" + "files": 48, + "generated_at_commit": "863c0faa01ef9615fb77bb8f7d38ac43b1e9b143", + "source_tree": "sha256:6fd9a4182ed58b02820629ce0c760603ffbad3fcb727aff620ffbf8656d25da2" } }, "invariants": [ diff --git a/crates/site-builder/src/components/csp.rs b/crates/site-builder/src/components/csp.rs new file mode 100644 index 0000000..ff8755f --- /dev/null +++ b/crates/site-builder/src/components/csp.rs @@ -0,0 +1,370 @@ +//! Page-level Content-Security-Policy. GitHub Pages cannot set response +//! headers, so every emitted HTML page carries the policy as the first +//! element of its head: a `<meta http-equiv>` governs only what follows it. +//! +//! Scripts run from first-party files only. The single outside script host is +//! the consent-gated X pixel loaded by `/js/allen-intro.js`; its requests go +//! to the analytics hosts in `img-src` and `connect-src`. `style-src` keeps +//! `'unsafe-inline'` because every page carries `style` attributes (the +//! shared layout sets them on `#root` and `main`) and hand-written pages +//! carry `<style>` blocks; inline styles cannot run code. Additions are +//! page-scoped by what the page actually loads: +//! - `WASM_SCRIPTS` compile WebAssembly in the page, so their pages get +//! `'wasm-unsafe-eval'` (WebAssembly compilation only, never JavaScript +//! `eval`). +//! - `BLOB_WORKER_SCRIPTS` start a worker from a `blob:` URL, so their pages +//! get `worker-src blob:`; a blob worker inherits the page policy. +//! - Pages that embed YouTube videos may frame `www.youtube.com`. +//! +//! `verify` checks both lists against the scripts themselves, in both +//! directions, so a grant cannot go missing or outlive its need. +//! +//! A frame showing `srcdoc` inherits its parent's policy, so programs Aien +//! writes, which carry inline scripts, cannot run in one. They run in +//! `RUNNER_PATH`, the one document whose policy allows inline scripts: its +//! only script, `RUNNER_SCRIPT`, writes what the parent posts, and only while +//! the frame is sandboxed to an opaque origin. The edge-rendered +//! `/hive/board/` is not built here and keeps its own stricter header policy. + +use regex::Regex; +use std::collections::BTreeSet; +use std::fs; +use std::path::Path; +use std::sync::LazyLock; + +const X_HOSTS: &str = "https://analytics.twitter.com https://analytics.x.com https://t.co"; +const WASM_SCRIPTS: &[&str] = &["/js/hive.js", "/js/allen.js", "/js/allen-scene.js"]; +const BLOB_WORKER_SCRIPTS: &[&str] = &["/js/allen.js"]; +const YOUTUBE_EMBED: &str = "src=\"https://www.youtube.com/embed/"; +const META_OPEN: &str = "<meta http-equiv=\"Content-Security-Policy\" content=\""; + +/// The program runner, relative to dist, and its script. +pub const RUNNER_PATH: &str = "aien/run.html"; +pub const RUNNER_SCRIPT: &str = "/js/aien-run.js"; +/// The runner's policy. The program's own policy, which `sandboxed()` in the +/// Aien scripts writes into its head, narrows this further. +const RUNNER_POLICY: &str = "default-src 'none'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; \ + img-src 'self' data:; form-action 'none'; base-uri 'none'"; + +fn loads(html: &str, script: &str) -> bool { + html.contains(&format!("src=\"{script}\"")) +} + +/// The policy for one page, derived from what the page loads. +pub fn policy_for(html: &str) -> String { + if loads(html, RUNNER_SCRIPT) { + return RUNNER_POLICY.into(); + } + let wasm = if WASM_SCRIPTS.iter().any(|s| loads(html, s)) { " 'wasm-unsafe-eval'" } else { "" }; + let mut p = format!( + "default-src 'self'; script-src 'self' https://static.ads-twitter.com{wasm}; style-src 'self' 'unsafe-inline'; \ + img-src 'self' data: {X_HOSTS}; connect-src 'self' {X_HOSTS}; font-src 'self'; object-src 'none'; \ + base-uri 'self'; form-action 'self'" + ); + if BLOB_WORKER_SCRIPTS.iter().any(|s| loads(html, s)) { + p.push_str("; worker-src blob:"); + } + if html.contains(YOUTUBE_EMBED) { + p.push_str("; frame-src https://www.youtube.com"); + } + p +} + +/// End of the opening `<head ...>` tag, or after a leading `<meta charset>` +/// so the charset declaration stays first. +fn insertion_point(html: &str) -> Option<usize> { + let lower = html.to_ascii_lowercase(); + let head = lower.find("<head")?; + let mut at = head + lower[head..].find('>')? + 1; + let rest = &lower[at..]; + let lead = rest.len() - rest.trim_start().len(); + if rest.trim_start().starts_with("<meta charset") { + at += lead + rest[lead..].find('>')? + 1; + } + Some(at) +} + +/// Adds the policy to a finished page. Idempotent. +pub fn enrich(mut page: String) -> String { + if page.contains(META_OPEN) { + return page; + } + let at = insertion_point(&page).expect("csp: page has a head"); + let meta = format!("{META_OPEN}{}\">", policy_for(&page)); + page.insert_str(at, &meta); + page +} + +static HANDLER: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"(?i)<[a-z][a-z0-9-]*\b[^>]*?\son[a-z]+\s*="#).unwrap()); +static SCRIPT: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(?is)<script\b([^>]*)>(.*?)</script\s*>").unwrap()); +/// Comments, style blocks and script bodies: text a handler scan must skip. +static INERT: LazyLock<Regex> = + LazyLock::new(|| Regex::new(r"(?is)<!--.*?-->|<style\b.*?</style\s*>|<script\b[^>]*>.*?</script\s*>").unwrap()); +/// A `javascript:` URL where a URL starts: after `=` (attributes, and `url=` +/// in a refresh) or `(` (CSS `url(`), past optional quotes and the spaces +/// and controls a browser trims. Prose such as "needs JavaScript: it" is +/// not a URL. +static JS_URL: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"[=(]["'\x00-\x20]*javascript:"#).unwrap()); +static PAGE_SCRIPT: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"src="(/js/[A-Za-z0-9._-]+\.js)""#).unwrap()); +static COMPILES_WASM: LazyLock<Regex> = + LazyLock::new(|| Regex::new(r"WebAssembly\.(compile|compileStreaming|instantiate|instantiateStreaming|validate|Module)\b").unwrap()); + +/// Lowercased markup with character references decoded (`:`, `&tab;`, +/// `&newline;` and numeric ones, with or without `;`) and the tabs and line +/// breaks a URL parser drops removed, so `java	script:` reads as +/// `javascript:`. +fn url_text(markup: &str) -> String { + let lower = markup.to_ascii_lowercase(); + let mut out = String::with_capacity(lower.len()); + let mut rest = lower.as_str(); + while let Some(amp) = rest.find('&') { + out.push_str(&rest[..amp]); + rest = &rest[amp..]; + let (decoded, used) = reference(rest); + match decoded { + Some(c) => out.push(c), + None => out.push('&'), + } + rest = &rest[used..]; + } + out.push_str(rest); + out.retain(|c| !matches!(c, '\t' | '\n' | '\r')); + out +} + +/// One character reference at the start of `s` (which begins with `&`): +/// the character and the bytes consumed, or `None` and 1. +fn reference(s: &str) -> (Option<char>, usize) { + for (name, c) in [(":", ':'), ("&tab;", '\t'), ("&newline;", '\n'), ("(", '(')] { + if s.starts_with(name) { + return (Some(c), name.len()); + } + } + let Some(num) = s.strip_prefix("&#") else { return (None, 1) }; + let (hex, digits) = match num.strip_prefix('x') { + Some(h) => (true, h), + None => (false, num), + }; + let len = digits.bytes().take_while(|b| if hex { b.is_ascii_hexdigit() } else { b.is_ascii_digit() }).count(); + if len == 0 { + return (None, 1); + } + let value = u32::from_str_radix(&digits[..len], if hex { 16 } else { 10 }).ok().and_then(char::from_u32); + let mut used = 2 + usize::from(hex) + len; + if s[used..].starts_with(';') { + used += 1; + } + (Some(value.unwrap_or('\u{fffd}')), used) +} + +/// One page: exactly one policy, equal to `policy_for`, ahead of anything it +/// governs; no inline script other than JSON-LD data; no inline event +/// handler; no `javascript:` URL. The runner loads its script and nothing +/// else. +pub fn check_page(html: &str) -> Result<(), String> { + if html.matches(META_OPEN).count() != 1 { + return Err("needs exactly one Content-Security-Policy meta".into()); + } + let start = html.find(META_OPEN).unwrap(); + let body = &html[start + META_OPEN.len()..]; + let got = &body[..body.find('"').ok_or("unterminated policy")?]; + let want = policy_for(html); + if got != want { + return Err(format!("policy {got:?} differs from {want:?}")); + } + let lower = html.to_ascii_lowercase(); + let head = lower.find("<head").ok_or("no head")?; + if start < head || lower[..start].contains("<script") || lower[..start].contains("<link") || lower[..start].contains("<style") { + return Err("the policy must precede every script, link and style".into()); + } + for c in SCRIPT.captures_iter(html) { + let attrs = c[1].to_ascii_lowercase(); + let ld = attrs.contains("type=\"application/ld+json\""); + if !attrs.contains("src=") && !ld { + return Err(format!("inline script: {}", c[2].trim().chars().take(60).collect::<String>())); + } + if attrs.contains("src=") && !c[2].trim().is_empty() { + return Err("a script with src must have an empty body".into()); + } + } + if want == RUNNER_POLICY && (lower.matches("<script").count() != 1 || lower.contains("<iframe") || lower.contains("<object") || lower.contains("<embed")) { + return Err("the runner loads its own script and nothing else that runs".into()); + } + let markup = INERT.replace_all(html, ""); + if let Some(m) = HANDLER.find(&markup) { + return Err(format!("inline event handler: {}", m.as_str().chars().take(80).collect::<String>())); + } + if JS_URL.is_match(&url_text(&markup)) { + return Err("javascript: URL".into()); + } + Ok(()) +} + +/// What one first-party script needs beyond the base policy, read from the +/// script itself: (compiles WebAssembly, starts a blob: worker). +fn script_needs(js: &str) -> (bool, bool) { + (COMPILES_WASM.is_match(js), js.contains("new Worker(") && js.contains("URL.createObjectURL(")) +} + +/// Every HTML file in the build carries the policy and needs nothing it +/// forbids; only `RUNNER_PATH` loads the runner; the page-scoped grants match +/// what the scripts the pages load actually do. All failures are reported +/// together. +pub fn verify(dist: &Path) { + fn walk(dist: &Path, dir: &Path, n: &mut usize, bad: &mut Vec<String>, scripts: &mut BTreeSet<String>) { + for entry in fs::read_dir(dir).expect("read dist directory") { + let path = entry.expect("dist entry").path(); + if path.is_dir() { + walk(dist, &path, n, bad, scripts); + } else if path.extension().and_then(|e| e.to_str()) == Some("html") { + let html = fs::read_to_string(&path).expect("read page"); + if let Err(e) = check_page(&html) { + bad.push(format!("{}: {e}", path.display())); + } + let rel = path.strip_prefix(dist).expect("under dist").to_string_lossy().replace('\\', "/"); + if loads(&html, RUNNER_SCRIPT) != (rel == RUNNER_PATH) { + bad.push(format!("{}: only {RUNNER_PATH} loads {RUNNER_SCRIPT}, and it must", path.display())); + } + scripts.extend(PAGE_SCRIPT.captures_iter(&html).map(|c| c[1].to_string())); + *n += 1; + } + } + } + let (mut n, mut bad, mut scripts) = (0, Vec::new(), BTreeSet::new()); + walk(dist, dist, &mut n, &mut bad, &mut scripts); + assert!(n > 0, "csp: no HTML pages found under {}", dist.display()); + if !dist.join(RUNNER_PATH).is_file() { + bad.push(format!("{}: missing; Aien's programs run there", dist.join(RUNNER_PATH).display())); + } + for script in &scripts { + let file = dist.join(&script[1..]); + let Ok(js) = fs::read_to_string(&file) else { + bad.push(format!("{}: a page loads it, but it is not in the build", file.display())); + continue; + }; + let (wasm, blob_worker) = script_needs(&js); + if wasm != WASM_SCRIPTS.contains(&script.as_str()) { + bad.push(format!("{script}: compiles WebAssembly is {wasm}, but WASM_SCRIPTS says otherwise")); + } + if blob_worker != BLOB_WORKER_SCRIPTS.contains(&script.as_str()) { + bad.push(format!("{script}: starts a blob: worker is {blob_worker}, but BLOB_WORKER_SCRIPTS says otherwise")); + } + } + for listed in WASM_SCRIPTS.iter().chain(BLOB_WORKER_SCRIPTS) { + if !scripts.contains(*listed) { + bad.push(format!("{listed}: granted a policy addition, but no page loads it")); + } + } + bad.sort(); + bad.dedup(); + assert!(bad.is_empty(), "csp: {} problems in {n} pages:\n{}", bad.len(), bad.join("\n")); + println!(" Content-Security-Policy meta: {n} pages, {} first-party scripts checked", scripts.len()); +} + +#[cfg(test)] +mod tests { + use super::*; + + const PAGE: &str = "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title>t</title><link rel=\"stylesheet\" href=\"/a.css\"><script defer src=\"/js/allen-intro.js\"></script><script type=\"application/ld+json\">{\"a\":1}</script></head><body><p style=\"color:red\">x</p></body></html>"; + const RUNNER: &str = "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title>r</title><link rel=\"stylesheet\" href=\"/a.css\"><script src=\"/js/aien-run.js\"></script></head><body><p>x</p></body></html>"; + + #[test] + fn enriched_page_passes_and_keeps_charset_first() { + let page = enrich(PAGE.to_string()); + check_page(&page).unwrap(); + assert!(page.contains("<head><meta charset=\"utf-8\"><meta http-equiv=\"Content-Security-Policy\"")); + assert_eq!(enrich(page.clone()), page, "enrich is idempotent"); + let p = policy_for(&page); + for d in [ + "default-src 'self'", + "script-src 'self' https://static.ads-twitter.com;", + "object-src 'none'", + "base-uri 'self'", + "form-action 'self'", + "img-src 'self' data: https://analytics.twitter.com https://analytics.x.com https://t.co", + "connect-src 'self' https://analytics.twitter.com https://analytics.x.com https://t.co", + ] { + assert!(p.contains(d), "policy lacks {d}"); + } + assert!(!p.contains("frame-src") && !p.contains("wasm") && !p.contains("worker-src"), "no page-scoped additions on a plain page"); + let script_src = p.split(';').find(|d| d.trim_start().starts_with("script-src")).unwrap(); + assert!(!script_src.contains("unsafe"), "scripts never get unsafe-inline or unsafe-eval"); + } + + #[test] + fn additions_follow_what_the_page_loads() { + let hive = enrich(PAGE.replace("</head>", "<script defer src=\"/js/hive.js\"></script></head>")); + assert!(policy_for(&hive).contains("script-src 'self' https://static.ads-twitter.com 'wasm-unsafe-eval';")); + assert!(!policy_for(&hive).contains("worker-src")); + let aien = enrich(PAGE.replace("</head>", "<script defer src=\"/js/allen.js\"></script></head>")); + assert!(policy_for(&aien).contains("'wasm-unsafe-eval';")); + assert!(policy_for(&aien).ends_with("; worker-src blob:")); + let tube = enrich(PAGE.replace("</body>", "<iframe src=\"https://www.youtube.com/embed/x\"></iframe></body>")); + assert!(policy_for(&tube).ends_with("; frame-src https://www.youtube.com")); + for page in [&hive, &aien, &tube] { + check_page(page).unwrap(); + let script_src = policy_for(page); + let script_src = script_src.split(';').find(|d| d.trim_start().starts_with("script-src")).unwrap(); + assert!(script_src.split_whitespace().all(|t| t != "'unsafe-inline'" && t != "'unsafe-eval'"), "no page script gets inline or eval"); + } + } + + #[test] + fn the_runner_alone_allows_inline_scripts() { + let runner = enrich(RUNNER.to_string()); + check_page(&runner).unwrap(); + assert_eq!(policy_for(&runner), RUNNER_POLICY); + for d in ["default-src 'none'", "form-action 'none'", "base-uri 'none'"] { + assert!(RUNNER_POLICY.contains(d), "runner policy lacks {d}"); + } + for bad in [ + runner.replace("</head>", "<script src=\"/js/allen-intro.js\"></script></head>"), + runner.replace("</body>", "<iframe src=\"/x/\"></iframe></body>"), + runner.replace("</body>", "<script>x()</script></body>"), + ] { + assert!(check_page(&bad).is_err(), "the runner must load nothing else: {bad}"); + } + } + + #[test] + fn script_needs_read_the_script() { + assert_eq!(script_needs("WebAssembly.instantiate(bytes)"), (true, false)); + assert_eq!(script_needs("const w = new Worker(URL.createObjectURL(blob));"), (false, true)); + assert_eq!(script_needs("new Worker('/js/lab-worker.js')"), (false, false)); + assert_eq!(script_needs("WebAssembly.RuntimeError"), (false, false)); + } + + #[test] + fn negative_controls_are_refused() { + let good = enrich(PAGE.to_string()); + let bad = [ + ("no meta", PAGE.to_string()), + ("two metas", good.replacen("<title>", &format!("{META_OPEN}x\"><title>"), 1)), + ("wrong policy", good.replace("object-src 'none'", "object-src *")), + ("runner policy on a page", good.replace(&policy_for(&good), RUNNER_POLICY)), + ("inline script", good.replace("</body>", "<script>alert(1)</script></body>")), + ("inline module", good.replace("</body>", "<script type=\"module\">x()</script></body>")), + ("src with body", good.replace("allen-intro.js\"></script>", "allen-intro.js\">x()</script>")), + ("inline handler", good.replace("<p style", "<p onclick=\"x()\" style")), + ("upper handler", good.replace("<p style", "<P ONLOAD='x()' style")), + ("javascript url", good.replace("</body>", "<a href=\"javascript:x()\">a</a></body>")), + ("unquoted javascript url", good.replace("</body>", "<a href=JavaScript:x()>a</a></body>")), + ("spaced javascript url", good.replace("</body>", "<a href=\" \tjavascript:x()\">a</a></body>")), + ("tab in javascript url", good.replace("</body>", "<a href=\"java	script:x()\">a</a></body>")), + ("named colon", good.replace("</body>", "<a href=\"javascript:x()\">a</a></body>")), + ("decimal colon", good.replace("</body>", "<a href=\"javascript:x()\">a</a></body>")), + ("refresh to javascript", good.replace("</head>", "<meta http-equiv=\"refresh\" content=\"0; url=javascript:x()\"></head>")), + ("css javascript url", good.replace("<p style=\"color:red\"", "<p style=\"background:url(javascript:x())\"")), + ("meta after script", PAGE.replace("<title>", "<script src=\"/x.js\"></script><title>").replace("<title>", &format!("{META_OPEN}{}\"><title>", policy_for(PAGE)))), + ]; + for (what, page) in bad { + assert!(check_page(&page).is_err(), "must refuse: {what}"); + } + // JSON-LD and text that merely mentions handlers or JavaScript stay allowed. + let fine = good.replace( + "</body>", + "<p>use onclick= in text</p><noscript><p>Aien needs JavaScript: he lives in the page.</p></noscript><script type=\"application/ld+json\">{\"onload\":\"x\"}</script></body>", + ); + check_page(&fine).unwrap(); + } +} diff --git a/crates/site-builder/src/components/mod.rs b/crates/site-builder/src/components/mod.rs index 93a5e91..2b5dfbb 100644 --- a/crates/site-builder/src/components/mod.rs +++ b/crates/site-builder/src/components/mod.rs @@ -44,3 +44,4 @@ pub mod agora_protocol; pub mod agora_network; pub mod agents_hello; pub mod agents_knowledge; +pub mod csp; diff --git a/crates/site-builder/src/layouts/base.rs b/crates/site-builder/src/layouts/base.rs index 4b0507e..2fb4b52 100644 --- a/crates/site-builder/src/layouts/base.rs +++ b/crates/site-builder/src/layouts/base.rs @@ -1,4 +1,4 @@ -use maud::{html, Markup, PreEscaped, DOCTYPE}; +use maud::{html, Markup, DOCTYPE}; pub fn render_base_layout(content: Markup) -> Markup { render_page_layout( @@ -10,11 +10,6 @@ pub fn render_base_layout(content: Markup) -> Markup { // Zero-dependency terminal micro-script script defer src="/js/terminal.js" {} script defer src="/js/turing-game.js" {} - (PreEscaped(r#"<script> - document.addEventListener('DOMContentLoaded', () => { - console.log('[AienOS] Pure Rust Maud engine online. Zero hydration overhead.'); - }); - </script>"#)) }, content, ) diff --git a/crates/site-builder/src/main.rs b/crates/site-builder/src/main.rs index a7b6175..7e94c04 100644 --- a/crates/site-builder/src/main.rs +++ b/crates/site-builder/src/main.rs @@ -11,7 +11,7 @@ use std::path::{Path, PathBuf}; use std::time::Instant; use layouts::base::{render_base_layout, render_page_layout}; -use maud::html; +use maud::{html, DOCTYPE}; fn copy_dir_all(src: &Path, dst: &Path) -> std::io::Result<()> { if !src.exists() { @@ -271,7 +271,40 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { ); fs::create_dir_all(dist.join("aien")).expect("Create Aien directory"); fs::write(dist.join("aien/index.html"), allen_page.into_string()).expect("Write Aien page"); - // Old addresses (seo::REDIRECTS) forward visitors, with any ?query and #hash, to the new one. + // Programs Aien writes run in this document, never in a srcdoc frame, which + // would inherit the page policy (components::csp). A direct visitor sees + // the shared header and footer and a pointer back to /aien/. + let run_page = html! { + (DOCTYPE) + html lang="en" { + head { + meta charset="utf-8"; + meta name="viewport" content="width=device-width, initial-scale=1"; + title { "Program runner | AienOS" } + meta name="description" content="Runs a program Aien wrote, sandboxed, inside the Aien page."; + meta name="robots" content="noindex"; + link rel="icon" type="image/svg+xml" href="/favicon.svg"; + link rel="stylesheet" href="/assets/style.css"; + link rel="stylesheet" href="/assets/site-nav.css"; + link rel="stylesheet" href="/assets/turing-look.css"; + script src=(components::csp::RUNNER_SCRIPT) {} + } + body { + div id="root" style="min-height: 100vh; display: flex; flex-direction: column;" { + (components::navbar::render_navbar()) + main id="main-content" style="flex: 1;" { + section class="container" { + p { "This document runs programs Aien writes, inside a sandboxed frame on " a href="/aien/" { "aienos.com/aien/" } "." } + } + } + (components::footer::render_footer()) + } + } + } + }; + fs::write(dist.join(components::csp::RUNNER_PATH), components::csp::enrich(run_page.into_string())).expect("Write the program runner"); + // Old addresses (seo::REDIRECTS) forward visitors, with any ?query and #hash, + // to the new one; /js/redirect.js reads the target from data-to. for (old, new) in seo::REDIRECTS { let page = render_page_layout( &format!("Moved to {new} | AienOS"), @@ -281,7 +314,7 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { html! { meta name="robots" content="noindex"; meta http-equiv="refresh" content=(format!("0; url={new}")); - script { (maud::PreEscaped(format!("location.replace('{new}' + location.search + location.hash);"))) } + script src="/js/redirect.js" data-to=(new) {} }, html! { section class="container" { @@ -291,7 +324,7 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { ); let dir = dist.join(old.trim_matches('/')); fs::create_dir_all(&dir).expect("Create redirect directory"); - fs::write(dir.join("index.html"), page.into_string()).expect("Write redirect page"); + fs::write(dir.join("index.html"), components::csp::enrich(page.into_string())).expect("Write redirect page"); } let alpha_page = render_page_layout( components::alpha::TITLE, @@ -561,7 +594,7 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { seo::head_404(), seo::render_404(), ); - fs::write(dist.join("404.html"), components::allen_intro::enrich(components::support::enrich(not_found.into_string()))).expect("Failed to write 404.html"); + fs::write(dist.join("404.html"), components::csp::enrich(components::allen_intro::enrich(components::support::enrich(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 @@ -892,6 +925,8 @@ fn verify_site(dist: &Path) { components::names::verify_canonical_names(dist); // Every page shows the X contact button in its header and the contact line in its footer. components::contact::verify(dist); + // Every page carries its Content-Security-Policy and needs no inline script. + components::csp::verify(dist); println!("------------------------------------------------------------"); println!(" Verified index.html ({} bytes)", content.len()); diff --git a/crates/site-builder/src/seo.rs b/crates/site-builder/src/seo.rs index d283883..b1d61e7 100644 --- a/crates/site-builder/src/seo.rs +++ b/crates/site-builder/src/seo.rs @@ -799,6 +799,8 @@ pub fn enrich(dist: &Path, ctx: &BuildCtx) -> Vec<Emitted> { out.push_str(&html[head_end..]); let zh = page.is_zh(); let out = crate::components::allen_intro::enrich(crate::components::support::enrich(crate::components::contact::enrich(crate::components::navbar::fold_legacy(ensure_glossary_link(out), zh), zh))); + // Last: the policy is derived from everything the page now loads. + let out = crate::components::csp::enrich(out); write_markdown_mirror(dist, page, &facts, &out); fs::write(&page.file, out).unwrap_or_else(|e| panic!("write {}: {e}", page.file.display())); } @@ -1206,9 +1208,11 @@ fn verify_consent_boundary(dist: &Path) { } else if path.extension().and_then(|e| e.to_str()) == Some("html") { let html = fs::read_to_string(&path).expect("read consent boundary HTML"); check_script_boundary(&html).unwrap_or_else(|e| panic!("{}: {e}", path.display())); - // A redirect stub leaves at once: it loads no consent dialog and no pixel. + // A redirect stub leaves at once, and the program runner is replaced by + // what it runs in an opaque origin: neither loads a consent dialog or a pixel. let rel = path.strip_prefix(dist).expect("under dist").to_string_lossy().replace('\\', "/"); - let consent = if REDIRECTS.iter().any(|(old, _)| format!("{}index.html", &old[1..]) == rel) { 0 } else { 1 }; + let frame_only = rel == crate::components::csp::RUNNER_PATH; + let consent = if frame_only || REDIRECTS.iter().any(|(old, _)| format!("{}index.html", &old[1..]) == rel) { 0 } else { 1 }; assert_eq!(html.matches("src=\"/js/allen-intro.js\"").count(), consent, "{} must have exactly {consent} first-party consent loader", path.display()); assert_eq!(html.matches("id=\"aien-allen-intro\"").count(), consent, "{} must have exactly {consent} consent dialog", path.display()); assert!(consent == 0 || html.contains("href=\"/privacy/\""), "{} must link privacy", path.display()); diff --git a/om/allen-page/allen-js.om b/om/allen-page/allen-js.om index e15be59..7ac8194 100644 --- a/om/allen-page/allen-js.om +++ b/om/allen-page/allen-js.om @@ -132,7 +132,7 @@ note JavaScript sandboxed text js42 " /* The policy becomes the first element of the program's head: after an\n existing head tag that only whitespace, a doctype, comments and an html\n tag precede, else in a head of its own placed after any doctype and html\n tag. A linear scan (no backtracking regex): each comment ends at its\n first -->, as the HTML parser ends it. */\n function sandboxed(source) {\n const meta = `<meta http-equiv=\"Content-Security-Policy\" content=\"${CSP}\">`;\n const lower = source.toLowerCase();\n let at = 0;\n const space = () => {\n while (at < source.length && /\\s/.test(source[at])) at += 1;\n };\n const tag = name => {\n const open = `<${name}`;\n if (!lower.startsWith(open, at)) return false;\n const next = source[at + open.length];\n if (next !== '>' && !(next && /\\s/.test(next))) return false;\n const close = source.indexOf('>', at + open.length);\n if (close < 0) return false;\n at = close + 1;\n return true;\n };\n const doctype = () => {\n if (!lower.startsWith('<!doctype', at)) return false;\n const close = source.indexOf('>', at + 9);\n if (close < 0) return false;\n at = close + 1;\n return true;\n };\n const comments = () => {\n for (;;) {\n space();\n if (!lower.startsWith('<!--', at)) return;\n const close = source.indexOf('-->', at + 4);\n if (close < 0) return;\n at = close + 3;\n }\n };\n space();\n if (doctype()) space();\n const lead = (() => {\n const mark = at;\n const html = tag('html');\n const end = at;\n at = mark;\n return html ? end : mark;\n })();\n comments();\n if (tag('html')) comments();\n if (tag('head')) return source.slice(0, at) + meta + source.slice(at);\n return `${source.slice(0, lead)}<head>${meta}</head>${source.slice(lead)}`;\n }\n" note JavaScript runHtml -text js43 " function runHtml(source, out) {\n const frame = document.createElement('iframe');\n frame.setAttribute('sandbox', SANDBOX);\n frame.setAttribute('referrerpolicy', 'no-referrer');\n frame.setAttribute('title', 'Program written by Aien, sandboxed');\n frame.className = 'allen-frame';\n frame.srcdoc = sandboxed(source);\n const box = el('div', 'allen-frame-box');\n box.append(frame);\n out.replaceChildren(box, el('p', 'allen-note', 'Sandboxed: its scripts run with no access to this page or your cookies, and its content security policy blocks network loads. Drag the corner to resize.'));\n }\n" +text js43 " /* The page policy forbids inline scripts, and a srcdoc frame would inherit\n it, so the program runs in /aien/run.html, the one document whose policy\n allows them. That document writes only what its parent posts, and only\n while sandboxed to an opaque origin. */\n function runHtml(source, out) {\n const frame = document.createElement('iframe');\n frame.setAttribute('sandbox', SANDBOX);\n frame.setAttribute('referrerpolicy', 'no-referrer');\n frame.setAttribute('title', 'Program written by Aien, sandboxed');\n frame.className = 'allen-frame';\n frame.addEventListener('load', () => frame.contentWindow.postMessage(sandboxed(source), '*'), { once: true });\n frame.src = '/aien/run.html';\n const box = el('div', 'allen-frame-box');\n box.append(frame);\n out.replaceChildren(box, el('p', 'allen-note', 'Sandboxed: its scripts run with no access to this page or your cookies, and its content security policy blocks network loads. Drag the corner to resize.'));\n }\n" note JavaScript retryAfter text js44 " function retryAfter(response, body) {\n const value = Number(body && body.retry_after !== undefined ? body.retry_after : response.headers.get('Retry-After'));\n return Number.isFinite(value) && value > 0 ? Math.ceil(value) : 0;\n }\n" diff --git a/om/allen-page/allen.js.sha256 b/om/allen-page/allen.js.sha256 index 7c0f7d7..0538b40 100644 --- a/om/allen-page/allen.js.sha256 +++ b/om/allen-page/allen.js.sha256 @@ -1 +1 @@ -985ec9f6ca6286a0a9c0af4a5bcd979e24fcc9b7b31f88102631d67ff1d569da ../../public/js/allen.js +a1174e5ce918f49237eedaa5b581e1e0e31123a3f16607654687f54058d24af2 ../../public/js/allen.js diff --git a/om/allen-panes/allen-panes.js.sha256 b/om/allen-panes/allen-panes.js.sha256 index a867a71..3920555 100644 --- a/om/allen-panes/allen-panes.js.sha256 +++ b/om/allen-panes/allen-panes.js.sha256 @@ -1 +1 @@ -0df902e426e99496d55623ba233bc440dacafcbaca86f15870e2a21826d27494 ../../public/js/allen-panes.js +d9807d71bac136d162a1633a406a162df02226520a1fe4d01ff9f94e580c59d7 ../../public/js/allen-panes.js diff --git a/om/allen-panes/panes.om b/om/allen-panes/panes.om index be74a2a..b10bb7c 100644 --- a/om/allen-panes/panes.om +++ b/om/allen-panes/panes.om @@ -219,7 +219,7 @@ note JavaScript mount text js7 " function mount(host, options) {\n if (!(host instanceof Element)) throw new TypeError('AllenPanes.mount needs an element');\n const opts = options && typeof options === 'object' ? options : {};\n const panes = new Map();\n const closedIds = new Set();\n const closed = [];\n let order = [];\n let cascade = 0;\n let current = null;\n let alive = true;\n let fitting = 0;\n const root = el('div', 'allen-panes');\n const layer = el('div', 'allen-panes-layer');\n const dock = el('nav', 'allen-panes-dock');\n dock.setAttribute('aria-label', 'Aien panes');\n const chips = el('ul', 'allen-panes-chips');\n const projectsButton = button('allen-panes-tool', 'Projects: save, open, export or import panes', 'Projects', () => projectsPane());\n const exportButton = button('allen-panes-tool', 'Export the open panes as a JSON file', 'Export', () => exportOpen());\n const reopenButton = button('allen-panes-tool', '', 'Reopen', () => reopen());\n reopenButton.hidden = true;\n dock.append(chips, projectsButton, exportButton, reopenButton);\n const live = el('p', 'allen-panes-live');\n live.setAttribute('role', 'status');\n live.setAttribute('aria-live', 'polite');\n root.append(layer, dock, live);\n host.append(root);\n const media = typeof window.matchMedia === 'function' ? window.matchMedia(SHEET) : null;\n\n function say(message) {\n live.textContent = '';\n setTimeout(() => {\n if (alive) live.textContent = message;\n }, 60);\n if (typeof opts.announce === 'function') {\n try {\n opts.announce(message);\n } catch (_) {}\n }\n }\n function refuse(name, reason) {\n if (typeof opts.onRefuse === 'function') {\n try {\n opts.onRefuse(name, reason);\n } catch (_) {}\n }\n return { ok: false, reason };\n }\n function sheet() {\n return root.dataset.layout === 'sheet';\n }\n function layout() {\n root.dataset.layout = media && media.matches ? 'sheet' : 'float';\n refit();\n }\n function bounds() {\n return { w: Math.max(root.clientWidth, MIN_W), h: Math.max(root.clientHeight, MIN_H) };\n }\n function place(rec, x, y, w, h) {\n const b = bounds();\n const nw = Math.round(Math.min(Math.max(w, MIN_W), b.w));\n const nh = Math.round(Math.min(Math.max(h, MIN_H), b.h));\n const nx = Math.round(Math.min(Math.max(x, 0), b.w - nw));\n const ny = Math.round(Math.min(Math.max(y, 0), b.h - nh));\n rec.geom = { x: nx, y: ny, w: nw, h: nh };\n rec.el.style.transform = `translate(${nx}px, ${ny}px)`;\n rec.el.style.width = `${nw}px`;\n rec.el.style.height = `${nh}px`;\n }\n function refit() {\n for (const rec of panes.values()) place(rec, rec.geom.x, rec.geom.y, rec.geom.w, rec.geom.h);\n }\n function onResize() {\n if (!fitting) fitting = requestAnimationFrame(() => {\n fitting = 0;\n if (alive) refit();\n });\n }\n function initial(rec) {\n const b = bounds();\n const w = Math.min(560, b.w - 32);\n const h = Math.min(460, b.h - 160);\n const step = (cascade % 6) * 28;\n cascade += 1;\n place(rec, b.w - w - 32 - step, 76 + step, w, h);\n }\n function topmost() {\n for (let i = order.length - 1; i >= 0; i--) if (!order[i].minimized) return order[i];\n return null;\n }\n function chipState(rec) {\n rec.chipTitle.textContent = rec.title;\n rec.chip.setAttribute('aria-label', `${rec.title}, ${NAMES[rec.kind]} pane, ${rec.minimized ? 'minimized' : 'open'}`);\n rec.chip.dataset.state = rec.minimized ? 'minimized' : 'open';\n }\n function stack() {\n const top = topmost();\n order.forEach((rec, i) => {\n rec.el.style.zIndex = String(i + 1);\n rec.el.toggleAttribute('data-top', rec === top);\n rec.chip.toggleAttribute('data-top', rec === top);\n });\n dock.dataset.empty = panes.size ? 'no' : 'yes';\n }\n function raise(rec) {\n if (order[order.length - 1] !== rec) {\n order = order.filter(r => r !== rec);\n order.push(rec);\n }\n stack();\n }\n function owner(node) {\n for (const rec of panes.values()) if (rec.el.contains(node)) return rec;\n return null;\n }\n function label(rec) {\n rec.heading.textContent = rec.title;\n rec.move.setAttribute('aria-label', `Move ${rec.title}. Drag, or use the arrow keys; Shift moves farther.`);\n rec.size.setAttribute('aria-label', `Resize ${rec.title}. Drag, or use the arrow keys; Shift resizes farther.`);\n rec.min.setAttribute('aria-label', `Minimize ${rec.title}`);\n rec.max.setAttribute('aria-label', `Maximize ${rec.title}`);\n rec.max.setAttribute('aria-pressed', String(rec.maximized));\n rec.shut.setAttribute('aria-label', `Close ${rec.title}`);\n rec.grab.setAttribute('aria-label', `Minimize ${rec.title}. On a touch screen, swipe the top of the sheet down to minimize, or sideways for the next pane.`);\n chipState(rec);\n }\n function create(key, kind, title) {\n const rec = { id: key, kind, title: clean(title, MAX_TITLE) || NAMES[kind], revision: 0, content: null, provenance: null, geom: null, minimized: false, maximized: false, svg: null, app: null, projects: null };\n const pane = el('section', 'allen-pane');\n pane.dataset.kind = kind;\n pane.tabIndex = -1;\n pane.setAttribute('role', 'region');\n pane.setAttribute('aria-roledescription', 'pane');\n const head = el('header', 'allen-pane-head');\n const heading = el('h2', 'allen-pane-title');\n heading.id = uid('allen-pane-title');\n pane.setAttribute('aria-labelledby', heading.id);\n const move = button('allen-pane-move', '', '', null);\n const badge = el('span', 'allen-pane-badge');\n badge.hidden = true;\n const controls = el('div', 'allen-pane-controls');\n const min = button('allen-pane-ctl allen-pane-min', '', '\\u2212', () => minimize(rec));\n const max = button('allen-pane-ctl allen-pane-max', '', '\\u25a1', () => maximize(rec));\n const shut = button('allen-pane-ctl allen-pane-close', '', '\\u00d7', () => close(rec, true));\n controls.append(min, max, shut);\n head.append(move, el('span', 'allen-pane-kind', NAMES[kind]), heading, badge, controls);\n const notice = el('p', 'allen-pane-notice');\n notice.setAttribute('role', 'alert');\n notice.hidden = true;\n const body = el('div', 'allen-pane-body');\n body.tabIndex = 0;\n const source = el('details', 'allen-pane-source');\n source.hidden = true;\n const foot = el('div', 'allen-pane-foot');\n foot.hidden = true;\n const size = button('allen-pane-size', '', '', null);\n const grab = button('allen-pane-grab', '', '', () => minimize(rec));\n pane.append(grab, head, notice, body, source, foot, size);\n const item = el('li', 'allen-panes-item');\n const chip = button('allen-panes-chip', '', '', () => chipClick(rec));\n const chipTitle = el('span', 'allen-panes-chip-title');\n chip.append(el('span', 'allen-panes-chip-kind', NAMES[kind]), chipTitle);\n item.append(chip);\n Object.assign(rec, { el: pane, heading, badge, notice, body, source, foot, move, size, grab, min, max, shut, item, chip, chipTitle, swallow: 0 });\n label(rec);\n pane.addEventListener('pointerdown', () => raise(rec), true);\n pane.addEventListener('focusin', () => raise(rec));\n drag(rec, head, 'move');\n swipe(rec, head);\n swipe(rec, grab);\n pane.addEventListener('click', event => {\n if (event.timeStamp > rec.swallow) return;\n rec.swallow = 0;\n event.preventDefault();\n event.stopPropagation();\n }, true);\n drag(rec, size, 'size');\n keyed(rec, move, 'move');\n keyed(rec, size, 'size');\n layer.append(pane);\n chips.append(item);\n panes.set(key, rec);\n order.push(rec);\n initial(rec);\n stack();\n return rec;\n }\n /* Bottom sheet gestures, only on the grab strip and the title bar, so the\n content keeps its own scrolling, selection and editing. Down past a\n quarter of the sheet (or a quick flick) minimizes; sideways shows the\n neighbouring pane. A swipe never reaches the button it started on. */\n function swipe(rec, zone) {\n zone.addEventListener('pointerdown', event => {\n if (!sheet() || !event.isPrimary || event.button !== 0) return;\n const start = { x: event.clientX, y: event.clientY, t: event.timeStamp };\n const height = Math.max(1, rec.el.getBoundingClientRect().height);\n let mode = '';\n let last = event;\n let frame = 0;\n const paint = () => {\n frame = 0;\n if (!alive || !mode) return;\n const dx = last.clientX - start.x;\n const dy = last.clientY - start.y;\n rec.el.style.setProperty('--allen-pane-swipe-x', mode === 'side' ? `${Math.round(dx / 2)}px` : '0px');\n rec.el.style.setProperty('--allen-pane-swipe-y', mode === 'down' ? `${Math.round(Math.max(0, dy))}px` : '0px');\n };\n const settle = () => {\n rec.el.classList.remove('is-swiping');\n rec.el.style.removeProperty('--allen-pane-swipe-x');\n rec.el.style.removeProperty('--allen-pane-swipe-y');\n };\n const onMove = e => {\n if (e.pointerId !== event.pointerId) return;\n last = e;\n const dx = e.clientX - start.x;\n const dy = e.clientY - start.y;\n if (!mode) {\n if (Math.abs(dx) < 10 && Math.abs(dy) < 10) return;\n mode = Math.abs(dy) >= Math.abs(dx) ? (dy > 0 ? 'down' : 'up') : 'side';\n try {\n zone.setPointerCapture(e.pointerId);\n } catch (_) {}\n rec.el.classList.add('is-swiping');\n }\n if (mode !== 'up' && !frame) frame = requestAnimationFrame(paint);\n };\n const onEnd = e => {\n if (e.pointerId !== event.pointerId) return;\n zone.removeEventListener('pointermove', onMove);\n zone.removeEventListener('pointerup', onEnd);\n zone.removeEventListener('pointercancel', onEnd);\n if (frame) cancelAnimationFrame(frame);\n frame = 0;\n settle();\n if (!mode) return;\n rec.swallow = e.timeStamp + 500;\n if (e.type === 'pointercancel' || !alive) return;\n const dx = e.clientX - start.x;\n const dy = e.clientY - start.y;\n const speed = Math.max(Math.abs(dx), Math.abs(dy)) / Math.max(1, e.timeStamp - start.t);\n if (mode === 'down' && (dy > height / 4 || (dy > 24 && speed > 0.6))) minimize(rec);\n else if (mode === 'side' && (Math.abs(dx) > 72 || (Math.abs(dx) > 24 && speed > 0.6))) neighbour(rec, dx < 0 ? 1 : -1);\n };\n zone.addEventListener('pointermove', onMove);\n zone.addEventListener('pointerup', onEnd);\n zone.addEventListener('pointercancel', onEnd);\n });\n }\n function neighbour(rec, dir) {\n const all = [...panes.values()];\n if (all.length < 2) return;\n const next = all[(all.indexOf(rec) + dir + all.length) % all.length];\n const had = rec.el.contains(document.activeElement);\n restore(next, had);\n say(`${next.title}, pane ${all.indexOf(next) + 1} of ${all.length}.`);\n }\n function drag(rec, handle, mode) {\n handle.addEventListener('pointerdown', event => {\n if (event.button !== 0 || sheet() || rec.maximized) return;\n const hit = event.target.closest('button');\n if (mode === 'move' && hit && hit !== rec.move) return;\n event.preventDefault();\n raise(rec);\n const start = { x: event.clientX, y: event.clientY, g: { ...rec.geom } };\n let frame = 0;\n let last = null;\n try {\n handle.setPointerCapture(event.pointerId);\n } catch (_) {}\n rec.el.classList.add(mode === 'move' ? 'is-moving' : 'is-sizing');\n const apply = () => {\n frame = 0;\n if (!last || !alive) return;\n const dx = last.clientX - start.x;\n const dy = last.clientY - start.y;\n if (mode === 'move') place(rec, start.g.x + dx, start.g.y + dy, start.g.w, start.g.h);\n else place(rec, start.g.x, start.g.y, start.g.w + dx, start.g.h + dy);\n };\n const onMove = e => {\n if (e.pointerId !== event.pointerId) return;\n last = e;\n if (!frame) frame = requestAnimationFrame(apply);\n };\n const onUp = e => {\n if (e.pointerId !== event.pointerId) return;\n handle.removeEventListener('pointermove', onMove);\n handle.removeEventListener('pointerup', onUp);\n handle.removeEventListener('pointercancel', onUp);\n if (frame) cancelAnimationFrame(frame);\n apply();\n rec.el.classList.remove('is-moving', 'is-sizing');\n };\n handle.addEventListener('pointermove', onMove);\n handle.addEventListener('pointerup', onUp);\n handle.addEventListener('pointercancel', onUp);\n });\n }\n function keyed(rec, handle, mode) {\n handle.addEventListener('keydown', event => {\n const d = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] }[event.key];\n if (!d || event.altKey || event.ctrlKey || event.metaKey || sheet() || rec.maximized) return;\n event.preventDefault();\n const s = event.shiftKey ? BIG_STEP : STEP;\n const g = rec.geom;\n if (mode === 'move') place(rec, g.x + d[0] * s, g.y + d[1] * s, g.w, g.h);\n else place(rec, g.x, g.y, g.w + d[0] * s, g.h + d[1] * s);\n });\n handle.addEventListener('keyup', event => {\n if (!event.key.startsWith('Arrow') || sheet() || rec.maximized) return;\n const g = rec.geom;\n say(mode === 'move' ? `${rec.title} at ${g.x}, ${g.y}.` : `${rec.title} is ${g.w} by ${g.h}.`);\n });\n }\n function minimize(rec) {\n if (rec.minimized) return;\n const had = rec.el.contains(document.activeElement);\n rec.minimized = true;\n rec.el.hidden = true;\n chipState(rec);\n stack();\n if (had) rec.chip.focus();\n say(`${rec.title} minimized; it stays in the pane list.`);\n }\n function restore(rec, focus) {\n if (rec.minimized) {\n rec.minimized = false;\n rec.el.hidden = false;\n chipState(rec);\n }\n raise(rec);\n if (focus) rec.el.focus({ preventScroll: true });\n }\n function maximize(rec) {\n rec.maximized = !rec.maximized;\n rec.el.classList.toggle('is-max', rec.maximized);\n label(rec);\n raise(rec);\n }\n function chipClick(rec) {\n if (rec.minimized) restore(rec, true);\n else if (topmost() === rec) minimize(rec);\n else restore(rec, true);\n }\n function dataPane(rec) {\n return KINDS.includes(rec.kind) && rec.revision > 0;\n }\n function entry(rec) {\n return { id: rec.id, kind: rec.kind, title: rec.title, revision: rec.revision, content: copy(rec.content), provenance: copy(rec.provenance), geom: { ...rec.geom }, minimized: rec.minimized };\n }\n function reopenState() {\n const last = closed[closed.length - 1];\n reopenButton.hidden = !last;\n if (last) reopenButton.setAttribute('aria-label', `Reopen ${last.title}`);\n }\n function close(rec, byPerson, quiet) {\n if (panes.get(rec.id) !== rec) return;\n const had = rec.el.contains(document.activeElement);\n stopApp(rec);\n rec.el.remove();\n rec.item.remove();\n panes.delete(rec.id);\n order = order.filter(r => r !== rec);\n const kept = dataPane(rec);\n if (kept) {\n closed.push(entry(rec));\n while (closed.length > MAX_CLOSED) closed.shift();\n }\n reopenState();\n stack();\n if (had) {\n const next = topmost();\n if (next) next.el.focus({ preventScroll: true });\n else if (opts.returnFocus instanceof HTMLElement && opts.returnFocus.isConnected) opts.returnFocus.focus();\n else projectsButton.focus();\n }\n if (!quiet) say(byPerson ? `${rec.title} closed.${kept ? ' Reopen brings it back.' : ''}` : `Aien closed ${rec.title}.`);\n if (typeof opts.onClose === 'function') {\n try {\n opts.onClose(rec.kind === 'card' ? rec.id.slice(5) : rec.id, rec.kind, byPerson);\n } catch (_) {}\n }\n }\n function reopen() {\n const last = closed.pop();\n reopenState();\n if (!last) return;\n const rec = restoreEntry(last);\n if (rec) {\n rec.el.focus({ preventScroll: true });\n say(`${rec.title} reopened.`);\n } else {\n closed.push(last);\n reopenState();\n say(`At most ${MAX_PANES} panes can be open. Close one to make room.`);\n }\n }\n function notify(rec, message) {\n rec.notice.textContent = message;\n rec.notice.hidden = false;\n }\n function waiting(rec) {\n rec.el.setAttribute('aria-busy', 'true');\n rec.body.replaceChildren(el('p', 'allen-pane-note', 'Aien is preparing this pane.'));\n }\n\n" note JavaScript apply -text js8 " function apply(rec, revision, content, prov) {\n stopApp(rec);\n rec.revision = revision;\n rec.content = copy(content);\n rec.provenance = copy(prov);\n rec.svg = null;\n rec.notice.hidden = true;\n rec.el.removeAttribute('aria-busy');\n rec.body.replaceChildren();\n render(rec);\n rec.badge.textContent = STATUS_NAMES[rec.provenance.status];\n rec.badge.dataset.status = rec.provenance.status;\n rec.badge.hidden = false;\n sourceBlock(rec);\n footBlock(rec);\n }\n function section(heading) {\n const box = el('section', 'allen-pane-section');\n box.append(el('h3', 'allen-pane-h3', heading));\n return box;\n }\n function refList(heading, items) {\n const box = section(heading);\n const list = el('ol', 'allen-pane-refs');\n for (const r of items) {\n const li = el('li');\n li.append(link(r.title, r.url));\n list.append(li);\n }\n box.append(list, el('p', 'allen-pane-label', 'Links are shown as given; this page never fetched or checked them.'));\n return box;\n }\n /* A diff or patch fence gets its own Copy and Download patch. The patch\n is only ever a downloaded file; nothing here applies it. */\n function patchTool(rec) {\n let n = 0;\n return (lang, text) => {\n if (!/^(diff|patch)$/i.test(lang) || !text.trim()) return null;\n n += 1;\n const name = `${slug(rec.title) || 'allen'}${n > 1 ? `-${n}` : ''}.patch`;\n const bar = el('div', 'allen-pane-bar allen-md-tools');\n const copyButton = button('allen-pane-act', `Copy patch ${n} of ${rec.title}`, 'Copy patch', () => copyText(`${text}\\n`, copyButton));\n bar.append(copyButton, button('allen-pane-act', `Download patch ${n} of ${rec.title} as ${name}; it is not applied anywhere`, 'Download patch', () => download(name, `${text}\\n`)));\n return bar;\n };\n }\n function render(rec) {\n const c = rec.content;\n const body = rec.body;\n body.append(el('p', 'allen-pane-caveat', CAVEATS[rec.provenance.status]));\n if (rec.kind === 'math') {\n const result = el('p', 'allen-pane-math', c.text);\n result.setAttribute('aria-label', `Result: ${c.text}`);\n body.append(result);\n if (own(c, 'tex')) body.append(texBlock(c.tex, 'The engine\\u2019s formula'));\n } else if (rec.kind === 'plot') {\n const drawn = plot(c, rec.title);\n rec.svg = drawn.svg;\n body.append(drawn.figure);\n } else if (rec.kind === 'doc') {\n body.append(markdown(c.markdown, el('div', 'allen-md'), patchTool(rec)));\n if (c.citations.length) body.append(refList('Citations', c.citations));\n } else if (rec.kind === 'code' || rec.kind === 'omega') {\n body.append(el('p', 'allen-pane-label', rec.kind === 'omega' ? 'Omega source' : `${clean(c.language, 40) || 'Code'} source`));\n const pre = el('pre', 'allen-pane-code');\n pre.append(el('code', '', c.source));\n body.append(pre);\n if (own(c, 'functions') && c.functions.length) {\n const box = section('Functions');\n const list = el('ul', 'allen-pane-fns');\n for (const f of c.functions) list.append(el('li', 'allen-pane-mono', `${f.name}(${f.params.map(p => `${p.name} ${p.type}`).join(', ')}) to ${f.ret}`));\n box.append(list);\n body.append(box);\n }\n if (own(c, 'wasm')) {\n const bytes = wasmBytes(c.wasm);\n const box = section('WebAssembly');\n if (bytes) {\n box.append(el('p', 'allen-pane-note', `${bytes.length} bytes. Offered as a file only; this page does not run it.`), button('allen-pane-act', `Download the WebAssembly of ${rec.title}`, 'Download .wasm', () => download(`${slug(rec.title) || 'omega'}.wasm`, bytes)));\n } else {\n box.append(el('p', 'allen-pane-note', 'WebAssembly was attached, but it is not a valid base64 WebAssembly module.'));\n }\n body.append(box);\n }\n } else if (rec.kind === 'app') {\n body.append(el('p', 'allen-pane-note', 'Aien wrote this app. It runs only when you press Run, in a sandbox with no access to this page, your cookies or the network.'));\n const bar = el('div', 'allen-pane-bar');\n const stage = el('div', 'allen-pane-stage');\n const run = button('allen-pane-act allen-pane-run', `Run ${rec.title} in a sandbox`, 'Run', () => runApp(rec, stage, run, stop));\n const stop = button('allen-pane-act', `Stop ${rec.title}`, 'Stop', () => stopApp(rec));\n stop.hidden = true;\n bar.append(run, stop);\n body.append(bar, stage);\n rec.app = { frame: null, run, stop };\n } else if (rec.kind === 'research') {\n const notes = section('Notes');\n notes.append(markdown(c.notes, el('div', 'allen-md'), patchTool(rec)));\n body.append(notes);\n if (c.hypotheses.length) {\n const box = section('Hypotheses');\n const list = el('ul', 'allen-md-list');\n for (const h of c.hypotheses) list.append(inline(el('li'), h));\n box.append(list);\n body.append(box);\n }\n if (c.derivations.length) {\n const box = section('Derivations');\n const list = el('ol', 'allen-pane-derivations');\n for (const d of c.derivations) {\n const li = el('li');\n li.append(el('pre', 'allen-pane-pre', d));\n list.append(li);\n }\n box.append(list);\n body.append(box);\n }\n if (c.sources.length) body.append(refList('Sources', c.sources));\n } else if (rec.kind === 'data') {\n const grid = table(c.columns, c.rows);\n grid.firstChild.setAttribute('aria-labelledby', rec.heading.id);\n body.append(grid);\n }\n }\n function runApp(rec, stage, run, stop) {\n stopApp(rec);\n const frame = document.createElement('iframe');\n frame.setAttribute('sandbox', SANDBOX);\n frame.setAttribute('referrerpolicy', 'no-referrer');\n frame.setAttribute('allow', \"camera 'none'; microphone 'none'; geolocation 'none'; usb 'none'; serial 'none'; bluetooth 'none'; payment 'none'; display-capture 'none'; clipboard-read 'none'; clipboard-write 'none'; fullscreen 'none'\");\n frame.setAttribute('title', `${rec.title}, an app written by Aien, sandboxed`);\n frame.className = 'allen-pane-frame';\n frame.srcdoc = sandboxed(rec.content.html);\n stage.replaceChildren(frame);\n rec.app = { frame, run, stop };\n run.hidden = true;\n stop.hidden = false;\n stop.focus();\n }\n function stopApp(rec) {\n if (!rec.app || !rec.app.frame) return;\n const hadFocus = rec.el.contains(document.activeElement);\n rec.app.frame.remove();\n rec.app.frame = null;\n rec.app.run.hidden = false;\n rec.app.stop.hidden = true;\n if (hadFocus && rec.app.run.isConnected) rec.app.run.focus();\n }\n function sourceBlock(rec) {\n const list = el('dl', 'allen-pane-prov');\n const row = (key, value, mono) => {\n if (value === '') return;\n list.append(el('dt', '', key), el('dd', mono ? 'allen-pane-mono' : '', value));\n };\n const p = rec.provenance;\n row('Status', STATUS_NAMES[p.status]);\n row('Engine', p.engine);\n row('Expression', p.expression, true);\n row('Result', p.result, true);\n row('Source', p.source);\n row('Commit', p.commit, true);\n row('Pane', rec.id, true);\n row('Revision', String(rec.revision));\n const raw = el('pre', 'allen-pane-raw', JSON.stringify({ content: rec.content, provenance: rec.provenance }, null, 2));\n raw.setAttribute('aria-label', `Everything Aien sent for ${rec.title}, as JSON`);\n raw.tabIndex = 0;\n rec.source.replaceChildren(el('summary', 'allen-pane-summary', 'Source and provenance'), list, el('p', 'allen-pane-label', 'As received'), raw);\n rec.source.hidden = false;\n }\n function footBlock(rec) {\n const out = artefact(rec);\n if (!out) return;\n const base = slug(rec.title) || rec.kind;\n const ext = out.name.slice(out.name.lastIndexOf('.'));\n const copyButton = button('allen-pane-act', `Copy the ${out.what} of ${rec.title}`, 'Copy', () => copyText(out.copy, copyButton));\n const save = button('allen-pane-act', `Download ${rec.title} as ${ext}`, `Download ${ext}`, () => download(out.name, out.data()));\n const json = button('allen-pane-act', `Download ${rec.title} with its provenance as JSON`, 'Download .json', () => download(`${base}.json`, JSON.stringify(file([entry(rec)], rec.title), null, 2)));\n rec.foot.replaceChildren(copyButton, save, json);\n const keep = reportSave(rec);\n if (keep) rec.foot.append(...keep);\n rec.foot.hidden = false;\n }\n /* A repo report can become the visitor's own Omega project, only when the\n page supplies saveProject and only after the visitor has seen the file\n list and pressed Save. The page owns the request and the visitor's\n handle; this file never touches the network. */\n function reportSave(rec) {\n if (rec.kind !== 'doc' || typeof opts.saveProject !== 'function') return null;\n const named = REPORT.exec(rec.title);\n if (!named) return null;\n const files = reportFiles(rec.content.markdown);\n const repo = `${named[1]}/${named[2]}`;\n const ports = files.filter(f => f.path.endsWith('.om')).length;\n const box = el('div', 'allen-pane-save');\n box.hidden = true;\n const state = el('p', 'allen-projects-state');\n state.setAttribute('role', 'status');\n const open = button('allen-pane-act allen-pane-run', `Save ${rec.title} to my Omega projects`, 'Save to my Omega projects', () => {\n box.hidden = !box.hidden;\n open.setAttribute('aria-expanded', String(!box.hidden));\n if (!box.hidden) confirm.focus();\n });\n open.setAttribute('aria-expanded', 'false');\n const list = el('ul', 'allen-pane-files');\n for (const f of files) list.append(el('li', 'allen-pane-mono', `${f.path}, ${utf8(f.content)} bytes`));\n const confirm = button('allen-pane-act allen-pane-run', `Save these ${files.length} files as an Omega project`, `Save ${files.length} file${files.length === 1 ? '' : 's'}`, async () => {\n confirm.disabled = true;\n state.replaceChildren(document.createTextNode('Saving.'));\n let r;\n try {\n r = await opts.saveProject({ project: slug(`${named[1]}-${named[2]}`) || 'allen-report', title: `Omega path for ${repo}`, description: `Aien's report on ${repo}${ports ? `, with ${ports} Omega port${ports === 1 ? '' : 's'}` : ''}.`, files: files.map(f => ({ path: f.path, content: f.content })) });\n } catch (_) {\n r = null;\n }\n confirm.disabled = false;\n if (r && r.ok === true) {\n state.replaceChildren(document.createTextNode('Saved. Status: '), statusLink(r.url));\n } else {\n state.replaceChildren(document.createTextNode(r && typeof r.reason === 'string' ? clean(r.reason, 300) : 'The project could not be saved; nothing was stored.'));\n }\n });\n const cancel = button('allen-pane-act', 'Do not save the report', 'Cancel', () => {\n box.hidden = true;\n open.setAttribute('aria-expanded', 'false');\n open.focus();\n });\n const bar = el('div', 'allen-pane-bar');\n bar.append(confirm, cancel);\n box.append(el('p', 'allen-pane-note', `These files become a project under your handle in Omega projects, for Drake to review before anything is published:`), list, bar);\n return [open, box, state];\n }\n function statusLink(url) {\n if (typeof url !== 'string' || !url) return document.createTextNode('no status address was returned.');\n if (/^\\/(?!\\/)/.test(url)) {\n try {\n const here = new URL(url, window.location.href);\n if (here.origin === window.location.origin) {\n const a = el('a', 'allen-link', here.pathname + here.search);\n a.href = here.href;\n return a;\n }\n } catch (_) {}\n }\n return link(url, url);\n }\n function download(name, data) {\n const blob = new Blob([data], { type: 'application/octet-stream' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = name;\n a.hidden = true;\n root.append(a);\n a.click();\n a.remove();\n setTimeout(() => URL.revokeObjectURL(url), 30000);\n }\n function file(entries, name) {\n return { format: FORMAT, v: VERSION, name: clean(name || 'Aien panes', MAX_NAME), exported: new Date().toISOString(), panes: entries };\n }\n function snapshot() {\n return order.filter(dataPane).map(entry);\n }\n function exportOpen() {\n const entries = snapshot();\n if (!entries.length) {\n say('There are no panes with content to export yet.');\n return { ok: false, reason: 'nothing to export' };\n }\n download('aien-panes.json', JSON.stringify(file(entries, current ? current.name : 'Aien panes'), null, 2));\n say(`Exported ${entries.length} pane${entries.length === 1 ? '' : 's'} as a JSON file.`);\n return { ok: true, count: entries.length };\n }\n function restoreEntry(p) {\n if (panes.size >= MAX_PANES) return null;\n let key = p.id;\n for (let n = 2; panes.has(key) && n < 100; n++) key = `${p.id.slice(0, 58)}-${n}`;\n if (panes.has(key)) return null;\n const rec = create(key, p.kind, p.title);\n apply(rec, p.revision, p.content, p.provenance);\n if (p.geom) place(rec, p.geom.x, p.geom.y, p.geom.w, p.geom.h);\n if (p.minimized) {\n rec.minimized = true;\n rec.el.hidden = true;\n chipState(rec);\n }\n stack();\n return rec;\n }\n function restoreAll(data) {\n const room = MAX_PANES - panes.size;\n if (data.panes.length > room) return { ok: false, reason: `Only ${room} more pane${room === 1 ? '' : 's'} fit; close some panes first.` };\n for (const p of data.panes) restoreEntry(p);\n return { ok: true, count: data.panes.length };\n }\n\n" +text js8 " function apply(rec, revision, content, prov) {\n stopApp(rec);\n rec.revision = revision;\n rec.content = copy(content);\n rec.provenance = copy(prov);\n rec.svg = null;\n rec.notice.hidden = true;\n rec.el.removeAttribute('aria-busy');\n rec.body.replaceChildren();\n render(rec);\n rec.badge.textContent = STATUS_NAMES[rec.provenance.status];\n rec.badge.dataset.status = rec.provenance.status;\n rec.badge.hidden = false;\n sourceBlock(rec);\n footBlock(rec);\n }\n function section(heading) {\n const box = el('section', 'allen-pane-section');\n box.append(el('h3', 'allen-pane-h3', heading));\n return box;\n }\n function refList(heading, items) {\n const box = section(heading);\n const list = el('ol', 'allen-pane-refs');\n for (const r of items) {\n const li = el('li');\n li.append(link(r.title, r.url));\n list.append(li);\n }\n box.append(list, el('p', 'allen-pane-label', 'Links are shown as given; this page never fetched or checked them.'));\n return box;\n }\n /* A diff or patch fence gets its own Copy and Download patch. The patch\n is only ever a downloaded file; nothing here applies it. */\n function patchTool(rec) {\n let n = 0;\n return (lang, text) => {\n if (!/^(diff|patch)$/i.test(lang) || !text.trim()) return null;\n n += 1;\n const name = `${slug(rec.title) || 'allen'}${n > 1 ? `-${n}` : ''}.patch`;\n const bar = el('div', 'allen-pane-bar allen-md-tools');\n const copyButton = button('allen-pane-act', `Copy patch ${n} of ${rec.title}`, 'Copy patch', () => copyText(`${text}\\n`, copyButton));\n bar.append(copyButton, button('allen-pane-act', `Download patch ${n} of ${rec.title} as ${name}; it is not applied anywhere`, 'Download patch', () => download(name, `${text}\\n`)));\n return bar;\n };\n }\n function render(rec) {\n const c = rec.content;\n const body = rec.body;\n body.append(el('p', 'allen-pane-caveat', CAVEATS[rec.provenance.status]));\n if (rec.kind === 'math') {\n const result = el('p', 'allen-pane-math', c.text);\n result.setAttribute('aria-label', `Result: ${c.text}`);\n body.append(result);\n if (own(c, 'tex')) body.append(texBlock(c.tex, 'The engine\\u2019s formula'));\n } else if (rec.kind === 'plot') {\n const drawn = plot(c, rec.title);\n rec.svg = drawn.svg;\n body.append(drawn.figure);\n } else if (rec.kind === 'doc') {\n body.append(markdown(c.markdown, el('div', 'allen-md'), patchTool(rec)));\n if (c.citations.length) body.append(refList('Citations', c.citations));\n } else if (rec.kind === 'code' || rec.kind === 'omega') {\n body.append(el('p', 'allen-pane-label', rec.kind === 'omega' ? 'Omega source' : `${clean(c.language, 40) || 'Code'} source`));\n const pre = el('pre', 'allen-pane-code');\n pre.append(el('code', '', c.source));\n body.append(pre);\n if (own(c, 'functions') && c.functions.length) {\n const box = section('Functions');\n const list = el('ul', 'allen-pane-fns');\n for (const f of c.functions) list.append(el('li', 'allen-pane-mono', `${f.name}(${f.params.map(p => `${p.name} ${p.type}`).join(', ')}) to ${f.ret}`));\n box.append(list);\n body.append(box);\n }\n if (own(c, 'wasm')) {\n const bytes = wasmBytes(c.wasm);\n const box = section('WebAssembly');\n if (bytes) {\n box.append(el('p', 'allen-pane-note', `${bytes.length} bytes. Offered as a file only; this page does not run it.`), button('allen-pane-act', `Download the WebAssembly of ${rec.title}`, 'Download .wasm', () => download(`${slug(rec.title) || 'omega'}.wasm`, bytes)));\n } else {\n box.append(el('p', 'allen-pane-note', 'WebAssembly was attached, but it is not a valid base64 WebAssembly module.'));\n }\n body.append(box);\n }\n } else if (rec.kind === 'app') {\n body.append(el('p', 'allen-pane-note', 'Aien wrote this app. It runs only when you press Run, in a sandbox with no access to this page, your cookies or the network.'));\n const bar = el('div', 'allen-pane-bar');\n const stage = el('div', 'allen-pane-stage');\n const run = button('allen-pane-act allen-pane-run', `Run ${rec.title} in a sandbox`, 'Run', () => runApp(rec, stage, run, stop));\n const stop = button('allen-pane-act', `Stop ${rec.title}`, 'Stop', () => stopApp(rec));\n stop.hidden = true;\n bar.append(run, stop);\n body.append(bar, stage);\n rec.app = { frame: null, run, stop };\n } else if (rec.kind === 'research') {\n const notes = section('Notes');\n notes.append(markdown(c.notes, el('div', 'allen-md'), patchTool(rec)));\n body.append(notes);\n if (c.hypotheses.length) {\n const box = section('Hypotheses');\n const list = el('ul', 'allen-md-list');\n for (const h of c.hypotheses) list.append(inline(el('li'), h));\n box.append(list);\n body.append(box);\n }\n if (c.derivations.length) {\n const box = section('Derivations');\n const list = el('ol', 'allen-pane-derivations');\n for (const d of c.derivations) {\n const li = el('li');\n li.append(el('pre', 'allen-pane-pre', d));\n list.append(li);\n }\n box.append(list);\n body.append(box);\n }\n if (c.sources.length) body.append(refList('Sources', c.sources));\n } else if (rec.kind === 'data') {\n const grid = table(c.columns, c.rows);\n grid.firstChild.setAttribute('aria-labelledby', rec.heading.id);\n body.append(grid);\n }\n }\n function runApp(rec, stage, run, stop) {\n stopApp(rec);\n const frame = document.createElement('iframe');\n frame.setAttribute('sandbox', SANDBOX);\n frame.setAttribute('referrerpolicy', 'no-referrer');\n frame.setAttribute('allow', \"camera 'none'; microphone 'none'; geolocation 'none'; usb 'none'; serial 'none'; bluetooth 'none'; payment 'none'; display-capture 'none'; clipboard-read 'none'; clipboard-write 'none'; fullscreen 'none'\");\n frame.setAttribute('title', `${rec.title}, an app written by Aien, sandboxed`);\n frame.className = 'allen-pane-frame';\n /* A srcdoc frame would inherit the page policy, which forbids inline\n scripts; /aien/run.html writes what this page posts, sandboxed. */\n const html = sandboxed(rec.content.html);\n frame.addEventListener('load', () => frame.contentWindow.postMessage(html, '*'), { once: true });\n frame.src = '/aien/run.html';\n stage.replaceChildren(frame);\n rec.app = { frame, run, stop };\n run.hidden = true;\n stop.hidden = false;\n stop.focus();\n }\n function stopApp(rec) {\n if (!rec.app || !rec.app.frame) return;\n const hadFocus = rec.el.contains(document.activeElement);\n rec.app.frame.remove();\n rec.app.frame = null;\n rec.app.run.hidden = false;\n rec.app.stop.hidden = true;\n if (hadFocus && rec.app.run.isConnected) rec.app.run.focus();\n }\n function sourceBlock(rec) {\n const list = el('dl', 'allen-pane-prov');\n const row = (key, value, mono) => {\n if (value === '') return;\n list.append(el('dt', '', key), el('dd', mono ? 'allen-pane-mono' : '', value));\n };\n const p = rec.provenance;\n row('Status', STATUS_NAMES[p.status]);\n row('Engine', p.engine);\n row('Expression', p.expression, true);\n row('Result', p.result, true);\n row('Source', p.source);\n row('Commit', p.commit, true);\n row('Pane', rec.id, true);\n row('Revision', String(rec.revision));\n const raw = el('pre', 'allen-pane-raw', JSON.stringify({ content: rec.content, provenance: rec.provenance }, null, 2));\n raw.setAttribute('aria-label', `Everything Aien sent for ${rec.title}, as JSON`);\n raw.tabIndex = 0;\n rec.source.replaceChildren(el('summary', 'allen-pane-summary', 'Source and provenance'), list, el('p', 'allen-pane-label', 'As received'), raw);\n rec.source.hidden = false;\n }\n function footBlock(rec) {\n const out = artefact(rec);\n if (!out) return;\n const base = slug(rec.title) || rec.kind;\n const ext = out.name.slice(out.name.lastIndexOf('.'));\n const copyButton = button('allen-pane-act', `Copy the ${out.what} of ${rec.title}`, 'Copy', () => copyText(out.copy, copyButton));\n const save = button('allen-pane-act', `Download ${rec.title} as ${ext}`, `Download ${ext}`, () => download(out.name, out.data()));\n const json = button('allen-pane-act', `Download ${rec.title} with its provenance as JSON`, 'Download .json', () => download(`${base}.json`, JSON.stringify(file([entry(rec)], rec.title), null, 2)));\n rec.foot.replaceChildren(copyButton, save, json);\n const keep = reportSave(rec);\n if (keep) rec.foot.append(...keep);\n rec.foot.hidden = false;\n }\n /* A repo report can become the visitor's own Omega project, only when the\n page supplies saveProject and only after the visitor has seen the file\n list and pressed Save. The page owns the request and the visitor's\n handle; this file never touches the network. */\n function reportSave(rec) {\n if (rec.kind !== 'doc' || typeof opts.saveProject !== 'function') return null;\n const named = REPORT.exec(rec.title);\n if (!named) return null;\n const files = reportFiles(rec.content.markdown);\n const repo = `${named[1]}/${named[2]}`;\n const ports = files.filter(f => f.path.endsWith('.om')).length;\n const box = el('div', 'allen-pane-save');\n box.hidden = true;\n const state = el('p', 'allen-projects-state');\n state.setAttribute('role', 'status');\n const open = button('allen-pane-act allen-pane-run', `Save ${rec.title} to my Omega projects`, 'Save to my Omega projects', () => {\n box.hidden = !box.hidden;\n open.setAttribute('aria-expanded', String(!box.hidden));\n if (!box.hidden) confirm.focus();\n });\n open.setAttribute('aria-expanded', 'false');\n const list = el('ul', 'allen-pane-files');\n for (const f of files) list.append(el('li', 'allen-pane-mono', `${f.path}, ${utf8(f.content)} bytes`));\n const confirm = button('allen-pane-act allen-pane-run', `Save these ${files.length} files as an Omega project`, `Save ${files.length} file${files.length === 1 ? '' : 's'}`, async () => {\n confirm.disabled = true;\n state.replaceChildren(document.createTextNode('Saving.'));\n let r;\n try {\n r = await opts.saveProject({ project: slug(`${named[1]}-${named[2]}`) || 'allen-report', title: `Omega path for ${repo}`, description: `Aien's report on ${repo}${ports ? `, with ${ports} Omega port${ports === 1 ? '' : 's'}` : ''}.`, files: files.map(f => ({ path: f.path, content: f.content })) });\n } catch (_) {\n r = null;\n }\n confirm.disabled = false;\n if (r && r.ok === true) {\n state.replaceChildren(document.createTextNode('Saved. Status: '), statusLink(r.url));\n } else {\n state.replaceChildren(document.createTextNode(r && typeof r.reason === 'string' ? clean(r.reason, 300) : 'The project could not be saved; nothing was stored.'));\n }\n });\n const cancel = button('allen-pane-act', 'Do not save the report', 'Cancel', () => {\n box.hidden = true;\n open.setAttribute('aria-expanded', 'false');\n open.focus();\n });\n const bar = el('div', 'allen-pane-bar');\n bar.append(confirm, cancel);\n box.append(el('p', 'allen-pane-note', `These files become a project under your handle in Omega projects, for Drake to review before anything is published:`), list, bar);\n return [open, box, state];\n }\n function statusLink(url) {\n if (typeof url !== 'string' || !url) return document.createTextNode('no status address was returned.');\n if (/^\\/(?!\\/)/.test(url)) {\n try {\n const here = new URL(url, window.location.href);\n if (here.origin === window.location.origin) {\n const a = el('a', 'allen-link', here.pathname + here.search);\n a.href = here.href;\n return a;\n }\n } catch (_) {}\n }\n return link(url, url);\n }\n function download(name, data) {\n const blob = new Blob([data], { type: 'application/octet-stream' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = name;\n a.hidden = true;\n root.append(a);\n a.click();\n a.remove();\n setTimeout(() => URL.revokeObjectURL(url), 30000);\n }\n function file(entries, name) {\n return { format: FORMAT, v: VERSION, name: clean(name || 'Aien panes', MAX_NAME), exported: new Date().toISOString(), panes: entries };\n }\n function snapshot() {\n return order.filter(dataPane).map(entry);\n }\n function exportOpen() {\n const entries = snapshot();\n if (!entries.length) {\n say('There are no panes with content to export yet.');\n return { ok: false, reason: 'nothing to export' };\n }\n download('aien-panes.json', JSON.stringify(file(entries, current ? current.name : 'Aien panes'), null, 2));\n say(`Exported ${entries.length} pane${entries.length === 1 ? '' : 's'} as a JSON file.`);\n return { ok: true, count: entries.length };\n }\n function restoreEntry(p) {\n if (panes.size >= MAX_PANES) return null;\n let key = p.id;\n for (let n = 2; panes.has(key) && n < 100; n++) key = `${p.id.slice(0, 58)}-${n}`;\n if (panes.has(key)) return null;\n const rec = create(key, p.kind, p.title);\n apply(rec, p.revision, p.content, p.provenance);\n if (p.geom) place(rec, p.geom.x, p.geom.y, p.geom.w, p.geom.h);\n if (p.minimized) {\n rec.minimized = true;\n rec.el.hidden = true;\n chipState(rec);\n }\n stack();\n return rec;\n }\n function restoreAll(data) {\n const room = MAX_PANES - panes.size;\n if (data.panes.length > room) return { ok: false, reason: `Only ${room} more pane${room === 1 ? '' : 's'} fit; close some panes first.` };\n for (const p of data.panes) restoreEntry(p);\n return { ok: true, count: data.panes.length };\n }\n\n" note JavaScript list text js9 " /* Projects: IndexedDB only after an explicit save; an index store keeps\n the list cheap to read. */\n async function list() {\n try {\n const items = await store('readonly', (_, index) => ask(index.getAll()));\n items.sort((a, b) => String(b.saved).localeCompare(String(a.saved)));\n return { ok: true, projects: items.map(i => ({ id: i.id, name: i.name, saved: i.saved, count: i.count })) };\n } catch (error) {\n return { ok: false, reason: storageError(error) };\n }\n }\n async function save(name) {\n const entries = snapshot();\n if (!entries.length) return { ok: false, reason: 'There are no panes with content to save yet.' };\n const title = clean(name || '', MAX_NAME) || (current ? current.name : `Project ${new Date().toLocaleString()}`);\n const id = current && current.name === title ? current.id : `p${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;\n const record = { format: FORMAT, v: VERSION, id, name: title, saved: new Date().toISOString(), panes: entries };\n const bytes = utf8(JSON.stringify(record));\n if (bytes > MAX_PROJECT_BYTES) return { ok: false, reason: `This project is ${bytes} bytes; one project holds at most ${MAX_PROJECT_BYTES}. Export it as a file instead.` };\n try {\n await store('readwrite', async (projects, index) => {\n const existing = await ask(index.get(id));\n const count = await ask(index.count());\n if (!existing && count >= MAX_PROJECTS) throw limit(`${MAX_PROJECTS} projects are saved in this browser; delete one first, or export instead.`);\n await ask(projects.put(record));\n await ask(index.put({ id, name: title, saved: record.saved, count: entries.length }));\n });\n } catch (error) {\n return { ok: false, reason: storageError(error) };\n }\n current = { id, name: title };\n return { ok: true, id, name: title, count: entries.length };\n }\n async function load(id) {\n let record;\n try {\n record = await store('readonly', projects => ask(projects.get(String(id))));\n } catch (error) {\n return { ok: false, reason: storageError(error) };\n }\n if (!record) return { ok: false, reason: 'That project is no longer saved in this browser.' };\n const reason = checkFile(record);\n if (reason) return { ok: false, reason: `The saved project could not be read: ${reason}.` };\n const done = restoreAll(record);\n if (done.ok) current = { id: record.id, name: record.name };\n return done.ok ? { ok: true, id: record.id, name: record.name, count: done.count } : done;\n }\n async function remove(id) {\n try {\n await store('readwrite', (projects, index) => Promise.all([ask(projects.delete(String(id))), ask(index.delete(String(id)))]));\n } catch (error) {\n return { ok: false, reason: storageError(error) };\n }\n if (current && current.id === id) current = null;\n return { ok: true, id };\n }\n async function exportSaved(id) {\n let record;\n try {\n record = await store('readonly', projects => ask(projects.get(String(id))));\n } catch (error) {\n return { ok: false, reason: storageError(error) };\n }\n if (!record) return { ok: false, reason: 'That project is no longer saved in this browser.' };\n download(`${slug(record.name) || 'allen-project'}.json`, JSON.stringify(record, null, 2));\n return { ok: true, id };\n }\n async function importFile(source) {\n let text;\n if (typeof source === 'string') text = source;\n else if (source && typeof source.text === 'function' && typeof source.size === 'number') {\n if (source.size > MAX_PROJECT_BYTES) return { ok: false, reason: `A project file holds at most ${MAX_PROJECT_BYTES} bytes.` };\n try {\n text = await source.text();\n } catch (_) {\n return { ok: false, reason: 'This browser could not read the file.' };\n }\n } else return { ok: false, reason: 'Import takes a project file or its JSON text.' };\n if (utf8(text) > MAX_PROJECT_BYTES) return { ok: false, reason: `A project file holds at most ${MAX_PROJECT_BYTES} bytes.` };\n let data;\n try {\n data = JSON.parse(text);\n } catch (_) {\n return { ok: false, reason: 'That file is not JSON.' };\n }\n const reason = checkFile(data);\n if (reason) return { ok: false, reason: `That file was refused: ${reason}.` };\n return restoreAll(data);\n }\n function project(command, arg) {\n if (!alive) return Promise.resolve({ ok: false, reason: 'unmounted' });\n if (command === 'save') return save(arg);\n if (command === 'list') return list();\n if (command === 'open') return load(arg);\n if (command === 'remove') return remove(arg);\n if (command === 'export') return arg === undefined ? Promise.resolve(exportOpen()) : exportSaved(arg);\n if (command === 'import') return importFile(arg);\n if (command === undefined || command === 'panel') {\n projectsPane();\n return Promise.resolve({ ok: true });\n }\n return Promise.resolve({ ok: false, reason: 'unknown project command' });\n }\n function projectsPane() {\n let rec = panes.get('#projects');\n if (rec) {\n restore(rec, true);\n refreshProjects(rec);\n return;\n }\n if (panes.size >= MAX_PANES) {\n say(`At most ${MAX_PANES} panes can be open. Close one to make room.`);\n return;\n }\n rec = create('#projects', 'projects', 'Projects');\n const body = rec.body;\n const status = el('p', 'allen-projects-state');\n status.setAttribute('role', 'status');\n const show = r => {\n status.textContent = r.ok ? r.message : r.reason;\n };\n const form = el('form', 'allen-projects-form');\n const nameId = uid('allen-project-name');\n const nameLabel = el('label', 'allen-pane-label', 'Project name');\n nameLabel.htmlFor = nameId;\n const input = el('input', 'allen-projects-name');\n input.id = nameId;\n input.type = 'text';\n input.maxLength = MAX_NAME;\n input.autocomplete = 'off';\n input.value = current ? current.name : '';\n const submit = el('button', 'allen-pane-act allen-pane-run', 'Save project');\n submit.type = 'submit';\n form.append(nameLabel, input, submit);\n form.addEventListener('submit', async event => {\n event.preventDefault();\n submit.disabled = true;\n const r = await save(input.value);\n submit.disabled = false;\n show(r.ok ? { ok: true, message: `Saved ${r.name} with ${r.count} pane${r.count === 1 ? '' : 's'} in this browser.` } : r);\n if (r.ok) {\n input.value = r.name;\n refreshProjects(rec);\n }\n });\n const saved = el('ul', 'allen-projects-list');\n const fileId = uid('allen-project-file');\n const fileLabel = el('label', 'allen-pane-label', 'Import a project file (.json)');\n fileLabel.htmlFor = fileId;\n const picker = el('input', 'allen-projects-file');\n picker.id = fileId;\n picker.type = 'file';\n picker.accept = 'application/json,.json';\n picker.addEventListener('change', async () => {\n const chosen = picker.files && picker.files[0];\n picker.value = '';\n if (!chosen) return;\n const r = await importFile(chosen);\n show(r.ok ? { ok: true, message: `Imported ${r.count} pane${r.count === 1 ? '' : 's'}. Nothing is stored until you press Save project.` } : r);\n });\n const exporter = button('allen-pane-act', 'Export the open panes as a JSON file', 'Export open panes', () => {\n const r = exportOpen();\n show(r.ok ? { ok: true, message: `Exported ${r.count} pane${r.count === 1 ? '' : 's'}.` } : { ok: false, reason: 'There are no panes with content to export yet.' });\n });\n const tools = el('div', 'allen-pane-bar');\n tools.append(exporter);\n const academy = el('p', 'allen-pane-note allen-projects-academy');\n academy.append(link('Train your agent', ACADEMY));\n body.append(el('p', 'allen-pane-note', 'Nothing is stored until you press Save project. A project keeps the open panes, their provenance and where they sit, in this browser only. Conversations are not part of a project.'), form, status, section('Saved in this browser'), saved, fileLabel, picker, tools, academy);\n if (typeof opts.syncSummary === 'function') body.append(summaryBox(show));\n rec.projects = { saved, show };\n refreshProjects(rec);\n rec.el.focus({ preventScroll: true });\n }\n /* Only when the page supplies syncSummary (a visitor with a remember key):\n a short summary the visitor reads and edits first, sent on one explicit\n click. Panes, code and data never leave the browser this way. */\n function draft() {\n const parts = snapshot().map(p => `${NAMES[p.kind]}: ${p.title}`);\n let text = `${current ? current.name : 'Project'}: ${parts.join('; ')}`;\n while (utf8(text) > SYNC_MAX) text = text.slice(0, -1);\n return text;\n }\n function summaryBox(show) {\n const box = section('Sync a short summary');\n const areaId = uid('allen-project-summary');\n const note = el('p', 'allen-pane-note', `Only this summary is sent, at most ${SYNC_MAX} bytes, never the panes, code or data. Aien keeps one project summary for you and replaces it each time. Edit it first if you like.`);\n const areaLabel = el('label', 'allen-pane-label', 'Summary to sync');\n areaLabel.htmlFor = areaId;\n const area = el('textarea', 'allen-projects-summary');\n area.id = areaId;\n area.rows = 3;\n area.value = draft();\n const count = el('p', 'allen-pane-label');\n const recount = () => {\n const n = utf8(area.value);\n count.textContent = `${n} of ${SYNC_MAX} bytes`;\n count.dataset.over = n > SYNC_MAX ? 'yes' : 'no';\n };\n area.addEventListener('input', recount);\n recount();\n const refresh = button('allen-pane-act', 'Write the summary again from the open panes', 'Draft again', () => {\n area.value = draft();\n recount();\n });\n const send = button('allen-pane-act allen-pane-run', 'Sync this short summary to Aien\\u2019s memory of you', 'Sync short summary', async () => {\n const text = area.value.trim();\n if (!text) return show({ ok: false, reason: 'The summary is empty.' });\n if (utf8(text) > SYNC_MAX) return show({ ok: false, reason: `The summary is over ${SYNC_MAX} bytes.` });\n send.disabled = true;\n let r;\n try {\n r = await opts.syncSummary(text);\n } catch (_) {\n r = null;\n }\n send.disabled = false;\n show(r && r.ok === true ? { ok: true, message: 'Synced the summary. Aien replaced the previous one.' } : { ok: false, reason: r && typeof r.reason === 'string' ? clean(r.reason, 300) : 'Aien could not sync the summary; nothing was stored.' });\n });\n const bar = el('div', 'allen-pane-bar');\n bar.append(refresh, send);\n box.append(note, areaLabel, area, count, bar);\n return box;\n }\n async function refreshProjects(rec) {\n const ui = rec.projects;\n if (!ui) return;\n const r = await list();\n if (!r.ok) {\n ui.saved.replaceChildren(el('li', 'allen-pane-note', r.reason));\n return;\n }\n if (!r.projects.length) {\n ui.saved.replaceChildren(el('li', 'allen-pane-note', 'No projects are saved in this browser.'));\n return;\n }\n ui.saved.replaceChildren(...r.projects.map(p => projectRow(rec, p)));\n }\n function projectRow(rec, p) {\n const name = clean(p.name, MAX_NAME) || 'Untitled';\n const li = el('li', 'allen-projects-item');\n const text = el('div', 'allen-projects-text');\n text.append(el('span', 'allen-projects-title', name), el('span', 'allen-projects-meta', `${p.count} pane${p.count === 1 ? '' : 's'}, saved ${stamp(p.saved)}`));\n const acts = el('div', 'allen-pane-bar');\n const open = button('allen-pane-act', `Open project ${name}`, 'Open', async () => {\n const r = await load(p.id);\n rec.projects.show(r.ok ? { ok: true, message: `Opened ${r.name}.` } : r);\n });\n const out = button('allen-pane-act', `Export project ${name} as a JSON file`, 'Export', async () => {\n const r = await exportSaved(p.id);\n rec.projects.show(r.ok ? { ok: true, message: `Exported ${name}.` } : r);\n });\n const del = button('allen-pane-act allen-pane-danger', `Delete project ${name} from this browser`, 'Delete', async () => {\n if (del.dataset.armed !== 'yes') {\n del.dataset.armed = 'yes';\n del.textContent = 'Confirm delete';\n del.setAttribute('aria-label', `Confirm: delete project ${name} from this browser`);\n setTimeout(() => {\n if (!del.isConnected) return;\n del.dataset.armed = '';\n del.textContent = 'Delete';\n del.setAttribute('aria-label', `Delete project ${name} from this browser`);\n }, 5000);\n return;\n }\n const r = await remove(p.id);\n rec.projects.show(r.ok ? { ok: true, message: `Deleted ${name} from this browser.` } : r);\n refreshProjects(rec);\n if (rec.el.contains(document.activeElement) || !document.activeElement || document.activeElement === document.body) rec.el.focus({ preventScroll: true });\n });\n acts.append(open, out, del);\n li.append(text, acts);\n return li;\n }\n\n" diff --git a/public/.crumb b/public/.crumb index fde4691..73a0fa3 100644 --- a/public/.crumb +++ b/public/.crumb @@ -8,7 +8,7 @@ "children": [ { "digest": "937ca48aa52a1bcdaea3533e8e508e7c154415294449fe8ff99c65be0eea2c1d", - "last_commit": "fdb3d63", + "last_commit": "0804a19", "name": "alpha", "purpose": "Pinned alpha wizard source and unmodified terminal capture assets" }, @@ -25,8 +25,8 @@ "purpose": "Published generated project measurements with pinned sources" }, { - "digest": "f7663e11702c9495ea6de2f05d8ec832561970a0892403abbec155cf018405c5", - "last_commit": "6e76cd8", + "digest": "15e41d311cc2a344f5a9337f8aa092e73ba2304ff351b41a5ad863ef55349490", + "last_commit": "863c0fa", "name": "js", "purpose": "Browser interactions using public data only" }, @@ -37,8 +37,8 @@ "purpose": "Public static research or licensing pages using the shared website navigation" }, { - "digest": "936828b67284e18ab0ab934dfa6010a80e0adf4ea6cf29753f304b9b5edba1ec", - "last_commit": "8f55098", + "digest": "92ddc743ca7340b6a0f015a1ca78e1f6978e87f089182fe0bf1abc9e6b4fe48d", + "last_commit": "863c0fa", "name": "post-llm-case", "purpose": "Public static research or licensing pages using the shared website navigation" }, @@ -49,15 +49,15 @@ "purpose": "Public static research or licensing pages using the shared website navigation" } ], - "children_root": "sha256:1dc96ed8af99361ffb59e6bab603f542a78c15babd56294469864d1a1e90b180", - "compiled_at": "2026-10-31T02:30:20Z", + "children_root": "sha256:66c4427ecaea2fd667ece74aba469b70aefac2a7a82c68570a93cbdeb56a007b", + "compiled_at": "2026-10-31T09:45:58Z", "compiler": "crumb-compile/1", - "digest": "sha256:4e0b99a85603ed0df420b6b264141f4172504377ccaa4be8f42c239c95acdf5b", + "digest": "sha256:47f5bd186e43673d3fdf11b3ea370607c1f13d4fd583fa35993b61aed4d2e291", "evidence_files": 1, "evidence_root": "sha256:63bece7cb299b29d19622dcb0de4cbaa623357b117d8c7643a562de286c4b2fb", - "files": 156, - "generated_at_commit": "dbc8d1cdba74d49904001bec14847596d203368c", - "source_tree": "sha256:b6e0f34a0332f46579ebaecf490b71404450a0d081699cb875af58a79fe52437" + "files": 158, + "generated_at_commit": "863c0faa01ef9615fb77bb8f7d38ac43b1e9b143", + "source_tree": "sha256:a6a083100862559e8f2c22c38a10b2aa8303c766b04dde92ac456217d2cdc9ed" } }, "invariants": [ diff --git a/public/js/.crumb b/public/js/.crumb index f96e167..a43f43a 100644 --- a/public/js/.crumb +++ b/public/js/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-30T21:57:23Z", + "compiled_at": "2026-10-31T09:45:58Z", "compiler": "crumb-compile/1", - "digest": "sha256:f7663e11702c9495ea6de2f05d8ec832561970a0892403abbec155cf018405c5", + "digest": "sha256:15e41d311cc2a344f5a9337f8aa092e73ba2304ff351b41a5ad863ef55349490", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 17, - "generated_at_commit": "06d824b1d063d7cfd2e8a40294f22880e8a7a77d", - "source_tree": "sha256:5ed038eef7a3be67fb8faf8d53dae4fb485d8f5aad43fa1142fc0e4d27106896" + "files": 19, + "generated_at_commit": "863c0faa01ef9615fb77bb8f7d38ac43b1e9b143", + "source_tree": "sha256:dd1cfda032d35e401cfe33b00251404d935bab07755429bac06b8bdb73c98aa7" } }, "invariants": [ diff --git a/public/js/aien-run.js b/public/js/aien-run.js new file mode 100644 index 0000000..f1f8234 --- /dev/null +++ b/public/js/aien-run.js @@ -0,0 +1,16 @@ +/* The program runner (/aien/run.html, components::csp). The Aien page frames + this document sandboxed to allow-scripts and posts one program; it is + written here, where the policy allows inline scripts. Nothing is written + unless this document has an opaque origin (a sandboxed frame) and the + message comes from the framing page. document.open() drops this listener, + so a document is written once. */ +(() => { + if (self.origin !== 'null' || parent === self) return; + document.documentElement.style.visibility = 'hidden'; + addEventListener('message', event => { + if (event.source !== parent || typeof event.data !== 'string') return; + document.open(); + document.write(event.data); + document.close(); + }); +})(); diff --git a/public/js/allen-panes.js b/public/js/allen-panes.js index 3b7296c..8d07207 100644 --- a/public/js/allen-panes.js +++ b/public/js/allen-panes.js @@ -1433,7 +1433,11 @@ frame.setAttribute('allow', "camera 'none'; microphone 'none'; geolocation 'none'; usb 'none'; serial 'none'; bluetooth 'none'; payment 'none'; display-capture 'none'; clipboard-read 'none'; clipboard-write 'none'; fullscreen 'none'"); frame.setAttribute('title', `${rec.title}, an app written by Aien, sandboxed`); frame.className = 'allen-pane-frame'; - frame.srcdoc = sandboxed(rec.content.html); + /* A srcdoc frame would inherit the page policy, which forbids inline + scripts; /aien/run.html writes what this page posts, sandboxed. */ + const html = sandboxed(rec.content.html); + frame.addEventListener('load', () => frame.contentWindow.postMessage(html, '*'), { once: true }); + frame.src = '/aien/run.html'; stage.replaceChildren(frame); rec.app = { frame, run, stop }; run.hidden = true; diff --git a/public/js/allen.js b/public/js/allen.js index e7e5b34..d5f424d 100644 --- a/public/js/allen.js +++ b/public/js/allen.js @@ -1728,13 +1728,18 @@ ${script} if (tag('head')) return source.slice(0, at) + meta + source.slice(at); return `${source.slice(0, lead)}<head>${meta}</head>${source.slice(lead)}`; } + /* The page policy forbids inline scripts, and a srcdoc frame would inherit + it, so the program runs in /aien/run.html, the one document whose policy + allows them. That document writes only what its parent posts, and only + while sandboxed to an opaque origin. */ function runHtml(source, out) { const frame = document.createElement('iframe'); frame.setAttribute('sandbox', SANDBOX); frame.setAttribute('referrerpolicy', 'no-referrer'); frame.setAttribute('title', 'Program written by Aien, sandboxed'); frame.className = 'allen-frame'; - frame.srcdoc = sandboxed(source); + frame.addEventListener('load', () => frame.contentWindow.postMessage(sandboxed(source), '*'), { once: true }); + frame.src = '/aien/run.html'; const box = el('div', 'allen-frame-box'); box.append(frame); out.replaceChildren(box, el('p', 'allen-note', 'Sandboxed: its scripts run with no access to this page or your cookies, and its content security policy blocks network loads. Drag the corner to resize.')); diff --git a/public/js/post-llm-case.js b/public/js/post-llm-case.js new file mode 100644 index 0000000..7750ca9 --- /dev/null +++ b/public/js/post-llm-case.js @@ -0,0 +1,52 @@ +(function () { + var datasets = { + global: { + values: [{ label: "2025", value: 447 }, { label: "2026", value: 565 }], + max: 600, + ticks: [0, 200, 400, 600], + suffix: " TWh", + color: "#4bd3a1" + }, + ai: { + values: [{ label: "2025", value: 95 }, { label: "2026", value: 175 }, { label: "2027*", value: 258 }], + max: 300, + ticks: [0, 100, 200, 300], + suffix: " TWh", + color: "#ff7864" + } + }; + var NS = "http://www.w3.org/2000/svg"; + function node(name, attrs, text) { + var el = document.createElementNS(NS, name); + Object.keys(attrs || {}).forEach(function (key) { el.setAttribute(key, attrs[key]); }); + if (text !== undefined) el.textContent = text; + return el; + } + function renderChart(id, data) { + var host = document.getElementById(id); + var width = 560, height = 270, left = 52, right = 18, top = 22, bottom = 46; + var plotW = width - left - right, plotH = height - top - bottom; + var svg = node("svg", { viewBox: "0 0 " + width + " " + height, "aria-hidden": "true", focusable: "false" }); + data.ticks.forEach(function (tick) { + var y = top + plotH - (tick / data.max) * plotH; + svg.appendChild(node("line", { x1: left, y1: y, x2: width - right, y2: y, stroke: "currentColor", "stroke-opacity": ".20", "stroke-width": "1" })); + svg.appendChild(node("text", { x: left - 10, y: y + 4, "text-anchor": "end", fill: "currentColor", "fill-opacity": ".66", "font-size": "11", "font-family": "IBM Plex Mono, monospace" }, String(tick))); + }); + var slot = plotW / data.values.length; + var barW = Math.min(96, slot * .48); + data.values.forEach(function (d, i) { + var h = (d.value / data.max) * plotH; + var x = left + slot * i + (slot - barW) / 2; + var y = top + plotH - h; + svg.appendChild(node("rect", { x: x, y: y, width: barW, height: h, fill: data.color })); + svg.appendChild(node("text", { x: x + barW / 2, y: y - 9, "text-anchor": "middle", fill: "currentColor", "font-size": "13", "font-weight": "700", "font-family": "IBM Plex Mono, monospace" }, d.value + data.suffix)); + svg.appendChild(node("text", { x: x + barW / 2, y: height - 17, "text-anchor": "middle", fill: "currentColor", "fill-opacity": ".75", "font-size": "12", "font-family": "IBM Plex Mono, monospace" }, d.label)); + }); + host.appendChild(svg); + } + renderChart("chartGlobal", datasets.global); + renderChart("chartAI", datasets.ai); + var growth = ((datasets.global.values[1].value / datasets.global.values[0].value - 1) * 100).toFixed(1); + document.getElementById("energyValue").setAttribute("title", growth + "% increase from 2025"); +}()); + diff --git a/public/js/redirect.js b/public/js/redirect.js new file mode 100644 index 0000000..dc505c1 --- /dev/null +++ b/public/js/redirect.js @@ -0,0 +1,6 @@ +/* Redirect stubs (seo::REDIRECTS): forward to data-to, keeping any ?query + and #hash. Only a root-relative target is followed. */ +(() => { + const to = document.currentScript && document.currentScript.dataset.to; + if (typeof to === 'string' && /^\/(?!\/)/.test(to)) location.replace(to + location.search + location.hash); +})(); diff --git a/public/js/turing.js b/public/js/turing.js new file mode 100644 index 0000000..79fc5c2 --- /dev/null +++ b/public/js/turing.js @@ -0,0 +1,215 @@ +(function(){ +"use strict"; +var $ = function(id){ return document.getElementById(id); }; + +/* ---------- scroll progress ---------- */ +var prog = $("progress"); +function onScroll(){ + var h = document.documentElement; + var p = h.scrollTop / (h.scrollHeight - h.clientHeight); + prog.style.width = (p*100).toFixed(2) + "%"; +} +window.addEventListener("scroll", onScroll, {passive:true}); onScroll(); + +/* ---------- reveal on scroll ---------- */ +var io = new IntersectionObserver(function(es){ + es.forEach(function(e){ if(e.isIntersecting){ e.target.classList.add("visible"); io.unobserve(e.target); } }); +},{threshold:.12}); +document.querySelectorAll(".reveal").forEach(function(el){ io.observe(el); }); + +/* ---------- hero particle field: scattered bits coalescing ---------- */ +var cv = $("field"), ctx = cv.getContext("2d"), W=0, H=0, parts=[]; +function sizeCanvas(){ + W = cv.width = cv.offsetWidth; H = cv.height = cv.offsetHeight; + parts = []; + var n = Math.max(90, Math.min(240, Math.floor(W*H/9000))); + for(var i=0;i<n;i++){ + parts.push({ + hx: Math.random()*W, hy: Math.random()*H, + sa: Math.random()*Math.PI*2, + sr: 26 + Math.random()*Math.min(W,H)*0.30, + s: .7 + Math.random()*1.9, + sp: .5 + Math.random()*.9, + c: Math.random()<.72 ? "45,127,249" : "0,229,153", + dr: (Math.random()-.5)*.14 + }); + } +} +sizeCanvas(); window.addEventListener("resize", sizeCanvas); +function ease(x){ return x<.5 ? 2*x*x : 1-Math.pow(-2*x+2,2)/2; } +var t0 = performance.now(); +function frame(now){ + var t = ((now - t0)/16000) % 1; /* 16s loop */ + var k = t<.5 ? ease(t*2) : ease((1-t)*2); /* 0 scattered, 1 coalesced */ + ctx.clearRect(0,0,W,H); + ctx.globalCompositeOperation = "lighter"; + var cx = W/2, cy = H*0.40, rot = now*0.00012; + for(var i=0;i<parts.length;i++){ + var p = parts[i]; + p.hx += p.dr; p.hy += p.dr*.6; + if(p.hx<0)p.hx=W; if(p.hx>W)p.hx=0; if(p.hy<0)p.hy=H; if(p.hy>H)p.hy=0; + var a = p.sa + rot*p.sp; + var tx = cx + Math.cos(a)*p.sr, ty = cy + Math.sin(a)*p.sr*.72; + var x = p.hx + (tx-p.hx)*k, y = p.hy + (ty-p.hy)*k; + var al = .16 + .6*k; + ctx.beginPath(); ctx.arc(x, y, p.s*(0.7+0.9*k), 0, 6.2832); + ctx.fillStyle = "rgba("+p.c+","+al.toFixed(3)+")"; ctx.fill(); + } + ctx.globalCompositeOperation = "source-over"; + requestAnimationFrame(frame); +} +requestAnimationFrame(frame); + +/* ---------- GAME 1: crack the code ---------- */ +var g1rules = document.querySelectorAll("#g1-rules .rule-btn"); +var g1tiles = [$("g1-h0"),$("g1-h1"),$("g1-h2")]; +function paintTiles(vals, ok){ + g1tiles.forEach(function(t,i){ + t.textContent = vals[i]; + t.style.borderStyle = "solid"; + if(ok===true){ t.style.background="rgba(0,229,153,.14)"; t.style.borderColor="#00e599"; t.style.color="#00e599"; } + else if(ok===false){ t.style.background="rgba(255,93,93,.12)"; t.style.borderColor="#ff5d5d"; t.style.color="#ff5d5d"; } + }); +} +function resetTiles(){ + g1tiles.forEach(function(t){ + t.textContent="?"; t.style.background=""; t.style.borderColor=""; t.style.color=""; t.style.borderStyle=""; + }); +} +var g1data = { + good: { vals:["28","33","38"], ok:true, cls:"good", + verdict:"+2.6 T. The rule earns its keep.", + math:"3 sealed events nailed <b>+3.0</b><br>rule rent, 4 words × 0.1 <b>−0.4</b><br>= <b>+2.6 T</b>", + explain:"<strong>Why it wins:</strong> four words that keep working on data nobody has seen. The rent is tiny and the prediction is total. This is what a Turing rewards." }, + memo: { vals:["23","23","23"], ok:false, cls:"bad", + verdict:"−1.0 T. Memory is not understanding.", + math:"0 sealed events predicted <b>+0.0</b><br>rule rent, 10 words × 0.1 <b>−1.0</b><br>= <b>−1.0 T</b>", + explain:"<strong>Why it fails:</strong> the rule only recites what was already shown, so when it meets sealed numbers it just repeats the last thing it saw. Ten words of rent, zero prediction. Negative Turings." }, + wrong: { vals:["43","83","163"], ok:false, cls:"bad", + verdict:"−0.5 T. Confident and wrong.", + math:"0 sealed events predicted <b>+0.0</b><br>rule rent, 5 words × 0.1 <b>−0.5</b><br>= <b>−0.5 T</b>", + explain:"<strong>Why it fails:</strong> it sounds like a rule, but the sealed data disagrees with every guess. The scorer does not grade confidence. It grades sealed predictions minus rent." } +}; +g1rules.forEach(function(btn){ + btn.addEventListener("click", function(){ + var d = g1data[btn.getAttribute("data-rule")]; + g1rules.forEach(function(b){ b.disabled=true; b.classList.add("dim"); }); + btn.classList.remove("dim"); btn.classList.add("picked"); + paintTiles(d.vals, d.ok); + $("g1-score").textContent = d.cls==="good" ? "+2.6 T" : (btn.getAttribute("data-rule")==="memo" ? "-1.0 T" : "-0.5 T"); + var v=$("g1-verdict"); v.className="verdict "+d.cls; v.innerHTML=d.verdict; + $("g1-math").innerHTML=d.math; $("g1-explain").innerHTML=d.explain; + $("g1-result").classList.add("show"); + }); +}); +$("g1-again").addEventListener("click", function(){ + g1rules.forEach(function(b){ b.disabled=false; b.classList.remove("dim","picked"); }); + resetTiles(); $("g1-result").classList.remove("show"); $("g1-score").textContent="--"; +}); + +/* ---------- RULE LAB ---------- */ +var rGain=$("r-gain"), rCost=$("r-cost"); +function lab(){ + var g=+rGain.value, c=+rCost.value, rent=c*0.1, t=g-rent; + $("o-gain").textContent=g; $("o-cost").textContent=c; + var tv=$("lab-t"); + var txt=(t>0?"+":"")+(Math.round(t*10)/10).toFixed(1)+" T"; + tv.textContent=txt; + tv.className="tval "+(t>0?"pos":t<0?"neg":"zero"); + $("lab-f-gain").textContent=g; $("lab-f-cost").textContent=rent.toFixed(1); + var ft=$("lab-f-t"); ft.textContent=txt; ft.style.color=t>0?"#00e599":t<0?"#ff5d5d":"#94a3b8"; + var w=Math.max(3,Math.min(100,(t+4)/16*100)); + var bar=$("lab-bar"); bar.style.width=w+"%"; + bar.style.background=t>0?"linear-gradient(90deg,#2d7ff9,#00e599)":t<0?"linear-gradient(90deg,#7f1d1d,#ff5d5d)":"#475569"; + var note=$("lab-note"), msg; + if(t>=8) msg="Theory territory. Short, powerful, keeps predicting on unseen data."; + else if(t>=3) msg="A solid explanation. It earns its keep with room to spare."; + else if(t>0) msg="Positive but thin. Can you say it in fewer words?"; + else if(t===0) msg="Exactly at baseline. It predicts nothing beyond its own cost."; + else msg="Memorizer zone: longer than the insight it carries. The scorer charges rent."; + note.textContent=msg; +} +rGain.addEventListener("input", lab); rCost.addEventListener("input", lab); lab(); + +/* ---------- GAME 2: beat the memorizer ---------- */ +var rounds=[ + {q:"Duel 1: the number game", sub:"A machine watched 3, 8, 13, 18, 23, then sealed data.", + a:{who:"CANDIDATE A", text:"\u201Cadd 5 each time\u201D (4 words)"}, + b:{who:"CANDIDATE B", text:"\u201Cthe numbers are 3, 8, 13, 18, 23, 28, 33, 38\u201D (12 words)"}, + correct:"a", + why:"<strong>A wins.</strong> Both name the hidden numbers, but B is three times longer and carries no reusable rule. On a brand-new game, A still works and B knows nothing. Turings reward the rule, not the recital."}, + {q:"Duel 2: the night sky", sub:"Two explanations of dots moving overhead.", + a:{who:"CANDIDATE A", text:"\u201Cplanets orbit the sun in ellipses\u201D (6 words)"}, + b:{who:"CANDIDATE B", text:"\u201C4,000 sky-dots move along these 4,000 listed paths\u201D (plus a 4,000-line table)"}, + correct:"a", + why:"<strong>A wins.</strong> Six words that predict every future night. B is a phone book of the sky: enormous rent, zero generalization. This is the whole game in one duel."}, + {q:"Duel 3: the twist", sub:"Now length is not the whole story.", + a:{who:"CANDIDATE A", text:"\u201Cadd 5 each time\u201D (4 words), predicts 3 sealed events"}, + b:{who:"CANDIDATE B", text:"\u201Cadd 5 each time, except after primes add 7\u201D (10 words), predicts 9 sealed events"}, + correct:"b", + why:"<strong>B wins.</strong> 9 predicted minus 1.0 rent = +8.0 T, against A's 3 minus 0.4 = +2.6 T. A longer rule CAN win, but only if the extra words buy more prediction than they cost. That is what \u201Cnet\u201D means."} +]; +var g2score=0, g2done=0; +var wrap=$("g2-rounds"); +rounds.forEach(function(r,i){ + var card=document.createElement("div"); card.className="quiz-card"; + card.innerHTML='<p class="quiz-q">'+r.q+'</p><p class="quiz-sub">'+r.sub+'</p>'+ + '<div class="duel"><button data-pick="a"><span class="who">'+r.a.who+'</span>'+r.a.text+'</button>'+ + '<button data-pick="b"><span class="who">'+r.b.who+'</span>'+r.b.text+'</button></div>'+ + '<div class="quiz-why"></div>'; + wrap.appendChild(card); + var btns=card.querySelectorAll("button"), why=card.querySelector(".quiz-why"), open=false; + btns.forEach(function(b){ + b.addEventListener("click", function(){ + if(open) return; open=true; g2done++; + var pick=b.getAttribute("data-pick"), win=pick===r.correct; + btns.forEach(function(x){ + x.disabled=true; + if(x.getAttribute("data-pick")===r.correct) x.classList.add("right"); else x.classList.add("wrong"); + }); + if(win){ g2score++; } + why.innerHTML=(win?"<strong style='color:#00e599'>Correct. </strong>":"<strong style='color:#ff5d5d'>Not this one. </strong>")+r.why; + why.classList.add("show"); + $("g2-score").textContent=g2score+" / 3"; + if(g2done===3){ + var msg=g2score===3?"Flawless. You score explanations like the instrument does.": + g2score===2?"Strong. Round 3 tricks almost everyone the first time.": + "The twist got you. Replay it: net means prediction minus rent, always."; + var d=document.createElement("p"); d.className="explain"; d.style.marginTop="22px"; + d.innerHTML="<strong>"+msg+"</strong>"; + wrap.appendChild(d); + } + }); + }); +}); + +/* ---------- big number count-up ---------- */ +var bignum=$("bignum"), counted=false; +function fmt(n){ return n.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}); } +var bio=new IntersectionObserver(function(es){ + es.forEach(function(e){ + if(e.isIntersecting && !counted){ + counted=true; var target=2559679.825, start=performance.now(), dur=2200; + (function tick(now){ + var p=Math.min(1,(now-start)/dur), v=target*(1-Math.pow(1-p,3)); + bignum.textContent=fmt(v); + if(p<1) requestAnimationFrame(tick); else bignum.textContent=fmt(target); + })(start); + var gc=$("gcurve"); + gc.style.transition="stroke-dashoffset 2.2s ease .3s"; gc.style.strokeDashoffset="0"; + bio.disconnect(); + } + }); +},{threshold:.3}); +bio.observe(document.querySelector(".bigstat")); +var cio=new IntersectionObserver(function(es){ + es.forEach(function(e){ + if(e.isIntersecting){ + var gc=$("gcurve"); + gc.style.transition="stroke-dashoffset 2.2s ease .3s"; gc.style.strokeDashoffset="0"; + cio.disconnect(); + } + }); +},{threshold:.4}); +cio.observe($("gcurve")); +})(); diff --git a/public/post-llm-case/.crumb b/public/post-llm-case/.crumb index 30e2f0b..05f235f 100644 --- a/public/post-llm-case/.crumb +++ b/public/post-llm-case/.crumb @@ -3,14 +3,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-30T21:57:23Z", + "compiled_at": "2026-10-31T09:45:58Z", "compiler": "crumb-compile/1", - "digest": "sha256:936828b67284e18ab0ab934dfa6010a80e0adf4ea6cf29753f304b9b5edba1ec", + "digest": "sha256:92ddc743ca7340b6a0f015a1ca78e1f6978e87f089182fe0bf1abc9e6b4fe48d", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 1, - "generated_at_commit": "06d824b1d063d7cfd2e8a40294f22880e8a7a77d", - "source_tree": "sha256:e16d6d45de0f0cbb1edb11a2c8a4a2f65c657c7b8550ec4232788418e2b3e5ca" + "generated_at_commit": "863c0faa01ef9615fb77bb8f7d38ac43b1e9b143", + "source_tree": "sha256:80e2a7f7fbcee87d93a8cc7a651f305481d6c9eb7861c54e4531ab2dd4d29284" } }, "layer": "website", diff --git a/public/post-llm-case/index.html b/public/post-llm-case/index.html index 3b9703a..5dca2bc 100644 --- a/public/post-llm-case/index.html +++ b/public/post-llm-case/index.html @@ -929,58 +929,6 @@ </div> </section> - <script> - (function () { - var datasets = { - global: { - values: [{ label: "2025", value: 447 }, { label: "2026", value: 565 }], - max: 600, - ticks: [0, 200, 400, 600], - suffix: " TWh", - color: "#4bd3a1" - }, - ai: { - values: [{ label: "2025", value: 95 }, { label: "2026", value: 175 }, { label: "2027*", value: 258 }], - max: 300, - ticks: [0, 100, 200, 300], - suffix: " TWh", - color: "#ff7864" - } - }; - var NS = "http://www.w3.org/2000/svg"; - function node(name, attrs, text) { - var el = document.createElementNS(NS, name); - Object.keys(attrs || {}).forEach(function (key) { el.setAttribute(key, attrs[key]); }); - if (text !== undefined) el.textContent = text; - return el; - } - function renderChart(id, data) { - var host = document.getElementById(id); - var width = 560, height = 270, left = 52, right = 18, top = 22, bottom = 46; - var plotW = width - left - right, plotH = height - top - bottom; - var svg = node("svg", { viewBox: "0 0 " + width + " " + height, "aria-hidden": "true", focusable: "false" }); - data.ticks.forEach(function (tick) { - var y = top + plotH - (tick / data.max) * plotH; - svg.appendChild(node("line", { x1: left, y1: y, x2: width - right, y2: y, stroke: "currentColor", "stroke-opacity": ".20", "stroke-width": "1" })); - svg.appendChild(node("text", { x: left - 10, y: y + 4, "text-anchor": "end", fill: "currentColor", "fill-opacity": ".66", "font-size": "11", "font-family": "IBM Plex Mono, monospace" }, String(tick))); - }); - var slot = plotW / data.values.length; - var barW = Math.min(96, slot * .48); - data.values.forEach(function (d, i) { - var h = (d.value / data.max) * plotH; - var x = left + slot * i + (slot - barW) / 2; - var y = top + plotH - h; - svg.appendChild(node("rect", { x: x, y: y, width: barW, height: h, fill: data.color })); - svg.appendChild(node("text", { x: x + barW / 2, y: y - 9, "text-anchor": "middle", fill: "currentColor", "font-size": "13", "font-weight": "700", "font-family": "IBM Plex Mono, monospace" }, d.value + data.suffix)); - svg.appendChild(node("text", { x: x + barW / 2, y: height - 17, "text-anchor": "middle", fill: "currentColor", "fill-opacity": ".75", "font-size": "12", "font-family": "IBM Plex Mono, monospace" }, d.label)); - }); - host.appendChild(svg); - } - renderChart("chartGlobal", datasets.global); - renderChart("chartAI", datasets.ai); - var growth = ((datasets.global.values[1].value / datasets.global.values[0].value - 1) * 100).toFixed(1); - document.getElementById("energyValue").setAttribute("title", growth + "% increase from 2025"); - }()); - </script> + <script src="/js/post-llm-case.js"></script> </body> </html> diff --git a/public/turing/index.html b/public/turing/index.html index d4a5c93..80726a4 100644 --- a/public/turing/index.html +++ b/public/turing/index.html @@ -561,222 +561,6 @@ Version 1.14 (not peer reviewed).</div> <a href="/research/">Aien Research</a> · <a href="https://github.com/aien-dev/omega">Omega on GitHub</a> </footer> -<script> -(function(){ -"use strict"; -var $ = function(id){ return document.getElementById(id); }; - -/* ---------- scroll progress ---------- */ -var prog = $("progress"); -function onScroll(){ - var h = document.documentElement; - var p = h.scrollTop / (h.scrollHeight - h.clientHeight); - prog.style.width = (p*100).toFixed(2) + "%"; -} -window.addEventListener("scroll", onScroll, {passive:true}); onScroll(); - -/* ---------- reveal on scroll ---------- */ -var io = new IntersectionObserver(function(es){ - es.forEach(function(e){ if(e.isIntersecting){ e.target.classList.add("visible"); io.unobserve(e.target); } }); -},{threshold:.12}); -document.querySelectorAll(".reveal").forEach(function(el){ io.observe(el); }); - -/* ---------- hero particle field: scattered bits coalescing ---------- */ -var cv = $("field"), ctx = cv.getContext("2d"), W=0, H=0, parts=[]; -function sizeCanvas(){ - W = cv.width = cv.offsetWidth; H = cv.height = cv.offsetHeight; - parts = []; - var n = Math.max(90, Math.min(240, Math.floor(W*H/9000))); - for(var i=0;i<n;i++){ - parts.push({ - hx: Math.random()*W, hy: Math.random()*H, - sa: Math.random()*Math.PI*2, - sr: 26 + Math.random()*Math.min(W,H)*0.30, - s: .7 + Math.random()*1.9, - sp: .5 + Math.random()*.9, - c: Math.random()<.72 ? "45,127,249" : "0,229,153", - dr: (Math.random()-.5)*.14 - }); - } -} -sizeCanvas(); window.addEventListener("resize", sizeCanvas); -function ease(x){ return x<.5 ? 2*x*x : 1-Math.pow(-2*x+2,2)/2; } -var t0 = performance.now(); -function frame(now){ - var t = ((now - t0)/16000) % 1; /* 16s loop */ - var k = t<.5 ? ease(t*2) : ease((1-t)*2); /* 0 scattered, 1 coalesced */ - ctx.clearRect(0,0,W,H); - ctx.globalCompositeOperation = "lighter"; - var cx = W/2, cy = H*0.40, rot = now*0.00012; - for(var i=0;i<parts.length;i++){ - var p = parts[i]; - p.hx += p.dr; p.hy += p.dr*.6; - if(p.hx<0)p.hx=W; if(p.hx>W)p.hx=0; if(p.hy<0)p.hy=H; if(p.hy>H)p.hy=0; - var a = p.sa + rot*p.sp; - var tx = cx + Math.cos(a)*p.sr, ty = cy + Math.sin(a)*p.sr*.72; - var x = p.hx + (tx-p.hx)*k, y = p.hy + (ty-p.hy)*k; - var al = .16 + .6*k; - ctx.beginPath(); ctx.arc(x, y, p.s*(0.7+0.9*k), 0, 6.2832); - ctx.fillStyle = "rgba("+p.c+","+al.toFixed(3)+")"; ctx.fill(); - } - ctx.globalCompositeOperation = "source-over"; - requestAnimationFrame(frame); -} -requestAnimationFrame(frame); - -/* ---------- GAME 1: crack the code ---------- */ -var g1rules = document.querySelectorAll("#g1-rules .rule-btn"); -var g1tiles = [$("g1-h0"),$("g1-h1"),$("g1-h2")]; -function paintTiles(vals, ok){ - g1tiles.forEach(function(t,i){ - t.textContent = vals[i]; - t.style.borderStyle = "solid"; - if(ok===true){ t.style.background="rgba(0,229,153,.14)"; t.style.borderColor="#00e599"; t.style.color="#00e599"; } - else if(ok===false){ t.style.background="rgba(255,93,93,.12)"; t.style.borderColor="#ff5d5d"; t.style.color="#ff5d5d"; } - }); -} -function resetTiles(){ - g1tiles.forEach(function(t){ - t.textContent="?"; t.style.background=""; t.style.borderColor=""; t.style.color=""; t.style.borderStyle=""; - }); -} -var g1data = { - good: { vals:["28","33","38"], ok:true, cls:"good", - verdict:"+2.6 T. The rule earns its keep.", - math:"3 sealed events nailed <b>+3.0</b><br>rule rent, 4 words × 0.1 <b>−0.4</b><br>= <b>+2.6 T</b>", - explain:"<strong>Why it wins:</strong> four words that keep working on data nobody has seen. The rent is tiny and the prediction is total. This is what a Turing rewards." }, - memo: { vals:["23","23","23"], ok:false, cls:"bad", - verdict:"−1.0 T. Memory is not understanding.", - math:"0 sealed events predicted <b>+0.0</b><br>rule rent, 10 words × 0.1 <b>−1.0</b><br>= <b>−1.0 T</b>", - explain:"<strong>Why it fails:</strong> the rule only recites what was already shown, so when it meets sealed numbers it just repeats the last thing it saw. Ten words of rent, zero prediction. Negative Turings." }, - wrong: { vals:["43","83","163"], ok:false, cls:"bad", - verdict:"−0.5 T. Confident and wrong.", - math:"0 sealed events predicted <b>+0.0</b><br>rule rent, 5 words × 0.1 <b>−0.5</b><br>= <b>−0.5 T</b>", - explain:"<strong>Why it fails:</strong> it sounds like a rule, but the sealed data disagrees with every guess. The scorer does not grade confidence. It grades sealed predictions minus rent." } -}; -g1rules.forEach(function(btn){ - btn.addEventListener("click", function(){ - var d = g1data[btn.getAttribute("data-rule")]; - g1rules.forEach(function(b){ b.disabled=true; b.classList.add("dim"); }); - btn.classList.remove("dim"); btn.classList.add("picked"); - paintTiles(d.vals, d.ok); - $("g1-score").textContent = d.cls==="good" ? "+2.6 T" : (btn.getAttribute("data-rule")==="memo" ? "-1.0 T" : "-0.5 T"); - var v=$("g1-verdict"); v.className="verdict "+d.cls; v.innerHTML=d.verdict; - $("g1-math").innerHTML=d.math; $("g1-explain").innerHTML=d.explain; - $("g1-result").classList.add("show"); - }); -}); -$("g1-again").addEventListener("click", function(){ - g1rules.forEach(function(b){ b.disabled=false; b.classList.remove("dim","picked"); }); - resetTiles(); $("g1-result").classList.remove("show"); $("g1-score").textContent="--"; -}); - -/* ---------- RULE LAB ---------- */ -var rGain=$("r-gain"), rCost=$("r-cost"); -function lab(){ - var g=+rGain.value, c=+rCost.value, rent=c*0.1, t=g-rent; - $("o-gain").textContent=g; $("o-cost").textContent=c; - var tv=$("lab-t"); - var txt=(t>0?"+":"")+(Math.round(t*10)/10).toFixed(1)+" T"; - tv.textContent=txt; - tv.className="tval "+(t>0?"pos":t<0?"neg":"zero"); - $("lab-f-gain").textContent=g; $("lab-f-cost").textContent=rent.toFixed(1); - var ft=$("lab-f-t"); ft.textContent=txt; ft.style.color=t>0?"#00e599":t<0?"#ff5d5d":"#94a3b8"; - var w=Math.max(3,Math.min(100,(t+4)/16*100)); - var bar=$("lab-bar"); bar.style.width=w+"%"; - bar.style.background=t>0?"linear-gradient(90deg,#2d7ff9,#00e599)":t<0?"linear-gradient(90deg,#7f1d1d,#ff5d5d)":"#475569"; - var note=$("lab-note"), msg; - if(t>=8) msg="Theory territory. Short, powerful, keeps predicting on unseen data."; - else if(t>=3) msg="A solid explanation. It earns its keep with room to spare."; - else if(t>0) msg="Positive but thin. Can you say it in fewer words?"; - else if(t===0) msg="Exactly at baseline. It predicts nothing beyond its own cost."; - else msg="Memorizer zone: longer than the insight it carries. The scorer charges rent."; - note.textContent=msg; -} -rGain.addEventListener("input", lab); rCost.addEventListener("input", lab); lab(); - -/* ---------- GAME 2: beat the memorizer ---------- */ -var rounds=[ - {q:"Duel 1: the number game", sub:"A machine watched 3, 8, 13, 18, 23, then sealed data.", - a:{who:"CANDIDATE A", text:"\u201Cadd 5 each time\u201D (4 words)"}, - b:{who:"CANDIDATE B", text:"\u201Cthe numbers are 3, 8, 13, 18, 23, 28, 33, 38\u201D (12 words)"}, - correct:"a", - why:"<strong>A wins.</strong> Both name the hidden numbers, but B is three times longer and carries no reusable rule. On a brand-new game, A still works and B knows nothing. Turings reward the rule, not the recital."}, - {q:"Duel 2: the night sky", sub:"Two explanations of dots moving overhead.", - a:{who:"CANDIDATE A", text:"\u201Cplanets orbit the sun in ellipses\u201D (6 words)"}, - b:{who:"CANDIDATE B", text:"\u201C4,000 sky-dots move along these 4,000 listed paths\u201D (plus a 4,000-line table)"}, - correct:"a", - why:"<strong>A wins.</strong> Six words that predict every future night. B is a phone book of the sky: enormous rent, zero generalization. This is the whole game in one duel."}, - {q:"Duel 3: the twist", sub:"Now length is not the whole story.", - a:{who:"CANDIDATE A", text:"\u201Cadd 5 each time\u201D (4 words), predicts 3 sealed events"}, - b:{who:"CANDIDATE B", text:"\u201Cadd 5 each time, except after primes add 7\u201D (10 words), predicts 9 sealed events"}, - correct:"b", - why:"<strong>B wins.</strong> 9 predicted minus 1.0 rent = +8.0 T, against A's 3 minus 0.4 = +2.6 T. A longer rule CAN win, but only if the extra words buy more prediction than they cost. That is what \u201Cnet\u201D means."} -]; -var g2score=0, g2done=0; -var wrap=$("g2-rounds"); -rounds.forEach(function(r,i){ - var card=document.createElement("div"); card.className="quiz-card"; - card.innerHTML='<p class="quiz-q">'+r.q+'</p><p class="quiz-sub">'+r.sub+'</p>'+ - '<div class="duel"><button data-pick="a"><span class="who">'+r.a.who+'</span>'+r.a.text+'</button>'+ - '<button data-pick="b"><span class="who">'+r.b.who+'</span>'+r.b.text+'</button></div>'+ - '<div class="quiz-why"></div>'; - wrap.appendChild(card); - var btns=card.querySelectorAll("button"), why=card.querySelector(".quiz-why"), open=false; - btns.forEach(function(b){ - b.addEventListener("click", function(){ - if(open) return; open=true; g2done++; - var pick=b.getAttribute("data-pick"), win=pick===r.correct; - btns.forEach(function(x){ - x.disabled=true; - if(x.getAttribute("data-pick")===r.correct) x.classList.add("right"); else x.classList.add("wrong"); - }); - if(win){ g2score++; } - why.innerHTML=(win?"<strong style='color:#00e599'>Correct. </strong>":"<strong style='color:#ff5d5d'>Not this one. </strong>")+r.why; - why.classList.add("show"); - $("g2-score").textContent=g2score+" / 3"; - if(g2done===3){ - var msg=g2score===3?"Flawless. You score explanations like the instrument does.": - g2score===2?"Strong. Round 3 tricks almost everyone the first time.": - "The twist got you. Replay it: net means prediction minus rent, always."; - var d=document.createElement("p"); d.className="explain"; d.style.marginTop="22px"; - d.innerHTML="<strong>"+msg+"</strong>"; - wrap.appendChild(d); - } - }); - }); -}); - -/* ---------- big number count-up ---------- */ -var bignum=$("bignum"), counted=false; -function fmt(n){ return n.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}); } -var bio=new IntersectionObserver(function(es){ - es.forEach(function(e){ - if(e.isIntersecting && !counted){ - counted=true; var target=2559679.825, start=performance.now(), dur=2200; - (function tick(now){ - var p=Math.min(1,(now-start)/dur), v=target*(1-Math.pow(1-p,3)); - bignum.textContent=fmt(v); - if(p<1) requestAnimationFrame(tick); else bignum.textContent=fmt(target); - })(start); - var gc=$("gcurve"); - gc.style.transition="stroke-dashoffset 2.2s ease .3s"; gc.style.strokeDashoffset="0"; - bio.disconnect(); - } - }); -},{threshold:.3}); -bio.observe(document.querySelector(".bigstat")); -var cio=new IntersectionObserver(function(es){ - es.forEach(function(e){ - if(e.isIntersecting){ - var gc=$("gcurve"); - gc.style.transition="stroke-dashoffset 2.2s ease .3s"; gc.style.strokeDashoffset="0"; - cio.disconnect(); - } - }); -},{threshold:.4}); -cio.observe($("gcurve")); -})(); -</script> +<script src="/js/turing.js"></script> </body> </html> diff --git a/public/zh-CN/index.html b/public/zh-CN/index.html index 9778df8..62395f2 100644 --- a/public/zh-CN/index.html +++ b/public/zh-CN/index.html @@ -1,6 +1,2 @@ <!DOCTYPE html> -<html lang="zh-CN"><head><meta charset="utf-8"/><meta content="width=device-width, initial-scale=1" name="viewport"/><title>AienOS | 您拥有的机器上的持久机器智能</title><meta content="AienOS 是一个实验性的主权机器,用于持久的机器智能:Atlas 在您拥有的硬件上唤醒它,Omega 将意图转化为可验证的程序,Aien 从可验证的经验中学习。每个声明都附带公开的凭证。" name="description"/><link href="/favicon.svg" rel="icon" type="image/svg+xml"/><meta content="AienOS | 您拥有的机器上的持久机器智能" property="og:title"/><meta content="AienOS 是一个实验性的主权机器,用于持久的机器智能:Atlas 在您拥有的硬件上唤醒它,Omega 将意图转化为可验证的程序,Aien 从可验证的经验中学习。每个声明都附带公开的凭证。" property="og:description"/><meta content="https://aienos.com/" property="og:url"/><meta content="website" property="og:type"/><meta content="https://aienos.com/og.png" property="og:image"/><meta content="summary_large_image" name="twitter:card"/><meta content="AienOS | 您拥有的机器上的持久机器智能" name="twitter:title"/><meta content="AienOS 是一个实验性的主权机器,用于持久的机器智能:Atlas 在您拥有的硬件上唤醒它,Omega 将意图转化为可验证的程序,Aien 从可验证的经验中学习。每个声明都附带公开的凭证。" name="twitter:description"/><meta content="https://aienos.com/og.png" name="twitter:image"/><link href="/assets/style.css" rel="stylesheet"/><link href="/assets/site-nav.css" rel="stylesheet"/><link href="/assets/turing-look.css" rel="stylesheet"/><script defer="" src="/js/turing-look.js"></script><script defer="" src="/js/terminal.js"></script><script defer="" src="/js/turing-game.js"></script><script> - document.addEventListener('DOMContentLoaded', () => { - console.log('[AienOS] Pure Rust Maud engine online. Zero hydration overhead.'); - }); - </script><link href="https://www.aienos.com/zh-CN/" rel="canonical"/><link href="https://www.aienos.com/" hreflang="en" rel="alternate"/><link href="https://www.aienos.com/zh-CN/" hreflang="zh-CN" rel="alternate"/></head><body><div id="root" style="min-height: 100vh; display: flex; flex-direction: column;"><a class="skip-link" href="#main-content">跳转到内容</a><header class="aien-header"><div class="aien-header-inner"><a aria-label="AienOS 主页" class="aien-brand" href="/zh-CN/"><span aria-hidden="true" class="aien-brand-mark"><svg fill="none" height="18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewbox="0 0 24 24" width="18"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" x2="20" y1="19" y2="19"></line></svg></span><span class="aien-brand-copy"><span class="aien-brand-name">AienOS</span><span class="aien-brand-tag">持久的机器智能</span></span></a><nav aria-label="主要导航" class="aien-nav"><ul class="aien-nav-primary"><li><a class="aien-nav-link" href="/zh-CN/machine/">机器</a></li><li><a class="aien-nav-link" href="/zh-CN/turing/">图灵</a></li><li><a class="aien-nav-link" href="/zh-CN/experiments/">实验</a></li><li><a class="aien-nav-link" href="/zh-CN/discovery/">科学发现</a></li><li><a class="aien-nav-link" href="/zh-CN/evidence/">证据</a></li><li><a class="aien-nav-link" href="/zh-CN/philosophy/">哲学</a></li></ul><ul aria-label="更多" class="aien-nav-secondary"><li><a class="aien-nav-minor" href="/zh-CN/progress/">进展</a></li><li><a class="aien-nav-minor" href="/zh-CN/blog">博客</a></li><li><a class="aien-nav-minor" href="/zh-CN/#follow">关注</a></li><li><a class="aien-nav-minor" href="https://github.com/aien-dev">GitHub</a></li></ul><ul aria-label="Language" class="aien-nav-secondary aien-nav-lang" translate="no"><li><a class="aien-nav-minor" href="/" hreflang="en" lang="en">English</a></li><li><a class="aien-nav-minor" href="/zh-CN/" hreflang="zh-CN" lang="zh-CN">简体中文</a></li></ul></nav></div></header><main id="main-content" style="flex: 1;"><section aria-labelledby="home-lead" class="home-top bg-grid" id="top"><div class="container"><div class="home-column"><div class="home-badges"><span class="badge badge-amber">实验性 · 预发布版</span><span class="badge badge-blue">开源 · Apache-2.0 WITH LLVM-exception</span></div><h1 class="home-lead" id="home-lead">AienOS 是一个由您拥有的实验性机器,用于将搜索转化为可验证的理解。</h1><p class="home-lead-rest">Aien 提出结构。Omega 将该结构显式化并可验证。机器在权威下对其实行现实检验。图灵衡量实际学到的内容。Cortex 保存证据。然后下一次搜索从幸存下来的部分开始。</p><div class="home-thesis"><p>AienOS 是一种尝试,将持久的机器智能构建为科学过程,而非模型调用。神经机制可能提出想法,但这些想法并无权威性。</p><p>Omega 将其转化为显式的程序和理论;验证决定其内部有效性;拥有机器在物理现实中测试它们;图灵衡量它们在支付自身复杂性成本后是否能解释未见的观测;Cortex 保存证据;而这些经过验证的经验改变了下一次搜索。</p><p>Atlas 跨硬件传承其谱系。目标不是一台听起来像理解的机器,而是一台其解释力增长可被测量、证伪、复现和拥有的机器。</p></div></div><p class="home-slogan">权重暗示。程序解释。验证决定。证据教学。图灵记分。</p><figure aria-labelledby="loop-title" class="loop"><h2 class="loop-title" id="loop-title">循环</h2><p class="loop-intro">提案沿生成路径前行,遭遇现实,并被评分。幸存的证据启动下一次搜索。一个由权威、观察和凭证构成的边界围绕整个循环。</p><ul aria-label="如何阅读此图示" class="loop-legend"><li class="loop-key loop-key-gen">生成路径</li><li class="loop-key loop-key-feedback">证据反馈</li><li class="loop-key loop-key-perimeter">验证与权威边界</li></ul><div class="loop-perimeter"><p class="loop-perimeter-label">边界:围绕循环,而非某个阶段</p><ul aria-label="边界、权限与观测" class="loop-perimeter-band"><li class="loop-guard"><span class="loop-guard-name">AEGIS</span><span class="loop-guard-role">权威 + 证明边界</span></li><li class="loop-guard"><span class="loop-guard-name">ARGUS</span><span class="loop-guard-role">观察 / 审计</span></li></ul><ol aria-label="循环阶段,按顺序" class="loop-stages"><li class="loop-stage loop-stage-gen"><span class="loop-stage-name">ATLAS</span><span class="loop-stage-role">觉醒 / 谱系</span><span class="loop-stage-band">生成路径</span></li><li class="loop-stage loop-stage-gen"><span class="loop-stage-name">AienOS</span><span class="loop-stage-role">持久的拥有基础</span><span class="loop-stage-band">生成路径</span></li><li class="loop-stage loop-stage-gen"><span class="loop-stage-name">Aien</span><span class="loop-stage-role">提出 / 引导搜索</span><span class="loop-stage-band">生成路径</span></li><li class="loop-stage loop-stage-gen"><span class="loop-stage-name">OMEGA</span><span class="loop-stage-role">形式化 / 搜索 / 验证意义</span><span class="loop-stage-band">生成路径</span></li><li class="loop-stage loop-stage-gen"><span class="loop-stage-name">FORGE</span><span class="loop-stage-role">实现</span><span class="loop-stage-band">生成路径</span></li><li class="loop-stage loop-stage-reality"><span class="loop-stage-name">REALITY</span><span class="loop-stage-role">执行 / 响应</span><span class="loop-stage-band">与现实接触</span></li><li class="loop-stage loop-stage-feedback"><span class="loop-stage-name">TURING</span><span class="loop-stage-role">评分解释性提升</span><span class="loop-stage-band">证据反馈</span></li><li class="loop-stage loop-stage-feedback"><span class="loop-stage-name">CORTEX</span><span class="loop-stage-role">保存证据</span><span class="loop-stage-band">证据反馈</span></li></ol><p class="loop-return"><span aria-hidden="true" class="loop-return-arrow">↺</span><span>返回下一次 <strong>Aien / Omega 搜索</strong>:Cortex 的证据为下一轮提供输入。</span></p><ul aria-label="边界、能力与凭证" class="loop-perimeter-band"><li class="loop-guard"><span class="loop-guard-name">能力系统</span><span class="loop-guard-role">控制可能发生的事</span></li><li class="loop-guard"><span class="loop-guard-name">证据凭证</span><span class="loop-guard-role">使结果可复现</span></li></ul></div><figcaption class="loop-caption">ATLAS、AienOS、Aien、OMEGA、FORGE、REALITY、TURING 和 CORTEX 是各个阶段。AEGIS、ARGUS、能力系统和证据凭证构成了围绕它们的边界。</figcaption></figure><div class="home-questions"><h2 class="home-questions-title">循环中的三个问题</h2><ol class="home-q-list"><li class="home-q"><p class="home-q-question">它学到了什么吗?</p><p class="home-q-measure"><span class="home-q-measure-name">图灵增益</span> <span class="home-q-badge status-experimental">TY-2 通过</span></p><p class="home-q-meaning">在保留的现实之外仍能成立的网络解释结构。</p><p class="home-q-note">TY-2 记录了 2,559,679.825 比特的图灵增益。</p></li><li class="home-q"><p class="home-q-question">学习的成本是多少?</p><p class="home-q-measure"><span class="home-q-measure-name">图灵产出</span> <span class="home-q-badge status-planned">尚未开始</span></p><p class="home-q-meaning">经测量的物理资源所对应的验证解释增益。</p><p class="home-q-note">由于尚未测量能量,每焦耳的图灵数无法计算,因此此项尚未启动。</p></li><li class="home-q"><p class="home-q-question">它所学的内容是否让未来的发现更容易?</p><p class="home-q-measure"><span class="home-q-measure-name">搜索/验证差距</span></p><p class="home-q-meaning">所获取的抽象是否会降低未来搜索的复杂性。</p><p class="home-q-note">这是一个我们希望研究的开放问题。目前此处尚未有任何测量结果。</p></li></ol></div><div class="home-actions"><a class="home-cta home-cta-primary" href="#evidence">查看证据</a><a class="home-cta" href="#architecture">探索架构</a><a class="home-cta home-cta-ghost" href="https://github.com/aien-dev" rel="noopener noreferrer" target="_blank">GitHub</a></div><ul class="home-checks"><li>C 内核通过 UEFI 启动 ✓</li><li>每个主张都附有凭证 ✓</li><li>失败记录公开,不隐藏 ✓</li></ul></div></section><section id="story" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle);"><div class="container"><div style="max-width: 760px; margin-bottom: 36px;"><div class="badge badge-green" style="margin-bottom: 12px;">这是什么</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">不是运行在他人计算机上的另一个应用程序</h2><p style="color: var(--text-secondary); margin-top: 16px; line-height: 1.7; font-size: 16px;">大多数人工智能存在于租用的堆栈中。提供商拥有机器、模型、价格和关机开关。你的代理依附于他们的意愿存在,按他们的计划遗忘,并在他们的条款下工作。</p><p style="color: var(--text-secondary); margin-top: 14px; line-height: 1.7; font-size: 16px;">AienOS 是相反的赌注:一台主权机器,从固件之后的第一条指令开始构建,其中持续存在的智能运行在你拥有的硬件上。它将记忆、身份和凭证保留在你这一侧。底层硬件是能力,而非身份:机器可以更换,但传承得以延续。</p></div></div></section><section id="evidence" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface);"><div class="container"><div style="margin-bottom: 40px; max-width: 760px;"><div class="badge badge-green" style="margin-bottom: 12px;">证明,而非承诺</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">每个主张都附有凭证</h2><p style="color: var(--text-secondary); margin-top: 8px; line-height: 1.6;">本项目不寻求被相信。每张卡片都标明其环境、其关卡、其日期以及其结论,并明确说明凭证证明了什么,以及未证明什么。这包括失败,尤其是失败。</p></div><div class="responsive-card-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px;"><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; gap: 14px;"><div><span class="badge badge-green" style="font-size: 10px;">通过</span></div><div class="tabular-nums" style="font-size: 26px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); line-height: 1.2;">230 次检查 · 0 次失败</div><h3 style="font-size: 17px; font-weight: 700; color: var(--text-primary);">关卡 14:基础关闭</h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">Omega 和 Physics 的联合基础凭证,逐级重新计算并被主分支接纳。两个仓库,一个结论,没有任何内容被轻信。</p><div style="font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px;"><p style="margin: 0; color: var(--text-secondary);"><span style="color: var(--accent-green); font-weight: 700;">证明:</span> Omega 和 Physics 的基础层在记录的提交点上逐级重新计算并达成一致,端到端一致。</p><p style="margin: 0; color: var(--text-secondary);"><span style="color: #f5a623; font-weight: 700;">未证明:</span> 原生机器是否合格,或任何物理硬件关卡是否通过。</p></div><div style="padding-top: 14px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 5px;"><span>日期 2026-09-30</span><span>环境 Omega + Physics 仓库,合并至主分支</span><span>关卡 关卡 14 联合基础接纳</span><a href="https://github.com/aien-dev/omega/pull/111" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">凭证:aien-dev/omega · PR #111 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; gap: 14px;"><div><span class="badge badge-green" style="font-size: 10px;">通过</span></div><div class="tabular-nums" style="font-size: 26px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); line-height: 1.2;">2,559,679.825 比特的图灵增益</div><h3 style="font-size: 17px; font-weight: 700; color: var(--text-primary);">TY-2 图灵增益</h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">在保留数据上,候选模型 C 描述事件所用的比特数比一阶基线 B 少约 256 万比特,平均每事件少 0.4387 比特。</p><div style="font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px;"><p style="margin: 0; color: var(--text-secondary);"><span style="color: var(--accent-green); font-weight: 700;">证明:</span> 保留预测压缩,图灵产出 V0;候选模型 C(操作 + 前 4 次结果)对比基线模型 B(一阶);拟合种子 1-7,保留 8-10;共 5,834,845 个保留事件,来自 crumbline 控制学习器搜索事件</p><p style="margin: 0; color: var(--text-secondary);"><span style="color: #f5a623; font-weight: 700;">无法证明:</span>仅验证理想代码长度,无可解码的比特流。验证使用相同工具(自我重推导,非独立)。并非科学发现的度量标准。无能量消耗。事后分析的op+prev1..5得分更高(+2,722,851.799),未计入。检查:dl_b_ub 7484024867446 减去 dl_c_ub 4924345042631 = 2559679824815</p></div><div style="padding-top: 14px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 5px;"><span>运行日期 2026-09-29</span><span>环境 Omega 验证套件,main 分支上的 turing-yield CI</span><span>证据/TURING_YIELD/ty2_heldout_receipt.txt</span><a href="https://github.com/aien-dev/omega/pull/88" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/omega · PR #88 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; gap: 14px;"><div><span class="badge badge-blue" style="font-size: 10px;">已合并</span></div><div class="tabular-nums" style="font-size: 26px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); line-height: 1.2;">C 内核通过 UEFI 启动</div><h3 style="font-size: 17px; font-weight: 700; color: var(--text-primary);">主分支上的原生内核</h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">一个独立的 C 内核核心通过 UEFI 启动,支持 NVMe、ARGUS 能力安全机制,以及启动路径中的密封存储(PR #195,同日上午)</p><div style="font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px;"><p style="margin: 0; color: var(--text-secondary);"><span style="color: var(--accent-green); font-weight: 700;">证明了:</span>C 内核在模拟环境中成功进入其启动阶段,路径中包含存储、能力检查和密封存储</p><p style="margin: 0; color: var(--text-secondary);"><span style="color: #f5a623; font-weight: 700;">无法证明:</span>物理 DGX Spark 的认证。硬件路径在通过认证前保持封闭;详见 M5 卡</p></div><div style="padding-top: 14px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 5px;"><span>日期 2026-10-01</span><span>环境 QEMU 模拟,UEFI 启动路径</span><span>门禁 AIENOS_CK_M1 内核启动</span><a href="https://github.com/aien-dev/aienux/pull/194" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aienux · PR #194 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; gap: 14px;"><div><span class="badge badge-amber" style="font-size: 10px;">未通过认证</span></div><div class="tabular-nums" style="font-size: 26px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); line-height: 1.2;">10 个阻塞 · 6 个缺失</div><h3 style="font-size: 17px; font-weight: 700; color: var(--text-primary);">首次 M5 认证尝试</h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">首次正式认证原生机器失败,但收据仍被发布。一个你无法失败的仪表,就不是仪表。这就是此处收据的含义</p><div style="font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px;"><p style="margin: 0; color: var(--text-secondary);"><span style="color: var(--accent-green); font-weight: 700;">证明了:</span>认证流程正常运行,测量并公开诚实报告,所有缺口均被明确指出并公开计数</p><p style="margin: 0; color: var(--text-secondary);"><span style="color: #f5a623; font-weight: 700;">无法证明:</span>该方法失败。它精确标记了仍需构建和验证的内容</p></div><div style="padding-top: 14px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 5px;"><span>日期 2026-09-30</span><span>环境 原生机器认证矩阵</span><span>门禁 M5 认证</span><a href="https://github.com/aien-dev/aienux/pull/187" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aienux · PR #187 →</a></div></div></div></div></section><section id="architecture" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle);"><div class="container"><div style="margin-bottom: 40px; max-width: 760px;"><div class="badge badge-blue" style="margin-bottom: 12px;">如何协同工作</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">一个流水线,四个角色</h2><p style="color: var(--text-secondary); margin-top: 8px; line-height: 1.6;">硬件被视为能力元数据,而非身份。身份是谱系:谁唤醒机器,谁维持其运行,谁检查其工作,谁从结果中学习</p></div><div style="display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;"><div class="glow-box" style="flex: 1 1 210px; padding: 26px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px;"><div style="font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.06em;">ATLAS</div><div style="font-size: 13px; color: var(--accent-green); font-weight: 600;">唤醒</div><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">在机器上唤醒 AienOS 的种子。Atlas 携带谱系至新硬件,并将其主权栈带入生命</p></div><div aria-hidden="true" style="display: flex; align-items: center; color: var(--accent-blue); font-family: var(--font-mono); font-size: 18px;">→</div><div class="glow-box" style="flex: 1 1 210px; padding: 26px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px;"><div style="font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.06em;">AienOS</div><div style="font-size: 13px; color: var(--accent-green); font-weight: 600;">持续</div><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">主权基础,远不止操作系统:它拥有硬件,维持代理的持续运行,并将内存、密钥和收据保留在所有者一侧</p></div><div aria-hidden="true" style="display: flex; align-items: center; color: var(--accent-blue); font-family: var(--font-mono); font-size: 18px;">→</div><div class="glow-box" style="flex: 1 1 210px; padding: 26px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px;"><div style="font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.06em;">OMEGA</div><div style="font-size: 13px; color: var(--accent-green); font-weight: 600;">定义 · 合成 · 验证</div><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">将意图转化为程序,然后在信任之前用现实验证它们。没有凭据运行的程序;所有运行都基于检查</p></div><div aria-hidden="true" style="display: flex; align-items: center; color: var(--accent-blue); font-family: var(--font-mono); font-size: 18px;">→</div><div class="glow-box" style="flex: 1 1 210px; padding: 26px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px;"><div style="font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.06em;">Aien</div><div style="font-size: 13px; color: var(--accent-green); font-weight: 600;">学习</div><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">持久智能本身。它从已验证的经验中学习:经受住 Omega 检查并接触现实的内容成为知识。权重提出假设,程序提供解释,证据进行教学</p></div></div><p style="color: var(--text-muted); font-size: 13px; font-family: var(--font-mono); margin-bottom: 36px;">从左到右阅读:每个角色将其工作传递给下一个,证据形成闭环</p><div style="border: 1px dashed var(--border-active); border-radius: 8px; padding: 26px 28px; background: rgba(45, 127, 249, 0.04);"><div style="font-family: var(--font-mono); font-size: 11px; color: var(--accent-blue); letter-spacing: 0.08em; margin-bottom: 6px;">围绕闭环,而非流水线内</div><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0 0 18px 0; max-width: 720px;">这四个并非第五到第八阶段。它们并非按顺序流动。它们围绕着流水线而存在,服务于流水线:一个验证,一个实现,一个观察,一个记忆。</p><div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px;"><div><div><span style="font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.05em;">AEGIS</span><span style="font-size: 12.5px; color: var(--accent-blue); font-weight: 600; margin-left: 8px;">验证</span></div><p style="color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin: 4px 0 0 0;">检查生成的代码。不作任何更改,不决定任何策略,不属于任何生成系统。</p></div><div><div><span style="font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.05em;">FORGE</span><span style="font-size: 12.5px; color: var(--accent-blue); font-weight: 600; margin-left: 8px;">实现</span></div><p style="color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin: 4px 0 0 0;">将Omega验证的内容构建为可运行的形式。</p></div><div><div><span style="font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.05em;">ARGUS</span><span style="font-size: 12.5px; color: var(--accent-blue); font-weight: 600; margin-left: 8px;">观察</span></div><p style="color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin: 4px 0 0 0;">观察者。在原生内核中执行能力强制,记录在案。</p></div><div><div><span style="font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.05em;">CORTEX</span><span style="font-size: 12.5px; color: var(--accent-blue); font-weight: 600; margin-left: 8px;">记忆</span></div><p style="color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin: 4px 0 0 0;">标准记忆:机器对已验证经验的长期记录。</p></div></div></div></div></section><section id="research" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle);"><div class="container"><div style="margin-bottom: 40px; max-width: 760px;"><div class="badge badge-green" style="margin-bottom: 12px;">已发表的研究</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">不要轻信我们的说法。请查看原始证据。</h2><p style="color: var(--text-secondary); margin-top: 8px; line-height: 1.6;">大多数AI要求你信任一个演示和一个承诺。而本项目选择公开其科学成果:图灵(Turing),即净保留解释压缩单位(机器理解的一个操作性组件),以及支撑它的论文和任何人都可复核的数据。它始于图灵。</p></div><div class="glow-box" style="padding: 32px; border-radius: 8px; margin-bottom: 24px;"><div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px;"><div><div class="badge badge-blue" style="margin-bottom: 12px; font-size: 10px;">图灵(T)</div><h3 style="font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px;">净保留解释压缩的单位</h3><p style="color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin-bottom: 12px;">一个图灵等于网络保留描述长度的改进量:一个能预测从未见过的事物的简短解释可获得图灵。猜测不计分,记忆也不计分,因为测试数据是全新的。</p><p style="color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin-bottom: 20px;">当前等级:L2,仅限布朗运动范围,仪器认证。超出布朗运动范围,上限为L1。TY-2不会改变上限。<a href="/zh-CN/research/status/" style="color: var(--accent-green); font-weight: 600;">查看完整研究阶梯。</a></p><div style="display: flex; gap: 12px; flex-wrap: wrap;"><a href="/zh-CN/turing/" style="background: var(--accent-green); color: var(--bg-base); border-radius: 4px; padding: 8px 16px; font-family: var(--font-mono); font-size: 13px; font-weight: 700;">探索图灵</a><a href="/zh-CN/research/computing-machinery-and-understanding" style="background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 8px 16px; font-family: var(--font-mono); font-size: 13px; font-weight: 600;">阅读正式论文</a></div></div><div id="turing-game" style="background: var(--bg-base); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 20px;"><div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;"><span style="font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;">尝试:赚取你的第一个图灵</span><span id="tg-round" style="font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);">第0轮 / 12轮</span></div><p style="font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 14px;">一个隐藏的规则正在生成这一串比特流。观察它,找出规律,并在比特落地前预测下一个比特。</p><div aria-live="polite" id="tg-stream" style="font-family: var(--font-mono); font-size: 20px; font-weight: 700; letter-spacing: 0.35em; color: var(--text-primary); min-height: 30px; margin-bottom: 16px; word-break: break-all;"></div><div style="display: flex; gap: 12px; margin-bottom: 16px;"><button id="tg-zero" style="flex: 1; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 12px; font-family: var(--font-mono); font-size: 18px; font-weight: 700; cursor: pointer;" type="button">0</button><button id="tg-one" style="flex: 1; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 12px; font-family: var(--font-mono); font-size: 18px; font-weight: 700; cursor: pointer;" type="button">1</button></div><div style="display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;"><div style="font-family: var(--font-mono); font-size: 14px; color: var(--text-primary);">得分:<span id="tg-score" style="color: var(--accent-green); font-weight: 700;">0 T</span></div><button id="tg-reset" style="background: transparent; color: var(--text-muted); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 6px 12px; font-family: var(--font-mono); font-size: 12px; cursor: pointer;" type="button">新流</button></div><p aria-live="polite" id="tg-msg" style="font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-top: 12px; min-height: 20px;">每次正确预测获得1 T,每次错误扣除1 T。抛硬币的平均值为零。</p></div></div></div><div class="responsive-card-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px;"><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;"><div><div style="margin-bottom: 12px;"><span class="badge badge-blue" style="font-size: 10px;">正式论文</span></div><h3 style="font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px;"><a href="/zh-CN/research/computing-machinery-and-understanding" style="color: inherit;">计算机械与理解</a></h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">正式论文。图灵衡量的是净保留解释压缩:机器理解的一个操作性组件。当前等级:L2,仅限布朗运动范围,仪器认证。</p></div><div style="padding-top: 16px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px;"><a href="/zh-CN/research/computing-machinery-and-understanding" style="color: var(--accent-green); font-weight: 600;">阅读论文 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;"><div><div style="margin-bottom: 12px;"><span class="badge badge-blue" style="font-size: 10px;">配套论文</span></div><h3 style="font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px;"><a href="/zh-CN/research/computing-machinery-and-understanding-emergence" style="color: inherit;">计算机械与理解:涌现</a></h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">配套论文:理解如何在一个系统中涌现,以及该度量对此的说明。</p></div><div style="padding-top: 16px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px;"><a href="/zh-CN/research/computing-machinery-and-understanding-emergence" style="color: var(--accent-green); font-weight: 600;">阅读配套论文 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;"><div><div style="margin-bottom: 12px;"><span class="badge badge-blue" style="font-size: 10px;">立场论文</span></div><h3 style="font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px;"><a href="/zh-CN/research/the-stapleton-doctrine" style="color: inherit;">斯塔普尔顿学说</a></h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">架构背后的哲学,以立场论文形式陈述:基于物理,掌握基础,证明每一项主张。</p></div><div style="padding-top: 16px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px;"><a href="/zh-CN/research/the-stapleton-doctrine" style="color: var(--accent-green); font-weight: 600;">阅读学说 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;"><div><div style="margin-bottom: 12px;"><span class="badge badge-blue" style="font-size: 10px;">文章</span></div><h3 style="font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px;"><a href="/zh-CN/post-llm-case/" style="color: inherit;">后大语言模型时代之论</a></h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">论证为何要超越大语言模型时代,以及一个自主机器如何改变谁有资格思考。</p></div><div style="padding-top: 16px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px;"><a href="/zh-CN/post-llm-case/" style="color: var(--accent-green); font-weight: 600;">阅读文章 →</a></div></div></div><p style="margin-top: 24px; font-size: 14px; color: var(--text-secondary);">所有内容,包括协议、密封实验档案和源文件:<a href="/zh-CN/research/" style="color: var(--accent-green); font-weight: 600;">完整研究索引</a> · <a href="https://github.com/aien-dev" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">GitHub上的公开代码与原始证据</a></p></div></section><section id="terminal" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface);"><div class="container"><div style="margin-bottom: 32px;"><div class="badge badge-green" style="margin-bottom: 12px;">交互式模拟</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">系统调用接口,已模拟</h2><p style="color: var(--text-secondary); margin-top: 8px; max-width: 680px;">一个完全在您的浏览器中运行的模拟。此页面未连接任何真实机器,您输入的内容也不会离开页面。它展示了真实机器所使用的接口形态。真实机器的证明请见上方的证据部分,包括收据等。</p></div><div class="terminal-shell" style="border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-base); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); overflow: hidden;"><div style="padding: 12px 16px; background: rgba(14, 18, 25, 0.95); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; gap: 16px;"><div style="display: flex; align-items: center; gap: 8px;"><span style="width: 10px; height: 10px; border-radius: 50%; background: #ef4444;"></span><span style="width: 10px; height: 10px; border-radius: 50%; background: #f59e0b;"></span><span style="width: 10px; height: 10px; border-radius: 50%; background: #10b981;"></span><span class="terminal-title" style="margin-left: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);">AienOS REPL v0.4.0 (sm_121a · aarch64 · 128GB LPDDR5x)</span></div><div class="terminal-status" style="display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--accent-green);"><span style="width: 6px; height: 6px; border-radius: 50%; background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green);"></span>COHERENT_ACTIVE</div></div><div style="padding: 10px 16px; background: rgba(14, 18, 25, 0.6); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;"><span style="font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase;">快速触发:</span><button data-cmd="sys_telemetry" style="background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 4px 10px; font-family: var(--font-mono); font-size: 12px; cursor: pointer;" type="button">sys_telemetry</button><button data-cmd="sys_alloc_kv" style="background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 4px 10px; font-family: var(--font-mono); font-size: 12px; cursor: pointer;" type="button">sys_alloc_kv</button><button data-cmd="sys_vault" style="background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 4px 10px; font-family: var(--font-mono); font-size: 12px; cursor: pointer;" type="button">sys_vault</button><button id="terminal-clear-btn" style="margin-left: auto; background: transparent; color: var(--text-muted); border: none; font-family: var(--font-mono); font-size: 11px; cursor: pointer;" type="button">[清除]</button></div><div id="terminal-output" style="padding: 20px; min-height: 280px; max-height: 440px; overflow-y: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.6;"><div class="terminal-log-line sys"><span class="sys-msg" style="color: var(--accent-blue);">[*] AienOS 神经内核 v0.4.0 已在 GB10 (aarch64) 上初始化。</span></div><div class="terminal-log-line sys"><span class="sys-msg" style="color: var(--accent-blue);">[*] 统一的相干地址空间:128 GB LPDDR5x 已上线。</span></div><div class="terminal-log-line sys"><span class="sys-msg" style="color: var(--accent-blue);">[*] 权限保险库已密封。零磁盘密钥不变量已激活。</span></div><div class="terminal-log-line sys"><span class="sys-msg" style="color: var(--text-muted);">[*] 输入一个系统调用,或点击上方的快速触发按钮之一。</span></div></div><form id="terminal-form" style="padding: 12px 16px; background: rgba(14, 18, 25, 0.95); border-top: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 8px;"><span style="color: var(--accent-green); font-family: var(--font-mono); font-size: 14px; font-weight: 700;">$</span><input autocomplete="off" id="terminal-input" placeholder="输入一个系统调用(sys_telemetry、sys_alloc_kv、sys_vault、help)..." style="flex: 1; background: transparent; border: none; outline: none; color: var(--text-primary); font-family: var(--font-mono); font-size: 13px;" type="text"/><button style="background: var(--accent-green); color: var(--bg-base); border: none; border-radius: 4px; padding: 6px 14px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; cursor: pointer;" type="submit">运行</button></form></div></div></section><section id="status" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle);"><div class="container"><div style="max-width: 760px; margin-bottom: 36px;"><div class="badge badge-amber" style="margin-bottom: 12px;">规范项目状态</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">它真实所处的位置</h2><p style="color: var(--text-secondary); margin-top: 8px; line-height: 1.6;">一个项目状态,发布一次,处处消费。本节、<a href="/status.json" style="color: var(--accent-green); font-weight: 600;">status.json</a> 和 <a href="/llms.txt" style="color: var(--accent-green); font-weight: 600;">llms.txt</a> 均来自同一源,因此不会产生偏差。最后更新于 2026-10-01。</p></div><div style="display: flex; flex-direction: column;"><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(0, 229, 153, 0.4); color: var(--accent-green); background: rgba(0, 229, 153, 0.08);">合格</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">Omega 基础门禁</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">门禁 1 至 14 已关闭,凭一份合并的准入收据:230 次检查,0 次失败。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/omega/pull/111" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/omega · PR #111 →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(45, 127, 249, 0.4); color: var(--accent-blue); background: rgba(45, 127, 249, 0.08);">已实现</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">图灵仪器</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">已实现(仪器);科学部分完成。当前等级:L2,仅限布朗运动范围,仪器认证。L2 判定已与 2026-10-01 的私有密封记录核对,记录保持私有。在布朗运动范围之外,上限为 L1。TY-2 记录了 2,559,679.825 比特的图灵增益。这是比特增益,而非产出。产出是 T/J(每焦耳图灵数),而 T/J 尚未建立:未测量能量。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/omega/pull/88" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/omega · PR #88 →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(45, 127, 249, 0.4); color: var(--accent-blue); background: rgba(45, 127, 249, 0.08);">已实现</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">原生 C 内核</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">主控上的独立 C 内核。通过 UEFI 模拟启动,包含 NVMe、ARGUS 权限检查,以及启动路径中的密封存储。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/aienux/pull/194" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aienux · PR #194 →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(248, 113, 113, 0.4); color: #f87171; background: rgba(248, 113, 113, 0.08);">被阻塞</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">原生机器资格认证(M5)</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">首次资格收据:未合格,10 项被阻塞,6 项缺失。已发布,并正在公开处理中。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/aienux/pull/187" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aienux · PR #187 →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(245, 158, 11, 0.4); color: #f5a623; background: rgba(245, 158, 11, 0.08);">实验性</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">图灵实验(EXP-001 / 002 / 003)</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">EXP-001 失败,EXP-001R 通过,EXP-002A 通过,EXP-002B 通过,EXP-002C 通过,EXP-002D 不完整,EXP-003 被阻塞。失败记录将保留在档案中。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/omega/pull/119" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/omega · PR #119 →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(245, 158, 11, 0.4); color: #f5a623; background: rgba(245, 158, 11, 0.08);">实验性</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">Aien,持久化代理</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">在 DGX Spark 实验室中运行。学习循环,从已验证的经验中学习,是当前的构建活动。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/aienux" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aienux →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid var(--border-subtle); color: var(--text-muted); background: var(--bg-surface);">计划中</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">Atlas,觉醒层</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">在新硬件上唤醒AienOS的种子。教义已发布于架构仓库;实现工作正在进行中。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/aien-architecture" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aien-architecture →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid var(--border-subtle); color: var(--text-muted); background: var(--bg-surface);">计划中</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">公开发布</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">预Alpha版。尚未提供支持的发布版本或安装程序。一旦有,将随版本号、哈希值和签名一同发布,运行前可检查。</p></div></div></div><div class="live" id="live"><div class="live-head"><div class="badge badge-blue">从公开记录中读取</div><h3>截至上次构建的组件</h3><p>六个仓库构成核心。最后两列在页面构建时从GitHub读取,而非手动输入。数据采集于 <span class="mono">2026-10-16T16:29:47Z</span>;页面每小时重建一次。</p></div><div class="live-grid"><table class="status-table"><thead><tr><th>组件</th><th>它是什么</th><th>最后合并的更改</th><th class="num">开放</th></tr></thead><tbody><tr><td class="name"><a href="https://github.com/aien-dev/aienux" rel="noopener">AienOS</a><small>aienos</small></td><td>操作系统。以代理为先;模型永远不是内核。</td><td><a class="merge" href="https://github.com/aien-dev/aienux/pull/401" rel="noopener">文档:原生KV所有权状态及一个已解决的GB10未知问题(PERF-DOC P1)</a><span class="when">2026年10月16日</span></td><td class="num">4</td></tr><tr><td class="name"><a href="https://github.com/aien-dev/omega" rel="noopener">Omega</a><small>omega</small></td><td>堆栈正在重写的语言与GPU引擎。</td><td><a class="merge" href="https://github.com/aien-dev/omega-mv/pull/504" rel="noopener">文档:记录Spark切换后的必要检查</a><span class="when">2026年10月16日</span></td><td class="num">18</td></tr><tr><td class="name"><a href="https://github.com/aien-dev/aien-sovereign-core" rel="noopener">主权核心</a><small>aien-sovereign-core</small></td><td>主机运行时、推理ABI,以及判断每次变更的流水线。</td><td><a class="merge" href="https://github.com/aien-dev/aien-sovereign-core-mv/pull/588" rel="noopener">aien-kv-cache:在源码中记录KV内存所有权与并发性(PERF-DOC P1)</a><span class="when">2026年10月16日</span></td><td class="num">22</td></tr><tr><td class="name"><a href="https://github.com/aien-dev/aien-architecture" rel="noopener">架构</a><small>aien-architecture</small></td><td>流程、边界、决策记录、执行计划。</td><td><a class="merge" href="https://github.com/aien-dev/aien-architecture-mv/pull/238" rel="noopener">文档/research:仓库拓扑(Unix风格、单体仓库、混合模式)</a><span class="when">2026年10月16日</span></td><td class="num">1</td></tr><tr><td class="name"><a href="https://github.com/aien-dev/aien-protocols" rel="noopener">协议</a><small>aien-protocols</small></td><td>规范、网络协议、数据结构。</td><td><a class="merge" href="https://github.com/aien-dev/aien-protocols-mv/pull/26" rel="noopener">文档:记录Spark切换后的必要检查</a><span class="when">2026年10月16日</span></td><td class="num">0</td></tr><tr><td class="name"><a href="https://github.com/aien-dev/physics" rel="noopener">物理</a><small>physics</small></td><td>FORGE实现层及GB10的启动制品。</td><td><a class="merge" href="https://github.com/aien-dev/physics-mv/pull/62" rel="noopener">文档:记录Spark切换后的必要检查</a><span class="when">2026年10月16日</span></td><td class="num">1</td></tr></tbody></table><aside aria-label="最新验证凭证" class="receipt" id="receipt"><h3>AIEN 验证</h3><div class="rule"></div><div class="row"><span>仓库</span><span>aien-sovereign-core</span></div><div class="row"><span>分支</span><span>main</span></div><div class="row"><span>提交</span><span>bdd58a2b8fc8</span></div><div class="row"><span>提交时间</span><span>2026年10月16日</span></div><div class="row"><span>判断者</span><span>Spark本身</span></div><div class="rule"></div><p>aien-kv-cache:在源码中记录KV内存所有权与并发性(PERF-DOC P1)(#588)</p><div class="rule"></div><div class="verdict fail">失败</div><p class="receipt-note">BLOCKED FAIL PREFILL-E2E-2:rc_nonzero</p><div class="foot">发布于2026年10月16日。<a href="https://github.com/aien-dev/aien-sovereign-core/commit/bdd58a2b8fc873deecc06871809817801ac8b1e2" rel="noopener">打开收据</a></div></aside></div><div class="decisions"><h4>最新决策记录</h4><ul><li><a href="https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0037-native-image-slot-signing-roles.md" rel="noopener"><span class="mono">ADR 0037</span> 谁签署原生槽位镜像:由所有者根直接签署,还是由发布签署者签署...</a></li><li><a href="https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0036-release-v1-memory-owner.md" rel="noopener"><span class="mono">ADR 0036</span> 发布v1内存所有者(发布就绪计划的L3车道)</a></li><li><a href="https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0035-persistent-cognitive-entity-boundary-allen.md" rel="noopener"><span class="mono">ADR 0035</span> 持久认知实体边界(ALLEN)</a></li><li><a href="https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0034-physical-form-realization-ir.md" rel="noopener"><span class="mono">ADR 0034</span> 物理形态实现IR</a></li><li><a href="https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0033-aien-verification-pipeline.md" rel="noopener"><span class="mono">ADR 0033</span> AIEN 验证:检查IR(manifest v2)、精确性类别、Spark...</a></li></ul><p class="small"><a href="https://github.com/aien-dev/aien-architecture/tree/main/docs/adr" rel="noopener">所有决策记录</a> · <a href="/facts.json">facts.json</a>,此区块背后的数据。</p></div></div><div style="display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px;"><a href="https://github.com/aien-dev" rel="noopener noreferrer" style="background: var(--accent-green); color: var(--bg-base); border-radius: 4px; padding: 10px 20px; font-family: var(--font-mono); font-size: 13px; font-weight: 700;" target="_blank">在GitHub上关注进展</a><a href="#research" style="background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 10px 20px; font-family: var(--font-mono); font-size: 13px; font-weight: 600;">阅读研究</a><a href="#follow" style="background: transparent; color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 10px 20px; font-family: var(--font-mono); font-size: 13px; font-weight: 600;">关注工作</a></div></div></section><section id="follow" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle); background: var(--bg-base);"><div class="container"><div class="glow-box" style="max-width: 760px; margin: 0 auto; padding: 48px 40px; border-radius: 12px; text-align: center; background: var(--bg-surface);"><div class="badge badge-green" style="margin-bottom: 16px; display: inline-flex;">在公开中构建</div><h2 style="font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 16px;">关注工作。</h2><p style="color: var(--text-secondary); line-height: 1.6; max-width: 600px; margin: 0 auto 32px auto; font-size: 16px;">无需等待发布,也无需加入列表。所有事情都在公共仓库中发生,每次变更都由机器本身进行判断,此页面每小时读取一次记录。关注仓库,阅读收据,打开一个问题。</p><div style="display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;"><a href="https://github.com/aien-dev" rel="noopener noreferrer" style="background: var(--accent-green); color: var(--bg-base); border-radius: 4px; padding: 12px 22px; font-family: var(--font-mono); font-size: 13px; font-weight: 700;" target="_blank">GitHub:aien-dev</a><a href="/zh-CN/progress/" style="background: transparent; color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 12px 22px; font-family: var(--font-mono); font-size: 13px; font-weight: 600;">项目进展</a></div><p style="color: var(--text-muted); font-size: 13px; margin-top: 28px; font-family: var(--font-mono);">机器可读:<a href="/status.json" style="color: var(--text-secondary);">status.json</a> · <a href="/facts.json" style="color: var(--text-secondary);">facts.json</a> · <a href="/llms.txt" style="color: var(--text-secondary);">llms.txt</a></p></div></div></section></main><footer class="aien-footer"><div class="container"><div class="aien-footer-top"><div class="aien-footer-about"><div class="aien-footer-brand"><svg aria-hidden="true" fill="none" height="18" stroke="var(--accent-blue)" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewbox="0 0 24 24" width="18"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" x2="20" y1="19" y2="19"></line></svg><span>AienOS</span></div><p>在您拥有的硬件上实现持久的机器智能。实验性、开源且公开验证,所有凭证均公开可查。</p></div><nav aria-label="网站章节" class="aien-footer-sections"><div class="aien-footer-group"><h2 class="aien-footer-heading">机器</h2><ul><li><a href="/zh-CN/machine/">机器</a></li><li><a href="https://github.com/aien-dev/aienux" rel="noopener noreferrer" target="_blank">AienOS 源代码</a></li><li><a href="https://github.com/aien-dev/omega" rel="noopener noreferrer" target="_blank">Omega 源代码</a></li><li><a href="https://github.com/aien-dev/aien-architecture" rel="noopener noreferrer" target="_blank">架构</a></li><li><a href="https://github.com/aien-dev/physics" rel="noopener noreferrer" target="_blank">物理机制</a></li></ul></div><div class="aien-footer-group"><h2 class="aien-footer-heading">图灵</h2><ul><li><a href="/zh-CN/turing/">图灵</a></li><li><a href="/zh-CN/research/computing-machinery-and-understanding/">图灵论文</a></li></ul></div><div class="aien-footer-group"><h2 class="aien-footer-heading">实验</h2><ul><li><a href="/zh-CN/experiments/">实验</a></li><li><a href="/zh-CN/research/">研究索引</a></li></ul></div><div class="aien-footer-group"><h2 class="aien-footer-heading">科学发现</h2><ul><li><a href="/zh-CN/discovery/">科学发现</a></li></ul></div><div class="aien-footer-group"><h2 class="aien-footer-heading">证据</h2><ul><li><a href="/zh-CN/evidence/">证据</a></li><li><a href="/zh-CN/research/status/">研究状态</a></li><li><a href="/research-status.json">状态数据(JSON)</a></li><li><a href="https://github.com/aien-dev/omega/blob/main/docs/turing/TURING_SCIENTIFIC_QUALIFICATION_STATE.md" rel="noopener noreferrer" target="_blank">资格记录</a></li></ul></div><div class="aien-footer-group"><h2 class="aien-footer-heading">哲学</h2><ul><li><a href="/zh-CN/philosophy/">哲学</a></li><li><a href="/zh-CN/research/the-stapleton-doctrine/">斯塔普尔顿学说</a></li><li><a href="/zh-CN/post-llm-case/">后大语言模型时代之论</a></li></ul></div><div class="aien-footer-group aien-footer-more"><h2 class="aien-footer-heading">更多</h2><ul><li><a href="/zh-CN/progress/">进展</a></li><li><a href="/zh-CN/blog">博客</a></li><li><a href="/zh-CN/#follow">关注</a></li><li><a href="/zh-CN/licensing/">许可协议</a></li><li><a href="https://github.com/aien-dev" rel="noopener noreferrer" target="_blank">GitHub</a></li><li><a href="/engineer/">德雷克·斯塔普尔顿</a></li></ul></div></nav></div><div class="aien-footer-legal"><div>Aien © 2026。根据 <a href="/zh-CN/licensing/">Apache-2.0 WITH LLVM-exception</a> 许可证授权。</div><div class="aien-footer-mottos"><span>凭证胜于声明</span><span>ZERO_UNSOLICITED_TELEMETRY</span></div></div></div></footer></div></body></html> \ No newline at end of file +<html lang="zh-CN"><head><meta charset="utf-8"/><meta content="width=device-width, initial-scale=1" name="viewport"/><title>AienOS | 您拥有的机器上的持久机器智能</title><meta content="AienOS 是一个实验性的主权机器,用于持久的机器智能:Atlas 在您拥有的硬件上唤醒它,Omega 将意图转化为可验证的程序,Aien 从可验证的经验中学习。每个声明都附带公开的凭证。" name="description"/><link href="/favicon.svg" rel="icon" type="image/svg+xml"/><meta content="AienOS | 您拥有的机器上的持久机器智能" property="og:title"/><meta content="AienOS 是一个实验性的主权机器,用于持久的机器智能:Atlas 在您拥有的硬件上唤醒它,Omega 将意图转化为可验证的程序,Aien 从可验证的经验中学习。每个声明都附带公开的凭证。" property="og:description"/><meta content="https://aienos.com/" property="og:url"/><meta content="website" property="og:type"/><meta content="https://aienos.com/og.png" property="og:image"/><meta content="summary_large_image" name="twitter:card"/><meta content="AienOS | 您拥有的机器上的持久机器智能" name="twitter:title"/><meta content="AienOS 是一个实验性的主权机器,用于持久的机器智能:Atlas 在您拥有的硬件上唤醒它,Omega 将意图转化为可验证的程序,Aien 从可验证的经验中学习。每个声明都附带公开的凭证。" name="twitter:description"/><meta content="https://aienos.com/og.png" name="twitter:image"/><link href="/assets/style.css" rel="stylesheet"/><link href="/assets/site-nav.css" rel="stylesheet"/><link href="/assets/turing-look.css" rel="stylesheet"/><script defer="" src="/js/turing-look.js"></script><script defer="" src="/js/terminal.js"></script><script defer="" src="/js/turing-game.js"></script><link href="https://www.aienos.com/zh-CN/" rel="canonical"/><link href="https://www.aienos.com/" hreflang="en" rel="alternate"/><link href="https://www.aienos.com/zh-CN/" hreflang="zh-CN" rel="alternate"/></head><body><div id="root" style="min-height: 100vh; display: flex; flex-direction: column;"><a class="skip-link" href="#main-content">跳转到内容</a><header class="aien-header"><div class="aien-header-inner"><a aria-label="AienOS 主页" class="aien-brand" href="/zh-CN/"><span aria-hidden="true" class="aien-brand-mark"><svg fill="none" height="18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewbox="0 0 24 24" width="18"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" x2="20" y1="19" y2="19"></line></svg></span><span class="aien-brand-copy"><span class="aien-brand-name">AienOS</span><span class="aien-brand-tag">持久的机器智能</span></span></a><nav aria-label="主要导航" class="aien-nav"><ul class="aien-nav-primary"><li><a class="aien-nav-link" href="/zh-CN/machine/">机器</a></li><li><a class="aien-nav-link" href="/zh-CN/turing/">图灵</a></li><li><a class="aien-nav-link" href="/zh-CN/experiments/">实验</a></li><li><a class="aien-nav-link" href="/zh-CN/discovery/">科学发现</a></li><li><a class="aien-nav-link" href="/zh-CN/evidence/">证据</a></li><li><a class="aien-nav-link" href="/zh-CN/philosophy/">哲学</a></li></ul><ul aria-label="更多" class="aien-nav-secondary"><li><a class="aien-nav-minor" href="/zh-CN/progress/">进展</a></li><li><a class="aien-nav-minor" href="/zh-CN/blog">博客</a></li><li><a class="aien-nav-minor" href="/zh-CN/#follow">关注</a></li><li><a class="aien-nav-minor" href="https://github.com/aien-dev">GitHub</a></li></ul><ul aria-label="Language" class="aien-nav-secondary aien-nav-lang" translate="no"><li><a class="aien-nav-minor" href="/" hreflang="en" lang="en">English</a></li><li><a class="aien-nav-minor" href="/zh-CN/" hreflang="zh-CN" lang="zh-CN">简体中文</a></li></ul></nav></div></header><main id="main-content" style="flex: 1;"><section aria-labelledby="home-lead" class="home-top bg-grid" id="top"><div class="container"><div class="home-column"><div class="home-badges"><span class="badge badge-amber">实验性 · 预发布版</span><span class="badge badge-blue">开源 · Apache-2.0 WITH LLVM-exception</span></div><h1 class="home-lead" id="home-lead">AienOS 是一个由您拥有的实验性机器,用于将搜索转化为可验证的理解。</h1><p class="home-lead-rest">Aien 提出结构。Omega 将该结构显式化并可验证。机器在权威下对其实行现实检验。图灵衡量实际学到的内容。Cortex 保存证据。然后下一次搜索从幸存下来的部分开始。</p><div class="home-thesis"><p>AienOS 是一种尝试,将持久的机器智能构建为科学过程,而非模型调用。神经机制可能提出想法,但这些想法并无权威性。</p><p>Omega 将其转化为显式的程序和理论;验证决定其内部有效性;拥有机器在物理现实中测试它们;图灵衡量它们在支付自身复杂性成本后是否能解释未见的观测;Cortex 保存证据;而这些经过验证的经验改变了下一次搜索。</p><p>Atlas 跨硬件传承其谱系。目标不是一台听起来像理解的机器,而是一台其解释力增长可被测量、证伪、复现和拥有的机器。</p></div></div><p class="home-slogan">权重暗示。程序解释。验证决定。证据教学。图灵记分。</p><figure aria-labelledby="loop-title" class="loop"><h2 class="loop-title" id="loop-title">循环</h2><p class="loop-intro">提案沿生成路径前行,遭遇现实,并被评分。幸存的证据启动下一次搜索。一个由权威、观察和凭证构成的边界围绕整个循环。</p><ul aria-label="如何阅读此图示" class="loop-legend"><li class="loop-key loop-key-gen">生成路径</li><li class="loop-key loop-key-feedback">证据反馈</li><li class="loop-key loop-key-perimeter">验证与权威边界</li></ul><div class="loop-perimeter"><p class="loop-perimeter-label">边界:围绕循环,而非某个阶段</p><ul aria-label="边界、权限与观测" class="loop-perimeter-band"><li class="loop-guard"><span class="loop-guard-name">AEGIS</span><span class="loop-guard-role">权威 + 证明边界</span></li><li class="loop-guard"><span class="loop-guard-name">ARGUS</span><span class="loop-guard-role">观察 / 审计</span></li></ul><ol aria-label="循环阶段,按顺序" class="loop-stages"><li class="loop-stage loop-stage-gen"><span class="loop-stage-name">ATLAS</span><span class="loop-stage-role">觉醒 / 谱系</span><span class="loop-stage-band">生成路径</span></li><li class="loop-stage loop-stage-gen"><span class="loop-stage-name">AienOS</span><span class="loop-stage-role">持久的拥有基础</span><span class="loop-stage-band">生成路径</span></li><li class="loop-stage loop-stage-gen"><span class="loop-stage-name">Aien</span><span class="loop-stage-role">提出 / 引导搜索</span><span class="loop-stage-band">生成路径</span></li><li class="loop-stage loop-stage-gen"><span class="loop-stage-name">OMEGA</span><span class="loop-stage-role">形式化 / 搜索 / 验证意义</span><span class="loop-stage-band">生成路径</span></li><li class="loop-stage loop-stage-gen"><span class="loop-stage-name">FORGE</span><span class="loop-stage-role">实现</span><span class="loop-stage-band">生成路径</span></li><li class="loop-stage loop-stage-reality"><span class="loop-stage-name">REALITY</span><span class="loop-stage-role">执行 / 响应</span><span class="loop-stage-band">与现实接触</span></li><li class="loop-stage loop-stage-feedback"><span class="loop-stage-name">TURING</span><span class="loop-stage-role">评分解释性提升</span><span class="loop-stage-band">证据反馈</span></li><li class="loop-stage loop-stage-feedback"><span class="loop-stage-name">CORTEX</span><span class="loop-stage-role">保存证据</span><span class="loop-stage-band">证据反馈</span></li></ol><p class="loop-return"><span aria-hidden="true" class="loop-return-arrow">↺</span><span>返回下一次 <strong>Aien / Omega 搜索</strong>:Cortex 的证据为下一轮提供输入。</span></p><ul aria-label="边界、能力与凭证" class="loop-perimeter-band"><li class="loop-guard"><span class="loop-guard-name">能力系统</span><span class="loop-guard-role">控制可能发生的事</span></li><li class="loop-guard"><span class="loop-guard-name">证据凭证</span><span class="loop-guard-role">使结果可复现</span></li></ul></div><figcaption class="loop-caption">ATLAS、AienOS、Aien、OMEGA、FORGE、REALITY、TURING 和 CORTEX 是各个阶段。AEGIS、ARGUS、能力系统和证据凭证构成了围绕它们的边界。</figcaption></figure><div class="home-questions"><h2 class="home-questions-title">循环中的三个问题</h2><ol class="home-q-list"><li class="home-q"><p class="home-q-question">它学到了什么吗?</p><p class="home-q-measure"><span class="home-q-measure-name">图灵增益</span> <span class="home-q-badge status-experimental">TY-2 通过</span></p><p class="home-q-meaning">在保留的现实之外仍能成立的网络解释结构。</p><p class="home-q-note">TY-2 记录了 2,559,679.825 比特的图灵增益。</p></li><li class="home-q"><p class="home-q-question">学习的成本是多少?</p><p class="home-q-measure"><span class="home-q-measure-name">图灵产出</span> <span class="home-q-badge status-planned">尚未开始</span></p><p class="home-q-meaning">经测量的物理资源所对应的验证解释增益。</p><p class="home-q-note">由于尚未测量能量,每焦耳的图灵数无法计算,因此此项尚未启动。</p></li><li class="home-q"><p class="home-q-question">它所学的内容是否让未来的发现更容易?</p><p class="home-q-measure"><span class="home-q-measure-name">搜索/验证差距</span></p><p class="home-q-meaning">所获取的抽象是否会降低未来搜索的复杂性。</p><p class="home-q-note">这是一个我们希望研究的开放问题。目前此处尚未有任何测量结果。</p></li></ol></div><div class="home-actions"><a class="home-cta home-cta-primary" href="#evidence">查看证据</a><a class="home-cta" href="#architecture">探索架构</a><a class="home-cta home-cta-ghost" href="https://github.com/aien-dev" rel="noopener noreferrer" target="_blank">GitHub</a></div><ul class="home-checks"><li>C 内核通过 UEFI 启动 ✓</li><li>每个主张都附有凭证 ✓</li><li>失败记录公开,不隐藏 ✓</li></ul></div></section><section id="story" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle);"><div class="container"><div style="max-width: 760px; margin-bottom: 36px;"><div class="badge badge-green" style="margin-bottom: 12px;">这是什么</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">不是运行在他人计算机上的另一个应用程序</h2><p style="color: var(--text-secondary); margin-top: 16px; line-height: 1.7; font-size: 16px;">大多数人工智能存在于租用的堆栈中。提供商拥有机器、模型、价格和关机开关。你的代理依附于他们的意愿存在,按他们的计划遗忘,并在他们的条款下工作。</p><p style="color: var(--text-secondary); margin-top: 14px; line-height: 1.7; font-size: 16px;">AienOS 是相反的赌注:一台主权机器,从固件之后的第一条指令开始构建,其中持续存在的智能运行在你拥有的硬件上。它将记忆、身份和凭证保留在你这一侧。底层硬件是能力,而非身份:机器可以更换,但传承得以延续。</p></div></div></section><section id="evidence" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface);"><div class="container"><div style="margin-bottom: 40px; max-width: 760px;"><div class="badge badge-green" style="margin-bottom: 12px;">证明,而非承诺</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">每个主张都附有凭证</h2><p style="color: var(--text-secondary); margin-top: 8px; line-height: 1.6;">本项目不寻求被相信。每张卡片都标明其环境、其关卡、其日期以及其结论,并明确说明凭证证明了什么,以及未证明什么。这包括失败,尤其是失败。</p></div><div class="responsive-card-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px;"><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; gap: 14px;"><div><span class="badge badge-green" style="font-size: 10px;">通过</span></div><div class="tabular-nums" style="font-size: 26px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); line-height: 1.2;">230 次检查 · 0 次失败</div><h3 style="font-size: 17px; font-weight: 700; color: var(--text-primary);">关卡 14:基础关闭</h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">Omega 和 Physics 的联合基础凭证,逐级重新计算并被主分支接纳。两个仓库,一个结论,没有任何内容被轻信。</p><div style="font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px;"><p style="margin: 0; color: var(--text-secondary);"><span style="color: var(--accent-green); font-weight: 700;">证明:</span> Omega 和 Physics 的基础层在记录的提交点上逐级重新计算并达成一致,端到端一致。</p><p style="margin: 0; color: var(--text-secondary);"><span style="color: #f5a623; font-weight: 700;">未证明:</span> 原生机器是否合格,或任何物理硬件关卡是否通过。</p></div><div style="padding-top: 14px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 5px;"><span>日期 2026-09-30</span><span>环境 Omega + Physics 仓库,合并至主分支</span><span>关卡 关卡 14 联合基础接纳</span><a href="https://github.com/aien-dev/omega/pull/111" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">凭证:aien-dev/omega · PR #111 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; gap: 14px;"><div><span class="badge badge-green" style="font-size: 10px;">通过</span></div><div class="tabular-nums" style="font-size: 26px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); line-height: 1.2;">2,559,679.825 比特的图灵增益</div><h3 style="font-size: 17px; font-weight: 700; color: var(--text-primary);">TY-2 图灵增益</h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">在保留数据上,候选模型 C 描述事件所用的比特数比一阶基线 B 少约 256 万比特,平均每事件少 0.4387 比特。</p><div style="font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px;"><p style="margin: 0; color: var(--text-secondary);"><span style="color: var(--accent-green); font-weight: 700;">证明:</span> 保留预测压缩,图灵产出 V0;候选模型 C(操作 + 前 4 次结果)对比基线模型 B(一阶);拟合种子 1-7,保留 8-10;共 5,834,845 个保留事件,来自 crumbline 控制学习器搜索事件</p><p style="margin: 0; color: var(--text-secondary);"><span style="color: #f5a623; font-weight: 700;">无法证明:</span>仅验证理想代码长度,无可解码的比特流。验证使用相同工具(自我重推导,非独立)。并非科学发现的度量标准。无能量消耗。事后分析的op+prev1..5得分更高(+2,722,851.799),未计入。检查:dl_b_ub 7484024867446 减去 dl_c_ub 4924345042631 = 2559679824815</p></div><div style="padding-top: 14px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 5px;"><span>运行日期 2026-09-29</span><span>环境 Omega 验证套件,main 分支上的 turing-yield CI</span><span>证据/TURING_YIELD/ty2_heldout_receipt.txt</span><a href="https://github.com/aien-dev/omega/pull/88" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/omega · PR #88 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; gap: 14px;"><div><span class="badge badge-blue" style="font-size: 10px;">已合并</span></div><div class="tabular-nums" style="font-size: 26px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); line-height: 1.2;">C 内核通过 UEFI 启动</div><h3 style="font-size: 17px; font-weight: 700; color: var(--text-primary);">主分支上的原生内核</h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">一个独立的 C 内核核心通过 UEFI 启动,支持 NVMe、ARGUS 能力安全机制,以及启动路径中的密封存储(PR #195,同日上午)</p><div style="font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px;"><p style="margin: 0; color: var(--text-secondary);"><span style="color: var(--accent-green); font-weight: 700;">证明了:</span>C 内核在模拟环境中成功进入其启动阶段,路径中包含存储、能力检查和密封存储</p><p style="margin: 0; color: var(--text-secondary);"><span style="color: #f5a623; font-weight: 700;">无法证明:</span>物理 DGX Spark 的认证。硬件路径在通过认证前保持封闭;详见 M5 卡</p></div><div style="padding-top: 14px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 5px;"><span>日期 2026-10-01</span><span>环境 QEMU 模拟,UEFI 启动路径</span><span>门禁 AIENOS_CK_M1 内核启动</span><a href="https://github.com/aien-dev/aienux/pull/194" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aienux · PR #194 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; gap: 14px;"><div><span class="badge badge-amber" style="font-size: 10px;">未通过认证</span></div><div class="tabular-nums" style="font-size: 26px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); line-height: 1.2;">10 个阻塞 · 6 个缺失</div><h3 style="font-size: 17px; font-weight: 700; color: var(--text-primary);">首次 M5 认证尝试</h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">首次正式认证原生机器失败,但收据仍被发布。一个你无法失败的仪表,就不是仪表。这就是此处收据的含义</p><div style="font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px;"><p style="margin: 0; color: var(--text-secondary);"><span style="color: var(--accent-green); font-weight: 700;">证明了:</span>认证流程正常运行,测量并公开诚实报告,所有缺口均被明确指出并公开计数</p><p style="margin: 0; color: var(--text-secondary);"><span style="color: #f5a623; font-weight: 700;">无法证明:</span>该方法失败。它精确标记了仍需构建和验证的内容</p></div><div style="padding-top: 14px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 5px;"><span>日期 2026-09-30</span><span>环境 原生机器认证矩阵</span><span>门禁 M5 认证</span><a href="https://github.com/aien-dev/aienux/pull/187" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aienux · PR #187 →</a></div></div></div></div></section><section id="architecture" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle);"><div class="container"><div style="margin-bottom: 40px; max-width: 760px;"><div class="badge badge-blue" style="margin-bottom: 12px;">如何协同工作</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">一个流水线,四个角色</h2><p style="color: var(--text-secondary); margin-top: 8px; line-height: 1.6;">硬件被视为能力元数据,而非身份。身份是谱系:谁唤醒机器,谁维持其运行,谁检查其工作,谁从结果中学习</p></div><div style="display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;"><div class="glow-box" style="flex: 1 1 210px; padding: 26px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px;"><div style="font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.06em;">ATLAS</div><div style="font-size: 13px; color: var(--accent-green); font-weight: 600;">唤醒</div><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">在机器上唤醒 AienOS 的种子。Atlas 携带谱系至新硬件,并将其主权栈带入生命</p></div><div aria-hidden="true" style="display: flex; align-items: center; color: var(--accent-blue); font-family: var(--font-mono); font-size: 18px;">→</div><div class="glow-box" style="flex: 1 1 210px; padding: 26px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px;"><div style="font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.06em;">AienOS</div><div style="font-size: 13px; color: var(--accent-green); font-weight: 600;">持续</div><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">主权基础,远不止操作系统:它拥有硬件,维持代理的持续运行,并将内存、密钥和收据保留在所有者一侧</p></div><div aria-hidden="true" style="display: flex; align-items: center; color: var(--accent-blue); font-family: var(--font-mono); font-size: 18px;">→</div><div class="glow-box" style="flex: 1 1 210px; padding: 26px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px;"><div style="font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.06em;">OMEGA</div><div style="font-size: 13px; color: var(--accent-green); font-weight: 600;">定义 · 合成 · 验证</div><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">将意图转化为程序,然后在信任之前用现实验证它们。没有凭据运行的程序;所有运行都基于检查</p></div><div aria-hidden="true" style="display: flex; align-items: center; color: var(--accent-blue); font-family: var(--font-mono); font-size: 18px;">→</div><div class="glow-box" style="flex: 1 1 210px; padding: 26px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px;"><div style="font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.06em;">Aien</div><div style="font-size: 13px; color: var(--accent-green); font-weight: 600;">学习</div><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">持久智能本身。它从已验证的经验中学习:经受住 Omega 检查并接触现实的内容成为知识。权重提出假设,程序提供解释,证据进行教学</p></div></div><p style="color: var(--text-muted); font-size: 13px; font-family: var(--font-mono); margin-bottom: 36px;">从左到右阅读:每个角色将其工作传递给下一个,证据形成闭环</p><div style="border: 1px dashed var(--border-active); border-radius: 8px; padding: 26px 28px; background: rgba(45, 127, 249, 0.04);"><div style="font-family: var(--font-mono); font-size: 11px; color: var(--accent-blue); letter-spacing: 0.08em; margin-bottom: 6px;">围绕闭环,而非流水线内</div><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0 0 18px 0; max-width: 720px;">这四个并非第五到第八阶段。它们并非按顺序流动。它们围绕着流水线而存在,服务于流水线:一个验证,一个实现,一个观察,一个记忆。</p><div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px;"><div><div><span style="font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.05em;">AEGIS</span><span style="font-size: 12.5px; color: var(--accent-blue); font-weight: 600; margin-left: 8px;">验证</span></div><p style="color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin: 4px 0 0 0;">检查生成的代码。不作任何更改,不决定任何策略,不属于任何生成系统。</p></div><div><div><span style="font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.05em;">FORGE</span><span style="font-size: 12.5px; color: var(--accent-blue); font-weight: 600; margin-left: 8px;">实现</span></div><p style="color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin: 4px 0 0 0;">将Omega验证的内容构建为可运行的形式。</p></div><div><div><span style="font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.05em;">ARGUS</span><span style="font-size: 12.5px; color: var(--accent-blue); font-weight: 600; margin-left: 8px;">观察</span></div><p style="color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin: 4px 0 0 0;">观察者。在原生内核中执行能力强制,记录在案。</p></div><div><div><span style="font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.05em;">CORTEX</span><span style="font-size: 12.5px; color: var(--accent-blue); font-weight: 600; margin-left: 8px;">记忆</span></div><p style="color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin: 4px 0 0 0;">标准记忆:机器对已验证经验的长期记录。</p></div></div></div></div></section><section id="research" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle);"><div class="container"><div style="margin-bottom: 40px; max-width: 760px;"><div class="badge badge-green" style="margin-bottom: 12px;">已发表的研究</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">不要轻信我们的说法。请查看原始证据。</h2><p style="color: var(--text-secondary); margin-top: 8px; line-height: 1.6;">大多数AI要求你信任一个演示和一个承诺。而本项目选择公开其科学成果:图灵(Turing),即净保留解释压缩单位(机器理解的一个操作性组件),以及支撑它的论文和任何人都可复核的数据。它始于图灵。</p></div><div class="glow-box" style="padding: 32px; border-radius: 8px; margin-bottom: 24px;"><div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px;"><div><div class="badge badge-blue" style="margin-bottom: 12px; font-size: 10px;">图灵(T)</div><h3 style="font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px;">净保留解释压缩的单位</h3><p style="color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin-bottom: 12px;">一个图灵等于网络保留描述长度的改进量:一个能预测从未见过的事物的简短解释可获得图灵。猜测不计分,记忆也不计分,因为测试数据是全新的。</p><p style="color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin-bottom: 20px;">当前等级:L2,仅限布朗运动范围,仪器认证。超出布朗运动范围,上限为L1。TY-2不会改变上限。<a href="/zh-CN/research/status/" style="color: var(--accent-green); font-weight: 600;">查看完整研究阶梯。</a></p><div style="display: flex; gap: 12px; flex-wrap: wrap;"><a href="/zh-CN/turing/" style="background: var(--accent-green); color: var(--bg-base); border-radius: 4px; padding: 8px 16px; font-family: var(--font-mono); font-size: 13px; font-weight: 700;">探索图灵</a><a href="/zh-CN/research/computing-machinery-and-understanding" style="background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 8px 16px; font-family: var(--font-mono); font-size: 13px; font-weight: 600;">阅读正式论文</a></div></div><div id="turing-game" style="background: var(--bg-base); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 20px;"><div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;"><span style="font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;">尝试:赚取你的第一个图灵</span><span id="tg-round" style="font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);">第0轮 / 12轮</span></div><p style="font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 14px;">一个隐藏的规则正在生成这一串比特流。观察它,找出规律,并在比特落地前预测下一个比特。</p><div aria-live="polite" id="tg-stream" style="font-family: var(--font-mono); font-size: 20px; font-weight: 700; letter-spacing: 0.35em; color: var(--text-primary); min-height: 30px; margin-bottom: 16px; word-break: break-all;"></div><div style="display: flex; gap: 12px; margin-bottom: 16px;"><button id="tg-zero" style="flex: 1; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 12px; font-family: var(--font-mono); font-size: 18px; font-weight: 700; cursor: pointer;" type="button">0</button><button id="tg-one" style="flex: 1; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 12px; font-family: var(--font-mono); font-size: 18px; font-weight: 700; cursor: pointer;" type="button">1</button></div><div style="display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;"><div style="font-family: var(--font-mono); font-size: 14px; color: var(--text-primary);">得分:<span id="tg-score" style="color: var(--accent-green); font-weight: 700;">0 T</span></div><button id="tg-reset" style="background: transparent; color: var(--text-muted); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 6px 12px; font-family: var(--font-mono); font-size: 12px; cursor: pointer;" type="button">新流</button></div><p aria-live="polite" id="tg-msg" style="font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-top: 12px; min-height: 20px;">每次正确预测获得1 T,每次错误扣除1 T。抛硬币的平均值为零。</p></div></div></div><div class="responsive-card-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px;"><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;"><div><div style="margin-bottom: 12px;"><span class="badge badge-blue" style="font-size: 10px;">正式论文</span></div><h3 style="font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px;"><a href="/zh-CN/research/computing-machinery-and-understanding" style="color: inherit;">计算机械与理解</a></h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">正式论文。图灵衡量的是净保留解释压缩:机器理解的一个操作性组件。当前等级:L2,仅限布朗运动范围,仪器认证。</p></div><div style="padding-top: 16px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px;"><a href="/zh-CN/research/computing-machinery-and-understanding" style="color: var(--accent-green); font-weight: 600;">阅读论文 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;"><div><div style="margin-bottom: 12px;"><span class="badge badge-blue" style="font-size: 10px;">配套论文</span></div><h3 style="font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px;"><a href="/zh-CN/research/computing-machinery-and-understanding-emergence" style="color: inherit;">计算机械与理解:涌现</a></h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">配套论文:理解如何在一个系统中涌现,以及该度量对此的说明。</p></div><div style="padding-top: 16px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px;"><a href="/zh-CN/research/computing-machinery-and-understanding-emergence" style="color: var(--accent-green); font-weight: 600;">阅读配套论文 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;"><div><div style="margin-bottom: 12px;"><span class="badge badge-blue" style="font-size: 10px;">立场论文</span></div><h3 style="font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px;"><a href="/zh-CN/research/the-stapleton-doctrine" style="color: inherit;">斯塔普尔顿学说</a></h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">架构背后的哲学,以立场论文形式陈述:基于物理,掌握基础,证明每一项主张。</p></div><div style="padding-top: 16px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px;"><a href="/zh-CN/research/the-stapleton-doctrine" style="color: var(--accent-green); font-weight: 600;">阅读学说 →</a></div></div><div class="glow-box" style="padding: 28px; border-radius: 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;"><div><div style="margin-bottom: 12px;"><span class="badge badge-blue" style="font-size: 10px;">文章</span></div><h3 style="font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px;"><a href="/zh-CN/post-llm-case/" style="color: inherit;">后大语言模型时代之论</a></h3><p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0;">论证为何要超越大语言模型时代,以及一个自主机器如何改变谁有资格思考。</p></div><div style="padding-top: 16px; border-top: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px;"><a href="/zh-CN/post-llm-case/" style="color: var(--accent-green); font-weight: 600;">阅读文章 →</a></div></div></div><p style="margin-top: 24px; font-size: 14px; color: var(--text-secondary);">所有内容,包括协议、密封实验档案和源文件:<a href="/zh-CN/research/" style="color: var(--accent-green); font-weight: 600;">完整研究索引</a> · <a href="https://github.com/aien-dev" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">GitHub上的公开代码与原始证据</a></p></div></section><section id="terminal" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface);"><div class="container"><div style="margin-bottom: 32px;"><div class="badge badge-green" style="margin-bottom: 12px;">交互式模拟</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">系统调用接口,已模拟</h2><p style="color: var(--text-secondary); margin-top: 8px; max-width: 680px;">一个完全在您的浏览器中运行的模拟。此页面未连接任何真实机器,您输入的内容也不会离开页面。它展示了真实机器所使用的接口形态。真实机器的证明请见上方的证据部分,包括收据等。</p></div><div class="terminal-shell" style="border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-base); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); overflow: hidden;"><div style="padding: 12px 16px; background: rgba(14, 18, 25, 0.95); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; gap: 16px;"><div style="display: flex; align-items: center; gap: 8px;"><span style="width: 10px; height: 10px; border-radius: 50%; background: #ef4444;"></span><span style="width: 10px; height: 10px; border-radius: 50%; background: #f59e0b;"></span><span style="width: 10px; height: 10px; border-radius: 50%; background: #10b981;"></span><span class="terminal-title" style="margin-left: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);">AienOS REPL v0.4.0 (sm_121a · aarch64 · 128GB LPDDR5x)</span></div><div class="terminal-status" style="display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--accent-green);"><span style="width: 6px; height: 6px; border-radius: 50%; background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green);"></span>COHERENT_ACTIVE</div></div><div style="padding: 10px 16px; background: rgba(14, 18, 25, 0.6); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;"><span style="font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase;">快速触发:</span><button data-cmd="sys_telemetry" style="background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 4px 10px; font-family: var(--font-mono); font-size: 12px; cursor: pointer;" type="button">sys_telemetry</button><button data-cmd="sys_alloc_kv" style="background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 4px 10px; font-family: var(--font-mono); font-size: 12px; cursor: pointer;" type="button">sys_alloc_kv</button><button data-cmd="sys_vault" style="background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 4px 10px; font-family: var(--font-mono); font-size: 12px; cursor: pointer;" type="button">sys_vault</button><button id="terminal-clear-btn" style="margin-left: auto; background: transparent; color: var(--text-muted); border: none; font-family: var(--font-mono); font-size: 11px; cursor: pointer;" type="button">[清除]</button></div><div id="terminal-output" style="padding: 20px; min-height: 280px; max-height: 440px; overflow-y: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.6;"><div class="terminal-log-line sys"><span class="sys-msg" style="color: var(--accent-blue);">[*] AienOS 神经内核 v0.4.0 已在 GB10 (aarch64) 上初始化。</span></div><div class="terminal-log-line sys"><span class="sys-msg" style="color: var(--accent-blue);">[*] 统一的相干地址空间:128 GB LPDDR5x 已上线。</span></div><div class="terminal-log-line sys"><span class="sys-msg" style="color: var(--accent-blue);">[*] 权限保险库已密封。零磁盘密钥不变量已激活。</span></div><div class="terminal-log-line sys"><span class="sys-msg" style="color: var(--text-muted);">[*] 输入一个系统调用,或点击上方的快速触发按钮之一。</span></div></div><form id="terminal-form" style="padding: 12px 16px; background: rgba(14, 18, 25, 0.95); border-top: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 8px;"><span style="color: var(--accent-green); font-family: var(--font-mono); font-size: 14px; font-weight: 700;">$</span><input autocomplete="off" id="terminal-input" placeholder="输入一个系统调用(sys_telemetry、sys_alloc_kv、sys_vault、help)..." style="flex: 1; background: transparent; border: none; outline: none; color: var(--text-primary); font-family: var(--font-mono); font-size: 13px;" type="text"/><button style="background: var(--accent-green); color: var(--bg-base); border: none; border-radius: 4px; padding: 6px 14px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; cursor: pointer;" type="submit">运行</button></form></div></div></section><section id="status" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle);"><div class="container"><div style="max-width: 760px; margin-bottom: 36px;"><div class="badge badge-amber" style="margin-bottom: 12px;">规范项目状态</div><h2 style="font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary);">它真实所处的位置</h2><p style="color: var(--text-secondary); margin-top: 8px; line-height: 1.6;">一个项目状态,发布一次,处处消费。本节、<a href="/status.json" style="color: var(--accent-green); font-weight: 600;">status.json</a> 和 <a href="/llms.txt" style="color: var(--accent-green); font-weight: 600;">llms.txt</a> 均来自同一源,因此不会产生偏差。最后更新于 2026-10-01。</p></div><div style="display: flex; flex-direction: column;"><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(0, 229, 153, 0.4); color: var(--accent-green); background: rgba(0, 229, 153, 0.08);">合格</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">Omega 基础门禁</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">门禁 1 至 14 已关闭,凭一份合并的准入收据:230 次检查,0 次失败。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/omega/pull/111" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/omega · PR #111 →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(45, 127, 249, 0.4); color: var(--accent-blue); background: rgba(45, 127, 249, 0.08);">已实现</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">图灵仪器</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">已实现(仪器);科学部分完成。当前等级:L2,仅限布朗运动范围,仪器认证。L2 判定已与 2026-10-01 的私有密封记录核对,记录保持私有。在布朗运动范围之外,上限为 L1。TY-2 记录了 2,559,679.825 比特的图灵增益。这是比特增益,而非产出。产出是 T/J(每焦耳图灵数),而 T/J 尚未建立:未测量能量。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/omega/pull/88" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/omega · PR #88 →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(45, 127, 249, 0.4); color: var(--accent-blue); background: rgba(45, 127, 249, 0.08);">已实现</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">原生 C 内核</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">主控上的独立 C 内核。通过 UEFI 模拟启动,包含 NVMe、ARGUS 权限检查,以及启动路径中的密封存储。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/aienux/pull/194" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aienux · PR #194 →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(248, 113, 113, 0.4); color: #f87171; background: rgba(248, 113, 113, 0.08);">被阻塞</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">原生机器资格认证(M5)</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">首次资格收据:未合格,10 项被阻塞,6 项缺失。已发布,并正在公开处理中。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/aienux/pull/187" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aienux · PR #187 →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(245, 158, 11, 0.4); color: #f5a623; background: rgba(245, 158, 11, 0.08);">实验性</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">图灵实验(EXP-001 / 002 / 003)</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">EXP-001 失败,EXP-001R 通过,EXP-002A 通过,EXP-002B 通过,EXP-002C 通过,EXP-002D 不完整,EXP-003 被阻塞。失败记录将保留在档案中。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/omega/pull/119" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/omega · PR #119 →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid rgba(245, 158, 11, 0.4); color: #f5a623; background: rgba(245, 158, 11, 0.08);">实验性</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">Aien,持久化代理</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">在 DGX Spark 实验室中运行。学习循环,从已验证的经验中学习,是当前的构建活动。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/aienux" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aienux →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid var(--border-subtle); color: var(--text-muted); background: var(--bg-surface);">计划中</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">Atlas,觉醒层</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">在新硬件上唤醒AienOS的种子。教义已发布于架构仓库;实现工作正在进行中。</p><div style="margin-top: 6px; font-family: var(--font-mono); font-size: 12px;"><a href="https://github.com/aien-dev/aien-architecture" rel="noopener noreferrer" style="color: var(--accent-green); font-weight: 600;" target="_blank">收据:aien-dev/aien-architecture →</a></div></div></div><div style="display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border-subtle); align-items: flex-start; flex-wrap: wrap;"><span class="badge" style="font-size: 10px; min-width: 118px; justify-content: center; border: 1px solid var(--border-subtle); color: var(--text-muted); background: var(--bg-surface);">计划中</span><div style="flex: 1; min-width: 260px;"><div style="font-weight: 700; color: var(--text-primary); font-size: 16px;">公开发布</div><p style="color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin: 4px 0 0 0;">预Alpha版。尚未提供支持的发布版本或安装程序。一旦有,将随版本号、哈希值和签名一同发布,运行前可检查。</p></div></div></div><div class="live" id="live"><div class="live-head"><div class="badge badge-blue">从公开记录中读取</div><h3>截至上次构建的组件</h3><p>六个仓库构成核心。最后两列在页面构建时从GitHub读取,而非手动输入。数据采集于 <span class="mono">2026-10-16T16:29:47Z</span>;页面每小时重建一次。</p></div><div class="live-grid"><table class="status-table"><thead><tr><th>组件</th><th>它是什么</th><th>最后合并的更改</th><th class="num">开放</th></tr></thead><tbody><tr><td class="name"><a href="https://github.com/aien-dev/aienux" rel="noopener">AienOS</a><small>aienos</small></td><td>操作系统。以代理为先;模型永远不是内核。</td><td><a class="merge" href="https://github.com/aien-dev/aienux/pull/401" rel="noopener">文档:原生KV所有权状态及一个已解决的GB10未知问题(PERF-DOC P1)</a><span class="when">2026年10月16日</span></td><td class="num">4</td></tr><tr><td class="name"><a href="https://github.com/aien-dev/omega" rel="noopener">Omega</a><small>omega</small></td><td>堆栈正在重写的语言与GPU引擎。</td><td><a class="merge" href="https://github.com/aien-dev/omega-mv/pull/504" rel="noopener">文档:记录Spark切换后的必要检查</a><span class="when">2026年10月16日</span></td><td class="num">18</td></tr><tr><td class="name"><a href="https://github.com/aien-dev/aien-sovereign-core" rel="noopener">主权核心</a><small>aien-sovereign-core</small></td><td>主机运行时、推理ABI,以及判断每次变更的流水线。</td><td><a class="merge" href="https://github.com/aien-dev/aien-sovereign-core-mv/pull/588" rel="noopener">aien-kv-cache:在源码中记录KV内存所有权与并发性(PERF-DOC P1)</a><span class="when">2026年10月16日</span></td><td class="num">22</td></tr><tr><td class="name"><a href="https://github.com/aien-dev/aien-architecture" rel="noopener">架构</a><small>aien-architecture</small></td><td>流程、边界、决策记录、执行计划。</td><td><a class="merge" href="https://github.com/aien-dev/aien-architecture-mv/pull/238" rel="noopener">文档/research:仓库拓扑(Unix风格、单体仓库、混合模式)</a><span class="when">2026年10月16日</span></td><td class="num">1</td></tr><tr><td class="name"><a href="https://github.com/aien-dev/aien-protocols" rel="noopener">协议</a><small>aien-protocols</small></td><td>规范、网络协议、数据结构。</td><td><a class="merge" href="https://github.com/aien-dev/aien-protocols-mv/pull/26" rel="noopener">文档:记录Spark切换后的必要检查</a><span class="when">2026年10月16日</span></td><td class="num">0</td></tr><tr><td class="name"><a href="https://github.com/aien-dev/physics" rel="noopener">物理</a><small>physics</small></td><td>FORGE实现层及GB10的启动制品。</td><td><a class="merge" href="https://github.com/aien-dev/physics-mv/pull/62" rel="noopener">文档:记录Spark切换后的必要检查</a><span class="when">2026年10月16日</span></td><td class="num">1</td></tr></tbody></table><aside aria-label="最新验证凭证" class="receipt" id="receipt"><h3>AIEN 验证</h3><div class="rule"></div><div class="row"><span>仓库</span><span>aien-sovereign-core</span></div><div class="row"><span>分支</span><span>main</span></div><div class="row"><span>提交</span><span>bdd58a2b8fc8</span></div><div class="row"><span>提交时间</span><span>2026年10月16日</span></div><div class="row"><span>判断者</span><span>Spark本身</span></div><div class="rule"></div><p>aien-kv-cache:在源码中记录KV内存所有权与并发性(PERF-DOC P1)(#588)</p><div class="rule"></div><div class="verdict fail">失败</div><p class="receipt-note">BLOCKED FAIL PREFILL-E2E-2:rc_nonzero</p><div class="foot">发布于2026年10月16日。<a href="https://github.com/aien-dev/aien-sovereign-core/commit/bdd58a2b8fc873deecc06871809817801ac8b1e2" rel="noopener">打开收据</a></div></aside></div><div class="decisions"><h4>最新决策记录</h4><ul><li><a href="https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0037-native-image-slot-signing-roles.md" rel="noopener"><span class="mono">ADR 0037</span> 谁签署原生槽位镜像:由所有者根直接签署,还是由发布签署者签署...</a></li><li><a href="https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0036-release-v1-memory-owner.md" rel="noopener"><span class="mono">ADR 0036</span> 发布v1内存所有者(发布就绪计划的L3车道)</a></li><li><a href="https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0035-persistent-cognitive-entity-boundary-allen.md" rel="noopener"><span class="mono">ADR 0035</span> 持久认知实体边界(ALLEN)</a></li><li><a href="https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0034-physical-form-realization-ir.md" rel="noopener"><span class="mono">ADR 0034</span> 物理形态实现IR</a></li><li><a href="https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0033-aien-verification-pipeline.md" rel="noopener"><span class="mono">ADR 0033</span> AIEN 验证:检查IR(manifest v2)、精确性类别、Spark...</a></li></ul><p class="small"><a href="https://github.com/aien-dev/aien-architecture/tree/main/docs/adr" rel="noopener">所有决策记录</a> · <a href="/facts.json">facts.json</a>,此区块背后的数据。</p></div></div><div style="display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px;"><a href="https://github.com/aien-dev" rel="noopener noreferrer" style="background: var(--accent-green); color: var(--bg-base); border-radius: 4px; padding: 10px 20px; font-family: var(--font-mono); font-size: 13px; font-weight: 700;" target="_blank">在GitHub上关注进展</a><a href="#research" style="background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 10px 20px; font-family: var(--font-mono); font-size: 13px; font-weight: 600;">阅读研究</a><a href="#follow" style="background: transparent; color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 10px 20px; font-family: var(--font-mono); font-size: 13px; font-weight: 600;">关注工作</a></div></div></section><section id="follow" style="padding: 80px 0; border-bottom: 1px solid var(--border-subtle); background: var(--bg-base);"><div class="container"><div class="glow-box" style="max-width: 760px; margin: 0 auto; padding: 48px 40px; border-radius: 12px; text-align: center; background: var(--bg-surface);"><div class="badge badge-green" style="margin-bottom: 16px; display: inline-flex;">在公开中构建</div><h2 style="font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 16px;">关注工作。</h2><p style="color: var(--text-secondary); line-height: 1.6; max-width: 600px; margin: 0 auto 32px auto; font-size: 16px;">无需等待发布,也无需加入列表。所有事情都在公共仓库中发生,每次变更都由机器本身进行判断,此页面每小时读取一次记录。关注仓库,阅读收据,打开一个问题。</p><div style="display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;"><a href="https://github.com/aien-dev" rel="noopener noreferrer" style="background: var(--accent-green); color: var(--bg-base); border-radius: 4px; padding: 12px 22px; font-family: var(--font-mono); font-size: 13px; font-weight: 700;" target="_blank">GitHub:aien-dev</a><a href="/zh-CN/progress/" style="background: transparent; color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 12px 22px; font-family: var(--font-mono); font-size: 13px; font-weight: 600;">项目进展</a></div><p style="color: var(--text-muted); font-size: 13px; margin-top: 28px; font-family: var(--font-mono);">机器可读:<a href="/status.json" style="color: var(--text-secondary);">status.json</a> · <a href="/facts.json" style="color: var(--text-secondary);">facts.json</a> · <a href="/llms.txt" style="color: var(--text-secondary);">llms.txt</a></p></div></div></section></main><footer class="aien-footer"><div class="container"><div class="aien-footer-top"><div class="aien-footer-about"><div class="aien-footer-brand"><svg aria-hidden="true" fill="none" height="18" stroke="var(--accent-blue)" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewbox="0 0 24 24" width="18"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" x2="20" y1="19" y2="19"></line></svg><span>AienOS</span></div><p>在您拥有的硬件上实现持久的机器智能。实验性、开源且公开验证,所有凭证均公开可查。</p></div><nav aria-label="网站章节" class="aien-footer-sections"><div class="aien-footer-group"><h2 class="aien-footer-heading">机器</h2><ul><li><a href="/zh-CN/machine/">机器</a></li><li><a href="https://github.com/aien-dev/aienux" rel="noopener noreferrer" target="_blank">AienOS 源代码</a></li><li><a href="https://github.com/aien-dev/omega" rel="noopener noreferrer" target="_blank">Omega 源代码</a></li><li><a href="https://github.com/aien-dev/aien-architecture" rel="noopener noreferrer" target="_blank">架构</a></li><li><a href="https://github.com/aien-dev/physics" rel="noopener noreferrer" target="_blank">物理机制</a></li></ul></div><div class="aien-footer-group"><h2 class="aien-footer-heading">图灵</h2><ul><li><a href="/zh-CN/turing/">图灵</a></li><li><a href="/zh-CN/research/computing-machinery-and-understanding/">图灵论文</a></li></ul></div><div class="aien-footer-group"><h2 class="aien-footer-heading">实验</h2><ul><li><a href="/zh-CN/experiments/">实验</a></li><li><a href="/zh-CN/research/">研究索引</a></li></ul></div><div class="aien-footer-group"><h2 class="aien-footer-heading">科学发现</h2><ul><li><a href="/zh-CN/discovery/">科学发现</a></li></ul></div><div class="aien-footer-group"><h2 class="aien-footer-heading">证据</h2><ul><li><a href="/zh-CN/evidence/">证据</a></li><li><a href="/zh-CN/research/status/">研究状态</a></li><li><a href="/research-status.json">状态数据(JSON)</a></li><li><a href="https://github.com/aien-dev/omega/blob/main/docs/turing/TURING_SCIENTIFIC_QUALIFICATION_STATE.md" rel="noopener noreferrer" target="_blank">资格记录</a></li></ul></div><div class="aien-footer-group"><h2 class="aien-footer-heading">哲学</h2><ul><li><a href="/zh-CN/philosophy/">哲学</a></li><li><a href="/zh-CN/research/the-stapleton-doctrine/">斯塔普尔顿学说</a></li><li><a href="/zh-CN/post-llm-case/">后大语言模型时代之论</a></li></ul></div><div class="aien-footer-group aien-footer-more"><h2 class="aien-footer-heading">更多</h2><ul><li><a href="/zh-CN/progress/">进展</a></li><li><a href="/zh-CN/blog">博客</a></li><li><a href="/zh-CN/#follow">关注</a></li><li><a href="/zh-CN/licensing/">许可协议</a></li><li><a href="https://github.com/aien-dev" rel="noopener noreferrer" target="_blank">GitHub</a></li><li><a href="/engineer/">德雷克·斯塔普尔顿</a></li></ul></div></nav></div><div class="aien-footer-legal"><div>Aien © 2026。根据 <a href="/zh-CN/licensing/">Apache-2.0 WITH LLVM-exception</a> 许可证授权。</div><div class="aien-footer-mottos"><span>凭证胜于声明</span><span>ZERO_UNSOLICITED_TELEMETRY</span></div></div></div></footer></div></body></html> \ No newline at end of file diff --git a/public/zh-CN/post-llm-case/index.html b/public/zh-CN/post-llm-case/index.html index 881d156..730608d 100644 --- a/public/zh-CN/post-llm-case/index.html +++ b/public/zh-CN/post-llm-case/index.html @@ -920,58 +920,6 @@ <div class="closing"><strong>这是一项提案,而非胜利宣言。</strong> <span>研究快照 · 2026年9月27日</span></div> </div> </section> -<script> - (function () { - var datasets = { - global: { - values: [{ label: "2025", value: 447 }, { label: "2026", value: 565 }], - max: 600, - ticks: [0, 200, 400, 600], - suffix: " TWh", - color: "#4bd3a1" - }, - ai: { - values: [{ label: "2025", value: 95 }, { label: "2026", value: 175 }, { label: "2027*", value: 258 }], - max: 300, - ticks: [0, 100, 200, 300], - suffix: " TWh", - color: "#ff7864" - } - }; - var NS = "http://www.w3.org/2000/svg"; - function node(name, attrs, text) { - var el = document.createElementNS(NS, name); - Object.keys(attrs || {}).forEach(function (key) { el.setAttribute(key, attrs[key]); }); - if (text !== undefined) el.textContent = text; - return el; - } - function renderChart(id, data) { - var host = document.getElementById(id); - var width = 560, height = 270, left = 52, right = 18, top = 22, bottom = 46; - var plotW = width - left - right, plotH = height - top - bottom; - var svg = node("svg", { viewBox: "0 0 " + width + " " + height, "aria-hidden": "true", focusable: "false" }); - data.ticks.forEach(function (tick) { - var y = top + plotH - (tick / data.max) * plotH; - svg.appendChild(node("line", { x1: left, y1: y, x2: width - right, y2: y, stroke: "currentColor", "stroke-opacity": ".20", "stroke-width": "1" })); - svg.appendChild(node("text", { x: left - 10, y: y + 4, "text-anchor": "end", fill: "currentColor", "fill-opacity": ".66", "font-size": "11", "font-family": "IBM Plex Mono, monospace" }, String(tick))); - }); - var slot = plotW / data.values.length; - var barW = Math.min(96, slot * .48); - data.values.forEach(function (d, i) { - var h = (d.value / data.max) * plotH; - var x = left + slot * i + (slot - barW) / 2; - var y = top + plotH - h; - svg.appendChild(node("rect", { x: x, y: y, width: barW, height: h, fill: data.color })); - svg.appendChild(node("text", { x: x + barW / 2, y: y - 9, "text-anchor": "middle", fill: "currentColor", "font-size": "13", "font-weight": "700", "font-family": "IBM Plex Mono, monospace" }, d.value + data.suffix)); - svg.appendChild(node("text", { x: x + barW / 2, y: height - 17, "text-anchor": "middle", fill: "currentColor", "fill-opacity": ".75", "font-size": "12", "font-family": "IBM Plex Mono, monospace" }, d.label)); - }); - host.appendChild(svg); - } - renderChart("chartGlobal", datasets.global); - renderChart("chartAI", datasets.ai); - var growth = ((datasets.global.values[1].value / datasets.global.values[0].value - 1) * 100).toFixed(1); - document.getElementById("energyValue").setAttribute("title", growth + "% increase from 2025"); - }()); - </script> +<script src="/js/post-llm-case.js"></script> </body> </html> diff --git a/public/zh-CN/turing/index.html b/public/zh-CN/turing/index.html index e07f74d..6830f4b 100644 --- a/public/zh-CN/turing/index.html +++ b/public/zh-CN/turing/index.html @@ -528,222 +528,6 @@ html,body{overflow-x:clip} <div class="cite reveal">M. Drake Stapleton.《计算机械与理解:从模仿游戏到图灵》. AIEN研究,2026年。版本1.14(未经同行评审)。</div> </section> <footer class="tfoot">图灵(T)是由AIEN项目提出的一种协议绑定的科学单位。<br/> 正式论文为版本1.14,配套论文为版本1.7,未经同行评审。测量结果已预先注册,且可独立验证。<br/> <a href="/zh-CN/research/">AIEN研究</a> · <a href="https://github.com/aien-dev/omega">Omega在GitHub上</a></footer> -<script> -(function(){ -"use strict"; -var $ = function(id){ return document.getElementById(id); }; - -/* ---------- scroll progress ---------- */ -var prog = $("progress"); -function onScroll(){ - var h = document.documentElement; - var p = h.scrollTop / (h.scrollHeight - h.clientHeight); - prog.style.width = (p*100).toFixed(2) + "%"; -} -window.addEventListener("scroll", onScroll, {passive:true}); onScroll(); - -/* ---------- reveal on scroll ---------- */ -var io = new IntersectionObserver(function(es){ - es.forEach(function(e){ if(e.isIntersecting){ e.target.classList.add("visible"); io.unobserve(e.target); } }); -},{threshold:.12}); -document.querySelectorAll(".reveal").forEach(function(el){ io.observe(el); }); - -/* ---------- hero particle field: scattered bits coalescing ---------- */ -var cv = $("field"), ctx = cv.getContext("2d"), W=0, H=0, parts=[]; -function sizeCanvas(){ - W = cv.width = cv.offsetWidth; H = cv.height = cv.offsetHeight; - parts = []; - var n = Math.max(90, Math.min(240, Math.floor(W*H/9000))); - for(var i=0;i<n;i++){ - parts.push({ - hx: Math.random()*W, hy: Math.random()*H, - sa: Math.random()*Math.PI*2, - sr: 26 + Math.random()*Math.min(W,H)*0.30, - s: .7 + Math.random()*1.9, - sp: .5 + Math.random()*.9, - c: Math.random()<.72 ? "45,127,249" : "0,229,153", - dr: (Math.random()-.5)*.14 - }); - } -} -sizeCanvas(); window.addEventListener("resize", sizeCanvas); -function ease(x){ return x<.5 ? 2*x*x : 1-Math.pow(-2*x+2,2)/2; } -var t0 = performance.now(); -function frame(now){ - var t = ((now - t0)/16000) % 1; /* 16s loop */ - var k = t<.5 ? ease(t*2) : ease((1-t)*2); /* 0 scattered, 1 coalesced */ - ctx.clearRect(0,0,W,H); - ctx.globalCompositeOperation = "lighter"; - var cx = W/2, cy = H*0.40, rot = now*0.00012; - for(var i=0;i<parts.length;i++){ - var p = parts[i]; - p.hx += p.dr; p.hy += p.dr*.6; - if(p.hx<0)p.hx=W; if(p.hx>W)p.hx=0; if(p.hy<0)p.hy=H; if(p.hy>H)p.hy=0; - var a = p.sa + rot*p.sp; - var tx = cx + Math.cos(a)*p.sr, ty = cy + Math.sin(a)*p.sr*.72; - var x = p.hx + (tx-p.hx)*k, y = p.hy + (ty-p.hy)*k; - var al = .16 + .6*k; - ctx.beginPath(); ctx.arc(x, y, p.s*(0.7+0.9*k), 0, 6.2832); - ctx.fillStyle = "rgba("+p.c+","+al.toFixed(3)+")"; ctx.fill(); - } - ctx.globalCompositeOperation = "source-over"; - requestAnimationFrame(frame); -} -requestAnimationFrame(frame); - -/* ---------- GAME 1: crack the code ---------- */ -var g1rules = document.querySelectorAll("#g1-rules .rule-btn"); -var g1tiles = [$("g1-h0"),$("g1-h1"),$("g1-h2")]; -function paintTiles(vals, ok){ - g1tiles.forEach(function(t,i){ - t.textContent = vals[i]; - t.style.borderStyle = "solid"; - if(ok===true){ t.style.background="rgba(0,229,153,.14)"; t.style.borderColor="#00e599"; t.style.color="#00e599"; } - else if(ok===false){ t.style.background="rgba(255,93,93,.12)"; t.style.borderColor="#ff5d5d"; t.style.color="#ff5d5d"; } - }); -} -function resetTiles(){ - g1tiles.forEach(function(t){ - t.textContent="?"; t.style.background=""; t.style.borderColor=""; t.style.color=""; t.style.borderStyle=""; - }); -} -var g1data = { - good: { vals:["28","33","38"], ok:true, cls:"good", - verdict:"+2.6 T. The rule earns its keep.", - math:"3 sealed events nailed <b>+3.0</b><br>rule rent, 4 words × 0.1 <b>−0.4</b><br>= <b>+2.6 T</b>", - explain:"<strong>Why it wins:</strong> four words that keep working on data nobody has seen. The rent is tiny and the prediction is total. This is what a Turing rewards." }, - memo: { vals:["23","23","23"], ok:false, cls:"bad", - verdict:"−1.0 T. Memory is not understanding.", - math:"0 sealed events predicted <b>+0.0</b><br>rule rent, 10 words × 0.1 <b>−1.0</b><br>= <b>−1.0 T</b>", - explain:"<strong>Why it fails:</strong> the rule only recites what was already shown, so when it meets sealed numbers it just repeats the last thing it saw. Ten words of rent, zero prediction. Negative Turings." }, - wrong: { vals:["43","83","163"], ok:false, cls:"bad", - verdict:"−0.5 T. Confident and wrong.", - math:"0 sealed events predicted <b>+0.0</b><br>rule rent, 5 words × 0.1 <b>−0.5</b><br>= <b>−0.5 T</b>", - explain:"<strong>Why it fails:</strong> it sounds like a rule, but the sealed data disagrees with every guess. The scorer does not grade confidence. It grades sealed predictions minus rent." } -}; -g1rules.forEach(function(btn){ - btn.addEventListener("click", function(){ - var d = g1data[btn.getAttribute("data-rule")]; - g1rules.forEach(function(b){ b.disabled=true; b.classList.add("dim"); }); - btn.classList.remove("dim"); btn.classList.add("picked"); - paintTiles(d.vals, d.ok); - $("g1-score").textContent = d.cls==="good" ? "+2.6 T" : (btn.getAttribute("data-rule")==="memo" ? "-1.0 T" : "-0.5 T"); - var v=$("g1-verdict"); v.className="verdict "+d.cls; v.innerHTML=d.verdict; - $("g1-math").innerHTML=d.math; $("g1-explain").innerHTML=d.explain; - $("g1-result").classList.add("show"); - }); -}); -$("g1-again").addEventListener("click", function(){ - g1rules.forEach(function(b){ b.disabled=false; b.classList.remove("dim","picked"); }); - resetTiles(); $("g1-result").classList.remove("show"); $("g1-score").textContent="--"; -}); - -/* ---------- RULE LAB ---------- */ -var rGain=$("r-gain"), rCost=$("r-cost"); -function lab(){ - var g=+rGain.value, c=+rCost.value, rent=c*0.1, t=g-rent; - $("o-gain").textContent=g; $("o-cost").textContent=c; - var tv=$("lab-t"); - var txt=(t>0?"+":"")+(Math.round(t*10)/10).toFixed(1)+" T"; - tv.textContent=txt; - tv.className="tval "+(t>0?"pos":t<0?"neg":"zero"); - $("lab-f-gain").textContent=g; $("lab-f-cost").textContent=rent.toFixed(1); - var ft=$("lab-f-t"); ft.textContent=txt; ft.style.color=t>0?"#00e599":t<0?"#ff5d5d":"#94a3b8"; - var w=Math.max(3,Math.min(100,(t+4)/16*100)); - var bar=$("lab-bar"); bar.style.width=w+"%"; - bar.style.background=t>0?"linear-gradient(90deg,#2d7ff9,#00e599)":t<0?"linear-gradient(90deg,#7f1d1d,#ff5d5d)":"#475569"; - var note=$("lab-note"), msg; - if(t>=8) msg="Theory territory. Short, powerful, keeps predicting on unseen data."; - else if(t>=3) msg="A solid explanation. It earns its keep with room to spare."; - else if(t>0) msg="Positive but thin. Can you say it in fewer words?"; - else if(t===0) msg="Exactly at baseline. It predicts nothing beyond its own cost."; - else msg="Memorizer zone: longer than the insight it carries. The scorer charges rent."; - note.textContent=msg; -} -rGain.addEventListener("input", lab); rCost.addEventListener("input", lab); lab(); - -/* ---------- GAME 2: beat the memorizer ---------- */ -var rounds=[ - {q:"Duel 1: the number game", sub:"A machine watched 3, 8, 13, 18, 23, then sealed data.", - a:{who:"CANDIDATE A", text:"\u201Cadd 5 each time\u201D (4 words)"}, - b:{who:"CANDIDATE B", text:"\u201Cthe numbers are 3, 8, 13, 18, 23, 28, 33, 38\u201D (12 words)"}, - correct:"a", - why:"<strong>A wins.</strong> Both name the hidden numbers, but B is three times longer and carries no reusable rule. On a brand-new game, A still works and B knows nothing. Turings reward the rule, not the recital."}, - {q:"Duel 2: the night sky", sub:"Two explanations of dots moving overhead.", - a:{who:"CANDIDATE A", text:"\u201Cplanets orbit the sun in ellipses\u201D (6 words)"}, - b:{who:"CANDIDATE B", text:"\u201C4,000 sky-dots move along these 4,000 listed paths\u201D (plus a 4,000-line table)"}, - correct:"a", - why:"<strong>A wins.</strong> Six words that predict every future night. B is a phone book of the sky: enormous rent, zero generalization. This is the whole game in one duel."}, - {q:"Duel 3: the twist", sub:"Now length is not the whole story.", - a:{who:"CANDIDATE A", text:"\u201Cadd 5 each time\u201D (4 words), predicts 3 sealed events"}, - b:{who:"CANDIDATE B", text:"\u201Cadd 5 each time, except after primes add 7\u201D (10 words), predicts 9 sealed events"}, - correct:"b", - why:"<strong>B wins.</strong> 9 predicted minus 1.0 rent = +8.0 T, against A's 3 minus 0.4 = +2.6 T. A longer rule CAN win, but only if the extra words buy more prediction than they cost. That is what \u201Cnet\u201D means."} -]; -var g2score=0, g2done=0; -var wrap=$("g2-rounds"); -rounds.forEach(function(r,i){ - var card=document.createElement("div"); card.className="quiz-card"; - card.innerHTML='<p class="quiz-q">'+r.q+'</p><p class="quiz-sub">'+r.sub+'</p>'+ - '<div class="duel"><button data-pick="a"><span class="who">'+r.a.who+'</span>'+r.a.text+'</button>'+ - '<button data-pick="b"><span class="who">'+r.b.who+'</span>'+r.b.text+'</button></div>'+ - '<div class="quiz-why"></div>'; - wrap.appendChild(card); - var btns=card.querySelectorAll("button"), why=card.querySelector(".quiz-why"), open=false; - btns.forEach(function(b){ - b.addEventListener("click", function(){ - if(open) return; open=true; g2done++; - var pick=b.getAttribute("data-pick"), win=pick===r.correct; - btns.forEach(function(x){ - x.disabled=true; - if(x.getAttribute("data-pick")===r.correct) x.classList.add("right"); else x.classList.add("wrong"); - }); - if(win){ g2score++; } - why.innerHTML=(win?"<strong style='color:#00e599'>Correct. </strong>":"<strong style='color:#ff5d5d'>Not this one. </strong>")+r.why; - why.classList.add("show"); - $("g2-score").textContent=g2score+" / 3"; - if(g2done===3){ - var msg=g2score===3?"Flawless. You score explanations like the instrument does.": - g2score===2?"Strong. Round 3 tricks almost everyone the first time.": - "The twist got you. Replay it: net means prediction minus rent, always."; - var d=document.createElement("p"); d.className="explain"; d.style.marginTop="22px"; - d.innerHTML="<strong>"+msg+"</strong>"; - wrap.appendChild(d); - } - }); - }); -}); - -/* ---------- big number count-up ---------- */ -var bignum=$("bignum"), counted=false; -function fmt(n){ return n.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}); } -var bio=new IntersectionObserver(function(es){ - es.forEach(function(e){ - if(e.isIntersecting && !counted){ - counted=true; var target=2559679.825, start=performance.now(), dur=2200; - (function tick(now){ - var p=Math.min(1,(now-start)/dur), v=target*(1-Math.pow(1-p,3)); - bignum.textContent=fmt(v); - if(p<1) requestAnimationFrame(tick); else bignum.textContent=fmt(target); - })(start); - var gc=$("gcurve"); - gc.style.transition="stroke-dashoffset 2.2s ease .3s"; gc.style.strokeDashoffset="0"; - bio.disconnect(); - } - }); -},{threshold:.3}); -bio.observe(document.querySelector(".bigstat")); -var cio=new IntersectionObserver(function(es){ - es.forEach(function(e){ - if(e.isIntersecting){ - var gc=$("gcurve"); - gc.style.transition="stroke-dashoffset 2.2s ease .3s"; gc.style.strokeDashoffset="0"; - cio.disconnect(); - } - }); -},{threshold:.4}); -cio.observe($("gcurve")); -})(); -</script> +<script src="/js/turing.js"></script> </body> </html>