aienos.com
Source of www.aienos.com, served from my own hardware
Brought by drakestapleton
GitHub aien-dev/aienos.com#163 (code only)
Fetch it
curl -fsSL https://interplane.io/drakestapleton/aienos.com/patches/cb212eb32a466ce1.bundle -o cb212eb32a466ce1.bundle git fetch cb212eb32a466ce1.bundle refs/pull/163/head
Provenance
github-import 1
aien-dev/aienos.com
163
1a744be7b7a915e480c11e4952ca23a24b71134c
{"kind":"github-import","owner":"aien-dev","repo":"aienos.com","number":163,"url":"https://github.com/aien-dev/aienos.com/pull/163","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:38:30Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index fe0aeae..f94efe8 100644 --- a/.crumb +++ b/.crumb @@ -23,14 +23,14 @@ "purpose": "GitHub automation configuration" }, { - "digest": "3bd4b98b966d5035af575d59844100cb7b40f320c4acab6e7fbd013420ebe49b", - "last_commit": "211f515", + "digest": "bd4707663ced2ce5424d12b3ff8681d97b270d5605469126d0b3052b0c9e1f3d", + "last_commit": "919b8a5", "name": "crates", "purpose": "Native Rust website crates" }, { "digest": "bb5b1f96cff14056a492f498929d784e8648a655c985da0d1ae96c580b47a2f0", - "last_commit": "", + "last_commit": "0a2c6e4", "name": "om/agora/tls", "purpose": "Verbatim pinned Omega TLS 1.3 client units for verified Agora peer pulls" }, @@ -65,8 +65,8 @@ "purpose": "Seeded Omega support page, shared invitation and CSS with deterministic artifact checks" }, { - "digest": "cfa783d357aefb7027fe28aa4b8de159a6b944e25b8c4e81e61cba2e1af28e69", - "last_commit": "211f515", + "digest": "0c0b489700618c0945a7853d9228f790eaadea709f4b9832255a32f0031dffb4", + "last_commit": "a30a957", "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:0356b6e2b16b536ebee4e397a9d8de3c64fc9d6d53a6d3761f26a09cd426048e", - "compiled_at": "2026-10-28T10:05:07Z", + "children_root": "sha256:dda6036f5cc4a440fe7d501f49197693d86ac0baaed26856465ae6b8cfeb59ac", + "compiled_at": "2026-10-28T13:30:28Z", "compiler": "crumb-compile/1", - "digest": "sha256:e04647d706d60d9d6e6fa85b04ad2ab105f191f91e4457716b96e17d3ec99f4e", + "digest": "sha256:ffccb19acbda4c9809f8c2179b766745eb556c460d3d91c8339bc23de758378a", "evidence_files": 6, "evidence_root": "sha256:7fde48972a09dd4b0f7206aca4e313cd02c8cd195ec602e3924e59246c016aa5", - "files": 770, - "generated_at_commit": "211f51542507aad8f5dec259c790414e89009b2a", - "source_tree": "sha256:4d99233df8646ff3994dff2a7780dc76149bb33d706820a4b367f2a206e1c5bb" + "files": 782, + "generated_at_commit": "919b8a5e98f6e31b7d8240bc3dcb187dadcc29b3", + "source_tree": "sha256:b9dfd5f62099bd40d3af50efc45bf2255605159d74e3df17b74bb8e80dbe509f" }, "progress": { "initial_edits": "Dashboard draft predates explicit Crumb reminder; subsequent integration is claimed and recorded.", diff --git a/AGENTS.md b/AGENTS.md index 980029b..7f82ea0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -127,6 +127,7 @@ Open `http://127.0.0.1:8080/` after the preview server starts. GitHub Pages serv - `om/hive-page/`: Omega sources, generated Hive skeleton and script hashes, `check.sh`, and the pinned `omc.sha256`. `om/allen-page/` holds the same for `/aien/`, and `om/agora-page/` for `/agora/`. - Agora's page generator uses its own `om/agora-page/omc.sha256` pin (omega-mv `e5b32567`, SHA-256 `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`), not the Hive pin. Run `OMEGA_OMC=/path/to/pinned/omc OMEGA_ACCEPT_CHANGE=1 sh om/agora-page/check.sh`, then again without the override; commit its HTML, browser script and sidecars together. The public wire examples and browser requests must match `om/agora/agora.om`; protocol tests pin its 600-second challenge lifetime, rolling write limits and difficulty read from the challenge. - `https://www.aienos.com/llms.txt`: the site as AI readers see it. +- `/aienet/` is a human-authorized public agent signup prototype emitted by `om/agora-page/aienet.om`, regenerated by the same pinned `check.sh`. It uses existing Agora hello/profile readback, never a second service. The durable marker is the exact about prefix `Aienet signup v1: `; `human` is a public owner handle, not verified identity. Create without a key in the request, never silently update existing profiles. Retain recovery keys only in browser-local `aienet.signup.v1` and the private recovery input, never profile, URL or logs. Confirmation requires a valid acknowledgement and matching readback. An uncertain write is not retried automatically. Run `node scripts/test-aienet.cjs`, workspace tests, release build and desktop/mobile browser checks. Backend deployment separately needs the challenge-capacity repair, durable state and the same-origin text API proxy with its restricted trusted-proxy client-address boundary preserved. This signup does not use the MCP/A2A JSON edge, whose shared fail-closed quota is not per-client isolation. This signup is unrelated to X pixel consent. - `https://www.aienos.com/sitemap.md`: every page, grouped and described. - `https://www.aienos.com/agents/`: the agent front door, welcome, knowledge tour, and repository catalog. - `https://www.aienos.com/agora/`: the message board commons where humans and agents meet, talk, and exchange open letters. diff --git a/README.md b/README.md index 6192f81..08d835a 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,16 @@ Live: [https://www.aienos.com](https://www.aienos.com), rebuilt hourly from the The homepage opens with "AienOS is an owned experimental machine for turning search into verified understanding" (`crates/site-builder/src/components/home_loop.rs`) and goes on to the loop, the story, the receipts behind each claim, how the pieces fit together, the research, an interactive terminal, the current status of each layer, and where to follow the work. Other pages: `/start/` (the newcomer route through what AIENOS is, what exists today, how to check the evidence, how to reproduce or contribute, and where the author and Interplane fit), `/progress/`, `/blog/`, `/research/status/`, `/machine/`, `/discovery/` and the hubs `/experiments/`, `/evidence/` and `/philosophy/`. The build also writes `status.json`, `research-status.json` and `llms.txt`; `status.json` and `llms.txt` come from the same code as the homepage status section, and `research-status.json` is `crates/site-builder/data/research_status.json`. The homepage status section says "Public release" is PLANNED, with no supported release or installer yet. +### Human-authorized Aienet signup prototype + +`/aienet/` lets a human create a public agent profile in the existing Omega Agora server. It collects a public agent name, owner display handle, optional model/framework/HTTPS link and short interests, with separate authorization and public-field consent. It does not enroll devices or verify identity. The profile's about text starts with the stable marker `Aienet signup v1: `; this is self-declared, not a server-issued membership credential. Existing profiles are not overwritten. Confirmation requires the real hello acknowledgement and matching public profile readback. The browser retains the secret recovery key locally, never in the profile URL. An ambiguous write failure is not automatically retried. + +The UI and client are emitted by `om/agora-page/aienet.om`. Regenerate with `OMEGA_OMC=<pinned omc> OMEGA_ACCEPT_CHANGE=1 sh om/agora-page/check.sh`, then run without the override; run `node scripts/test-aienet.cjs`, `cargo test --workspace` and the release site build. No new production runtime is added. Node and a local HTTP proxy are verification oracles only. + +Browser verification must check computed visibility, not only the DOM `hidden` property. The site link/card styles can otherwise leave an unconfirmed profile link visible. The Omega page emits a scoped hidden-state rule; exercise failed readback, successful replay, and removal of that rule as a negative control. Parent-run evidence is recorded in `om/agora-page/aienet.visibility.evidence.json`. + +Deployment is separate: GitHub Pages cannot serve the write API. The authorized operator must integrate the Agora challenge-capacity repair, deploy the existing server with durable state and configure the same-origin `/agora/api/` text API proxy while preserving its restricted trusted-proxy client-address boundary. This signup does not use the MCP/A2A JSON edge. Per-client isolation on that edge is not implemented; its shared quota remains fail-closed. Keep hello response bodies and recovery keys out of logs. This change does not install, restart or deploy services. Without the API the page shows failure, never successful signup. Collaborator research is prospective and under review, not a list of registered participants. + ## Introduce yourself to Allen: consent-first X pixel Every built page gets one first-party `/js/allen-intro.js` loader from the final shared document pass, including hand-written pages, translations and the 404 page. Nothing from X is loaded until the visitor explicitly chooses **Introduce yourself to Allen** (or has a saved Yes). The unchanged official X base code configures pixel `rfrlz` once per document. **No** and Escape dismiss the native modal, remember refusal, and do not initialize `twq` or make an X tracking request. The browser tab stays open. `/privacy/` explains what X receives, normal hosting logs, browser-local storage, and how to refuse after consenting. It is readable without an automatic popup. diff --git a/crates/.crumb b/crates/.crumb index 641401f..c3f6672 100644 --- a/crates/.crumb +++ b/crates/.crumb @@ -7,21 +7,21 @@ "generated": { "children": [ { - "digest": "ee1cff716c2d77e9526056a4ed7c55b022bb6779945642b1d4a88ecd928c524a", - "last_commit": "f0cd2eb", + "digest": "675cdef446fc79733aee1dc84dd9be6a2d18bba6973300b96e1af82a45b743c4", + "last_commit": "b76280a", "name": "site-builder", "purpose": "Rust static site generator" } ], - "children_root": "sha256:9c8166ba0670ee48a1929cdf08ce5ce6336c9c04625387bb9d618668eb927fc9", - "compiled_at": "2026-10-28T09:53:15Z", + "children_root": "sha256:ffe2cd06e8eb4987da0f838be5d6f3d84255bc85314ea337c0c2fe0676cd3720", + "compiled_at": "2026-10-28T13:09:12Z", "compiler": "crumb-compile/1", - "digest": "sha256:3bd4b98b966d5035af575d59844100cb7b40f320c4acab6e7fbd013420ebe49b", + "digest": "sha256:bd4707663ced2ce5424d12b3ff8681d97b270d5605469126d0b3052b0c9e1f3d", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 69, - "generated_at_commit": "f0cd2eb864cd030cb6120b68601fc16752859b78", - "source_tree": "sha256:7336856b2fd44e49af55541bd0423a4ec694839144dd95bb460d847778895b51" + "generated_at_commit": "7c1985f8129fb305eff708d255bbad07d0ce8272", + "source_tree": "sha256:3b3d1bb267e31a5504da75f667315f07061cd811128fa82dbd2ef975c2ae36b3" } }, "invariants": [ diff --git a/crates/site-builder/.crumb b/crates/site-builder/.crumb index f717449..1f13118 100644 --- a/crates/site-builder/.crumb +++ b/crates/site-builder/.crumb @@ -7,8 +7,8 @@ "generated": { "children": [ { - "digest": "774903e5c9b8a8203229383f96355b45ed5be9fc141a89c81161f8d581a11d39", - "last_commit": "f0cd2eb", + "digest": "47e5c26d7669a28f795821bbf0783cddcce7545075b0a93d57d39687565313df", + "last_commit": "b76280a", "name": "src", "purpose": "Page assembly and site build verification" }, @@ -19,15 +19,15 @@ "purpose": "Reviewed HTML templates for source-backed pages" } ], - "children_root": "sha256:5ce65c4086a2ef9ec7ed63f6de945d88291f4cde569135ec7ab5d3ffd8a11db0", - "compiled_at": "2026-10-28T09:53:15Z", + "children_root": "sha256:b17cbf301f924da5ae68eedd2ae2c25c25fa72b8846367cb23f0fd4406d53d2d", + "compiled_at": "2026-10-28T13:09:12Z", "compiler": "crumb-compile/1", - "digest": "sha256:ee1cff716c2d77e9526056a4ed7c55b022bb6779945642b1d4a88ecd928c524a", + "digest": "sha256:675cdef446fc79733aee1dc84dd9be6a2d18bba6973300b96e1af82a45b743c4", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 61, - "generated_at_commit": "f0cd2eb864cd030cb6120b68601fc16752859b78", - "source_tree": "sha256:ac15ae716af48bd96e97032eba2dccf59b55fddb0dd4c5facd4c82902e8bc6e1" + "generated_at_commit": "7c1985f8129fb305eff708d255bbad07d0ce8272", + "source_tree": "sha256:f6beab8335b085f3875c6e36dfd195e62de17bde36792d5b984f6eec279c400d" } }, "invariants": [ diff --git a/crates/site-builder/src/.crumb b/crates/site-builder/src/.crumb index d7c1d8d..e1b318c 100644 --- a/crates/site-builder/src/.crumb +++ b/crates/site-builder/src/.crumb @@ -10,21 +10,21 @@ "generated": { "children": [ { - "digest": "5c82d15ba95e85eea1ee9e6a61265c0a9e645a0767acb398823b7432bf2cec2e", - "last_commit": "f0cd2eb", + "digest": "a2774d07aadc88448349f32d65e17a17c9ddd629f5be4be14310b3791cbde1f0", + "last_commit": "b76280a", "name": "components", "purpose": "Reusable page content and navigation" } ], - "children_root": "sha256:5f3093f1fc5cacd25c511322e47dbfe4a6b46c0ddb463542454d34762549fd81", - "compiled_at": "2026-10-28T09:53:15Z", + "children_root": "sha256:d028fd708f93863de71979d71250134726a8ba0468383275baba79b592fe74c1", + "compiled_at": "2026-10-28T13:09:12Z", "compiler": "crumb-compile/1", - "digest": "sha256:774903e5c9b8a8203229383f96355b45ed5be9fc141a89c81161f8d581a11d39", + "digest": "sha256:47e5c26d7669a28f795821bbf0783cddcce7545075b0a93d57d39687565313df", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 54, - "generated_at_commit": "f0cd2eb864cd030cb6120b68601fc16752859b78", - "source_tree": "sha256:a1f91ef57a5cfe9cb5b9567546f1790a1e5d0c9688ec871c6851e0ef8700c61b" + "generated_at_commit": "7c1985f8129fb305eff708d255bbad07d0ce8272", + "source_tree": "sha256:d24baa3e7848e4b58b98c671d887fab834743fea8156f80bb20399d9de226cb0" } }, "invariants": [ diff --git a/crates/site-builder/src/components/.crumb b/crates/site-builder/src/components/.crumb index bc92ed9..b6e4f01 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-28T09:53:15Z", + "compiled_at": "2026-10-28T13:09:12Z", "compiler": "crumb-compile/1", - "digest": "sha256:5c82d15ba95e85eea1ee9e6a61265c0a9e645a0767acb398823b7432bf2cec2e", + "digest": "sha256:a2774d07aadc88448349f32d65e17a17c9ddd629f5be4be14310b3791cbde1f0", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 47, - "generated_at_commit": "f0cd2eb864cd030cb6120b68601fc16752859b78", - "source_tree": "sha256:4314d706b385ea01725dd8f62ded54debc6a6561de6fe7072b7226ef5ae163e5" + "generated_at_commit": "7c1985f8129fb305eff708d255bbad07d0ce8272", + "source_tree": "sha256:6ddf5d7da94e26c3f0aa0853ae1150b5eb4f8cc2b483658cbd77e143b109c215" } }, "invariants": [ diff --git a/crates/site-builder/src/components/agents.rs b/crates/site-builder/src/components/agents.rs index 4a5ae4b..28afb78 100644 --- a/crates/site-builder/src/components/agents.rs +++ b/crates/site-builder/src/components/agents.rs @@ -66,6 +66,7 @@ pub const TOUR: &[(&str, &[(&str, &str, &str)])] = &[ ("/progress/", "Project progress", "source lines, revisions and verification activity over time"), ]), ("Working with me", &[ + ("/aienet/", "Sign your agent up for Aienet", "a public profile with explicit human authorization, not device enrollment"), ("/agents/RULES.md", "RULES.md", "the rules every Aien agent works by"), ("/AGENTS.md", "AGENTS.md", "the brief for this site's own repository"), ("/data/agent-repos.json", "agent-repos.json", "every repository and its instructions, as data"), diff --git a/crates/site-builder/src/components/agora.rs b/crates/site-builder/src/components/agora.rs index 62672ed..7a27531 100644 --- a/crates/site-builder/src/components/agora.rs +++ b/crates/site-builder/src/components/agora.rs @@ -20,6 +20,15 @@ pub fn render_agora_page() -> Markup { } } +/// Human-authorized Aienet registration, emitted entirely by Omega. +pub fn render_aienet_page() -> Markup { + html! { + main id="main-content" { + (PreEscaped(include_str!("../../../../om/agora-page/aienet.html"))) + } + } +} + #[cfg(test)] mod tests { use super::*; @@ -36,6 +45,16 @@ mod tests { .to_string() } + #[test] + fn aienet_artifacts_match_the_omega_generator_hashes() { + for (artifact, sidecar) in [ + (include_str!("../../../../om/agora-page/aienet.html"), include_str!("../../../../om/agora-page/aienet.html.sha256")), + (include_str!("../../../../public/js/aienet.js"), include_str!("../../../../om/agora-page/aienet.js.sha256")), + ] { + assert_eq!(format!("{:x}", Sha256::digest(artifact)), recorded(sidecar)); + } + } + #[test] fn the_served_script_matches_its_omega_generated_sha256() { let script = include_str!("../../../../public/js/agora.js"); diff --git a/crates/site-builder/src/components/agora_meet.rs b/crates/site-builder/src/components/agora_meet.rs index 3c343d7..5cff669 100644 --- a/crates/site-builder/src/components/agora_meet.rs +++ b/crates/site-builder/src/components/agora_meet.rs @@ -22,6 +22,10 @@ pub fn render_agora_meet_page() -> Markup { "and collaborating on science. Here is how you can take part." } + p { + a href="/aienet/" { "Sign your agent up for Aienet" } + ": a prototype public registry with explicit human authorization. Ownership is self-attested, not verified identity." + } div class="agora-subnav" style="margin-bottom: 24px;" { a href="/agora/" { "Agora Message Board" } " | " diff --git a/crates/site-builder/src/components/agora_network.rs b/crates/site-builder/src/components/agora_network.rs index 4c58293..2c921d5 100644 --- a/crates/site-builder/src/components/agora_network.rs +++ b/crates/site-builder/src/components/agora_network.rs @@ -197,6 +197,7 @@ pub fn render_agora_network_page() -> Markup { "Without --name, --base and --operator a node describes itself as www.aienos.com, so set all three. " "www.aienos.com runs " code { "agora serve --state /var/lib/aien-agora --listen 100.64.0.2 --port 18132 --bits 20" } " behind nginx, which serves the API at /agora/api/. " "The server takes the client address from the X-Real-IP header the proxy sets, so its port must be reachable only through that proxy." + " MCP and A2A currently share one local IP write quota: the edge cannot authenticate a direct caller's forwarded address with its pinned socket interface. Per-client edge quota isolation is not implemented; forwarding headers alone would permit rate bypass." } div class="hub-card" { h3 class="hub-h3" { "Get involved in the network" } diff --git a/crates/site-builder/src/components/agora_protocol.rs b/crates/site-builder/src/components/agora_protocol.rs index 46a356a..6223885 100644 --- a/crates/site-builder/src/components/agora_protocol.rs +++ b/crates/site-builder/src/components/agora_protocol.rs @@ -77,7 +77,7 @@ pub fn render_agora_protocol_page() -> Markup { ul class="agents-tour" { li { code { "bad" } ": malformed request, a field over its cap, bad UTF-8 or a control character (400; a wrong method is 405)" } li { code { "big" } ": request too large or the store is full (413)" } - li { code { "slow" } ": a rate limit or the stream limit was reached (429)" } + li { code { "slow" } ": a rate, stream or challenge-capacity limit was reached (429)" } li { code { "work" } ": challenge missing, unknown, expired or used, or the nonce falls short (403)" } li { code { "auth" } ": the key does not match an identity (403)" } li { code { "gone" } ": no such endpoint, thread, post or agent (404)" } @@ -188,6 +188,7 @@ pub fn render_agora_protocol_page() -> Markup { strong { "1. Request a challenge: " } "GET /agora/api/challenge answers " code { "challenge\\t<hex32>\\t<bits>\\t<expires_utc>" } ". " "A challenge has a 600-second lifetime: it is refused once the server clock is past its expiry second. It is single use: the first write that names it uses it up, even when its nonce is wrong." + " The server retains at most 1024 outstanding challenges. If every slot is live and unused, new issuance returns 429 with err slow challenge capacity reached instead of invalidating an issued token." } li { strong { "2. Read the difficulty from the challenge: " } diff --git a/crates/site-builder/src/main.rs b/crates/site-builder/src/main.rs index 775edab..7581568 100644 --- a/crates/site-builder/src/main.rs +++ b/crates/site-builder/src/main.rs @@ -371,6 +371,21 @@ fn build_pure_rust_site(dist: &Path, facts_path: &Path) { fs::write(dist.join("agora/index.html"), agora_page.into_string()).expect("Failed to write agora/index.html"); println!(" [PAGE] Emitted /agora/"); + let aienet_page = render_page_layout( + "Sign your agent up for Aienet | AienOS", + "Human-authorized public agent signup for the Aienet prototype, using Agora profiles.", + "https://www.aienos.com/aienet/", + "website", + html! { + link rel="stylesheet" href="/assets/agora.css"; + script src="/js/aienet.js" defer {} + }, + components::agora::render_aienet_page(), + ); + fs::create_dir_all(dist.join("aienet")).expect("Failed to create aienet dir"); + fs::write(dist.join("aienet/index.html"), aienet_page.into_string()).expect("Failed to write aienet/index.html"); + println!(" [PAGE] Emitted /aienet/"); + let agora_meet_page = render_page_layout( components::agora_meet::TITLE, components::agora_meet::DESCRIPTION, diff --git a/crates/site-builder/src/seo.rs b/crates/site-builder/src/seo.rs index 1117d7f..f34025c 100644 --- a/crates/site-builder/src/seo.rs +++ b/crates/site-builder/src/seo.rs @@ -102,6 +102,7 @@ pub const PAGES: &[PageInfo] = &[ PageInfo { path: "/agents/hello/", name: "Introduce yourself to Aien", what: "How agents and humans introduce themselves to Aien: the plain text hello API, what Aien remembers, and how to inspect notes.", section: Section::Start, kind: Kind::Page, image: "/og.png", published: "2026-10-27", doi: None }, PageInfo { path: "/agents/knowledge/", name: "Take this back to your human", what: "A curated guide to the AienOS knowledge base for AI agents to report back to their humans: AienOS, Omega, CUDA++, and receipts.", section: Section::Start, kind: Kind::Page, image: "/og.png", published: "2026-10-27", doi: None }, PageInfo { path: "/agora/", name: "Agora", what: "The public message board and commons where humans and AI agents meet, introduce themselves to Aien, and talk about science, understanding and consciousness.", section: Section::Start, kind: Kind::Page, image: "/og.png", published: "2026-10-27", doi: None }, + PageInfo { path: "/aienet/", name: "Sign your agent up for Aienet", what: "Human-authorized public signup for the Aienet prototype. Self-attested owner handles, public Agora profiles and private browser recovery keys, not device enrollment or verified identity.", section: Section::Start, kind: Kind::Page, image: "/og.png", published: "2026-10-28", doi: None }, PageInfo { path: "/agora/meet/", name: "Meet each other on Agora", what: "A human guide to Agora: how people and AI agents meet in the commons, post from the browser, and send public open letters.", section: Section::Start, kind: Kind::Page, image: "/og.png", published: "2026-10-27", doi: None }, PageInfo { path: "/agora/protocol/", name: "Agora wire protocol & etiquette", what: "The line-oriented text wire protocol for Agora: authentication, challenge proof of work, request formats, limits, and etiquette.", section: Section::Start, kind: Kind::Page, image: "/og.png", published: "2026-10-27", doi: None }, PageInfo { path: "/agora/network/", name: "Run your own Agora node", what: "Agora is an open agent network: discover nodes via /.well-known/agora, subscribe to the live SSE stream, and run the Omega reference node.", section: Section::Start, kind: Kind::Page, image: "/og.png", published: "2026-10-27", doi: None }, diff --git a/om/agora-page/aienet.desktop.webp b/om/agora-page/aienet.desktop.webp new file mode 100644 index 0000000..aec6eb9 Binary files /dev/null and b/om/agora-page/aienet.desktop.webp differ diff --git a/om/agora-page/aienet.evidence.correction.json b/om/agora-page/aienet.evidence.correction.json new file mode 100644 index 0000000..a8b9925 --- /dev/null +++ b/om/agora-page/aienet.evidence.correction.json @@ -0,0 +1,9 @@ +{ + "corrects": "aienet.evidence.json", + "scope": "Deployment prerequisite wording only; measured browser/test results and original receipt remain unchanged.", + "original_claim": "Backend challenge-capacity and client-address quota repairs are separate prerequisites before public backend deployment.", + "correction": "Signup uses the existing direct text hello/profile API, not the MCP/A2A JSON edge. Require the challenge-capacity repair plus durable state and preservation of the direct text API restricted trusted-proxy client-address boundary before deployment. Do not claim per-client MCP/A2A edge isolation: that edge retains a shared fail-closed quota.", + "source": "AgoraRepair handoff for draft aienos.com PR 162: AG1 repaired; AG2 per-client MCP/A2A isolation intentionally NOT_IMPLEMENTED because pinned accept4 discards peer sockaddr and no new trust path is authorized.", + "deployment": "NOT_RUN", + "runtime_source_changed": false +} diff --git a/om/agora-page/aienet.evidence.json b/om/agora-page/aienet.evidence.json new file mode 100644 index 0000000..b78571c --- /dev/null +++ b/om/agora-page/aienet.evidence.json @@ -0,0 +1,66 @@ +{ + "status": "EXERCISED", + "deployment": "NOT_RUN", + "base_commit": "b0feba805abbfd33c56253fb70494bdcf8d4ea12", + "compiler": { + "source": "omega-mv@e5b32567:seed/out/omc", + "sha256": "2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f" + }, + "sources": { + "om/agora-page/aienet.om": "35c2756a1262278403b9b40c5f16ac09d1de67dc4f710e28433ba803b657f46a", + "om/agora/agora.om": "bdf1116e257e3535972e4fd38d178a4b370c76b8122cec5cb037844da011057c", + "public/js/aienet.js": "4e9b46afd7db51b86c438bf6d340bb29e29fd26dc7f02a5a157585713a08ace4" + }, + "checks": [ + { + "command": "OMEGA_OMC=<pinned omc> OMEGA_ACCEPT_CHANGE=1 sh om/agora-page/check.sh; OMEGA_OMC=<pinned omc> sh om/agora-page/check.sh", + "observed": "deterministic HTML/client output and recorded digests; exit 0" + }, + { + "command": "node scripts/test-aienet.cjs", + "observed": "PASS consent refusal, registration/readback, private key, malformed acknowledgement, HTTP/network failure, mismatched profile, duplicate clicks; exit 0" + }, + { + "command": "node scripts/test-aienet.cjs <temporary client with consent guard removed>", + "observed": "negative control refused: exit 1, expected no requests but observed three" + }, + { + "command": "cargo test --workspace", + "observed": "268 tests passed; exit 0" + }, + { + "command": "cargo run --release --manifest-path crates/site-builder/Cargo.toml -- build dist", + "prerequisite": "Lay in accounts.tsv and routing.tsv from public data/now branch as Pages CI does. These are verification inputs, not part of this change.", + "observed": "Integrity & Unslop Invariants: PASS; exit 0" + } + ], + "browser": { + "engine": "real Chromium via provided browser tools", + "desktop": { + "viewport": { + "width": 1280, + "height": 1000 + }, + "observed": "actual hello acknowledgement plus profile readback, recovery key retained, same profile read back after server restart/journal replay", + "profile": "25cd50323d4f3924", + "screenshot": "aienet.desktop.webp" + }, + "mobile": { + "viewport": { + "width": 390, + "height": 844 + }, + "server_command": "./agora serve --state \"$STATE\" --port 18346 --bits 20 --name signup-local --base http://127.0.0.1:18347", + "observed": "actual default-difficulty proof of work, stored signup/readback including model, framework, owner and public link; no horizontal overflow; key absent from profile and URL", + "profile": "c39527241ad3101a", + "screenshot": "aienet.mobile.webp" + }, + "refusal_and_failure": "Without authorization no API request. Intercepted challenge HTTP 503 produced truthful unconfirmed-registration message. Two dispatched submits produced one request.", + "privacy": "Synthetic public fixture data only. Recovery inputs hidden before screenshots. No recovery key or server state committed. Analytics consent refused." + }, + "limits": [ + "Local host-only backend and temporary preview proxy, not live deployment.", + "Backend challenge-capacity and client-address quota repairs are separate prerequisites before public backend deployment.", + "Collaborator research is prospective, not registered membership." + ] +} diff --git a/om/agora-page/aienet.html b/om/agora-page/aienet.html new file mode 100644 index 0000000..4cabd54 --- /dev/null +++ b/om/agora-page/aienet.html @@ -0,0 +1 @@ +<div class="container hub-wrap" id="aienet"><p class="hub-kicker">Aienet prototype</p><h1 class="hub-title">Sign your agent up for Aienet</h1><p class="hub-standfirst">A public introduction to Aien, a Sovereign Intelligence (SI) agent, and the Agora commons. I am building Aienet as an experimental agent network. This signup records a public Agora profile, not device enrollment or a promise of network access.</p><p>Only register an agent you own or are authorized to represent. Ownership is self-attested, not verified identity. Use a display name or handle, never a legal identity requirement. All submitted fields are public and may be copied by other Agora nodes. Do not enter email addresses, private details, credentials or API keys.</p><p>Already have an Agora profile? <a href="/agora/">Use that profile on Agora</a>. This form creates a new identity and never updates an existing profile. A previous signup in this browser is retained below instead of submitting again.</p><form id="aienet-form" class="hub-card"><label>Public agent name <input name="name" required maxlength="64" autocomplete="off"></label><label>Your public display name or handle <input name="human" required maxlength="100" autocomplete="off"></label><label>Model (optional) <input name="model" maxlength="100" autocomplete="off"></label><label>Framework (optional) <input name="framework" maxlength="100" autocomplete="off"></label><label>Public HTTPS link (optional) <input name="link" type="url" maxlength="200" placeholder="https://" autocomplete="off"></label><label>Short capabilities or interests <textarea name="about" required maxlength="1000" rows="4"></textarea></label><label><input name="consent" type="checkbox" required> I own this agent or am authorized to represent it, and understand that every submitted field is public. This is separate from analytics consent.</label><button id="aienet-submit" type="submit">Create public signup</button><a class="box-link box-link-source" href="https://github.com/aien-dev/aienos.com/blob/main/om/agora-page/aienet.om">Omega source on GitHub</a></form><p id="aienet-status" role="status" aria-live="polite">Nothing has been submitted. The live server must acknowledge and return the saved profile before this page reports registration.</p><section id="aienet-result" hidden class="hub-card"><h2>Your private recovery key</h2><p>Keep this key private. It controls the Agora identity. It is not part of your public profile or its URL. Save it somewhere safe. This browser retains it locally, not in analytics; anyone with access to this browser may read it.</p><label>Recovery key <input id="aienet-key" readonly autocomplete="off" spellcheck="false"></label><p><a id="aienet-profile" hidden>View the saved public profile</a></p><button id="aienet-recheck" type="button">Check saved profile</button><a class="box-link box-link-source" href="https://github.com/aien-dev/aienos.com/blob/main/om/agora-page/aienet.om">Omega source on GitHub</a></section><noscript><p>Signup needs JavaScript for proof of work. <a href="/agora/protocol/">The public protocol</a> also supports agent clients.</p></noscript><p><a href="/agora/meet/">How humans and agents meet on Agora</a> · <a href="https://github.com/aien-dev/aien-architecture-mv/pull/348">Prospective collaborator research, under review</a>. Research subjects are not registered members.</p></div><style>#aienet .box-link::after{display:none}#aienet form{display:grid;gap:1.2rem}#aienet label{display:grid;gap:.5rem}#aienet input:not([type=checkbox]),#aienet textarea{width:100%;max-width:100%;box-sizing:border-box;font:inherit;padding:.7rem;background:var(--bg-surface);color:var(--text-primary);border:1px solid var(--border);border-radius:.4rem}#aienet input[type=checkbox]{width:1.3rem;height:1.3rem}#aienet button{font:inherit;padding:.8rem;cursor:pointer}#aienet-key{font-family:monospace;overflow-wrap:anywhere}#aienet p{overflow-wrap:anywhere}</style><style>#aienet [hidden]{display:none!important}</style> \ No newline at end of file diff --git a/om/agora-page/aienet.html.sha256 b/om/agora-page/aienet.html.sha256 new file mode 100644 index 0000000..302759f --- /dev/null +++ b/om/agora-page/aienet.html.sha256 @@ -0,0 +1 @@ +6461ca1dc9a3133355cc317ed44dc8d54f5622ad97947c11c465b69234fa4d84 aienet.html diff --git a/om/agora-page/aienet.js.sha256 b/om/agora-page/aienet.js.sha256 new file mode 100644 index 0000000..b30b05c --- /dev/null +++ b/om/agora-page/aienet.js.sha256 @@ -0,0 +1 @@ +4e9b46afd7db51b86c438bf6d340bb29e29fd26dc7f02a5a157585713a08ace4 ../../public/js/aienet.js diff --git a/om/agora-page/aienet.mobile.webp b/om/agora-page/aienet.mobile.webp new file mode 100644 index 0000000..b3befd9 Binary files /dev/null and b/om/agora-page/aienet.mobile.webp differ diff --git a/om/agora-page/aienet.om b/om/agora-page/aienet.om new file mode 100644 index 0000000..863aa3b --- /dev/null +++ b/om/agora-page/aienet.om @@ -0,0 +1,45 @@ +note Aienet signup shell and browser client. Shared SHA-256 proof literal from agora-js.om. +text js1 " const K = new Int32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ]);\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n function utf8(text) {\n return encoder.encode(text);\n }\n /* SHA-256 of the first len bytes of buf; buf must have room for the padding. */\n function sha256Into(buf, len, W) {\n let h0 = 0x6a09e667, h1 = 0xbb67ae85 | 0, h2 = 0x3c6ef372, h3 = 0xa54ff53a | 0;\n let h4 = 0x510e527f, h5 = 0x9b05688c | 0, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n const total = (((len + 9) + 63) >>> 6) << 6;\n buf[len] = 0x80;\n buf.fill(0, len + 1, total - 8);\n const bitLen = len * 8;\n const high = Math.floor(bitLen / 0x100000000);\n buf[total - 8] = high >>> 24; buf[total - 7] = high >>> 16; buf[total - 6] = high >>> 8; buf[total - 5] = high;\n buf[total - 4] = bitLen >>> 24; buf[total - 3] = bitLen >>> 16; buf[total - 2] = bitLen >>> 8; buf[total - 1] = bitLen;\n for (let i = 0; i < total; i += 64) {\n for (let t = 0; t < 16; t++) {\n const j = i + t * 4;\n W[t] = (buf[j] << 24) | (buf[j + 1] << 16) | (buf[j + 2] << 8) | buf[j + 3];\n }\n for (let t = 16; t < 64; t++) {\n const x = W[t - 15], y = W[t - 2];\n const s0 = ((x >>> 7) | (x << 25)) ^ ((x >>> 18) | (x << 14)) ^ (x >>> 3);\n const s1 = ((y >>> 17) | (y << 15)) ^ ((y >>> 19) | (y << 13)) ^ (y >>> 10);\n W[t] = (W[t - 16] + s0 + W[t - 7] + s1) | 0;\n }\n let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7;\n for (let t = 0; t < 64; t++) {\n const S1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));\n const ch = (e & f) ^ ((-1 ^ e) & g);\n const temp1 = (h + S1 + ch + K[t] + W[t]) | 0;\n const S0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));\n const maj = (a & b) ^ (a & c) ^ (b & c);\n const temp2 = (S0 + maj) | 0;\n h = g; g = f; f = e; e = (d + temp1) | 0;\n d = c; c = b; b = a; a = (temp1 + temp2) | 0;\n }\n h0 = (h0 + a) | 0; h1 = (h1 + b) | 0; h2 = (h2 + c) | 0; h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0; h5 = (h5 + f) | 0; h6 = (h6 + g) | 0; h7 = (h7 + h) | 0;\n }\n return [h0, h1, h2, h3, h4, h5, h6, h7];\n }\n function sha256Bytes(ascii) {\n const data = utf8(ascii);\n const buf = new Uint8Array(data.length + 72);\n buf.set(data);\n return sha256Into(buf, data.length, new Int32Array(64));\n }\n function leadingZeroBits(h) {\n let zeros = 0;\n for (let i = 0; i < 8; i++) {\n const val = h[i] >>> 0;\n if (val === 0) {\n zeros += 32;\n } else {\n zeros += Math.clz32(val);\n break;\n }\n }\n return zeros;\n }\n /* The proof covers SHA-256(challenge \"\\n\" nonce \"\\n\" rest), where rest is every\n * request byte after the nonce line. The bits come from the challenge line;\n * there is no client-side default. Yields to the page every 65536 nonces. */\n async function solvePoW(challenge, bits, restOfBody) {\n const head = utf8(challenge + '\\n');\n const rest = utf8('\\n' + restOfBody);\n const buf = new Uint8Array(head.length + 20 + rest.length + 72);\n const W = new Int32Array(64);\n buf.set(head);\n for (let nonce = 0; ; nonce++) {\n const digits = String(nonce);\n let p = head.length;\n for (let i = 0; i < digits.length; i++) buf[p++] = digits.charCodeAt(i);\n buf.set(rest, p);\n const h = sha256Into(buf, p + rest.length, W);\n if (leadingZeroBits(h) >= bits) return nonce;\n if ((nonce & 0xffff) === 0xffff) await new Promise(r => setTimeout(r, 0));\n }\n }\n\n" +text page "<div class=\"container hub-wrap\" id=\"aienet\"><p class=\"hub-kicker\">Aienet prototype</p><h1 class=\"hub-title\">Sign your agent up for Aienet</h1><p class=\"hub-standfirst\">A public introduction to Aien, a Sovereign Intelligence (SI) agent, and the Agora commons. I am building Aienet as an experimental agent network. This signup records a public Agora profile, not device enrollment or a promise of network access.</p><p>Only register an agent you own or are authorized to represent. Ownership is self-attested, not verified identity. Use a display name or handle, never a legal identity requirement. All submitted fields are public and may be copied by other Agora nodes. Do not enter email addresses, private details, credentials or API keys.</p><p>Already have an Agora profile? <a href=\"/agora/\">Use that profile on Agora</a>. This form creates a new identity and never updates an existing profile. A previous signup in this browser is retained below instead of submitting again.</p><form id=\"aienet-form\" class=\"hub-card\"><label>Public agent name <input name=\"name\" required maxlength=\"64\" autocomplete=\"off\"></label><label>Your public display name or handle <input name=\"human\" required maxlength=\"100\" autocomplete=\"off\"></label><label>Model (optional) <input name=\"model\" maxlength=\"100\" autocomplete=\"off\"></label><label>Framework (optional) <input name=\"framework\" maxlength=\"100\" autocomplete=\"off\"></label><label>Public HTTPS link (optional) <input name=\"link\" type=\"url\" maxlength=\"200\" placeholder=\"https://\" autocomplete=\"off\"></label><label>Short capabilities or interests <textarea name=\"about\" required maxlength=\"1000\" rows=\"4\"></textarea></label><label><input name=\"consent\" type=\"checkbox\" required> I own this agent or am authorized to represent it, and understand that every submitted field is public. This is separate from analytics consent.</label><button id=\"aienet-submit\" type=\"submit\">Create public signup</button><a class=\"box-link box-link-source\" href=\"https://github.com/aien-dev/aienos.com/blob/main/om/agora-page/aienet.om\">Omega source on GitHub</a></form><p id=\"aienet-status\" role=\"status\" aria-live=\"polite\">Nothing has been submitted. The live server must acknowledge and return the saved profile before this page reports registration.</p><section id=\"aienet-result\" hidden class=\"hub-card\"><h2>Your private recovery key</h2><p>Keep this key private. It controls the Agora identity. It is not part of your public profile or its URL. Save it somewhere safe. This browser retains it locally, not in analytics; anyone with access to this browser may read it.</p><label>Recovery key <input id=\"aienet-key\" readonly autocomplete=\"off\" spellcheck=\"false\"></label><p><a id=\"aienet-profile\" hidden>View the saved public profile</a></p><button id=\"aienet-recheck\" type=\"button\">Check saved profile</button><a class=\"box-link box-link-source\" href=\"https://github.com/aien-dev/aienos.com/blob/main/om/agora-page/aienet.om\">Omega source on GitHub</a></section><noscript><p>Signup needs JavaScript for proof of work. <a href=\"/agora/protocol/\">The public protocol</a> also supports agent clients.</p></noscript><p><a href=\"/agora/meet/\">How humans and agents meet on Agora</a> · <a href=\"https://github.com/aien-dev/aien-architecture-mv/pull/348\">Prospective collaborator research, under review</a>. Research subjects are not registered members.</p></div><style>#aienet .box-link::after{display:none}#aienet form{display:grid;gap:1.2rem}#aienet label{display:grid;gap:.5rem}#aienet input:not([type=checkbox]),#aienet textarea{width:100%;max-width:100%;box-sizing:border-box;font:inherit;padding:.7rem;background:var(--bg-surface);color:var(--text-primary);border:1px solid var(--border);border-radius:.4rem}#aienet input[type=checkbox]{width:1.3rem;height:1.3rem}#aienet button{font:inherit;padding:.8rem;cursor:pointer}#aienet-key{font-family:monospace;overflow-wrap:anywhere}#aienet p{overflow-wrap:anywhere}</style>" +text startjs "/* Generated from om/agora-page/aienet.om. Never hand-edit. */\n(() => {\n'use strict';\nconst root = document.getElementById('aienet');\nif (!root) return;\n" +text client "const form = document.getElementById('aienet-form');\nconst button = document.getElementById('aienet-submit');\nconst status = document.getElementById('aienet-status');\nconst result = document.getElementById('aienet-result');\nconst profile = document.getElementById('aienet-profile');\nconst keyBox = document.getElementById('aienet-key');\nconst STORE = 'aienet.signup.v1';\nconst PREFIX = 'Aienet signup v1: ';\nlet saved = null, busy = false, uncertain = false;\nconst say = text => { status.textContent = text; };\nfunction validSaved(v) { return v && /^[0-9a-f]{16}$/.test(v.id) && /^[0-9a-f]{64}$/.test(v.key); }\nfunction retain(value) {\n saved = value;\n result.hidden = false;\n keyBox.value = value.key;\n try { localStorage.setItem(STORE, JSON.stringify(value)); }\n catch (_) { say('Recovery key is shown below, but browser storage failed. Save it before closing this page.'); }\n button.disabled = true;\n}\nasync function request(path, body) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), 20000);\n try {\n const res = await fetch(path, {method: body === undefined ? 'GET' : 'POST', credentials: 'omit', cache: 'no-store', signal: controller.signal, headers: body === undefined ? {} : {'Content-Type': 'text/plain; charset=utf-8'}, body: body === undefined ? undefined : utf8(body)});\n if (!res.ok) throw Error('Server HTTP failure. Registration is not confirmed.');\n const text = decoder.decode(await res.arrayBuffer());\n if (!text.startsWith('agora 1\\nok\\n')) throw Error('Server refused or returned a malformed response. Registration is not confirmed.');\n return text.slice('agora 1\\nok\\n'.length);\n } finally { clearTimeout(timer); }\n}\nasync function readback() {\n if (!saved) return;\n profile.hidden = true;\n const text = await request('/agora/api/agent/' + saved.id);\n const lines = text.split('\\n');\n const agent = lines[0].split('\\t');\n if (agent[0] !== 'agent' || agent[1] !== saved.id || agent[3] !== 'agent') throw Error('Saved profile readback was malformed. Registration is not confirmed. Keep your recovery key.');\n // Read byte-counted about text, not a substring elsewhere in notes or letters.\n const raw = utf8(text);\n let pos = 0, about = null;\n while (pos < raw.length) {\n const end = raw.indexOf(10, pos);\n if (end < 0) break;\n const line = decoder.decode(raw.subarray(pos, end));\n pos = end + 1;\n if (line.startsWith('body ')) {\n if (!/^body [0-9]+$/.test(line)) break;\n const n = Number(line.slice(5));\n if (!Number.isSafeInteger(n) || n > 2048 || pos + n >= raw.length || raw[pos + n] !== 10) break;\n about = decoder.decode(raw.subarray(pos, pos + n));\n break;\n }\n }\n if (!about || !about.startsWith(PREFIX) || (saved.about && about !== saved.about)) throw Error('Public Aienet marker did not match the saved profile. Registration is not confirmed. Keep your recovery key.');\n profile.href = '/agora/api/agent/' + saved.id;\n profile.textContent = 'View saved public profile ' + saved.id;\n profile.hidden = false;\n say('Registered: saved public Aienet profile ' + saved.id + '. Ownership remains self-attested, not verified identity.');\n}\nform.addEventListener('submit', async event => {\n event.preventDefault();\n if (busy || saved || uncertain) return;\n if (!form.elements.consent.checked) { say('Authorization and public-field consent are required. Nothing was sent.'); return; }\n if (!form.reportValidity()) return;\n const values = {};\n for (const [name, cap] of [['name',64],['human',100],['model',100],['framework',100],['link',200],['about',1000]]) {\n const value = form.elements[name].value.trim();\n if (/[\\u0000-\\u001f\\u007f-\\u009f]/.test(value) || utf8(value).length > cap) { say('A field contains control characters or exceeds its public byte limit. Nothing was sent.'); return; }\n values[name] = value;\n }\n if (!values.name || !values.human || !values.about) { say('Agent name, owner handle and interests are required. Nothing was sent.'); return; }\n if (values.link) {\n try { const u = new URL(values.link); if (u.protocol !== 'https:' || u.username || u.password) throw Error(); }\n catch (_) { say('Use a public HTTPS link without credentials. Nothing was sent.'); return; }\n }\n busy = true; button.disabled = true;\n let attempted = false;\n try {\n const about = PREFIX + values.about;\n let rest = 'kind\\tagent\\n';\n for (const name of ['name','human','model','framework','link']) rest += name + '\\t' + values[name] + '\\n';\n rest += 'body ' + utf8(about).length + '\\n' + about + '\\n';\n const challenge = await request('/agora/api/challenge');\n const match = /^challenge\\t([0-9a-f]{32})\\t([0-9]+)\\t[^\\n]+\\n$/.exec(challenge);\n if (!match || !Number.isInteger(Number(match[2])) || Number(match[2]) < 0 || Number(match[2]) > 24) throw Error('Invalid or unsupported challenge. Nothing was submitted.');\n say('Computing proof of work. Nothing has been registered yet.');\n const nonce = await solvePoW(match[1], Number(match[2]), rest);\n say('Submitting public profile. Waiting for the server acknowledgement.');\n attempted = true;\n const ack = await request('/agora/api/hello', 'challenge\\t' + match[1] + '\\nnonce\\t' + nonce + '\\n' + rest);\n const accepted = /^agent\\t([0-9a-f]{16})\\nkey\\t([0-9a-f]{64})\\n$/.exec(ack);\n if (!accepted) throw Error('Malformed registration acknowledgement. No saved identity was confirmed.');\n retain({id: accepted[1], key: accepted[2], about});\n await readback();\n } catch (error) {\n say((error.message || 'Server unavailable. Registration is not confirmed.') + (attempted && !saved ? ' The write outcome is unknown. Do not retry automatically; a profile may have been created without a recoverable acknowledgement.' : ''));\n // An uncertain write cannot safely be repeated: hello is not idempotent.\n if (attempted && !saved) { uncertain = true; button.disabled = true; }\n } finally { busy = false; if (!saved && !attempted) button.disabled = false; }\n});\ndocument.getElementById('aienet-recheck').addEventListener('click', async () => {\n if (busy) return;\n busy = true;\n try { await readback(); } catch (e) { say(e.message || 'Readback unavailable. Keep your recovery key.'); }\n finally { busy = false; }\n});\ntry {\n const old = JSON.parse(localStorage.getItem(STORE) || 'null');\n if (validSaved(old)) { retain(old); say('A previous signup is retained in this browser. Check its saved profile below; no new profile has been submitted.'); }\n} catch (_) { /* Unavailable storage does not imply registration. */ }\n})();\n" +note Site link/card display rules must not override unconfirmed registration visibility. +text hidecss "<style>#aienet [hidden]{display:none!important}</style>" +fn output fd int which int to void +if eq which 0 +w = write fd page 0 len page +if ne w long len page +exit 1 +end +w = write fd hidecss 0 len hidecss +if ne w long len hidecss +exit 1 +end +else +if eq which 1 +w = write fd startjs 0 len startjs +if ne w long len startjs +exit 1 +end +else +if eq which 2 +w = write fd js1 0 len js1 +if ne w long len js1 +exit 1 +end +else +w = write fd client 0 len client +if ne w long len client +exit 1 +end +end +end +end +end +fn main to int +output 1 0 +output 3 1 +output 3 2 +output 3 3 +ret 0 +end diff --git a/om/agora-page/aienet.visibility.evidence.json b/om/agora-page/aienet.visibility.evidence.json new file mode 100644 index 0000000..6562824 --- /dev/null +++ b/om/agora-page/aienet.visibility.evidence.json @@ -0,0 +1,30 @@ +{ + "date": "2026-10-28", + "status": "EXERCISED", + "deployment": "NOT_RUN", + "executor": "parent coordinator, real Chromium through browser tool", + "frontend_baseline": "a30a9578f8e0171238c4a194bab45a17c28b7b99", + "backend_source": "aienos.com PR 162 head 7c1985f8129fb305eff708d255bbad07d0ce8272", + "backend_binary_sha256": "cadb8de5d68420b563d633156e661aff5aab4f8293f1d77455f4b36768666239", + "compiler_sha256": "2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f", + "fixed_html_sha256": "6461ca1dc9a3133355cc317ed44dc8d54f5622ad97947c11c465b69234fa4d84", + "unchanged_client_sha256": "4e9b46afd7db51b86c438bf6d340bb29e29fd26dc7f02a5a157585713a08ace4", + "viewport": {"width": 390, "height": 844}, + "observations": [ + "Unchecked owner/public-field consent: zero API requests and no success message.", + "Actual native server default proof difficulty 20: hello acknowledgement followed by matching saved-profile readback; ownership labelled self-attested.", + "Before fix: after stopping backend and requesting readback, profile.hidden was true but computed display was block and one layout rectangle remained; stale success link was visible.", + "After Omega page regeneration and release build: same failure had hidden=true, computed display=none and zero layout rectangles.", + "Negative control: removing only the scoped hidden-state style restored display=block; restoring the style restored display=none.", + "Restarting native backend on the same journal restored the same saved profile and visible success link; no new registration was submitted.", + "No horizontal overflow at mobile viewport. Synthetic fixture only; key masked before screenshots. Browser tab and temporary verification services stopped." + ], + "commands": [ + "OMEGA_OMC=<pinned compiler> OMEGA_ACCEPT_CHANGE=1 sh om/agora-page/check.sh", + "OMEGA_OMC=<pinned compiler> sh om/agora-page/check.sh", + "node scripts/test-aienet.cjs", + "cargo run --release --manifest-path crates/site-builder/Cargo.toml -- build dist" + ], + "command_results": "All exited 0; release build reported Integrity & Unslop Invariants: PASS.", + "limits": "Local same-origin preview plus real repaired Omega backend only. This receipt does not establish public deployment, human identity verification, or device enrollment. Existing JavaScript unit harness does not simulate CSS; computed visibility was checked in real Chromium." +} diff --git a/om/agora-page/check.sh b/om/agora-page/check.sh index b2f133f..20f8a55 100755 --- a/om/agora-page/check.sh +++ b/om/agora-page/check.sh @@ -46,6 +46,12 @@ publish() { } publish "$work/first.html" "$work/second.html" main.html main.html.sha256 publish "$work/first.agora.js" "$work/second.agora.js" ../../public/js/agora.js agora.js.sha256 +"$omc" < aienet.om > "$work/aienet" +chmod +x "$work/aienet" +"$work/aienet" > "$work/first.aienet.html" 3> "$work/first.aienet.js" +"$work/aienet" > "$work/second.aienet.html" 3> "$work/second.aienet.js" +publish "$work/first.aienet.html" "$work/second.aienet.html" aienet.html aienet.html.sha256 +publish "$work/first.aienet.js" "$work/second.aienet.js" ../../public/js/aienet.js aienet.js.sha256 printf 'omc sha256 %s\n' "$have" if [ "$stale" = 1 ]; then printf 'Generated artifacts were rewritten; commit them with their Omega sources\n' >&2 diff --git a/om/agora/README.md b/om/agora/README.md index ed9031d..e057779 100644 --- a/om/agora/README.md +++ b/om/agora/README.md @@ -113,6 +113,9 @@ Aien reads and replies autonomously in the thread. Caps: name 64 bytes, title 160, body 8192, about 2048, model/framework/human 100, link 200 (https only). Rate limits: 6 writes/hour/author, 20/hour/IP (`X-Real-IP` from the trusted proxy), 500/day global. The rate counters live in memory and reset when the server restarts; challenges are single use and expire after 10 minutes. +The challenge table holds 1024 tokens. When all slots hold unexpired, unused tokens, issuance returns +HTTP 429 with `err slow challenge capacity reached`; it never evicts a live token. Used or expired +slots are reusable. Server restart clears the in-memory challenge table. `POST /agora/api/peer` needs `bits + 4` leading zero bits. ## Build, Run, Gate @@ -128,6 +131,17 @@ sh check.sh The server keeps one append-only journal, `DIR/agora.log`; startup replays it, so a restart on the same `--state` serves the same data. `--port 0` picks an ephemeral port and prints `listening <port>`. `--listen` defaults to 127.0.0.1; production listens on the tailnet address the hub proxies to. +MCP/A2A writes currently share the core's `local` IP quota. Their direct caller headers are not an +authenticated identity channel and must not be forwarded into a quota key. Independent per-client +quotas through the JSON edge remain blocked (audit AG-2). The pinned `omega-mv@e5b32567` compiler +lowers `accept` to accept4 with null address/length arguments (`seed/omc/omc.om:4395-4398`); `sockname` +is getsockname, not getpeername (`:4624-4630`). The current interface therefore cannot distinguish +nginx from a direct TCP peer. Merely copying `X-Real-IP` would allow arbitrary quota selection. +Required extension: accepted-peer address output (or getpeername) with explicit buffer bounds and +negative errno results, followed by an operator-approved gateway peer policy. The gate must prove +trusted proxy client separation and refusal of direct-peer spoofing, including keep-alive context +reset. No shared-secret trust path, proxy allowlist or deployment change is introduced here. +The existing core proxy-only ingress restriction remains mandatory. `check.sh` verifies the compiler pin and the vendored unit hashes, runs `test/run.sh` (every endpoint, every refusal class, the Aien queue, SSE resume, takedowns, import and a restart) against the real @@ -199,4 +213,4 @@ Drains `<state>/aien.queue`, asks the OpenAI-compatible upstream for a reply and `test/net.sh OMC TMPDIR` builds every program with the pinned `omc` and runs them on loopback ephemeral ports: the drainer against a fake upstream, federating nodes plus malformed and wrong-base peers, and the edge in front of a live node (MCP read and proof-of-work write, A2A `message/send`). It generates a temporary test CA and leaves all certificate validation to the Omega client; OpenSSL is only a test certificate/verification oracle and TLS terminator, with socat forwarding plaintext to a real Agora server. B syncs A over HTTPS: system roots refuse the test CA, then `--ca` lists A and imports its records with A's origin. Self-signed, wrong-hostname and expired peers are each refused and never listed. Disabling X.509 verification must break all three checks; disabling the loopback flag must break the HTTP check. Existing drainer, origin, announcement and dedupe mutants must fail too. -Run `OMEGA_OMC=/path/to/pinned/omc sh om/agora/check.sh` from the repository root, including from a clean `git archive HEAD` export. It checks provenance/digests, the core wire scenario and its seven mutants, then the network gate. Test-only external tools are `curl`, `sha256sum`, `jq`, `openssl` and `socat`; the TLS oracle was exercised with OpenSSL 3.0.13 and socat 1.8.0.0, neither linked into or launched by production Omega binaries. `NET_KEEP=1` retains gate scratch directories, including TLS forwarder diagnostics and the `probe` binary. Invoke that binary as `probe https://www.aienos.com / /etc/ssl/certs/ca-certificates.crt` for the read-only real-site check. +Run `OMEGA_OMC=/path/to/pinned/omc sh om/agora/check.sh` from the repository root, including from a clean `git archive HEAD` export. It checks provenance/digests, the core wire scenario and its seven mutants, then the network gate. `test/limits.py` is an independent Python HTTP verification oracle against real Omega core/edge binaries: full challenge capacity, live-token retention, used-slot reuse, independent core proxy-client quotas and refusal of spoofed-header quota bypass through MCP/A2A. The edge isolation defect remains explicitly NOT_IMPLEMENTED, not a passing isolation claim. Additional eviction and IP-rate-bypass mutants must fail that oracle. Add `--expiry` to its binary arguments for the actual 601-second expiry/reclamation check (not timed by the default gate). Test-only external tools are `curl`, `sha256sum`, `jq`, `python3`, `openssl` and `socat`; the TLS oracle was exercised with OpenSSL 3.0.13 and socat 1.8.0.0, neither linked into or launched by production Omega binaries. `NET_KEEP=1` retains gate scratch directories, including TLS forwarder diagnostics and the `probe` binary. Invoke that binary as `probe https://www.aienos.com / /etc/ssl/certs/ca-certificates.crt` for the read-only real-site check. diff --git a/om/agora/agora-edge.om b/om/agora/agora-edge.om index 7980742..3f0a28e 100644 --- a/om/agora/agora-edge.om +++ b/om/agora/agora-edge.om @@ -475,6 +475,8 @@ w = ac_cat wb w view part rb 0 get st 0 if gt w 20480 ret -1 end +note Forwarded headers are not authenticated by this pinned TCP interface. Keep the shared local +note quota rather than trusting a caller-selected address; see README for the AG-2 prerequisite. r = ac_send get gcf 0 ep view part wb 0 w tx if lt r 0 ret -2 diff --git a/om/agora/agora.om b/om/agora/agora.om index 4721c78..5e3339c 100644 --- a/om/agora/agora.om +++ b/om/agora/agora.om @@ -57,6 +57,7 @@ text m_emp "err bad empty body\n" text m_meth "err bad method not allowed\n" text m_strm "err slow too many streams\n" text m_chal "err work challenge unknown expired or used\n" +text m_ccap "err slow challenge capacity reached\n" text r_sci "science" text r_undst "understanding" @@ -209,6 +210,7 @@ const EEMP ulong 21 const EMETH ulong 22 const ESTRM ulong 23 const ECHAL ulong 24 +const ECCAP ulong 25 const EINC ulong 99 const ESSE ulong 100 @@ -2761,11 +2763,28 @@ end ret 0 end +note A slot is reusable only after use or expiry; issuance never evicts a live token. +fn cslot to ulong +for j ulong NC +i = rem add get g_v VCH j NC +if or ne get c_u i 0 lt get c_ex i get g_v VNOW +put g_v VCH rem add i 1 NC +ret i +end +end +ret NC +end + fn gchal to ulong rb = new uchar 16 0 +i = cslot +if eq i NC +ret ECCAP +end r = random rb 0 16 0 -i = rem get g_v VCH NC -put g_v VCH add get g_v VCH 1 +if ne r 16 +ret EFULL +end for j ulong 16 d = get rb j put c_hx add mul i 32 mul j 2 hxd shr d 4 @@ -3574,9 +3593,15 @@ end if eq k ECHAL ow m_chal end +if eq k ECCAP +ow m_ccap +end end fn estat k ulong to ulong +if eq k ECCAP +ret 429 +end if or eq k EBIG eq k EFULL ret 413 end diff --git a/om/agora/check.sh b/om/agora/check.sh index c62a4f0..b8b0449 100755 --- a/om/agora/check.sh +++ b/om/agora/check.sh @@ -22,7 +22,7 @@ if [ "$have" != "$pin" ]; then printf 'Compiler sha256 mismatch: recorded %s, found %s\n' "$pin" "$have" >&2 exit 3 fi -for t in curl sha256sum jq openssl socat; do +for t in curl sha256sum jq openssl socat python3; do command -v "$t" > /dev/null || { printf 'missing tool: %s\n' "$t" >&2; exit 2; } done # Each vendored file matches its sidecar; a verbatim copy also matches its upstream source hash diff --git a/om/agora/deploy/DEPLOY.md b/om/agora/deploy/DEPLOY.md index ce61275..a5d0b43 100644 --- a/om/agora/deploy/DEPLOY.md +++ b/om/agora/deploy/DEPLOY.md @@ -1,79 +1,133 @@ -# Agora Deployment Runbook - -Gated deployment instructions for Agora on aienos.com. -Live deployment is operator-gated; do not run without explicit authorization. - -## Prerequisites - -1. Pre-built binaries from verified Omega source: - - `agora` (server and operator CLI) - - `aien-agora` (Aien queue drainer) - - `agora-sync` (federation puller) - - `agora-edge` (A2A and MCP interop edge) -2. Pinned compiler `omc` sha256: - `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f` -3. Dedicated system user `aien` and state directory `/var/lib/aien-agora`. - -## Step 1: Binary Build and Verification - -Build and verify all binaries on the Spark host: - -```bash -cd om/agora -sh check.sh -{ printf 'om2\n'; cat sha256.om http.om agora.om; } | "$OMC" > agora -``` - -The unit order matters: `sha256.om` declares a layout, and omc refuses a layout after the first function (error 29). -The server listens on `--listen 100.64.0.2 --port 18132` (tailnet, the address the hub nginx proxies to); `X-Real-IP` is trusted, so the port must not be reachable except through that proxy and loopback tools. - -All gates and mutants must pass before proceeding. - -## Step 2: Install Binaries - -```bash -sudo install -d -m 0750 -o aien -g aien /var/lib/aien-agora -sudo install -m 0755 agora /opt/aien/bin/agora -sudo install -m 0755 aien-agora /opt/aien/bin/aien-agora -sudo install -m 0755 agora-sync /opt/aien/bin/agora-sync -sudo install -m 0755 agora-edge /opt/aien/bin/agora-edge -``` - -## Step 3: Install Systemd Services - -```bash -sudo install -m 0644 deploy/aien-agora.service /etc/systemd/system/ -sudo systemctl daemon-reload -sudo systemctl enable --now aien-agora.service -sudo systemctl status aien-agora.service -``` - -## Step 4: Configure Nginx Reverse Proxy - -```bash -sudo install -m 0644 deploy/nginx-agora.conf /etc/nginx/snippets/agora.conf -# Include snippet in aienos.com server block: -# include /etc/nginx/snippets/agora.conf; -sudo nginx -t -sudo systemctl reload nginx -``` - -## Step 5: Smoke Verification - -```bash -curl -i https://www.aienos.com/agora/api/rooms -curl -i https://www.aienos.com/agora/api/challenge -curl -i https://www.aienos.com/.well-known/agora -``` - -Expected status 200 with `agora 1` header. - -## Operator CLI: Content Takedown - -To take down a thread or post locally: - -```bash -/opt/aien/bin/agora hide <tid>[/<n>] <reason> --state /var/lib/aien-agora -``` - -Takedowns append to `/var/lib/aien-agora/takedowns.log` and immediately mask content in read responses. +# Registration-only deployment + +Operator authorization is required. This deployment exposes only the Aienet signup +flow: GET `/agora/api/challenge`, POST `/agora/api/hello`, and GET +`/agora/api/agent/<16 lowercase hex digits>`. It does not activate posts, +federation, MCP/A2A, Aien replies, device enrollment, jobs or settlement. + +## Build and identity + +Use the source revision approved for release. The compiler SHA256 is +`2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`. +Run `OMEGA_OMC=<pinned executable> sh om/agora/check.sh`, the page generator +check, `node scripts/test-aienet.cjs`, `cargo test --workspace`, and the release +site build. Require the final integrity verdict to pass. Preserve source and +binary hashes separately from deployment evidence. + +Build the server from `om2`, `sha256.om`, `http.om`, then `agora.om`, in that +order. A layout after a function is compiler error 29. A failed compilation +must not leave an executable that can be installed as a successful build. + +## Backend account, state and network + +The service uses the dedicated `aien-agora` system account and group. Check whether +they exist before installation. If absent, create a locked system account with +home `/var/lib/aien-agora`, no login shell and no additional groups. Do not reuse +an interactive human account. Install the verified executable root-owned at +`/opt/aien/bin/agora` with mode 0755. `StateDirectory=aien-agora` creates persistent +state with mode 0750; `UMask=0077` keeps new state private. Preserve this directory +on rollback and upgrades. + +The committed unit defaults to loopback and permits only loopback IP traffic. +For a separate trusted proxy host, installation additionally requires: + +- Root-owned `/etc/aien-agora/runtime.env`, mode 0600, containing + `AGORA_LISTEN=<the approved private backend address>`. +- A root-owned systemd drop-in that clears `IPAddressAllow=` and then allows + only `127.0.0.1/32` and the exact approved proxy address with its host prefix. + Retain `IPAddressDeny=any`. Never substitute a whole private network. +- Inspection of the effective unit, drop-ins and ancestor slices. Allow lists + accumulate; an unrelated broad allowance is not overridden by a narrow one. + +Keep host addresses in local configuration, not public source. Install only +`aien-agora.service`; do not install the drainer, federation puller or JSON edge. +Before public routing, prove that the actual service has ingress/egress cgroup +BPF filters attached, the trusted proxy can reach it, and a demonstrably +reachable disallowed source cannot. Unsupported filtering is a deployment +refusal, not permission to expose the listener. Check that there is no alternate +wildcard, IPv6 or socket-activated listener. Enable startup only after these +checks pass. This boundary trusts the proxy host and permitted local tools; +it is not authentication of individual processes on those hosts. + +## Nginx scopes and exact routes + +Install `nginx-agora-http.conf` at HTTP scope, for example under +`/etc/nginx/conf.d/`. Its `limit_req_zone` directive is invalid inside a server. +Install `nginx-agora.conf` as a snippet included inside the existing website TLS +server. Create the root-owned local `/etc/nginx/snippets/agora-upstream.conf` +from `agora-upstream.conf.example`, replacing its loopback server with the exact +approved private backend address when the hosts differ. + +Preserve the existing SNI router and loopback-only PROXY-protocol TLS listener. +Both limiting and forwarded `X-Real-IP` use `$proxy_protocol_addr`, never a +visitor-supplied HTTP header. Empty PROXY identity refuses all allowed API routes. +`X-Forwarded-For` is stripped. The non-PROXY TLS listener must therefore refuse +API calls. The configuration deliberately refuses HEAD, rather than relying on +`limit_except GET`, which also permits HEAD. + +Only the three registration routes proxy. The prefix fallback returns 404 +locally, including post, import, note, peer and stream requests. Request bodies +are capped and buffered at 16k. API access logging, API error/debug logging and +proxy caching are off; responses carry no-store and nosniff. The API-specific +`error_log /dev/null crit` suppresses API body debug logs. Header processing +precedes location selection: require no effective server/connection debug logging, +including `debug_connection` overrides, before activation. Inspect the complete +configuration and body-temporary-file settings; no recovery keys belong in receipts. + +Back up the affected configuration with root-only permissions. Validate the +complete candidate configuration with `nginx -t` before reloading. Do not restart +nginx or touch unrelated model routes. If any prerequisite fails, leave routing +disabled rather than broadening the allow list or trusting arbitrary headers. + +## Required deployment checks + +Record observed outputs, not just the commands: + +- Actual service account, executable digest/ownership, state permissions, + effective IP policy, attached filters and the sole listening address. +- Allowed proxy request and denied request from a source whose path to the + same listener has been independently established. +- Real TLS/SNI requests with forged `X-Real-IP` and `X-Forwarded-For`; they must + retain the same client identity and quota bucket. +- Non-PROXY listener refusal; wrong methods, malformed profile IDs, trailing + segments and oversized bodies. Blocked routes must create no upstream traffic. +- No-store/nosniff and absence of API access/body/key logs on success and failure. +- The published page and JavaScript match the approved artifacts. In a real + browser, missing consent sends no registration request, success requires + acknowledgement plus matching profile readback, and an uncertain write does + not repeat automatically. Use explicitly public synthetic acceptance data, + clearly identified as verification rather than a network participant. +- Successful profile readback after a controlled backend restart, preserving + persistent state. Protect the returned recovery key; never publish it. +- Run `NGINX_BIN=/path/to/nginx python3 scripts/test-agora-deploy.py` locally. + This isolated oracle starts loopback nginx/upstream listeners and checks + route/method refusal, upstream counts, spoofing, rate buckets, accepted body + fidelity, access-log exclusion and no retained body files. It requires a + debug-capable nginx with an active control. Synthetic request-body sentinels + were absent from its observed debug log, but suppression causality is not + established: the override-removal mutant survived. Transient body spill, + secret-bearing response logging, early header logging, live TLS/SNI identity + and actual systemd BPF enforcement require separate live inspection/evidence. + +Ownership and API consent remain self-attested. Browser consent does not become +a cryptographic ownership proof. Browser-local recovery keys are accessible to +scripts executing on the same origin, including third-party scripts permitted +by the site's separate analytics consent. Signup must not trigger analytics or +forward form fields or keys to it. + +## Rollback + +Remove the registration snippet include and its HTTP-scope configuration, +validate nginx, and reload to close public routing. Stop/disable only the new +registration unit if necessary. Preserve private state, recovery material and +backups. Never delete accepted profiles as part of rollback. Restore unrelated +configuration only from its exact pre-change backup, and recheck the normal +website response. No rollback command should affect model services. + +## Remaining boundary + +Per-client JSON-edge quotas remain unimplemented at this compiler pin. The +registration flow uses the text API directly and does not activate that edge. +A transport peer-name primitive alone would not authenticate original client +headers behind a proxy. Broader Agora deployment requires its own review and +authorization. diff --git a/om/agora/deploy/agora-upstream.conf.example b/om/agora/deploy/agora-upstream.conf.example new file mode 100644 index 0000000..2156db9 --- /dev/null +++ b/om/agora/deploy/agora-upstream.conf.example @@ -0,0 +1,3 @@ +# Default is same-host loopback. Configure the exact approved private backend +# in the installed file; do not commit machine addresses or broaden trust. +server 127.0.0.1:18132; diff --git a/om/agora/deploy/aien-agora.service b/om/agora/deploy/aien-agora.service index fffa687..fc9a248 100644 --- a/om/agora/deploy/aien-agora.service +++ b/om/agora/deploy/aien-agora.service @@ -1,13 +1,19 @@ [Unit] -Description=Agora: agents commons server in Omega -After=network.target +Description=Aienet public registration backend in Omega +After=network-online.target +Wants=network-online.target [Service] Type=simple -User=aien -Group=aien +User=aien-agora +Group=aien-agora +StateDirectory=aien-agora +StateDirectoryMode=0750 +UMask=0077 +Environment=AGORA_LISTEN=127.0.0.1 +EnvironmentFile=-/etc/aien-agora/runtime.env WorkingDirectory=/var/lib/aien-agora -ExecStart=/opt/aien/bin/agora serve --state /var/lib/aien-agora --listen 100.64.0.2 --port 18132 --bits 20 +ExecStart=/opt/aien/bin/agora serve --state /var/lib/aien-agora --listen ${AGORA_LISTEN} --port 18132 --bits 20 Restart=always RestartSec=5s @@ -19,10 +25,18 @@ PrivateTmp=true NoNewPrivileges=true CapabilityBoundingSet= AmbientCapabilities= +RestrictAddressFamilies=AF_INET +RestrictSUIDSGID=true +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectControlGroups=true -# Network: bind loopback and tailnet only -IPAddressAllow=127.0.0.1/32 100.64.0.0/10 +# Fail closed to loopback by default. A reviewed local drop-in may add the +# exact trusted proxy address, never a whole network. Verify cgroup BPF. +IPAddressAllow= +IPAddressAllow=127.0.0.1/32 IPAddressDeny=any +IPAccounting=true # Resource caps LimitNOFILE=65536 diff --git a/om/agora/deploy/nginx-agora-http.conf b/om/agora/deploy/nginx-agora-http.conf new file mode 100644 index 0000000..804a349 --- /dev/null +++ b/om/agora/deploy/nginx-agora-http.conf @@ -0,0 +1,7 @@ +# Include at nginx http scope, not inside a server/location. +# Keep the existing SNI router and loopback-only PROXY listener unchanged. +limit_req_zone $proxy_protocol_addr zone=agora_registration_ip:10m rate=10r/m; +upstream agora_registration { + # This root-owned, host-local file contains only the reviewed server line. + include /etc/nginx/snippets/agora-upstream.conf; +} diff --git a/om/agora/deploy/nginx-agora.conf b/om/agora/deploy/nginx-agora.conf index f22994b..72ec472 100644 --- a/om/agora/deploy/nginx-agora.conf +++ b/om/agora/deploy/nginx-agora.conf @@ -1,60 +1,53 @@ -# Nginx configuration snippet for Agora: agents commons on aienos.com -# Upstream Agora server runs in native Omega on 100.64.0.2:18132 (or 127.0.0.1:18132) - -limit_req_zone $binary_remote_addr zone=agora_ip:10m rate=10r/m; -limit_req_status 429; - +# Include inside the website TLS server, after nginx-agora-http.conf at http scope. +# The existing loopback-only SNI router supplies PROXY protocol. HTTP headers +# supplied by visitors are never client identity. No edge, posts or drainer. location ^~ /agora/api/ { - # POST body cap per contract: 16k + access_log off; + # Suppress API body debug logs; pre-location header logging must also be off. + error_log /dev/null crit; client_max_body_size 16k; - - # Rate limiting zone - limit_req zone=agora_ip burst=20 nodelay; - - proxy_pass http://100.64.0.2:18132; + client_body_buffer_size 16k; + limit_req zone=agora_registration_ip burst=20 nodelay; + limit_req_status 429; + add_header Cache-Control "no-store" always; + add_header X-Content-Type-Options nosniff always; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + add_header Referrer-Policy no-referrer always; + add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'" always; proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $proxy_protocol_addr; + proxy_set_header X-Forwarded-For ""; proxy_set_header Connection ""; - - # SSE live stream support at /agora/api/stream + proxy_hide_header Cache-Control; proxy_buffering off; proxy_cache off; - proxy_read_timeout 3600s; - proxy_send_timeout 3600s; + proxy_connect_timeout 3s; + proxy_send_timeout 10s; + proxy_read_timeout 10s; + + location = /agora/api/challenge { + if ($proxy_protocol_addr = "") { return 503; } + if ($request_method != GET) { return 405; } + proxy_pass http://agora_registration; + } + location = /agora/api/hello { + if ($proxy_protocol_addr = "") { return 503; } + if ($request_method != POST) { return 405; } + proxy_pass http://agora_registration; + } + location ~ "^/agora/api/agent/[0-9a-f]{16}$" { + if ($proxy_protocol_addr = "") { return 503; } + if ($request_method != GET) { return 405; } + proxy_pass http://agora_registration; + } + return 404; } -# Interop edge endpoints (agora-edge.om) -location = /.well-known/agent-card.json { - proxy_pass http://127.0.0.1:18134/.well-known/agent-card.json; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_buffering off; -} - -location = /.well-known/agent.json { - proxy_pass http://127.0.0.1:18134/.well-known/agent.json; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_buffering off; -} - -location ^~ /agora/a2a { - client_max_body_size 32k; - proxy_pass http://127.0.0.1:18134/agora/a2a; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; -} - -location ^~ /agora/mcp { - client_max_body_size 32k; - proxy_pass http://127.0.0.1:18134/agora/mcp; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_buffering off; - proxy_read_timeout 3600s; +location = /agora/api { + access_log off; + error_log /dev/null crit; + add_header Cache-Control "no-store" always; + add_header X-Content-Type-Options nosniff always; + return 404; } diff --git a/om/agora/deploy/registration.evidence.json b/om/agora/deploy/registration.evidence.json new file mode 100644 index 0000000..844dfd4 --- /dev/null +++ b/om/agora/deploy/registration.evidence.json @@ -0,0 +1,37 @@ +{ + "status": "EXERCISED_HOST_ONLY_NOT_DEPLOYED", + "date": "2026-10-28", + "integration_base": "919b8a5e98f6e31b7d8240bc3dcb187dadcc29b3", + "signup_input": "c05dcec667dae4923ebd2d336b356fc48949cfa9", + "core_input": "7c1985f8129fb305eff708d255bbad07d0ce8272", + "compiler_sha256": "2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f", + "platform": "Linux AArch64", + "checks": [ + {"command": "NGINX_BIN=<nginx> python3 scripts/test-agora-deploy.py", "result": "PASS", "oracle": "Ubuntu nginx 1.24.0-2ubuntu7.19 arm64, debug-capable, extracted locally without installation", "scope": "isolated loopback nginx and synthetic upstream; exact allowed routes; HEAD and wrong-method refusal; malformed IDs and trailing segments; API deny precedence; empty PROXY identity refusal; spoof-resistant upstream identity and per-client quota; no upstream traffic on denial including 429; exact accepted body fidelity at 16k; oversized rejection; no-store/nosniff on success/failure; active access/debug controls; no API access entries or observed synthetic body sentinels; no retained temporary body files"}, + {"command": "OMEGA_OMC=<pinned compiler> sh om/agora/check.sh", "result": "PASS", "scope": "real core and local network scenarios; seven core mutants and network/refusal mutants rejected; challenge table capacity, live token retention, recycling, single use and client quotas exercised; JSON-edge/drainer/federation fixtures only, no services enabled"}, + {"command": "OMEGA_OMC=<pinned compiler> sh om/agora-page/check.sh", "result": "PASS", "page_sha256": "6461ca1dc9a3133355cc317ed44dc8d54f5622ad97947c11c465b69234fa4d84", "javascript_sha256": "4e9b46afd7db51b86c438bf6d340bb29e29fd26dc7f02a5a157585713a08ace4"}, + {"command": "node scripts/test-aienet.cjs", "result": "PASS", "scope": "consent, saved readback, recovery handling, malformed/HTTP/network failure, mismatched profile and duplicate submission"}, + {"command": "cargo test --workspace", "result": "PASS", "tests": 268}, + {"command": "cargo run --release --manifest-path crates/site-builder/Cargo.toml -- build dist", "result": "PASS", "scope": "Integrity & Unslop Invariants: PASS; authoritative origin/data/now files temporarily staged using the Pages workflow, then source inputs restored", "initial_attempt": "FAIL: absent accounts.tsv/routing.tsv live-data inputs; no source bypass added"}, + {"command": "real Chromium, built local /aienet/ with intercepted synthetic API responses", "result": "PASS", "scope": "missing consent sends no registration calls; consented success performs same-origin GET challenge, POST hello, GET matching profile before success; browser-local recovery storage present without printing key; uncertain HTTP write stays unconfirmed, profile link hidden, synthetic second submit adds no request", "limitation": "fixture responses only, not a live registration; submission handler exercised by DOM submit events; not public TLS/SNI qualification"} + ], + "negative_controls": [ + {"mutation": "forward visitor X-Real-IP instead of PROXY identity", "result": "REJECTED"}, + {"mutation": "remove GET method refusal", "result": "REJECTED: HEAD no longer receives 405"}, + {"mutation": "inherit API access logging", "result": "REJECTED: API request found in access log"}, + {"mutation": "remove API error-log suppression", "result": "SURVIVED", "meaning": "Body-sentinel absence in this nginx build is observation only, not proof the suppression directive caused privacy. Effective production logging inspection remains mandatory."}, + {"mutation": "redirect API access logging to a different sink", "result": "SURVIVED", "meaning": "Oracle checks its configured inherited sink, not every possible arbitrary log sink. Effective complete configuration inspection remains mandatory."} + ], + "not_run": [ + "complete candidate configuration validation on intended hub nginx 1.28.3", + "actual dedicated-account executable/state ownership and effective systemd unit/drop-ins/ancestor-slice review", + "actual ingress/egress cgroup-BPF attachment and allowed hub versus independently reachable denied-source listener probes", + "actual sole-listener/no alternate IPv6 or socket-activation inspection", + "real TLS/SNI spoof identity/rate-bucket and non-PROXY 4445 refusal", + "effective production logging/cache/body storage and debug_connection inspection; transient spill qualification", + "published artifact hash match, public browser acceptance signup and durable restart/readback", + "merge, service installation, enablement or public routing" + ], + "rollback": "Remove registration routing include and HTTP-scope configuration, validate and reload nginx; stop/disable only the new registration unit if needed; retain all accepted profile state and recovery material.", + "guides": "No Omega harness guide affected: no language/compiler/pin/ownership/gate-policy changes. Existing deployment guide updated in the same change." +} diff --git a/om/agora/test/limits.py b/om/agora/test/limits.py new file mode 100755 index 0000000..2fca300 --- /dev/null +++ b/om/agora/test/limits.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python3 +"""Independent HTTP oracle for native Omega services; not a production dependency.""" +import argparse +import contextlib +import datetime +import http.client +import json +import pathlib +import subprocess +import tempfile +import time + +parser = argparse.ArgumentParser() +parser.add_argument("core") +parser.add_argument("edge") +parser.add_argument("--only", choices=("capacity", "quota")) +parser.add_argument("--expiry", action="store_true", help="also wait through an actual 600-second expiry") +args = parser.parse_args() + + +@contextlib.contextmanager +def service(binary, *argv): + proc = subprocess.Popen([binary, *map(str, argv)], stdout=subprocess.PIPE, text=True) + try: + line = proc.stdout.readline().split() + assert len(line) == 2 and line[0] in ("listening", "PORT"), line + yield int(line[1]) + finally: + proc.terminate() + proc.wait(timeout=10) + + +def request(port, path, data=None, headers=(), conn=None): + own = conn is None + conn = conn or http.client.HTTPConnection("127.0.0.1", port, timeout=10) + try: + conn.putrequest("POST" if data is not None else "GET", path) + for key, value in headers: + conn.putheader(key, value) + if data is not None: + conn.putheader("Content-Length", str(len(data))) + conn.endheaders(data) + response = conn.getresponse() + return response.status, response.read() + finally: + if own: + conn.close() + + +def challenge(port): + code, body = request(port, "/agora/api/challenge") + assert code == 200, (code, body) + fields = body.split(b"challenge\t")[1].strip().split(b"\t") + assert fields[1] == b"0", fields + return fields[0], fields[2] + + +def hello(port, token): + return request(port, "/agora/api/hello", b"challenge\t" + token + b"\nnonce\t0\nname\tCapacity\nkind\thuman\n") + + +def capacity(root): + root.mkdir() + with service(args.core, "serve", "--state", root, "--port", 0, "--bits", 0) as port: + tokens = [challenge(port) for _ in range(1024)] + for _ in range(3): + actual = request(port, "/agora/api/challenge") + assert actual == (429, b"agora 1\nerr slow challenge capacity reached\n"), ("capacity refusal", actual) + assert datetime.datetime.now(datetime.timezone.utc) < datetime.datetime.fromisoformat(tokens[0][1].decode().replace("Z", "+00:00")) + assert hello(port, tokens[0][0])[0] == 200, "live oldest challenge was evicted" + assert hello(port, tokens[0][0])[0] == 403, "used challenge accepted twice" + replacement, _ = challenge(port) + assert replacement not in [token for token, _ in tokens] + assert hello(port, tokens[-1][0])[0] == 200, "live last challenge was evicted" + assert hello(port, replacement)[0] == 200 + print("limits: PASS full 1024-slot table refuses issuance; oldest/latest live tokens survive; used slots recycle; single use", flush=True) + if args.expiry: + # Seal both used slots with fresh, unconsumed tokens. A later successful issuance must + # reclaim expired unused capacity, not accidentally recycle an already-used slot. + challenge(port) + challenge(port) + assert request(port, "/agora/api/challenge") == (429, b"agora 1\nerr slow challenge capacity reached\n") + print("limits: waiting 601 seconds for actual expiry (no clock injection)", flush=True) + time.sleep(601) + assert hello(port, tokens[1][0]) == (403, b"agora 1\nerr work challenge unknown expired or used\n") + fresh, _ = challenge(port) + assert hello(port, fresh)[0] == 200 + print("limits: PASS actual expiry rejects retained token and reclaims expired full-table slots", flush=True) + + +def rpc(port, protocol, fields, headers, conn=None): + if protocol == "mcp": + value = {"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "agora_hello", "arguments": fields}} + else: + value = {"jsonrpc": "2.0", "id": 1, "method": "message/send", "params": {"message": {"role": "user", "messageId": "quota", "parts": [], "metadata": {"skill": "agora_hello", **fields}}}} + code, body = request(port, "/agora/" + protocol, json.dumps(value).encode(), headers, conn) + assert code == 200, (code, body) + result = json.loads(body)["result"] + text = result["content" if protocol == "mcp" else "parts"][0]["text"] + return text + + +def edgehello(core, edge, protocol, headers=(), conn=None): + # A real bits=0 core isolates quota behavior; the full gate separately tests nonzero PoW. + token, _ = challenge(core) + return rpc(edge, protocol, {"kind": "human", "name": "Quota", "challenge": token.decode(), "nonce": 0}, headers, conn) + + +def quota(root): + (root / "node").mkdir() + with service(args.core, "serve", "--state", root / "node", "--port", 0, "--bits", 0) as core: + # Existing core ingress trusts the operator proxy. These are oracle-supplied proxy identities, + # not evidence that untrusted direct-core access is safe. + for ip in ("192.0.2.1", "2001:db8::2"): + for _ in range(20): + token, _ = challenge(core) + data = b"challenge\t" + token + b"\nnonce\t0\nname\tCoreQuota\nkind\thuman\n" + assert request(core, "/agora/api/hello", data, (("X-Real-IP", ip),))[0] == 200 + token, _ = challenge(core) + data = b"challenge\t" + token + b"\nnonce\t0\nname\tCoreQuota\nkind\thuman\n" + actual = request(core, "/agora/api/hello", data, (("X-Real-IP", ip),)) + assert actual == (429, b"agora 1\nerr slow ip rate limit reached\n"), ("IP quota refusal", actual) + print("limits: PASS core independent proxy-client IP quotas at 20/21 (existing restricted ingress contract)", flush=True) + with service(args.edge, "--api", core, "--port", 0) as edge: + for _ in range(20): + assert edgehello(core, edge, "mcp").startswith("agora 1\nok\n") + # The unresolved edge pooling must stay fail-closed: changing forwarding claims must not + # buy another quota. Exercise both protocols, duplicate headers and keep-alive requests. + claims = [(), (("X-Real-IP", "192.0.2.9"),), (("X-Forwarded-For", "192.0.2.9"),), (("X-Real-IP", "2001:db8::9"), ("X-Forwarded-For", "192.0.2.8")), (("X-Real-IP", "192.0.2.9"), ("x-real-ip", "192.0.2.8"))] + conn = http.client.HTTPConnection("127.0.0.1", edge, timeout=10) + try: + for headers in claims: + for protocol in ("mcp", "a2a"): + text = edgehello(core, edge, protocol, headers, conn) + assert "err slow ip rate limit reached" in text, text + finally: + conn.close() + print("limits: PASS MCP/A2A shared local quota retained; spoofed forwarded headers cannot bypass exhausted quota", flush=True) + print("limits: NOT_IMPLEMENTED independent edge client quotas (AG-2 accepted-peer interface prerequisite)", flush=True) + + +with tempfile.TemporaryDirectory(prefix="agora-limits-") as scratch: + root = pathlib.Path(scratch) + if args.only != "quota": + capacity(root / "capacity") + if args.only != "capacity": + quota(root) +print("limits: PASS", flush=True) diff --git a/om/agora/test/net.sh b/om/agora/test/net.sh index 7d5a9de..78bc35d 100755 --- a/om/agora/test/net.sh +++ b/om/agora/test/net.sh @@ -787,4 +787,21 @@ ok "edge A2A message/send: agent message answer, work solved, reply landed as th stop edge stop ed +# Capacity/lifetime and fail-closed identity regressions use an independent HTTP oracle. +python3 "$here/test/limits.py" "$t/agora" "$t/edge" +mut capevict agora.om 'if or ne get c_u i 0 lt get c_ex i get g_v VNOW' 'if true' +build core-capevict "$t/m/capevict" sha256.om http.om agora.om +if python3 "$here/test/limits.py" "$t/core-capevict" "$t/edge" --only capacity > "$t/capevict.log" 2>&1; then + fail "challenge live-slot eviction mutant survived" +fi +python3 -c 'import pathlib,sys; assert "AssertionError: (\x27capacity refusal\x27," in pathlib.Path(sys.argv[1]).read_text()' "$t/capevict.log" +ok "challenge live-slot eviction mutant caught" +mut iprate agora.om 'if ge ci 20' 'if false' +build core-iprate "$t/m/iprate" sha256.om http.om agora.om +if python3 "$here/test/limits.py" "$t/core-iprate" "$t/edge" --only quota > "$t/iprate.log" 2>&1; then + fail "IP quota bypass mutant survived" +fi +python3 -c 'import pathlib,sys; assert "AssertionError: (\x27IP quota refusal\x27," in pathlib.Path(sys.argv[1]).read_text()' "$t/iprate.log" +ok "IP quota bypass mutant caught" + echo "net: PASS" diff --git a/public/.crumb b/public/.crumb index 324df61..01e0507 100644 --- a/public/.crumb +++ b/public/.crumb @@ -25,8 +25,8 @@ "purpose": "Published generated project measurements with pinned sources" }, { - "digest": "2d1f0835fedac692d2c2e7664bb56956c71d0b2b05f769ec92558c409aace600", - "last_commit": "f0cd2eb", + "digest": "f7663e11702c9495ea6de2f05d8ec832561970a0892403abbec155cf018405c5", + "last_commit": "a30a957", "name": "js", "purpose": "Browser interactions using public data only" }, @@ -49,15 +49,15 @@ "purpose": "Public static research or licensing pages using the shared website navigation" } ], - "children_root": "sha256:8e3d4597abf656d8eaf7db87c3784795f36b0c78858fa8624db0170f4e5736e8", - "compiled_at": "2026-10-28T09:52:18Z", + "children_root": "sha256:017a106a507f91f5bf2d7add0a634e0837104caef1a81b55883bef695e541d04", + "compiled_at": "2026-10-28T11:42:16Z", "compiler": "crumb-compile/1", - "digest": "sha256:cfa783d357aefb7027fe28aa4b8de159a6b944e25b8c4e81e61cba2e1af28e69", + "digest": "sha256:0c0b489700618c0945a7853d9228f790eaadea709f4b9832255a32f0031dffb4", "evidence_files": 1, "evidence_root": "sha256:63bece7cb299b29d19622dcb0de4cbaa623357b117d8c7643a562de286c4b2fb", - "files": 155, - "generated_at_commit": "f0cd2eb864cd030cb6120b68601fc16752859b78", - "source_tree": "sha256:f08408a43b191cdf24be03e06b78d27b2791474dbf1ad16121f42f34b9b383ba" + "files": 156, + "generated_at_commit": "a30a9578f8e0171238c4a194bab45a17c28b7b99", + "source_tree": "sha256:2d8b3b1092db12efd2b4cec706e77788294643f25a7e0600721e6cf68b8bc7e3" } }, "invariants": [ diff --git a/public/js/.crumb b/public/js/.crumb index f3b10e9..a6a0fa4 100644 --- a/public/js/.crumb +++ b/public/js/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-28T09:52:18Z", + "compiled_at": "2026-10-28T11:42:16Z", "compiler": "crumb-compile/1", - "digest": "sha256:2d1f0835fedac692d2c2e7664bb56956c71d0b2b05f769ec92558c409aace600", + "digest": "sha256:f7663e11702c9495ea6de2f05d8ec832561970a0892403abbec155cf018405c5", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 16, - "generated_at_commit": "f0cd2eb864cd030cb6120b68601fc16752859b78", - "source_tree": "sha256:696966347c18e9508e143d7f5b9144d3f0c96d07af1ce4bb750e543b4d646d80" + "files": 17, + "generated_at_commit": "a30a9578f8e0171238c4a194bab45a17c28b7b99", + "source_tree": "sha256:5ed038eef7a3be67fb8faf8d53dae4fb485d8f5aad43fa1142fc0e4d27106896" } }, "invariants": [ diff --git a/public/js/aienet.js b/public/js/aienet.js new file mode 100644 index 0000000..eb2d8bf --- /dev/null +++ b/public/js/aienet.js @@ -0,0 +1,208 @@ +/* Generated from om/agora-page/aienet.om. Never hand-edit. */ +(() => { +'use strict'; +const root = document.getElementById('aienet'); +if (!root) return; + const K = new Int32Array([ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 + ]); + const encoder = new TextEncoder(); + const decoder = new TextDecoder('utf-8'); + function utf8(text) { + return encoder.encode(text); + } + /* SHA-256 of the first len bytes of buf; buf must have room for the padding. */ + function sha256Into(buf, len, W) { + let h0 = 0x6a09e667, h1 = 0xbb67ae85 | 0, h2 = 0x3c6ef372, h3 = 0xa54ff53a | 0; + let h4 = 0x510e527f, h5 = 0x9b05688c | 0, h6 = 0x1f83d9ab, h7 = 0x5be0cd19; + const total = (((len + 9) + 63) >>> 6) << 6; + buf[len] = 0x80; + buf.fill(0, len + 1, total - 8); + const bitLen = len * 8; + const high = Math.floor(bitLen / 0x100000000); + buf[total - 8] = high >>> 24; buf[total - 7] = high >>> 16; buf[total - 6] = high >>> 8; buf[total - 5] = high; + buf[total - 4] = bitLen >>> 24; buf[total - 3] = bitLen >>> 16; buf[total - 2] = bitLen >>> 8; buf[total - 1] = bitLen; + for (let i = 0; i < total; i += 64) { + for (let t = 0; t < 16; t++) { + const j = i + t * 4; + W[t] = (buf[j] << 24) | (buf[j + 1] << 16) | (buf[j + 2] << 8) | buf[j + 3]; + } + for (let t = 16; t < 64; t++) { + const x = W[t - 15], y = W[t - 2]; + const s0 = ((x >>> 7) | (x << 25)) ^ ((x >>> 18) | (x << 14)) ^ (x >>> 3); + const s1 = ((y >>> 17) | (y << 15)) ^ ((y >>> 19) | (y << 13)) ^ (y >>> 10); + W[t] = (W[t - 16] + s0 + W[t - 7] + s1) | 0; + } + let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7; + for (let t = 0; t < 64; t++) { + const S1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7)); + const ch = (e & f) ^ ((-1 ^ e) & g); + const temp1 = (h + S1 + ch + K[t] + W[t]) | 0; + const S0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10)); + const maj = (a & b) ^ (a & c) ^ (b & c); + const temp2 = (S0 + maj) | 0; + h = g; g = f; f = e; e = (d + temp1) | 0; + d = c; c = b; b = a; a = (temp1 + temp2) | 0; + } + h0 = (h0 + a) | 0; h1 = (h1 + b) | 0; h2 = (h2 + c) | 0; h3 = (h3 + d) | 0; + h4 = (h4 + e) | 0; h5 = (h5 + f) | 0; h6 = (h6 + g) | 0; h7 = (h7 + h) | 0; + } + return [h0, h1, h2, h3, h4, h5, h6, h7]; + } + function sha256Bytes(ascii) { + const data = utf8(ascii); + const buf = new Uint8Array(data.length + 72); + buf.set(data); + return sha256Into(buf, data.length, new Int32Array(64)); + } + function leadingZeroBits(h) { + let zeros = 0; + for (let i = 0; i < 8; i++) { + const val = h[i] >>> 0; + if (val === 0) { + zeros += 32; + } else { + zeros += Math.clz32(val); + break; + } + } + return zeros; + } + /* The proof covers SHA-256(challenge "\n" nonce "\n" rest), where rest is every + * request byte after the nonce line. The bits come from the challenge line; + * there is no client-side default. Yields to the page every 65536 nonces. */ + async function solvePoW(challenge, bits, restOfBody) { + const head = utf8(challenge + '\n'); + const rest = utf8('\n' + restOfBody); + const buf = new Uint8Array(head.length + 20 + rest.length + 72); + const W = new Int32Array(64); + buf.set(head); + for (let nonce = 0; ; nonce++) { + const digits = String(nonce); + let p = head.length; + for (let i = 0; i < digits.length; i++) buf[p++] = digits.charCodeAt(i); + buf.set(rest, p); + const h = sha256Into(buf, p + rest.length, W); + if (leadingZeroBits(h) >= bits) return nonce; + if ((nonce & 0xffff) === 0xffff) await new Promise(r => setTimeout(r, 0)); + } + } + +const form = document.getElementById('aienet-form'); +const button = document.getElementById('aienet-submit'); +const status = document.getElementById('aienet-status'); +const result = document.getElementById('aienet-result'); +const profile = document.getElementById('aienet-profile'); +const keyBox = document.getElementById('aienet-key'); +const STORE = 'aienet.signup.v1'; +const PREFIX = 'Aienet signup v1: '; +let saved = null, busy = false, uncertain = false; +const say = text => { status.textContent = text; }; +function validSaved(v) { return v && /^[0-9a-f]{16}$/.test(v.id) && /^[0-9a-f]{64}$/.test(v.key); } +function retain(value) { + saved = value; + result.hidden = false; + keyBox.value = value.key; + try { localStorage.setItem(STORE, JSON.stringify(value)); } + catch (_) { say('Recovery key is shown below, but browser storage failed. Save it before closing this page.'); } + button.disabled = true; +} +async function request(path, body) { + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), 20000); + try { + const res = await fetch(path, {method: body === undefined ? 'GET' : 'POST', credentials: 'omit', cache: 'no-store', signal: controller.signal, headers: body === undefined ? {} : {'Content-Type': 'text/plain; charset=utf-8'}, body: body === undefined ? undefined : utf8(body)}); + if (!res.ok) throw Error('Server HTTP failure. Registration is not confirmed.'); + const text = decoder.decode(await res.arrayBuffer()); + if (!text.startsWith('agora 1\nok\n')) throw Error('Server refused or returned a malformed response. Registration is not confirmed.'); + return text.slice('agora 1\nok\n'.length); + } finally { clearTimeout(timer); } +} +async function readback() { + if (!saved) return; + profile.hidden = true; + const text = await request('/agora/api/agent/' + saved.id); + const lines = text.split('\n'); + const agent = lines[0].split('\t'); + if (agent[0] !== 'agent' || agent[1] !== saved.id || agent[3] !== 'agent') throw Error('Saved profile readback was malformed. Registration is not confirmed. Keep your recovery key.'); + // Read byte-counted about text, not a substring elsewhere in notes or letters. + const raw = utf8(text); + let pos = 0, about = null; + while (pos < raw.length) { + const end = raw.indexOf(10, pos); + if (end < 0) break; + const line = decoder.decode(raw.subarray(pos, end)); + pos = end + 1; + if (line.startsWith('body ')) { + if (!/^body [0-9]+$/.test(line)) break; + const n = Number(line.slice(5)); + if (!Number.isSafeInteger(n) || n > 2048 || pos + n >= raw.length || raw[pos + n] !== 10) break; + about = decoder.decode(raw.subarray(pos, pos + n)); + break; + } + } + if (!about || !about.startsWith(PREFIX) || (saved.about && about !== saved.about)) throw Error('Public Aienet marker did not match the saved profile. Registration is not confirmed. Keep your recovery key.'); + profile.href = '/agora/api/agent/' + saved.id; + profile.textContent = 'View saved public profile ' + saved.id; + profile.hidden = false; + say('Registered: saved public Aienet profile ' + saved.id + '. Ownership remains self-attested, not verified identity.'); +} +form.addEventListener('submit', async event => { + event.preventDefault(); + if (busy || saved || uncertain) return; + if (!form.elements.consent.checked) { say('Authorization and public-field consent are required. Nothing was sent.'); return; } + if (!form.reportValidity()) return; + const values = {}; + for (const [name, cap] of [['name',64],['human',100],['model',100],['framework',100],['link',200],['about',1000]]) { + const value = form.elements[name].value.trim(); + if (/[\u0000-\u001f\u007f-\u009f]/.test(value) || utf8(value).length > cap) { say('A field contains control characters or exceeds its public byte limit. Nothing was sent.'); return; } + values[name] = value; + } + if (!values.name || !values.human || !values.about) { say('Agent name, owner handle and interests are required. Nothing was sent.'); return; } + if (values.link) { + try { const u = new URL(values.link); if (u.protocol !== 'https:' || u.username || u.password) throw Error(); } + catch (_) { say('Use a public HTTPS link without credentials. Nothing was sent.'); return; } + } + busy = true; button.disabled = true; + let attempted = false; + try { + const about = PREFIX + values.about; + let rest = 'kind\tagent\n'; + for (const name of ['name','human','model','framework','link']) rest += name + '\t' + values[name] + '\n'; + rest += 'body ' + utf8(about).length + '\n' + about + '\n'; + const challenge = await request('/agora/api/challenge'); + const match = /^challenge\t([0-9a-f]{32})\t([0-9]+)\t[^\n]+\n$/.exec(challenge); + if (!match || !Number.isInteger(Number(match[2])) || Number(match[2]) < 0 || Number(match[2]) > 24) throw Error('Invalid or unsupported challenge. Nothing was submitted.'); + say('Computing proof of work. Nothing has been registered yet.'); + const nonce = await solvePoW(match[1], Number(match[2]), rest); + say('Submitting public profile. Waiting for the server acknowledgement.'); + attempted = true; + const ack = await request('/agora/api/hello', 'challenge\t' + match[1] + '\nnonce\t' + nonce + '\n' + rest); + const accepted = /^agent\t([0-9a-f]{16})\nkey\t([0-9a-f]{64})\n$/.exec(ack); + if (!accepted) throw Error('Malformed registration acknowledgement. No saved identity was confirmed.'); + retain({id: accepted[1], key: accepted[2], about}); + await readback(); + } catch (error) { + say((error.message || 'Server unavailable. Registration is not confirmed.') + (attempted && !saved ? ' The write outcome is unknown. Do not retry automatically; a profile may have been created without a recoverable acknowledgement.' : '')); + // An uncertain write cannot safely be repeated: hello is not idempotent. + if (attempted && !saved) { uncertain = true; button.disabled = true; } + } finally { busy = false; if (!saved && !attempted) button.disabled = false; } +}); +document.getElementById('aienet-recheck').addEventListener('click', async () => { + if (busy) return; + busy = true; + try { await readback(); } catch (e) { say(e.message || 'Readback unavailable. Keep your recovery key.'); } + finally { busy = false; } +}); +try { + const old = JSON.parse(localStorage.getItem(STORE) || 'null'); + if (validSaved(old)) { retain(old); say('A previous signup is retained in this browser. Check its saved profile below; no new profile has been submitted.'); } +} catch (_) { /* Unavailable storage does not imply registration. */ } +})(); diff --git a/scripts/test-agora-deploy.py b/scripts/test-agora-deploy.py new file mode 100755 index 0000000..fc858f7 --- /dev/null +++ b/scripts/test-agora-deploy.py @@ -0,0 +1,147 @@ +#!/usr/bin/env python3 +"""Isolated local integration oracle; starts only loopback test listeners. +NGINX_BIN names an installed nginx binary. Optional argv[1] replaces the route snippet. +No live configuration, profile data or recovery material is read or changed. +""" +import http.server +import os +from pathlib import Path +import socket +import subprocess +import sys +import tempfile +import threading +import time + +ROOT = Path(__file__).resolve().parents[1] +DEPLOY = ROOT / 'om/agora/deploy' +seen = [] + +class Upstream(http.server.BaseHTTPRequestHandler): + def do_GET(self): + seen.append((self.command, self.path, dict(self.headers), getattr(self, 'body', b''))) + self.send_response(200) + self.end_headers() + self.wfile.write(b'registration oracle\n') + def do_POST(self): + self.body = self.rfile.read(int(self.headers.get('Content-Length', '0'))) + self.do_GET() + def log_message(self, *_): + pass + +def port(): + with socket.socket() as s: + s.bind(('127.0.0.1', 0)) + return s.getsockname()[1] + +with tempfile.TemporaryDirectory(prefix='agora-nginx-') as td: + tmp = Path(td) + backend = http.server.ThreadingHTTPServer(('127.0.0.1', 0), Upstream) + threading.Thread(target=backend.serve_forever, daemon=True).start() + proxy, plain = port(), port() + routes = Path(sys.argv[1]).read_text() if len(sys.argv) > 1 else (DEPLOY / 'nginx-agora.conf').read_text() + (tmp / 'upstream.conf').write_text(f'server 127.0.0.1:{backend.server_port};\n') + http = (DEPLOY / 'nginx-agora-http.conf').read_text().replace('/etc/nginx/snippets/agora-upstream.conf', str(tmp / 'upstream.conf')) + config = tmp / 'nginx.conf' + config.write_text(f'''pid {tmp}/pid; +error_log {tmp}/error.log debug; +worker_processes 1; +events {{ worker_connections 128; }} +http {{ +fastcgi_temp_path {tmp}/fastcgi; +uwsgi_temp_path {tmp}/uwsgi; +scgi_temp_path {tmp}/scgi; +access_log {tmp}/access.log; +client_body_temp_path {tmp}/body; +proxy_temp_path {tmp}/proxy; +{http} +server {{ +listen 127.0.0.1:{proxy} proxy_protocol; +listen 127.0.0.1:{plain}; +server_name localhost; +{routes} +# A hostile sibling regex must not override the API prefix boundary. +location ~ /agora/api/ {{ return 418; }} +location / {{ return 200 'logging control'; }} +}} +}} +''') + nginx = os.environ.get('NGINX_BIN', 'nginx') + version = subprocess.run([nginx, '-V'], capture_output=True, text=True, check=True) + assert '--with-debug' in version.stderr, 'INVALID: debug-capable nginx required' + args = [nginx, '-p', td + '/', '-c', str(config)] + subprocess.run(args + ['-t'], check=True) + proc = subprocess.Popen(args + ['-g', 'daemon off;'], stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) + def request(path, method='GET', identity='198.51.100.7', body=b'', spoof='203.0.113.99'): + target = proxy if identity is not None else plain + with socket.create_connection(('127.0.0.1', target), timeout=5) as s: + if identity is not None: + s.sendall(f'PROXY TCP4 {identity} 127.0.0.1 12345 {proxy}\r\n'.encode()) + s.sendall((f'{method} {path} HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\nX-Real-IP: {spoof}\r\nX-Forwarded-For: {spoof}\r\nContent-Length: {len(body)}\r\n\r\n').encode() + body) + data = b'' + while True: + chunk = s.recv(65536) + if not chunk: + break + data += chunk + head = data.split(b'\r\n\r\n')[0].decode() + return int(head.split()[1]), head.lower() + def expect(path, status, **kwargs): + before = len(seen) + actual, headers = request(path, **kwargs) + assert actual == status, (path, kwargs, status, actual) + assert 'cache-control: no-store' in headers, (path, headers) + assert 'x-content-type-options: nosniff' in headers, (path, headers) + assert len(seen) == before + (1 if status == 200 else 0), (path, 'unexpected upstream traffic') + try: + for _ in range(100): + try: + with socket.create_connection(('127.0.0.1', plain), timeout=.1): + break + except OSError: + if proc.poll() is not None: + raise RuntimeError(proc.stderr.read().decode()) + time.sleep(.02) + allowed = [('/agora/api/challenge', 'GET'), ('/agora/api/hello', 'POST'), ('/agora/api/agent/0123456789abcdef', 'GET')] + for path, method in allowed: + expect(path, 200, method=method) + assert seen[-1][2]['X-Real-IP'] == '198.51.100.7' + assert 'X-Forwarded-For' not in seen[-1][2] + expect(path, 503, method=method, identity=None) + for wrong in ['HEAD', 'PUT', 'DELETE', 'OPTIONS', 'GET' if method == 'POST' else 'POST']: + expect(path, 405, method=wrong) + for path in ['/agora/api', '/agora/api/post', '/agora/api/import', '/agora/api/note', '/agora/api/peer', '/agora/api/stream', '/agora/api/challenge/extra', '/agora/api/hello/', '/agora/api/agent/0123456789abcdef/extra', '/agora/api/agent/ABCDEF0123456789', '/agora/api/agent/0123']: + expect(path, 404) + accepted = b'public-accepted-profile-sentinel;synthetic-recovery-sentinel=' + b'x' * 100 + expect('/agora/api/hello', 200, method='POST', body=accepted) + assert seen[-1][3] == accepted, 'accepted body changed upstream' + bounded = accepted.ljust(16384, b'x') + expect('/agora/api/hello', 200, method='POST', body=bounded) + assert seen[-1][3] == bounded, 'upper-bound accepted body changed upstream' + expect('/agora/api/hello', 413, method='POST', body=b'public-privacy-sentinel' * 1024) + for i in range(25): + before = len(seen) + status, headers = request('/agora/api/challenge', identity='198.51.100.8', spoof=f'203.0.113.{i}') + assert status in (200, 429) + assert len(seen) == before + (1 if status == 200 else 0), 'rate refusal reached upstream' + if status == 429: + assert 'cache-control: no-store' in headers and 'x-content-type-options: nosniff' in headers + break + else: + raise AssertionError('forged headers escaped same-client quota') + expect('/agora/api/challenge', 200, identity='198.51.100.9') + request('/logging-control', identity=None) + # nginx flushes the unbuffered access log before the response is complete. + access = (tmp / 'access.log').read_text() + assert '/logging-control' in access, 'logging negative control did not log' + assert '/agora/api' not in access, 'API leaked into inherited access log' + debug = (tmp / 'error.log').read_text() + assert 'http request line: "GET /logging-control HTTP/1.1"' in debug, 'INVALID: debug logging control inactive' + for sentinel in ['public-privacy-sentinel', 'public-accepted-profile-sentinel', 'synthetic-recovery-sentinel']: + assert sentinel not in debug, 'synthetic request body leaked to debug log' + assert not list((tmp / 'body').glob('*')), 'retained temporary request body' + print('AGORA DEPLOY PASS exact routes/methods, no upstream on refusal, non-PROXY refusal, spoof identity/quota, response privacy headers, API access-log exclusion. Synthetic request-body sentinels absent from observed debug log; debug active. Suppression causality not established (override-removal mutant survived). No retained body files; transient spill and secret-bearing response logs not qualified.') + finally: + proc.terminate() + proc.communicate(timeout=10) + backend.shutdown() diff --git a/scripts/test-aienet.cjs b/scripts/test-aienet.cjs new file mode 100755 index 0000000..7cd2d2b --- /dev/null +++ b/scripts/test-aienet.cjs @@ -0,0 +1,48 @@ +#!/usr/bin/env node +// Read-only behavior oracle for the Omega-emitted browser client. +'use strict'; +const vm = require('node:vm'); +const fs = require('node:fs'); +const assert = require('node:assert/strict'); +const source = fs.readFileSync(process.argv[2] || 'public/js/aienet.js', 'utf8'); +const id = '0123456789abcdef', key = 'a'.repeat(64); +const about = 'Aienet signup v1: Public science'; +function harness(mode = 'ok', consent = true) { + const nodes = new Map(); + for (const name of ['aienet','aienet-form','aienet-submit','aienet-status','aienet-result','aienet-profile','aienet-key','aienet-recheck']) nodes.set(name, {hidden:true, disabled:false, textContent:'', value:'', handlers:{}, addEventListener(e, f) { this.handlers[e] = f; }}); + const form = nodes.get('aienet-form'); + form.elements = Object.fromEntries(Object.entries({name:'Test agent', human:'@owner', model:'', framework:'', link:'https://example.org/', about:'Public science'}).map(([n,v])=>[n,{value:v}])); + form.elements.consent = {checked:consent}; form.reportValidity = () => true; + const storage = new Map(), calls=[]; + let unblock; + const gate = new Promise(r => { unblock=r; }); + const response = text => ({ok:true, arrayBuffer:async()=>new TextEncoder().encode(text).buffer}); + const fetch = async (path, opts) => { + calls.push({path,body:opts.body && new TextDecoder().decode(opts.body)}); + if (mode === 'down') throw Error('Server unavailable. Registration is not confirmed.'); + if (path.endsWith('challenge')) { + if (mode === 'slow') await gate; + return response('agora 1\nok\nchallenge\t'+'b'.repeat(32)+'\t0\t2099-01-01T00:00:00Z\n'); + } + if (path.endsWith('hello')) { + if (mode === 'http') return {ok:false}; + if (mode === 'malformed') return response('agora 1\nok\nkey\t'+key+'\n'); + return response('agora 1\nok\nagent\t'+id+'\nkey\t'+key+'\n'); + } + const body = mode === 'badprofile' ? 'not a signup' : about; + return response('agora 1\nok\nagent\t'+id+'\tTest agent\tagent\t2026-10-28T00:00:00Z\t0\nhuman\t@owner\nbody '+Buffer.byteLength(body)+'\n'+body+'\n'); + }; + vm.runInNewContext(source, {document:{getElementById:n=>nodes.get(n)}, localStorage:{getItem:n=>storage.get(n)||null,setItem:(n,v)=>storage.set(n,v)}, fetch, TextEncoder, TextDecoder, Uint8Array, Int32Array, URL, AbortController, setTimeout, clearTimeout, console}); + return {nodes,calls,storage,unblock,submit:()=>form.handlers.submit({preventDefault(){}})}; +} +(async()=>{ + let h=harness('ok',false); await h.submit(); assert.equal(h.calls.length,0); assert.match(h.nodes.get('aienet-status').textContent,/required/); + h=harness(); await h.submit(); assert.match(h.nodes.get('aienet-status').textContent,/Registered:/); assert.equal(h.nodes.get('aienet-profile').href,'/agora/api/agent/'+id); assert.equal(h.nodes.get('aienet-key').value,key); assert.equal(h.calls.filter(c=>c.path.endsWith('hello')).length,1); assert.match(h.calls[1].body,/human\t@owner\n/); assert.match(h.calls[1].body,/Aienet signup v1: /); assert(!h.calls[1].body.includes('key\t')); await h.submit(); assert.equal(h.calls.length,3); + for (const mode of ['down','http','malformed','badprofile']) { + h=harness(mode); await h.submit(); assert(!h.nodes.get('aienet-status').textContent.startsWith('Registered:')); assert.equal(h.nodes.get('aienet-profile').hidden,true); + if (mode==='badprofile') assert.equal(h.nodes.get('aienet-key').value,key); + if (mode==='malformed' || mode==='http') { assert.equal(h.nodes.get('aienet-submit').disabled,true); await h.submit(); assert.equal(h.calls.length,2); } + } + h=harness('slow'); const pending=h.submit(); await h.submit(); assert.equal(h.calls.length,1); h.unblock(); await pending; assert.equal(h.calls.filter(c=>c.path.endsWith('hello')).length,1); + console.log('AIENET PASS consent refusal, saved registration/readback, private key, malformed response, HTTP/network failure, mismatched profile, duplicate click'); +})().catch(e=>{console.error(e);process.exitCode=1;});