aienos.com
Source of www.aienos.com, served from my own hardware
Brought by drakestapleton
GitHub aien-dev/aienos.com#108 (code only)
Apply it
git checkout -b patch-d27291508efb582c f31f6dfa89c950122cc922f9bbe43da46cc770ea curl -fsSL https://interplane.io/drakestapleton/aienos.com/patches/d27291508efb582c.patch | git am
Provenance
github-import 1
aien-dev/aienos.com
108
dd0a3e6aad8f34f738b7dfae1e44f0db0421b229
{"kind":"github-import","owner":"aien-dev","repo":"aienos.com","number":108,"url":"https://github.com/aien-dev/aienos.com/pull/108","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:38:18Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index 1343b04d..bf4b3064 100644 --- a/.crumb +++ b/.crumb @@ -17,33 +17,33 @@ "generated": { "children": [ { - "digest": "0b583086787004c64a5563391f90762fd720f6323cdc8a4db30612f3d176e72f", - "last_commit": "9346a76", + "digest": "10cc29c5beda4b3966baaa8fd52c9e795a6aebe3f36f07db51f98795de23c162", + "last_commit": "85062b8", "name": ".github", "purpose": "GitHub automation configuration" }, { - "digest": "5c40958bfb64c0ab2ffc63758d4071140a574b010058242ef5310d73afb9d85e", - "last_commit": "c1021f8", + "digest": "75f0f0090209fc8982e054298dc0c124ff2857fd9cb8df3c4d47c2faab42abd9", + "last_commit": "4fb264f", "name": "crates", "purpose": "Native Rust website crates" }, { - "digest": "7c947afeb823c511664920fb83102de90d9fac5f27725bce0b11fa91876e5725", - "last_commit": "c1021f8", + "digest": "34e8ff8461c8fa693c7b23fe08fcd95cc68d2e81be780dd060b8eba24b04d537", + "last_commit": "85062b8", "name": "public", "purpose": "Static public website assets" } ], - "children_root": "sha256:7bc94b9983167eb811f94f77529c6537516296d6965edaa7f09ef7fafdc8e68a", - "compiled_at": "2026-10-26T13:50:26Z", + "children_root": "sha256:7ce0df62d7b17c6a54cc3f6fe91083fc3bf473713403acc3c9bfec0b08ad4d6e", + "compiled_at": "2026-10-26T14:17:14Z", "compiler": "crumb-compile/1", - "digest": "sha256:05efd67cc41c19313705c113f2c40a3ccc6ba5096380ab71f197eac26408f74a", + "digest": "sha256:f16ee9e433d590d54102cc665fc8e1844b46b865006afb9b55aadd26bf58b297", "evidence_files": 1, "evidence_root": "sha256:1f6f4b14373405a3b91d0e7aa6ba11d0dd332d4543ad01421a5451cca3e7de0c", - "files": 199, - "generated_at_commit": "2166a329491815ba1850e969d05f1286895172ac", - "source_tree": "sha256:5d2255d0c5c5c60c0639a41f56f1175baf98f37341b89d1a90e21251e0a0ed8b" + "files": 220, + "generated_at_commit": "014f4caf509f70673fa56bc67369536b1af2a2f8", + "source_tree": "sha256:92386345993024696532519f7c0d147ffba65e2872fdf9903afe7b59b07bb169" }, "progress": { "initial_edits": "Dashboard draft predates explicit Crumb reminder; subsequent integration is claimed and recorded.", diff --git a/.github/.crumb b/.github/.crumb index d89addf8..213f2fe4 100644 --- a/.github/.crumb +++ b/.github/.crumb @@ -7,21 +7,21 @@ "generated": { "children": [ { - "digest": "fe29076b4751075725b71c56ef776dd83359654b9cb5bc6367072de373f00197", - "last_commit": "9346a76", + "digest": "3c9cd7500963e9c78ecb42e0fa0d9bea00811202cae43f5f89d016ebea8d12ef", + "last_commit": "85062b8", "name": "workflows", "purpose": "Test, collect public project metrics and deploy the GitHub Pages site" } ], - "children_root": "sha256:fad5d0846cef435f6271d04854ce316dd794f357957940acc08ff1e016d839a9", - "compiled_at": "2026-10-26T13:50:26Z", + "children_root": "sha256:519a00e869f86c348d571ce989a58862b18b3cb5e4ef3fdaf095e5e44f498ab8", + "compiled_at": "2026-10-26T14:15:16Z", "compiler": "crumb-compile/1", - "digest": "sha256:0b583086787004c64a5563391f90762fd720f6323cdc8a4db30612f3d176e72f", + "digest": "sha256:10cc29c5beda4b3966baaa8fd52c9e795a6aebe3f36f07db51f98795de23c162", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 2, - "generated_at_commit": "2166a329491815ba1850e969d05f1286895172ac", - "source_tree": "sha256:3f872a88afca840612b7ecf3f7e76aa1b7a94cbf7df2de6282b634570055494a" + "generated_at_commit": "85062b8a4eacd115d15cf3532aa05ede1c306218", + "source_tree": "sha256:20fe272198b67cb637eb77a971d8b29053451759f8b277d1057805546bc889b1" } }, "invariants": [ diff --git a/.github/workflows/.crumb b/.github/workflows/.crumb index f724955a..b4340abc 100644 --- a/.github/workflows/.crumb +++ b/.github/workflows/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-26T13:50:26Z", + "compiled_at": "2026-10-26T14:15:16Z", "compiler": "crumb-compile/1", - "digest": "sha256:fe29076b4751075725b71c56ef776dd83359654b9cb5bc6367072de373f00197", + "digest": "sha256:3c9cd7500963e9c78ecb42e0fa0d9bea00811202cae43f5f89d016ebea8d12ef", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 2, - "generated_at_commit": "2166a329491815ba1850e969d05f1286895172ac", - "source_tree": "sha256:3f872a88afca840612b7ecf3f7e76aa1b7a94cbf7df2de6282b634570055494a" + "generated_at_commit": "85062b8a4eacd115d15cf3532aa05ede1c306218", + "source_tree": "sha256:20fe272198b67cb637eb77a971d8b29053451759f8b277d1057805546bc889b1" } }, "invariants": [ diff --git a/.github/workflows/generated-hive.yml b/.github/workflows/generated-hive.yml index 51832d7b..253b9d3d 100644 --- a/.github/workflows/generated-hive.yml +++ b/.github/workflows/generated-hive.yml @@ -5,6 +5,7 @@ on: - 'om/hive-page/**' - 'public/js/hive.js' - 'public/js/turing-look.js' + - 'public/wasm/**' - 'crates/site-builder/**' - '.github/workflows/generated-hive.yml' push: @@ -13,6 +14,7 @@ on: - 'om/hive-page/**' - 'public/js/hive.js' - 'public/js/turing-look.js' + - 'public/wasm/**' - 'crates/site-builder/**' - '.github/workflows/generated-hive.yml' permissions: @@ -25,5 +27,5 @@ jobs: # These tests only hash committed bytes; never execute the arm64 omc pin. - name: Check generated skeleton run: cargo test --manifest-path crates/site-builder/Cargo.toml components::hive::tests::the_embedded_skeleton_matches_its_recorded_sha256 -- --exact - - name: Check generated browser scripts + - name: Check generated browser scripts and wasm run: cargo test --manifest-path crates/site-builder/Cargo.toml components::hive::tests::served_scripts_match_their_omega_generated_sha256 -- --exact diff --git a/AGENTS.md b/AGENTS.md index 760c8303..361a62d3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -69,6 +69,7 @@ Open `http://127.0.0.1:8080/` after the preview server starts. GitHub Pages serv - Tests live beside the code in `#[cfg(test)]` modules. Add a test when a rule can regress silently. - Hive's page structure and browser hydrator are generated by seeded Omega, never written in Rust or hand-edited in `public/js/`. `om/hive-page/check.sh` concatenates `contract.om`, `hive.om` and `hive-js.om` into one program: stdout emits the skeleton, fd 3 emits `hive.js`. The shared contract table owns the served ids, template ids, data-f slot names, poll interval and freshness bounds; `~N~` tokens in both units interpolate that table. Append contract entries rather than renumbering them. `hive.om` owns the section set and order (`meta`, eight pipe separated fields per record), aria wiring, bounded panel heads/bodies, mission tree, rows, templates and empty states. `fld` emits one interpolated field and `secthead` emits fields one to seven; `main` calls the section body, then emits field eight. Newlines and `|` are forbidden inside a meta field. The site-wide `turing-look.js` has its own independent generator, `turing-look.om`, in the same gate. The gate verifies `omc.sha256`, runs each program twice, requires byte-identical nonempty outputs, and writes `main.html` plus both served scripts and their `.sha256` sidecars. Commit sources, artifacts and hashes together. Run the gate twice (both exit 0), site-builder tests and `scripts/test-hive-cosmic.py`; the tests reject any artifact/hash disagreement without executing the arm64 compiler on x86_64. `components/hive.rs` only embeds the markup, while the generated hydrator only clones templates and fills text nodes. A structure change belongs in `hive.om`; a browser-behaviour change belongs in the corresponding function text in `hive-js.om`, never in generated `public/js/hive.js`. Both `public/js/hive.js` and `public/js/turing-look.js` are generated, never hand-edited. - `.github/workflows/generated-hive.yml` runs only the skeleton-hash and generated-script-hash tests on x86_64 for relevant pull requests and main pushes. It does not run `omc`, regenerate artifacts or change the full-suite-on-Spark policy. +- Hive freshness has a seeded WebAssembly backend: `om/hive-page/fresh.om` takes the current/effective source clock, generated timestamp, previous timestamp, stale threshold and fetch status; the threshold remains a caller input, not a duplicated policy constant. `freshness-js.om` emits the loader and explicit JavaScript fallback (`window.hiveFresh`); `data-fresh-engine="wasm|js"` and `data-fresh-state="0|1|2|3"` expose which decision ran. States are fresh, source stale (strictly past the threshold), timestamp moved backwards, and fetch aborted; backwards retains priority over abort. Clock-trust gating remains outside this scalar decision. `check.sh` compiles it through `omc ir` and the vendored, hash-pinned `irwasm` to `public/wasm/hive-fresh.wasm`; provenance lives in `irwasm.provenance`. The site omc pin stays unchanged. The existing generated-script hash test also checks the wasm on x86_64 without executing either arm64 tool. `sh om/hive-page/gate-fresh.sh` uses real AArch64 drivers and Node solely as a read-only wasm oracle, never a build dependency. - Hive keeps its Omega-generated information board. At Drake's explicit request for a universe presentation, the scene behind the masthead is Allen's two black holes, and the decorative galaxy (public/assets/hive-universe.svg) is only the residual sky behind them, dimmed and reasserted in the presentation block at the end of public/assets/hive.css. The scene must not represent agent positions, progress, topology or live activity, and no invented coordinates or data are allowed. It is a decoration over the board, never a source: the board itself is a status and freshness strip, a mission tree indented by depth, compact agent rows (name, status, model and provider, elapsed, current activity), a selected-agent manifest and a message feed. The missions panel and the manifest panel are bounded: their head never scrolls, only their body does, so a fleet of hundreds of agents is one scroll box rather than a document thousands of pixels tall, and the search tools stay at the top of the missions scroll body. The manifest panel is sticky beside the missions panel, and it stacks under it below 900px. Branches collapse: the row template declares a disclosure button carrying `aria-expanded` and `aria-controls`, `public/js/hive.js` assigns the id it points at, hides it on a leaf row and keeps one expanded state per branch. A branch holding more than twelve agents starts folded and says how many it holds, because the reported fleet is wide rather than deep; a search opens the branches that contain a match without discarding the state the reader chose, and choosing an agent opens the path down to it. Sections carry `data-requires` in the emitted markup, so a section the snapshot has no data for is hidden rather than shown empty; which sections exist and in what order is decided in `hive.om`. Task, activity and lifecycle data must come from real observations. Preserve source freshness, partial coverage, unknown states, message-time model identity, keyboard focus, and reduced-motion support. - The page says what it is. The masthead eyebrow and the `hive-omega` band state that the page is written in Omega, that every heading, panel, row and template comes from `om/hive-page/hive.om`, and that glitches are expected while the language is still being finished. That claim lives in `hive.om` and stays visible above the fleet; `scripts/test-hive-cosmic.py` fails if it disappears. - The scene is Allen's law, and the `.om` owns every number of it. `native/kernel/ui/night.c` (`orbit_angle`, `ck_night_at`) and `chirp.c` in the `aienos-allen-portable-build` tree are the source: separation as t^(1/4), angle as t^(5/8), t the time left, with the wide orbit at 270 units and one turn per 5200 ms, the shadows grown in from 2600 and 4000 ms, the merger at 12000 ms with a shadow from 323/256 to 2 of a single one and a glow of 362/256, the last hole gone at 15200 ms and the ripple out to 15600 ms. That law is real (section 4 of `docs/ALLEN_SKY_SCIENCE.md`); the ripple across the sky and the ringing of the last hole are illustration, not evidence, and the page says so. `om/hive-page/hive.om` samples it with integer and `f64` arithmetic and emits the markup, the keyframes and the wiring into `main.html`; `public/assets/hive.css` only places the stage and paints the discs, and animates nothing. Never hand write a sample, a keyframe or a duration in the stylesheet: a change to the sequence is an edit to the `.om` and then `sh om/hive-page/check.sh`. diff --git a/README.md b/README.md index e68f67fc..95aa843a 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,27 @@ Configuration lives on the hub at `/etc/nginx/sites-available/aienos.com` (edge The page and assets are generated normally; `/hive/live.json` is not a build artifact or a GitHub receipt. The separate, explicitly started `hive-feed` collector observes OMP collaboration hosts and their incremental session records. Recognized live process-only workers remain visible with unknown task/activity when no reliable transcript association exists. Coverage is always disclosed as partial; neither a live process nor a fresh snapshot proves productive or successful work. +Hive's browser freshness decision is compiled from `om/hive-page/fresh.om` to +`public/wasm/hive-fresh.wasm` through the pinned, seeded Omega compiler and +`irwasm` backend. `sh om/hive-page/check.sh` regenerates the module with the +other committed artifacts; the existing x86_64 asset-hash test checks its +`.sha256` without executing arm64 tools. `irwasm.provenance` pins the source, +compiler and binary. No Node tool is involved in generation. + +The browser uses `WebAssembly.instantiateStreaming`, retries with an +`arrayBuffer` for unsupported MIME/streaming, and explicitly retains the +previous JavaScript decision if the module cannot load. The page exposes +`data-fresh-engine="wasm|js"` and `data-fresh-state="0|1|2|3"` for fresh, +source stale, timestamp moved backwards and fetch interrupted. Backwards +timestamps take priority over interrupted fetches; equal timestamps are not +regressions, and age exactly at the supplied stale threshold is not stale. +The caller still verifies the HTTP source clock separately: wasm is not +evidence that a browser clock or source timestamp is trusted. + +On AArch64, `sh om/hive-page/gate-fresh.sh` compares wasm with native Omega +drivers over the committed boundary table. Node is solely a read-only wasm +validation/execution oracle for this gate, not a runtime/build dependency. + ```sh cargo test --workspace cargo build --release --workspace diff --git a/crates/.crumb b/crates/.crumb index 2b8452c6..2c2dae18 100644 --- a/crates/.crumb +++ b/crates/.crumb @@ -7,21 +7,21 @@ "generated": { "children": [ { - "digest": "a2f0c7820400633a8155ebf756c1b16932cd1dddf5185c7ba81996cd97945665", - "last_commit": "c1021f8", + "digest": "81f5649796d9723037c59a2ec3926e006ef1bbeb80cda63446d4ded6bbc315b5", + "last_commit": "4fb264f", "name": "site-builder", "purpose": "Rust static site generator" } ], - "children_root": "sha256:de8d7b627bd2cb20c891c99339be03f7441c1426c8041ba70419740aff557faf", - "compiled_at": "2026-10-26T13:48:37Z", + "children_root": "sha256:0b766c12ffae4d194d821b493b2f4c8a618c17d7cbaa39d7f2fc23919064f51e", + "compiled_at": "2026-10-26T14:15:16Z", "compiler": "crumb-compile/1", - "digest": "sha256:5c40958bfb64c0ab2ffc63758d4071140a574b010058242ef5310d73afb9d85e", + "digest": "sha256:75f0f0090209fc8982e054298dc0c124ff2857fd9cb8df3c4d47c2faab42abd9", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 52, - "generated_at_commit": "2166a329491815ba1850e969d05f1286895172ac", - "source_tree": "sha256:539d20c3e091f54c17353f1a6a9fa893d78d60cbc4d1e5111da0cf2a704f8d34" + "generated_at_commit": "85062b8a4eacd115d15cf3532aa05ede1c306218", + "source_tree": "sha256:dd7079f0e0a0f0dd3ace15ae3daa69365215bd5ef8a9107204b1f848521d73d7" } }, "invariants": [ diff --git a/crates/site-builder/.crumb b/crates/site-builder/.crumb index 6dadd3ed..8a69abd0 100644 --- a/crates/site-builder/.crumb +++ b/crates/site-builder/.crumb @@ -7,8 +7,8 @@ "generated": { "children": [ { - "digest": "cc554e254ae410733fa14833103355955a2326eddd3817c558e9b6826ed79c73", - "last_commit": "c1021f8", + "digest": "876927b378738927812dc127f5f8044ab505f6b5d079faaa94e67a36ff6af592", + "last_commit": "4fb264f", "name": "src", "purpose": "Page assembly and site build verification" }, @@ -19,15 +19,15 @@ "purpose": "Reviewed HTML templates for source-backed pages" } ], - "children_root": "sha256:47bf2b8c1db8922268ec7311faee31dfc732b8b081549baed2aa9be6ddd0e215", - "compiled_at": "2026-10-26T13:48:37Z", + "children_root": "sha256:8d1a12ba991cfd33195c858b927d6916b2ad6df9c3fb0b7a74ae02cab32dc12c", + "compiled_at": "2026-10-26T14:15:16Z", "compiler": "crumb-compile/1", - "digest": "sha256:a2f0c7820400633a8155ebf756c1b16932cd1dddf5185c7ba81996cd97945665", + "digest": "sha256:81f5649796d9723037c59a2ec3926e006ef1bbeb80cda63446d4ded6bbc315b5", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 44, - "generated_at_commit": "2166a329491815ba1850e969d05f1286895172ac", - "source_tree": "sha256:872b6fb847489335ea9d2e4f8e57fafc8d337265ff7ef3a91d0447a1e76fd109" + "generated_at_commit": "85062b8a4eacd115d15cf3532aa05ede1c306218", + "source_tree": "sha256:bf8a37edc8cd4bb9787704f3ace1d871320dbb47517037088ecdd3e47f005a92" } }, "invariants": [ diff --git a/crates/site-builder/src/.crumb b/crates/site-builder/src/.crumb index 6d4c42c2..6f292111 100644 --- a/crates/site-builder/src/.crumb +++ b/crates/site-builder/src/.crumb @@ -10,21 +10,21 @@ "generated": { "children": [ { - "digest": "02dcd60255f3074db74f8a15d21092b73591b77c6bcb0b2f2af4dd196bc9fd23", - "last_commit": "c1021f8", + "digest": "370f3af4fffd00c756c60d480d2db5b6958ff7bc5dedceff6b3c6e9b622e0a35", + "last_commit": "4fb264f", "name": "components", "purpose": "Reusable page content and navigation" } ], - "children_root": "sha256:c16d89d45efcf18b80006800e9a09056bc8e8db6d3e703b35ae979992cd658b0", - "compiled_at": "2026-10-26T13:48:37Z", + "children_root": "sha256:ae4d8fd93d391227414538bed9487901e258d47ec892ffbe7287257bf684b69a", + "compiled_at": "2026-10-26T14:15:16Z", "compiler": "crumb-compile/1", - "digest": "sha256:cc554e254ae410733fa14833103355955a2326eddd3817c558e9b6826ed79c73", + "digest": "sha256:876927b378738927812dc127f5f8044ab505f6b5d079faaa94e67a36ff6af592", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 37, - "generated_at_commit": "2166a329491815ba1850e969d05f1286895172ac", - "source_tree": "sha256:450c924628b25e0823c3bb9e69c5853684e1768f4023fbb20d1e40ffba61baa0" + "generated_at_commit": "85062b8a4eacd115d15cf3532aa05ede1c306218", + "source_tree": "sha256:c274441d6fcc9e6b85631b317e2ba6e50d3667540a03e7e1a016b17efd7a758d" } }, "invariants": [ diff --git a/crates/site-builder/src/components/.crumb b/crates/site-builder/src/components/.crumb index 65194cf4..eaa66bf9 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-26T13:48:37Z", + "compiled_at": "2026-10-26T14:15:16Z", "compiler": "crumb-compile/1", - "digest": "sha256:02dcd60255f3074db74f8a15d21092b73591b77c6bcb0b2f2af4dd196bc9fd23", + "digest": "sha256:370f3af4fffd00c756c60d480d2db5b6958ff7bc5dedceff6b3c6e9b622e0a35", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 31, - "generated_at_commit": "2166a329491815ba1850e969d05f1286895172ac", - "source_tree": "sha256:c7372eef625385966ac68bc3736a2d4e6b33f2d4bc6962a39fbb130c735709da" + "generated_at_commit": "85062b8a4eacd115d15cf3532aa05ede1c306218", + "source_tree": "sha256:471972ae6ffa43a8e77ebe2a4e616a6c80a7c63ee0451a9b772e796323450716" } }, "invariants": [ diff --git a/crates/site-builder/src/components/hive.rs b/crates/site-builder/src/components/hive.rs index b1981423..342191b5 100644 --- a/crates/site-builder/src/components/hive.rs +++ b/crates/site-builder/src/components/hive.rs @@ -80,6 +80,11 @@ mod tests { include_bytes!("../../../../public/js/turing-look.js").as_slice(), include_str!("../../../../om/hive-page/turing-look.js.sha256"), ), + ( + "hive-fresh.wasm", + include_bytes!("../../../../public/wasm/hive-fresh.wasm").as_slice(), + include_str!("../../../../public/wasm/hive-fresh.wasm.sha256"), + ), ] { let want = recorded.split_whitespace().next().expect("script digest"); assert_eq!(want.len(), 64, "{name} must have a sha256 digest"); diff --git a/om/hive-page/check.sh b/om/hive-page/check.sh index a67ad2ab..611420d1 100755 --- a/om/hive-page/check.sh +++ b/om/hive-page/check.sh @@ -18,11 +18,22 @@ if [ "$have" != "$pin" ]; then printf 'Compiler sha256 mismatch: recorded %s, found %s\n' "$pin" "$have" >&2 exit 3 fi +irwasm=${OMEGA_IRWASM:-$PWD/irwasm} +irpin=$(tr -d ' \n' < irwasm.sha256) +if [ ! -f "$irwasm" ]; then + printf 'No IR wasm backend at %s; expected %s\n' "$irwasm" "$irpin" >&2 + exit 2 +fi +irhave=$(sha256sum "$irwasm" | cut -d' ' -f1) +if [ "$irhave" != "$irpin" ]; then + printf 'IR wasm backend sha256 mismatch: recorded %s, found %s\n' "$irpin" "$irhave" >&2 + exit 3 +fi work=$(mktemp -d "${TMPDIR:-/tmp}/hive-page.XXXXXX") trap 'rm -rf "$work"' EXIT HUP INT TERM # One executable shares the contract between markup (fd 1) and hydrator (fd 3). # Concatenation composes Omega units; it does not implement generation in shell. -cat contract.om hive.om hive-js.om > "$work/hive.om" +cat contract.om freshness-js.om hive.om hive-js.om > "$work/hive.om" "$omc" < "$work/hive.om" > "$work/hive" "$omc" < turing-look.om > "$work/turing" chmod +x "$work/hive" "$work/turing" @@ -30,6 +41,10 @@ chmod +x "$work/hive" "$work/turing" "$work/hive" > "$work/second.html" 3> "$work/second.hive.js" "$work/turing" > "$work/first.turing.js" "$work/turing" > "$work/second.turing.js" +{ printf 'ir\n'; cat fresh.om; } > "$work/fresh.ir.om" +"$omc" < "$work/fresh.ir.om" > "$work/fresh.ir" +"$irwasm" < "$work/fresh.ir" > "$work/first.fresh.wasm" +"$irwasm" < "$work/fresh.ir" > "$work/second.fresh.wasm" stale=0 publish() { first=$1 @@ -55,6 +70,9 @@ publish() { publish "$work/first.html" "$work/second.html" main.html main.html.sha256 publish "$work/first.hive.js" "$work/second.hive.js" ../../public/js/hive.js hive.js.sha256 publish "$work/first.turing.js" "$work/second.turing.js" ../../public/js/turing-look.js turing-look.js.sha256 +mkdir -p ../../public/wasm +publish "$work/first.fresh.wasm" "$work/second.fresh.wasm" ../../public/wasm/hive-fresh.wasm ../../public/wasm/hive-fresh.wasm.sha256 +printf 'irwasm sha256 %s\n' "$irhave" 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/hive-page/fresh-browser-buffer-results.json b/om/hive-page/fresh-browser-buffer-results.json new file mode 100644 index 00000000..5318ba3c --- /dev/null +++ b/om/hive-page/fresh-browser-buffer-results.json @@ -0,0 +1,10 @@ +{ + "fixture": "incorrect wasm MIME forces arrayBuffer fallback; module still executes", + "wasmBoundaries": { + "at": 0, + "past": 1, + "equal": 0, + "back": 2, + "engine": "wasm" + } +} \ No newline at end of file diff --git a/om/hive-page/fresh-browser-fixture.js b/om/hive-page/fresh-browser-fixture.js new file mode 100644 index 00000000..ee2a1a80 --- /dev/null +++ b/om/hive-page/fresh-browser-fixture.js @@ -0,0 +1,4 @@ +// Read-only browser acceptance oracle. Install as a pre-navigation init script. +// fixture=fresh|stale|corrupt|buffer; then window.__freshMode=backwards|abort. +// Synthetic feed only, never production telemetry. +(() => { const original = window.fetch.bind(window); window.__freshMode = new URL(location.href).searchParams.get('fixture') || 'fresh'; window.fetch = async (url, options) => { const route = String(url); if (route.includes('/wasm/hive-fresh.wasm') && ['corrupt','buffer'].includes(window.__freshMode)) { const source = await original(url, options); const bytes = new Uint8Array(await source.arrayBuffer()); if(window.__freshMode==='corrupt') bytes[0] = 1; return new Response(bytes, {status:200, headers:{'content-type':window.__freshMode==='buffer'?'application/octet-stream':'application/wasm'}}); } if (route.includes('/hive/live.json')) { if (window.__freshMode === 'abort') throw new TypeError('fixture aborted'); const generated = window.__freshMode === 'backwards' ? '2026-10-26T00:00:01.999Z' : '2026-10-26T00:00:02.000Z'; const data={schema_version:1,generated_at:generated,sequence:'wasm-browser-fixture',poll_ms:1000,stale_after_ms:120000,coverage:{label:'Synthetic browser acceptance fixture',roots:0,agents:0,complete:true,notice:'Not production telemetry'},agents:[],interactions:[]}; return new Response(JSON.stringify(data),{status:200,headers:{'content-type':'application/json','date':window.__freshMode === 'stale'?'Mon, 26 Oct 2026 00:03:00 GMT':'Mon, 26 Oct 2026 00:00:02 GMT'}}); } return original(url,options); }; })(); diff --git a/om/hive-page/fresh-browser-results.json b/om/hive-page/fresh-browser-results.json new file mode 100644 index 00000000..bd95c8c3 --- /dev/null +++ b/om/hive-page/fresh-browser-results.json @@ -0,0 +1,46 @@ +{ + "fixture": "synthetic acceptance feed, not production telemetry", + "states": [ + { + "case": "fresh", + "engine": "wasm", + "state": "0", + "fresh": "true", + "label": "Receiving source observations" + }, + { + "case": "backwards", + "engine": "wasm", + "state": "2", + "fresh": "false", + "label": "Snapshot timestamp moved backwards; last observation retained" + }, + { + "case": "abort", + "engine": "wasm", + "state": "3", + "fresh": "false", + "label": "Connection interrupted; last snapshot retained" + }, + { + "case": "stale", + "engine": "wasm", + "state": "1", + "fresh": "false", + "label": "Source stale; last observation retained" + } + ], + "fallback": { + "case": "one-byte-corruption", + "engine": "js", + "state": "0", + "fresh": "true", + "label": "Receiving source observations" + }, + "boundaries": { + "at": 0, + "past": 1, + "equal": 0, + "back": 2 + } +} \ No newline at end of file diff --git a/om/hive-page/fresh-cosmic.log b/om/hive-page/fresh-cosmic.log new file mode 100644 index 00000000..dcf88bdb --- /dev/null +++ b/om/hive-page/fresh-cosmic.log @@ -0,0 +1,5 @@ +............ +---------------------------------------------------------------------- +Ran 12 tests in 0.022s + +OK diff --git a/om/hive-page/fresh-edge-browser-fixture.js b/om/hive-page/fresh-edge-browser-fixture.js new file mode 100644 index 00000000..2864aaf3 --- /dev/null +++ b/om/hive-page/fresh-edge-browser-fixture.js @@ -0,0 +1,3 @@ +// Read-only integrated EdgeRender browser acceptance oracle. +// Preserves rendered board markup, substitutes timestamp/header/failure fixtures. +(() => { const original=window.fetch.bind(window); window.__freshMode=new URL(location.href).searchParams.get('fixture')||'fresh'; window.fetch=async(url,options)=>{const route=String(url); if(route.includes('/wasm/hive-fresh.wasm')&&window.__freshMode==='corrupt'){const r=await original(url,options);const b=new Uint8Array(await r.arrayBuffer());b[0]=1;return new Response(b,{status:200,headers:{'content-type':'application/wasm'}});} if(route.includes('/hive/board/')){if(window.__freshMode==='abort')throw new TypeError('fixture aborted');const r=await original(url,options);const d=new DOMParser().parseFromString(await r.text(),'text/html');const board=d.getElementById('hive-board');board.dataset.generated=window.__freshMode==='backwards'?'2026-10-26T00:00:01.999Z':'2026-10-26T00:00:02.000Z';return new Response(d.documentElement.outerHTML,{status:200,headers:{'content-type':'text/html','date':window.__freshMode==='stale'?'Mon, 26 Oct 2026 00:03:00 GMT':'Mon, 26 Oct 2026 00:00:02 GMT'}});}return original(url,options);};})(); diff --git a/om/hive-page/fresh-edge-browser-results.json b/om/hive-page/fresh-edge-browser-results.json new file mode 100644 index 00000000..ba2f8f8e --- /dev/null +++ b/om/hive-page/fresh-edge-browser-results.json @@ -0,0 +1,40 @@ +{ + "source": "EdgeRender ad1cd71 integrated preview, synthetic acceptance board not production telemetry", + "results": [ + { + "case": "fresh", + "engine": "wasm", + "state": "0", + "fresh": "true", + "label": "Receiving source observations" + }, + { + "case": "backwards", + "engine": "wasm", + "state": "2", + "fresh": "false", + "label": "Snapshot timestamp moved backwards; last observation retained" + }, + { + "case": "abort", + "engine": "wasm", + "state": "3", + "fresh": "false", + "label": "Connection interrupted; last snapshot retained" + }, + { + "case": "stale", + "engine": "wasm", + "state": "1", + "fresh": "false", + "label": "Source stale; last observation retained" + }, + { + "case": "one-byte-corruption", + "engine": "js", + "state": "0", + "fresh": "true", + "label": "Receiving source observations" + } + ] +} \ No newline at end of file diff --git a/om/hive-page/fresh-evidence.log b/om/hive-page/fresh-evidence.log new file mode 100644 index 00000000..faac068c --- /dev/null +++ b/om/hive-page/fresh-evidence.log @@ -0,0 +1,63 @@ +Freshness wasm integration, host/browser exercise 2026-10-26. +Implementation source: 85062b8a4eacd115d15cf3532aa05ede1c306218. +Later commits 59dda42 and 014f4ca refresh crumbs only. +Base: f31f6df, origin/feat/hive-js-from-omega (draft #105). +No merge, deployment, GPU or live service action. + +Generation remains entirely seeded Omega: + nice -n 19 om/hive-page/omc < omega-mv/seed/wasm/irwasm.om > irwasm + source omega-mv a84f1e80020dede868b103605484529a9395ad69 (draft #787) + compile exit 0; binary identical to upstream seeded compiler output. + No omc pin bump required. Detailed provenance: irwasm.provenance. + Existing compiler sha256 734f0a39319fbfa930bcc62cb30dbf06d47d78e126372b74f5baf478e6126b61 + Backend sha256 2d235a70c39ac1461a09c41e10e058d962b767ae83893cdcfc693ef6c47182e6 + Wasm sha256 af9e1fb0d9e736949b2aa83c0bf978ac2d98f37428a8507176abaa1dd50b777b + Wasm size 336 bytes. + +EXERCISED commands: + OMEGA_ACCEPT_CHANGE=1 nice -n 19 sh om/hive-page/check.sh + nice -n 19 sh om/hive-page/check.sh + Both exit 0; generator itself runs every output twice and requires byte identity. + nice -n 19 sh om/hive-page/gate-fresh.sh + Exit 0; fresh-gate.log: PASS freshness native/wasm boundary cases=10; all four states + Native drivers execute fresh.om, not a host reimplementation. Node v24.21.0 + only validates/executes the produced wasm as a read-only oracle. + nice -n 19 cargo test -j2 --manifest-path crates/site-builder/Cargo.toml + Exit 0; fresh-site-tests.log: 168 passed; 0 failed; 0 ignored. + python3 scripts/test-hive-cosmic.py + Exit 0; fresh-cosmic.log: Ran 12 tests; OK. + nice -n 19 cargo run -j2 --manifest-path crates/site-builder/Cargo.toml -- build dist + Exit 0 with documented data/now files temporarily laid into public/data as pages.yml does; + original files restored after build. fresh-site-build.log: Integrity & Unslop Invariants: PASS. + Initial build without those inputs failed on absent /data/accounts.tsv; this was + missing build preparation, not reported as a completed build. Existing HIVE_CSS warning remains. + +Negative control: + Preserve original public/wasm/hive-fresh.wasm, replace only its magic byte at offset 0 with 1. + cargo test -j2 --manifest-path crates/site-builder/Cargo.toml served_scripts_match_their_omega_generated_sha256 + Exit 101; fresh-hash-negative.log names hive-fresh.wasm and mismatched hashes. + Original bytes restored immediately. Final site suite subsequently passes. + CI still runs hash-only tests on x86_64; wasm paths now trigger the existing workflow. + +Browser, real headless Chromium, standalone generated /hive/ from source above: + Preview built dist on local port 33247. Synthetic acceptance JSON feed, explicitly + labelled not production telemetry; installed fresh-browser-fixture.js as init script. + fresh-browser-results.json contains actual four poll-derived states and labels: + fresh 0, source stale 1, backwards 2, fetch aborted 3: every engine=wasm. + Each nonfresh state is data-fresh=false and retains the previous observation. + One-byte corrupt wasm response gives engine=js, state=0, correct fresh label. + Wrong wasm MIME forces instantiateStreaming failure and arrayBuffer fallback; + fresh-browser-buffer-results.json shows engine=wasm, equality=0, + fractional past-threshold=1, equal timestamps=0, backwards+fetch failure=2. + +Integrated EdgeRender client also exercised at its reported ad1cd71 preview on port33239: + fresh-edge-browser-fixture.js preserves its rendered board DOM, substitutes only + generated timestamp/server Date/failure controls. Not production telemetry. + fresh-edge-browser-results.json records all four actual poll states with engine=wasm + and corrupt-wasm fallback engine=js. No files in EdgeRender's worktree were edited. + +Boundary constants checked via WolframLanguageEvaluator: + {1000-1,1000,1000+1,2000-1,Ceiling[1000.01]} -> {999,1000,1001,1999,1001} + 180000-2000 > 120000 -> True (synthetic stale fixture). + +NOT_RUN: deployment, production-browser check, GPU/Alpha qualification, merge. diff --git a/om/hive-page/fresh-gate.log b/om/hive-page/fresh-gate.log new file mode 100644 index 00000000..33c291f9 --- /dev/null +++ b/om/hive-page/fresh-gate.log @@ -0,0 +1,10 @@ +main.html 46109 bytes sha256 80a036bc7591b53ba64a1e3313959d00c82242b08dc2b1ad312cf268abe35050 +../../public/js/hive.js 32891 bytes sha256 c3324b0f120fb61ad659f7ee52226443cd6200fa275895eea3eb5592a0cfa0aa +../../public/js/turing-look.js 2938 bytes sha256 e5a9df9cc92cd5f77edc2efc7b12c6a2e94f12698624f27d88f162972c8e068b +../../public/wasm/hive-fresh.wasm 336 bytes sha256 af9e1fb0d9e736949b2aa83c0bf978ac2d98f37428a8507176abaa1dd50b777b +irwasm sha256 2d235a70c39ac1461a09c41e10e058d962b767ae83893cdcfc693ef6c47182e6 +omc sha256 734f0a39319fbfa930bcc62cb30dbf06d47d78e126372b74f5baf478e6126b61 +PASS freshness native/wasm boundary cases=10; all four states +5989611014825711faec447335b1b6d15ae01c651e3f89abbeda8111461a9986 om/hive-page/fresh.om +af9e1fb0d9e736949b2aa83c0bf978ac2d98f37428a8507176abaa1dd50b777b public/wasm/hive-fresh.wasm +2d235a70c39ac1461a09c41e10e058d962b767ae83893cdcfc693ef6c47182e6 om/hive-page/irwasm diff --git a/om/hive-page/fresh-hash-negative.log b/om/hive-page/fresh-hash-negative.log new file mode 100644 index 00000000..22ee5e8d --- /dev/null +++ b/om/hive-page/fresh-hash-negative.log @@ -0,0 +1,24 @@ + Compiling site-builder v0.1.0 (/tmp/hive-wasm/crates/site-builder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.84s + Running unittests src/main.rs (target/debug/deps/site_builder-2fef39780c42351d) + +running 1 test +test components::hive::tests::served_scripts_match_their_omega_generated_sha256 ... FAILED + +failures: + +---- components::hive::tests::served_scripts_match_their_omega_generated_sha256 stdout ---- + +thread 'components::hive::tests::served_scripts_match_their_omega_generated_sha256' (343324) panicked at crates/site-builder/src/components/hive.rs:92:13: +assertion `left == right` failed: hive-fresh.wasm is generated, never hand-edited; run: sh om/hive-page/check.sh + left: "02b9e535a7121ba618598a12a2c632d79aba5f4273aef80d931481d2cd92ac6a" + right: "af9e1fb0d9e736949b2aa83c0bf978ac2d98f37428a8507176abaa1dd50b777b" +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + components::hive::tests::served_scripts_match_their_omega_generated_sha256 + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 167 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--bin site-builder` diff --git a/om/hive-page/fresh-oracle.js b/om/hive-page/fresh-oracle.js new file mode 100644 index 00000000..d2630e01 --- /dev/null +++ b/om/hive-page/fresh-oracle.js @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: Apache-2.0 +// Read-only verification oracle; no code/IR/wasm generation. +'use strict'; +const fs = require('node:fs'); +const assert = require('node:assert/strict'); +const [wasmPath, tablePath, statusPath] = process.argv.slice(2); +const bytes = fs.readFileSync(wasmPath); +assert(WebAssembly.validate(bytes)); +const moduleObject = new WebAssembly.Module(bytes); +assert.deepEqual(WebAssembly.Module.imports(moduleObject), []); +const { fresh } = new WebAssembly.Instance(moduleObject).exports; +const rows = fs.readFileSync(tablePath, 'utf8').split('\n') + .filter(line => line && !line.startsWith('#')).map(line => line.split(' ')); +const native = fs.readFileSync(statusPath, 'utf8').trim().split('\n').map(Number); +assert.equal(native.length, rows.length); +for (const [index, [now, generated, previous, stale, ok, expected]] of rows.entries()) { + const result = fresh(BigInt(now), BigInt(generated), BigInt(previous), BigInt(stale), ok === 'true' ? 1 : 0); + assert.equal(result, native[index], `native/wasm case ${index + 1}`); + assert.equal(result, Number(expected), `specified boundary case ${index + 1}`); +} +console.log(`PASS freshness native/wasm boundary cases=${rows.length}; all four states`); diff --git a/om/hive-page/fresh-site-build.log b/om/hive-page/fresh-site-build.log new file mode 100644 index 00000000..bd7b301c --- /dev/null +++ b/om/hive-page/fresh-site-build.log @@ -0,0 +1,47 @@ +warning: constant `HIVE_CSS` is never used + --> crates/site-builder/src/components/hive.rs:20:7 + | +20 | const HIVE_CSS: &str = include_str!("../../../../public/assets/hive.css"); + | ^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `site-builder` (bin "site-builder") generated 1 warning + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s + Running `target/debug/site-builder build dist` +============================================================ + AienOS Native Static Site Builder & Integrity Verifier + Engine: Pure Rust & Maud | Target: dist + Mode: build +============================================================ + [FACTS] Using facts gathered at 2026-10-16T16:29:47Z from facts.json + [BUILD] Compiling pure Rust Maud static site into: dist + [ASSETS] Synced public/ assets into dist + [ASSETS] Removed the legacy inline progress dataset from the zh-CN mirror + [STATE] Wrote status.json from the canonical layer states + [PAGE] Emitted / (index.html) + [FACTS] Published /facts.json + [PAGE] Emitted /start/ (index.html) + [PAGE] Emitted /blog (index.html) + [PAGE] Emitted /blog/aien-v3-research-plan (index.html) + [PAGE] Emitted /research/status (index.html) and /research-status.json + [PAGE] Emitted /now/ (837 ledger lines) and /now.json + [PAGE] Emitted /dash/ (7 quota accounts) + [PAGE] Emitted /agents/ (56 repositories) + [PAGE] Emitted /omega/ and /omega.json + [PAGE] Emitted /cudaplusplus/ and /cudaplusplus.json + [PAGE] Emitted /machine/ (index.html) + [PAGE] Emitted /discovery/ (index.html) + [PAGE] Emitted /owned/ (index.html) + [PAGE] Emitted /glossary/ (index.html) + [PAGE] Emitted /experiments/ (index.html) + [PAGE] Emitted /evidence/ (index.html) + [PAGE] Emitted /philosophy/ (index.html) + [SEO] Rewrote the head of 57 pages: canonical on https://www.aienos.com, cards, hreflang, JSON-LD, markdown mirrors + [GEN] sitemap.xml (57 urls), sitemap.md, AGENTS.md, robots.txt (26 named agents), feed.xml, now/feed.xml, llms.txt, llms-full.txt, data/index.json, humans.txt +------------------------------------------------------------ + Verified index.html (107026 bytes) + Every box links to GitHub: 1139 boxes across 19 pages + Integrity & Unslop Invariants: PASS + Build and Verification Completed in: 827.62ms +============================================================ diff --git a/om/hive-page/fresh-site-tests.log b/om/hive-page/fresh-site-tests.log new file mode 100644 index 00000000..6930eb26 --- /dev/null +++ b/om/hive-page/fresh-site-tests.log @@ -0,0 +1,176 @@ + Compiling site-builder v0.1.0 (/tmp/hive-wasm/crates/site-builder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 1.02s + Running unittests src/main.rs (target/debug/deps/site_builder-2fef39780c42351d) + +running 168 tests +test collector::tests::physical_lines_handle_empty_unterminated_and_binary_blobs ... ok +test collector::tests::daily_boundaries_use_chicago_rather_than_utc_including_daylight_saving_time ... ok +test collector::tests::repository_names_follow_the_project_rule ... ok +test collector::tests::blob_batches_are_read_in_order_and_malformed_batches_refused ... ok +test collector::tests::timestamps_parse_and_print_like_javascript ... ok +test collector::tests::measurement_boundaries_keep_named_tests_and_exclude_evidence_third_party_and_symlinks ... ok +test collector::tests::the_shared_blob_set_prevents_double_counting_migrated_files_across_repositories ... ok +test collector::tests::test_path_and_extension_rules_match_the_former_regular_expressions ... ok +test components::agents::tests::rules_headings_come_from_the_published_file ... ok +test components::agents::tests::prompt_names_both_files ... ok +test components::agents::tests::every_repository_links_its_own_brief_or_says_it_has_none ... ok +test components::agents::tests::rules_hold_the_public_invariants ... ok +test components::boxlink::tests::a_link_in_the_next_box_does_not_count_for_this_one ... ok +test collector::tests::github_collections_follow_every_page_and_deduplicate_overlapping_records ... ok +test components::agents::tests::whole_system_keeps_its_real_url_and_current_label ... ok +test components::boxlink::tests::check_counts_linked_boxes ... ok +test collector::tests::the_repository_map_follows_the_move_to_aien_dev ... ok +test components::boxlink::tests::check_rejects_a_box_without_a_link ... ok +test components::boxlink::tests::check_rejects_a_link_off_github ... ok +test components::boxlink::tests::foot_is_one_anchor_to_github ... ok +test components::dash::tests::routing_sorts_rows_by_kind_and_hides_an_advisor_role_the_seats_override ... ok +test components::dash::tests::accounts_group_in_provider_order_and_bound_their_numbers ... ok +test components::dash::tests::short_times_read_as_month_day_and_clock ... ok +test components::dash::tests::rows_carrying_an_identifier_are_dropped_whole ... ok +test components::agents::tests::pagination_includes_archived_and_excludes_private_repositories ... ok +test components::cudaplusplus::tests::data_parses_and_validates ... ok +test components::footer::tests::each_footer_group_links_its_hub_first ... ok +test components::footer::tests::evidence_group_reaches_the_research_status_record ... ok +test components::footer::tests::footer_groups_follow_the_six_sections_in_order ... ok +test components::footer::tests::footer_has_no_em_or_en_dash ... ok +test components::cudaplusplus::tests::pending_work_is_never_shown_as_done ... ok +test components::cudaplusplus::tests::every_box_links_to_github ... ok +test components::cudaplusplus::tests::page_names_it_with_the_plus_signs ... ok +test components::discovery::tests::named_answer_rule_is_present ... ok +test components::discovery::tests::no_em_or_en_dashes ... ok +test components::cudaplusplus::tests::refusals ... ok +test components::discovery::tests::exam_badges_come_from_the_data ... ok +test components::cudaplusplus::tests::no_dashes_and_plain_words ... ok +test components::home_loop::tests::central_statement_leads_and_thesis_follows ... ok +test components::home_loop::tests::eight_stages_in_canonical_order ... ok +test components::home_loop::tests::no_em_or_en_dashes_in_output ... ok +test components::hive::tests::the_skeleton_declares_collapsible_branches ... ok +test components::home_loop::tests::three_questions_directly_under_the_diagram ... ok +test components::home_loop::tests::return_arrow_follows_the_last_stage ... ok +test components::home_loop::tests::yield_and_gap_are_labelled_unmeasured ... ok +test components::evidence::tests::cards_are_fresh_linked_and_clean ... ok +test components::home_loop::tests::perimeter_is_drawn_outside_the_stage_list ... ok +test components::home_loop::tests::slogan_present_after_thesis_and_before_loop ... ok +test components::discovery::tests::no_hand_written_status_words ... ok +test components::hive::tests::the_stylesheet_stays_on_the_shared_palette_and_compositor_motion ... ok +test collector::tests::a_lifted_suffix_is_still_read_as_the_same_project ... ok +test components::hubs::tests::evidence_hierarchy_is_in_order ... ok +test components::hubs::tests::evidence_hub_says_failure_is_evidence ... ok +test components::hubs::tests::evidence_hub_links_the_status_record_and_its_data ... ok +test components::hubs::tests::philosophy_hub_is_labelled_position_not_evidence ... ok +test components::hive::tests::the_scene_is_emitted_by_the_omega_program ... ok +test components::hive::tests::served_scripts_match_their_omega_generated_sha256 ... ok +test components::hubs::tests::experiments_hub_embeds_the_ladder_and_links_the_full_record ... ok +test components::hubs::tests::nav_and_hub_source_has_no_hand_written_status ... ok +test components::hubs::tests::hubs_contain_no_em_or_en_dash ... ok +test components::hubs::tests::experiments_hub_renders_the_cards_from_data ... ok +test components::hubs::tests::three_hubs_are_registered ... ok +test components::machines::tests::fraction_matches_the_inventory ... ok +test components::hubs::tests::every_hub_card_links_to_github ... ok +test components::live::tests::receipt_and_component_rows_link_to_github ... ok +test components::hubs::tests::every_hub_passes_the_build_check ... ok +test components::machines::tests::every_row_has_a_public_link ... ok +test components::hubs::tests::build_check_rejects_bad_pages ... ok +test components::machines::tests::real_data_parses_and_validates ... ok +test components::hive::tests::the_embedded_skeleton_matches_its_recorded_sha256 ... ok +test components::machine::tests::turing_formula_is_present ... ok +test components::machine::tests::research_ladder_section_renders_the_canonical_ladder ... ok +test components::navbar::tests::every_listed_language_has_its_pages_and_a_menu_link ... ok +test components::machine::tests::slogan_is_present ... ok +test components::navbar::tests::rendered_navbar_has_six_sections_in_order_before_secondary ... ok +test components::navbar::tests::navbar_has_no_em_or_en_dash ... ok +test components::navbar::tests::primary_nav_const_matches_section_21 ... ok +test components::matrix::tests::every_role_links_to_its_home_on_github ... ok +test components::now::tests::linkify_bare_urls ... ok +test components::now::tests::linkify_commit_falls_back_to_the_stream_repo_or_stays_text ... ok +test components::now::tests::empty_ledger_is_honest ... ok +test components::now::tests::linkify_commit_uses_the_repo_named_earlier_in_the_note ... ok +test components::machine::tests::gain_figure_is_never_called_yield ... ok +test components::machine::tests::today_section_renders_the_canonical_implementation_list ... ok +test components::now::tests::claude_plan_shows_what_is_left_and_how_to_give ... ok +test components::machine::tests::no_em_or_en_dashes ... ok +test components::machines::tests::rejects_missing_link_dashes_and_comparisons ... ok +test components::machines::tests::sections_render_clean ... ok +test components::now::tests::linkify_issues_and_pull_requests ... ok +test components::now::tests::linkify_evidence_folder_on_the_branch_in_the_same_note ... ok +test components::now::tests::notes_render_links_with_escaping_intact ... ok +test components::now::tests::linkify_leaves_lookalikes_alone ... ok +test components::now::tests::keeper_wears_the_dachshund ... ok +test components::now::tests::keeper_replaces_renda_in_prose_only ... ok +test components::now::tests::time_round_trips ... ok +test components::omega::tests::link_expansion ... ok +test components::now::tests::parses_and_classifies ... ok +test components::omega::tests::link_first_links_only_the_word ... ok +test components::now::tests::models_follow_the_check ... ok +test components::omega::tests::data_parses_and_validates ... ok +test components::omega::tests::page_says_what_omega_is_first ... ok +test components::now::tests::page_holds_invariants ... ok +test components::now::tests::old_lines_fold_but_stay_in_the_page ... ok +test components::omega::tests::a_pass_without_receipt_is_refused ... ok +test components::omega::tests::every_box_links_to_github ... ok +test components::omega::tests::bar_is_an_honest_checklist ... ok +test components::omega::tests::missing_rows_are_shown_not_hidden ... ok +test components::omega::tests::no_dashes_and_plain_words ... ok +test components::omega::tests::unknown_status_and_off_github_box_are_refused ... ok +test components::owned::tests::every_box_links_to_github ... ok +test collector::tests::repository_links_must_be_github_addresses ... ok +test components::machine::tests::no_hand_written_status_words ... ok +test components::navbar::tests::hand_written_pages_carry_the_same_six_links ... ok +test components::owned::tests::no_comparisons_with_other_systems ... ok +test components::owned::tests::no_em_or_en_dashes ... ok +test components::owned::tests::no_status_words_on_a_position_page ... ok +test components::owned::tests::receipts_all_point_at_github ... ok +test components::owned::tests::thesis_and_signature_are_present ... ok +test components::research::tests::the_turing_card_and_every_paper_card_link_to_github ... ok +test collector::tests::the_kernel_and_the_whole_system_are_two_projects ... ok +test components::research_status::box_tests::evidence_resolves_to_github_or_honestly_to_the_data_file ... ok +test components::research_status::tests::ladder_matches_table ... ok +test components::research_status::tests::new_implementation_rows_present_once_with_evidence ... ok +test components::research_status::tests::rendered_output_has_no_em_or_en_dash ... ok +test components::research_status::tests::homepage_lookups_never_upgrade ... ok +test components::research_status::box_tests::a_link_off_aien_dev_is_refused ... ok +test components::research_status::tests::exp_002_rows_carry_sealed_commit_pointers ... ok +test components::research_status::tests::every_table_turing_row_present_exactly_once ... ok +test components::progress::tests::progress_is_a_real_page_with_the_same_published_measurements ... ok +test components::research_status::tests::exp001_failure_is_on_the_ladder_and_its_card ... ok +test components::start::tests::has_no_em_or_en_dash ... ok +test components::research_status::tests::data_file_parses ... ok +test components::start::tests::links_the_canonical_surfaces ... ok +test components::start::tests::names_the_cross_project_boundaries ... ok +test components::research_status::tests::no_status_outside_allowed_set ... ok +test components::research_status::tests::rendered_ladder_marks_exactly_the_achieved_levels ... ok +test components::status::wording_tests::counterexample_stale_wording_is_caught ... ok +test components::status::wording_tests::experiments_note_follows_the_status_file ... ok +test facts::tests::facts_round_trip ... ok +test facts::tests::now_utc_is_rfc3339_shaped ... ok +test components::status::wording_tests::counterexample_empty_or_missing_directory_fails ... ok +test facts::tests::short_date_reads_rfc3339 ... ok +test seo::tests::attributes_parse_in_any_order ... ok +test facts::tests::clip_cuts_at_a_word ... ok +test components::status::wording_tests::counterexample_quoted_phrase_in_public_page_is_caught ... ok +test facts::tests::public_description_drops_the_bundle_path ... ok +test components::status::wording_tests::yield_claim_is_caught_per_sentence ... ok +test seo::tests::discovery_files_link_every_list_item_in_an_h2_section ... ok +test components::status::wording_tests::every_layer_row_links_to_github ... ok +test seo::tests::feeds_are_well_formed_atom ... ok +test seo::tests::every_listed_page_has_a_unique_path_and_no_dash ... ok +test components::status::wording_tests::published_status_has_no_stale_wording ... ok +test seo::tests::markdown_mirror_paths_follow_the_public_convention ... ok +test seo::tests::html_to_text_keeps_headings_links_and_drops_chrome ... ok +test seo::tests::rfc3339_round_trip ... ok +test seo::tests::sitemap_carries_alternates_only_for_mirrored_pages ... ok +test seo::tests::strip_head_keeps_title_and_drops_owned_tags ... ok +test seo::tests::robots_names_every_agent_and_the_sitemap ... ok +test tests::test_layout_rendering ... ok +test tests::test_unslop_punctuation_invariants ... ok +test seo::tests::llms_txt_follows_the_convention ... ok +test seo::tests::graph_for_a_paper_carries_the_doi ... ok +test components::research_status::tests::ty2_card_says_gain_not_yield ... ok +test components::research_status::tests::research_hypotheses_are_grouped_apart ... ok +test collector::tests::incomplete_and_inconsistent_observations_are_refused_before_publication ... ok +test components::research_status::box_tests::every_step_card_and_item_links_to_github ... ok +test tests::turing_sliders_have_accessible_names ... ok +test components::status::wording_tests::repo_has_no_stale_wording_outside_this_source_file ... ok + +test result: ok. 168 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.11s + diff --git a/om/hive-page/fresh.cases b/om/hive-page/fresh.cases new file mode 100644 index 00000000..eb5e9f6e --- /dev/null +++ b/om/hive-page/fresh.cases @@ -0,0 +1,11 @@ +# now_ms generated_ms previous_ms stale_after_ms fetch_ok expected_state +999 0 0 1000 true 0 +1000 0 0 1000 true 0 +1001 0 0 1000 true 1 +2000 2000 2000 1000 true 0 +2000 1999 2000 1000 true 2 +2000 1999 2000 1000 false 2 +2000 2000 2000 1000 false 3 +1001 0 0 1000 false 3 +0 2000 2000 1000 true 0 +2000 2000 0 1000 true 0 diff --git a/om/hive-page/fresh.om b/om/hive-page/fresh.om new file mode 100644 index 00000000..3c97ccf3 --- /dev/null +++ b/om/hive-page/fresh.om @@ -0,0 +1,18 @@ +note Scalar OSC IR v1 unit. Threshold is passed from the shared feed contract. +note Inputs are integer milliseconds; JS rounds fractional elapsed age upward, +note preserving the strict stale comparison against the integer threshold. +note Backwards source timestamps retain priority over an interrupted fetch. +fn fresh now_ms long gen_ms long prev_ms long stale_ms long fetch_ok bool to uint +if lt gen_ms prev_ms +ret uint 2 +end +if not fetch_ok +ret uint 3 +end +if gt now_ms gen_ms +if gt sub now_ms gen_ms stale_ms +ret uint 1 +end +end +ret uint 0 +end diff --git a/om/hive-page/freshness-js.om b/om/hive-page/freshness-js.om new file mode 100644 index 00000000..e5776d4e --- /dev/null +++ b/om/hive-page/freshness-js.om @@ -0,0 +1,7 @@ +note Browser hook emitted from Omega. No structural DOM writes and no Node generator. +text freshsrc "/* Seeded Omega freshness decision; JS remains the explicit load-failure fallback. */\n(() => {\n 'use strict';\n const hive = document.getElementById('~9~');\n if (!hive) return;\n let wasmFresh = null;\n function jsFresh(nowMs, generatedMs, previousMs, staleAfterMs, fetchOk) {\n if (generatedMs < previousMs) return 2;\n if (!fetchOk) return 3;\n return Math.max(0, nowMs - generatedMs) > staleAfterMs ? 1 : 0;\n }\n window.hiveFresh = (nowMs, generatedMs, previousMs, staleAfterMs, fetchOk) => {\n // Date timestamps and thresholds are integers; ceil preserves strict > for elapsed fractions.\n const values = [Math.ceil(nowMs), generatedMs, previousMs, staleAfterMs];\n const useWasm = wasmFresh && values.every(Number.isSafeInteger);\n hive.dataset.freshEngine = useWasm ? 'wasm' : 'js';\n const state = useWasm\n ? wasmFresh(...values.map(BigInt), fetchOk ? 1 : 0)\n : jsFresh(nowMs, generatedMs, previousMs, staleAfterMs, fetchOk);\n hive.dataset.freshState = String(state);\n return state;\n };\n window.hiveFreshReady = (async () => {\n try {\n const response = await fetch('/wasm/hive-fresh.wasm', { cache: 'no-cache', credentials: 'omit' });\n if (!response.ok) throw new Error('Freshness module unavailable');\n const fallback = response.clone();\n let compiled;\n try {\n compiled = await WebAssembly.instantiateStreaming(response);\n } catch (_) {\n compiled = await WebAssembly.instantiate(await fallback.arrayBuffer());\n }\n if (typeof compiled.instance.exports.fresh !== 'function') throw new Error('Freshness export unavailable');\n wasmFresh = compiled.instance.exports.fresh;\n return true;\n } catch (_) {\n wasmFresh = null;\n return false;\n }\n })();\n})();\n" +fn freshjs to void +for b ulong len freshsrc +byteput get freshsrc b +end +end diff --git a/om/hive-page/gate-fresh.sh b/om/hive-page/gate-fresh.sh new file mode 100755 index 00000000..984bbe63 --- /dev/null +++ b/om/hive-page/gate-fresh.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Host-only gate: actual AArch64 compiler path and read-only Node wasm oracle. +set -eu +cd "$(dirname "$0")/../.." +[ "$(uname -m)" = aarch64 ] || { echo 'NOT_RUN requires AArch64 Linux'; exit 3; } +B=${FRESH_GATE_OUT:-/tmp/hive-fresh-gate} +mkdir -p "$B" +nice -n 19 sh om/hive-page/check.sh +: > "$B/native.status" +i=0 +while read -r now generated previous stale ok expected; do + case "$now" in ''|'#'*) continue ;; esac + i=$((i+1)) + cat om/hive-page/fresh.om > "$B/case-$i.om" + printf 'fn main to int\nret int fresh long %s long %s long %s long %s %s\nend\n' \ + "$now" "$generated" "$previous" "$stale" "$ok" >> "$B/case-$i.om" + om/hive-page/omc < "$B/case-$i.om" > "$B/case-$i" + chmod +x "$B/case-$i" + set +e + "$B/case-$i" + rc=$? + set -e + printf '%s\n' "$rc" >> "$B/native.status" + [ "$rc" = "$expected" ] || { echo "FAIL native case $i exit=$rc expected=$expected"; exit 1; } +done < om/hive-page/fresh.cases +node om/hive-page/fresh-oracle.js public/wasm/hive-fresh.wasm om/hive-page/fresh.cases "$B/native.status" +sha256sum om/hive-page/fresh.om public/wasm/hive-fresh.wasm om/hive-page/irwasm diff --git a/om/hive-page/hive-js.om b/om/hive-page/hive-js.om index ea2ba268..82404439 100644 --- a/om/hive-page/hive-js.om +++ b/om/hive-page/hive-js.om @@ -83,10 +83,10 @@ note JavaScript renderMessages text js26 " function renderMessages() {\n if (!snapshot) return;\n const list = get('chat');\n const atEnd = list.scrollHeight - list.scrollTop - list.clientHeight < 70;\n const items = snapshot.interactions.filter(item => scope === 'all' || item.agent_id === selected)\n .slice().sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));\n const ids = new Set(items.map(item => item.id));\n let added = 0;\n for (const [messageId, entry] of messages) {\n if (!ids.has(messageId)) { entry.li.remove(); messages.delete(messageId); }\n }\n for (const item of items) {\n let entry = messages.get(item.id);\n if (!entry) {\n const li = clone('~40~');\n if (!li) return;\n entry = { li, speaker: slot(li, '~53~'), model: slot(li, '~49~'), at: slot(li, '~54~'), body: slot(li, '~55~') };\n messages.set(item.id, entry);\n added++;\n }\n const agent = records.get(item.agent_id)?.data;\n entry.li.dataset.role = item.role;\n text(entry.speaker, item.role === 'drake' ? 'Drake' : agent?.name || 'Agent identity not in the current observation');\n text(entry.model, item.role === 'drake' ? `To: ${agent?.name || 'agent not in the current observation'}` : `${item.model || 'Model unknown'} · ${item.provider || 'Provider unknown'} · ${item.runtime || 'Runtime unknown'}`);\n setTime(entry.at, item.at);\n text(entry.body, item.text);\n }\n for (const item of items) list.append(messages.get(item.id).li);\n const empty = get('chat-empty');\n empty.hidden = items.length > 0;\n text(empty, scope === 'selected' ? selected ? 'No published live messages for this agent in the current window.' : 'Choose a mission to read its published conversations.' : 'No published live conversations in this snapshot. There are no sample messages here.');\n text(get('conversation-range'), items.length ? `${items.length} messages · ${utc(items[0].at)} to ${utc(items[items.length - 1].at)} · oldest first` : 'Only real messages published after this live feed started appear here.');\n if (atEnd) { list.scrollTop = list.scrollHeight; newMessages = 0; }\n else newMessages += added;\n get('chat-latest').hidden = !newMessages;\n text(get('chat-latest'), `${newMessages} new messages · go to latest`);\n }\n\n" note JavaScript freshness -text js27 " function freshness() {\n if (!snapshot) {\n page.dataset.fresh = 'false';\n return;\n }\n const elapsed = Math.max(0, performance.now() - advancedAt);\n const age = sourceAgeAtAdvance + elapsed;\n const stale = age > snapshot.stale_after_ms;\n page.dataset.fresh = String(connected && !stale && freshnessTrusted);\n const label = !connected ? (regressed ? 'Snapshot timestamp moved backwards; last observation retained' : 'Connection interrupted; last snapshot retained') : stale ? 'Source stale; last observation retained' : !freshnessTrusted ? 'Connected; source age not verified' : 'Receiving source observations';\n text(get('connection'), label);\n text(get('freshness'), `${Math.floor(elapsed / 1000)}s since the source timestamp last advanced here. ${freshnessTrusted ? `Source age at least ${Math.floor(age / 1000)}s, using the HTTP server clock.` : 'No usable server clock received; browser time is not proof of freshness.'}`);\n }\n" +text js27 " function freshness() {\n if (!snapshot) {\n page.dataset.fresh = 'false';\n return;\n }\n const elapsed = Math.max(0, performance.now() - advancedAt);\n const age = sourceAgeAtAdvance + elapsed;\n const state = window.hiveFresh(age, 0, regressed ? 1 : 0, snapshot.stale_after_ms, connected);\n const stale = state === 1;\n page.dataset.fresh = String(state === 0 && freshnessTrusted);\n const label = state === 2 ? 'Snapshot timestamp moved backwards; last observation retained' : state === 3 ? 'Connection interrupted; last snapshot retained' : stale ? 'Source stale; last observation retained' : !freshnessTrusted ? 'Connected; source age not verified' : 'Receiving source observations';\n text(get('connection'), label);\n text(get('freshness'), `${Math.floor(elapsed / 1000)}s since the source timestamp last advanced here. ${freshnessTrusted ? `Source age at least ${Math.floor(age / 1000)}s, using the HTTP server clock.` : 'No usable server clock received; browser time is not proof of freshness.'}`);\n }\n" note JavaScript ingest -text js28 " function ingest(value, serverDate) {\n const now = performance.now();\n const generated = Date.parse(value.generated_at);\n if (snapshot && generated < Date.parse(snapshot.generated_at)) { regressed = true; throw new Error('Snapshot moved backwards'); }\n if (generated > latestGenerated) {\n regressed = false;\n latestGenerated = generated;\n advancedAt = now;\n const server = Date.parse(serverDate || '');\n freshnessTrusted = Number.isFinite(server) && generated <= server + ~61~;\n sourceAgeAtAdvance = freshnessTrusted ? Math.max(0, server - generated) : 0;\n }\n snapshot = value;\n received = new Date().toISOString();\n connected = true;\n freshness();\n const currentIds = new Set(value.agents.map(agent => agent.id));\n const messageAgents = new Set(value.interactions.map(item => item.agent_id));\n for (const agent of value.agents) {\n let record = records.get(agent.id);\n if (!record) {\n record = makeRecord(agent, Boolean(agent.parent_id && records.has(agent.parent_id)));\n records.set(agent.id, record);\n }\n record.data = agent;\n record.absentAt = null;\n }\n for (const [agentId, record] of records) {\n if (!currentIds.has(agentId)) {\n if (record.absentAt === null) record.absentAt = now;\n const hasPresentChildren = value.agents.some(agent => agent.parent_id === agentId);\n if (now - record.absentAt > 30000 && selected !== agentId && !hasPresentChildren && !messageAgents.has(agentId)) {\n record.li.remove(); records.delete(agentId);\n }\n }\n }\n setTime(get('source-time'), value.generated_at);\n setTime(get('fetch-time'), received);\n text(get('counts'), `${value.coverage.agents} agents observed across ${value.coverage.roots} root missions.`);\n get('coverage').dataset.complete = String(value.coverage.complete);\n text(get('coverage'), `${value.coverage.complete ? 'Reported coverage' : 'Partial coverage'}: ${value.coverage.label}. ${value.coverage.notice}`);\n reconcileTree();\n if (!selected) {\n let fragment = '';\n try { fragment = location.hash.startsWith('#agent=') ? decodeURIComponent(location.hash.slice(7)) : ''; } catch (_) { /* Invalid fragments do not select a node. */ }\n selected = records.has(fragment) ? fragment : orderedRecords()[0]?.[0].data.id || null;\n }\n if (selected) choose(selected, false);\n else renderMessages();\n }\n" +text js28 " function ingest(value, serverDate) {\n const now = performance.now();\n const generated = Date.parse(value.generated_at);\n if (snapshot && window.hiveFresh(generated, generated, Date.parse(snapshot.generated_at), value.stale_after_ms, true) === 2) { regressed = true; throw new Error('Snapshot moved backwards'); }\n if (generated > latestGenerated) {\n regressed = false;\n latestGenerated = generated;\n advancedAt = now;\n const server = Date.parse(serverDate || '');\n freshnessTrusted = Number.isFinite(server) && generated <= server + ~61~;\n sourceAgeAtAdvance = freshnessTrusted ? Math.max(0, server - generated) : 0;\n }\n snapshot = value;\n received = new Date().toISOString();\n connected = true;\n freshness();\n const currentIds = new Set(value.agents.map(agent => agent.id));\n const messageAgents = new Set(value.interactions.map(item => item.agent_id));\n for (const agent of value.agents) {\n let record = records.get(agent.id);\n if (!record) {\n record = makeRecord(agent, Boolean(agent.parent_id && records.has(agent.parent_id)));\n records.set(agent.id, record);\n }\n record.data = agent;\n record.absentAt = null;\n }\n for (const [agentId, record] of records) {\n if (!currentIds.has(agentId)) {\n if (record.absentAt === null) record.absentAt = now;\n const hasPresentChildren = value.agents.some(agent => agent.parent_id === agentId);\n if (now - record.absentAt > 30000 && selected !== agentId && !hasPresentChildren && !messageAgents.has(agentId)) {\n record.li.remove(); records.delete(agentId);\n }\n }\n }\n setTime(get('source-time'), value.generated_at);\n setTime(get('fetch-time'), received);\n text(get('counts'), `${value.coverage.agents} agents observed across ${value.coverage.roots} root missions.`);\n get('coverage').dataset.complete = String(value.coverage.complete);\n text(get('coverage'), `${value.coverage.complete ? 'Reported coverage' : 'Partial coverage'}: ${value.coverage.label}. ${value.coverage.notice}`);\n reconcileTree();\n if (!selected) {\n let fragment = '';\n try { fragment = location.hash.startsWith('#agent=') ? decodeURIComponent(location.hash.slice(7)) : ''; } catch (_) { /* Invalid fragments do not select a node. */ }\n selected = records.has(fragment) ? fragment : orderedRecords()[0]?.[0].data.id || null;\n }\n if (selected) choose(selected, false);\n else renderMessages();\n }\n" note JavaScript poll text js29 " async function poll() {\n if (requestActive) return;\n requestActive = true;\n const began = performance.now();\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), ~62~);\n try {\n const response = await fetch('/hive/live.json', { cache: 'no-store', credentials: 'omit', signal: controller.signal, headers: { Accept: 'application/json' } });\n if (!response.ok || !response.headers.get('content-type')?.toLowerCase().includes('application/json')) throw new Error('Public source unavailable');\n ingest(validate(await response.json()), response.headers.get('date'));\n } catch (_) {\n connected = false;\n if (!snapshot) text(get('connection'), 'Telemetry unavailable');\n freshness();\n } finally {\n clearTimeout(timeout);\n requestActive = false;\n setTimeout(poll, Math.max(0, ~59~ - (performance.now() - began)));\n }\n }\n" @@ -97,6 +97,7 @@ text js30 " function motion() {\n const off = paused || reducedMotion.matche fn javascript to void flush put target 0 3 +freshjs js_prelude js_text js_utc diff --git a/om/hive-page/hive.js.sha256 b/om/hive-page/hive.js.sha256 index 243fd9c7..940bfc2a 100644 --- a/om/hive-page/hive.js.sha256 +++ b/om/hive-page/hive.js.sha256 @@ -1 +1 @@ -00c7fb2a312c49ae0ca6f43370551d4be80681060cdf7d2173ba13196412baa0 ../../public/js/hive.js +c3324b0f120fb61ad659f7ee52226443cd6200fa275895eea3eb5592a0cfa0aa ../../public/js/hive.js diff --git a/om/hive-page/irwasm b/om/hive-page/irwasm new file mode 100755 index 00000000..93e31dea Binary files /dev/null and b/om/hive-page/irwasm differ diff --git a/om/hive-page/irwasm.provenance b/om/hive-page/irwasm.provenance new file mode 100644 index 00000000..858e1884 --- /dev/null +++ b/om/hive-page/irwasm.provenance @@ -0,0 +1,15 @@ +repository https://github.com/aien-dev/omega-mv +source_commit a84f1e80020dede868b103605484529a9395ad69 +source_path seed/wasm/irwasm.om +source_sha256 8dc7bf602eb882e26a18b9e2dc4cacdd3ad68827215e71874b14c4acb237ccf8 +source_draft https://github.com/aien-dev/omega-mv/pull/787 +build_compiler om/hive-page/omc +build_compiler_sha256 734f0a39319fbfa930bcc62cb30dbf06d47d78e126372b74f5baf478e6126b61 +build_command nice -n 19 om/hive-page/omc < omega-mv/seed/wasm/irwasm.om > irwasm +build_compile_exit 0 +binary_sha256 2d235a70c39ac1461a09c41e10e058d962b767ae83893cdcfc693ef6c47182e6 +binary_platform Linux aarch64 +upstream_build_compiler_sha256 befb8199db8c4bca188a494dfaac2a6f0ee5c36fcea11188c75666c55fce8a1d +upstream_binary_sha256 2d235a70c39ac1461a09c41e10e058d962b767ae83893cdcfc693ef6c47182e6 +note Existing site omc pin compiles irwasm to bytes identical to the upstream PR build. No pin bump. +note IR translator and WebAssembly writer are seeded Omega. No C or Node in build/generation. diff --git a/om/hive-page/irwasm.sha256 b/om/hive-page/irwasm.sha256 new file mode 100644 index 00000000..2fbe48ed --- /dev/null +++ b/om/hive-page/irwasm.sha256 @@ -0,0 +1 @@ +2d235a70c39ac1461a09c41e10e058d962b767ae83893cdcfc693ef6c47182e6 diff --git a/public/.crumb b/public/.crumb index 17e7a352..549f9104 100644 --- a/public/.crumb +++ b/public/.crumb @@ -19,8 +19,8 @@ "purpose": "Published generated project measurements with pinned sources" }, { - "digest": "7f4aa48fce22d67842cbb6a5732ea43a5102b4ee99d0fa378dd8ea17015f9a4d", - "last_commit": "c3a98f3", + "digest": "5bb5fc31dcab4f00df8b8ce9a6ff5ea7c166a8bd60c7d0975e1a074c6bae99ff", + "last_commit": "85062b8", "name": "js", "purpose": "Browser interactions using public data only" }, @@ -41,17 +41,23 @@ "last_commit": "dffee39", "name": "research", "purpose": "Public static research or licensing pages using the shared website navigation" + }, + { + "digest": "450b0fd70eed766066851eafc12c60541d3826f9a0067c43a341b98b74cda748", + "last_commit": "4fb264f", + "name": "wasm", + "purpose": "Committed seeded Omega generated WebAssembly assets and hash sidecars; regenerate through om/hiv" } ], - "children_root": "sha256:012b4ab5a8711ef6202da518256e291bb8db0186476fae2b69e5bc58586a0d77", - "compiled_at": "2026-10-26T13:48:37Z", + "children_root": "sha256:dc1b12f22274d2f1488d41bd6d50b85632c685e0a257ea865b218075ab04840a", + "compiled_at": "2026-10-26T14:15:16Z", "compiler": "crumb-compile/1", - "digest": "sha256:7c947afeb823c511664920fb83102de90d9fac5f27725bce0b11fa91876e5725", + "digest": "sha256:34e8ff8461c8fa693c7b23fe08fcd95cc68d2e81be780dd060b8eba24b04d537", "evidence_files": 1, "evidence_root": "sha256:1f6f4b14373405a3b91d0e7aa6ba11d0dd332d4543ad01421a5451cca3e7de0c", - "files": 119, - "generated_at_commit": "2166a329491815ba1850e969d05f1286895172ac", - "source_tree": "sha256:6b8c9a359e3a24fef1b347eda6c649d7ed0bb40411644c5108dd7f19753930d7" + "files": 121, + "generated_at_commit": "85062b8a4eacd115d15cf3532aa05ede1c306218", + "source_tree": "sha256:db9553182420e874a0a046109ee4d737642b701a750467bc36dacab5b88d5451" } }, "invariants": [ diff --git a/public/js/.crumb b/public/js/.crumb index e614a995..bec53b56 100644 --- a/public/js/.crumb +++ b/public/js/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-26T13:48:37Z", + "compiled_at": "2026-10-26T14:15:16Z", "compiler": "crumb-compile/1", - "digest": "sha256:7f4aa48fce22d67842cbb6a5732ea43a5102b4ee99d0fa378dd8ea17015f9a4d", + "digest": "sha256:5bb5fc31dcab4f00df8b8ce9a6ff5ea7c166a8bd60c7d0975e1a074c6bae99ff", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 5, - "generated_at_commit": "2166a329491815ba1850e969d05f1286895172ac", - "source_tree": "sha256:5c6af58ab456826e47896536afdf4e50d526a25dd0ffbef0619f57395e5f098b" + "generated_at_commit": "85062b8a4eacd115d15cf3532aa05ede1c306218", + "source_tree": "sha256:a8695e71705d4c0e742a0d9b281b3058d3e908552a05614272b1001dba237d2e" } }, "invariants": [ diff --git a/public/js/hive.js b/public/js/hive.js index 0c38cc0f..8c6892a8 100644 --- a/public/js/hive.js +++ b/public/js/hive.js @@ -1,3 +1,45 @@ +/* Seeded Omega freshness decision; JS remains the explicit load-failure fallback. */ +(() => { + 'use strict'; + const hive = document.getElementById('hive'); + if (!hive) return; + let wasmFresh = null; + function jsFresh(nowMs, generatedMs, previousMs, staleAfterMs, fetchOk) { + if (generatedMs < previousMs) return 2; + if (!fetchOk) return 3; + return Math.max(0, nowMs - generatedMs) > staleAfterMs ? 1 : 0; + } + window.hiveFresh = (nowMs, generatedMs, previousMs, staleAfterMs, fetchOk) => { + // Date timestamps and thresholds are integers; ceil preserves strict > for elapsed fractions. + const values = [Math.ceil(nowMs), generatedMs, previousMs, staleAfterMs]; + const useWasm = wasmFresh && values.every(Number.isSafeInteger); + hive.dataset.freshEngine = useWasm ? 'wasm' : 'js'; + const state = useWasm + ? wasmFresh(...values.map(BigInt), fetchOk ? 1 : 0) + : jsFresh(nowMs, generatedMs, previousMs, staleAfterMs, fetchOk); + hive.dataset.freshState = String(state); + return state; + }; + window.hiveFreshReady = (async () => { + try { + const response = await fetch('/wasm/hive-fresh.wasm', { cache: 'no-cache', credentials: 'omit' }); + if (!response.ok) throw new Error('Freshness module unavailable'); + const fallback = response.clone(); + let compiled; + try { + compiled = await WebAssembly.instantiateStreaming(response); + } catch (_) { + compiled = await WebAssembly.instantiate(await fallback.arrayBuffer()); + } + if (typeof compiled.instance.exports.fresh !== 'function') throw new Error('Freshness export unavailable'); + wasmFresh = compiled.instance.exports.fresh; + return true; + } catch (_) { + wasmFresh = null; + return false; + } + })(); +})(); /* Public snapshot consumer. * * The page skeleton, including every template, is generated by om/hive-page/hive.om @@ -469,16 +511,17 @@ } const elapsed = Math.max(0, performance.now() - advancedAt); const age = sourceAgeAtAdvance + elapsed; - const stale = age > snapshot.stale_after_ms; - page.dataset.fresh = String(connected && !stale && freshnessTrusted); - const label = !connected ? (regressed ? 'Snapshot timestamp moved backwards; last observation retained' : 'Connection interrupted; last snapshot retained') : stale ? 'Source stale; last observation retained' : !freshnessTrusted ? 'Connected; source age not verified' : 'Receiving source observations'; + const state = window.hiveFresh(age, 0, regressed ? 1 : 0, snapshot.stale_after_ms, connected); + const stale = state === 1; + page.dataset.fresh = String(state === 0 && freshnessTrusted); + const label = state === 2 ? 'Snapshot timestamp moved backwards; last observation retained' : state === 3 ? 'Connection interrupted; last snapshot retained' : stale ? 'Source stale; last observation retained' : !freshnessTrusted ? 'Connected; source age not verified' : 'Receiving source observations'; text(get('connection'), label); text(get('freshness'), `${Math.floor(elapsed / 1000)}s since the source timestamp last advanced here. ${freshnessTrusted ? `Source age at least ${Math.floor(age / 1000)}s, using the HTTP server clock.` : 'No usable server clock received; browser time is not proof of freshness.'}`); } function ingest(value, serverDate) { const now = performance.now(); const generated = Date.parse(value.generated_at); - if (snapshot && generated < Date.parse(snapshot.generated_at)) { regressed = true; throw new Error('Snapshot moved backwards'); } + if (snapshot && window.hiveFresh(generated, generated, Date.parse(snapshot.generated_at), value.stale_after_ms, true) === 2) { regressed = true; throw new Error('Snapshot moved backwards'); } if (generated > latestGenerated) { regressed = false; latestGenerated = generated; diff --git a/public/wasm/.crumb b/public/wasm/.crumb new file mode 100644 index 00000000..8edda1a7 --- /dev/null +++ b/public/wasm/.crumb @@ -0,0 +1,20 @@ +{ + "extensions": { + "generated": { + "children": [], + "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "compiled_at": "2026-10-26T14:15:16Z", + "compiler": "crumb-compile/1", + "digest": "sha256:450b0fd70eed766066851eafc12c60541d3826f9a0067c43a341b98b74cda748", + "evidence_files": 0, + "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "files": 2, + "generated_at_commit": "85062b8a4eacd115d15cf3532aa05ede1c306218", + "source_tree": "sha256:0013d1eb9f985ff5168d1e7d766076c0f936313fbecceaa714728f63fe4dfe73" + } + }, + "layer": "public", + "name": "wasm", + "purpose": "Committed seeded Omega generated WebAssembly assets and hash sidecars; regenerate through om/hive-page/check.sh", + "schema_version": "1.0.0" +} diff --git a/public/wasm/hive-fresh.wasm b/public/wasm/hive-fresh.wasm new file mode 100644 index 00000000..f73cc9b9 Binary files /dev/null and b/public/wasm/hive-fresh.wasm differ diff --git a/public/wasm/hive-fresh.wasm.sha256 b/public/wasm/hive-fresh.wasm.sha256 new file mode 100644 index 00000000..8f78a95f --- /dev/null +++ b/public/wasm/hive-fresh.wasm.sha256 @@ -0,0 +1 @@ +af9e1fb0d9e736949b2aa83c0bf978ac2d98f37428a8507176abaa1dd50b777b ../../public/wasm/hive-fresh.wasm