Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/apps/aienos-site/om/hive-page/freshness-js.om # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / apps / aienos-site / om / hive-page / freshness-js.om` 7 lines ยท 1996 bytes Raw Blame History 1 note Browser hook emitted from Omega. No structural DOM writes and no Node generator. 2 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" 3 fn freshjs to void 4 for b ulong len freshsrc 5 byteput get freshsrc b 6 end 7 end