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/aienos.com/blob/main/om/allen-page/check.sh # aienos.com Source of www.aienos.com, served from my own hardware Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienos.com / om / allen-page / check.sh` 61 lines ยท 2524 bytes Raw Blame History 1 #!/bin/sh 2 # Regenerate the /allen/ skeleton and browser script using the pinned arm64 omc. 3 # The compiler is the one vendored for the Hive page; its pin is recorded once, 4 # in ../hive-page/omc.sha256. CI on x86_64 checks the committed artifacts 5 # against their recorded hashes. OMEGA_OMC overrides the compiler path, never its pin. 6 # OMEGA_ACCEPT_CHANGE=1 accepts rewritten artifacts; otherwise stale output exits 4. 7 # Exit 2: missing compiler; 3: wrong pin; 4: stale artifact rewritten; 8 # 5: nondeterministic output; 6: empty output. Compile/run failures propagate. 9 set -eu 10 cd "$(dirname "$0")" 11 omc=${OMEGA_OMC:-$PWD/../hive-page/omc} 12 pin=$(tr -d ' \n' < ../hive-page/omc.sha256) 13 if [ ! -f "$omc" ]; then 14 printf 'No compiler at %s; set OMEGA_OMC to the pinned omc (%s)\n' "$omc" "$pin" >&2 15 exit 2 16 fi 17 have=$(sha256sum "$omc" | cut -d' ' -f1) 18 if [ "$have" != "$pin" ]; then 19 printf 'Compiler sha256 mismatch: recorded %s, found %s\n' "$pin" "$have" >&2 20 exit 3 21 fi 22 work=$(mktemp -d "${TMPDIR:-/tmp}/allen-page.XXXXXX") 23 trap 'rm -rf "$work"' EXIT HUP INT TERM 24 # One executable shares the contract between markup (fd 1) and script (fd 3). 25 # Concatenation composes Omega units; it does not implement generation in shell. 26 cat contract.om allen.om allen-js.om > "$work/allen.om" 27 "$omc" < "$work/allen.om" > "$work/allen" 28 chmod +x "$work/allen" 29 "$work/allen" > "$work/first.html" 3> "$work/first.allen.js" 30 "$work/allen" > "$work/second.html" 3> "$work/second.allen.js" 31 stale=0 32 publish() { 33 first=$1 34 second=$2 35 artifact=$3 36 sidecar=$4 37 if ! cmp -s "$first" "$second"; then 38 printf '%s: generator output differs between runs\n' "$artifact" >&2 39 exit 5 40 fi 41 if [ ! -s "$first" ]; then 42 printf '%s: generator wrote nothing\n' "$artifact" >&2 43 exit 6 44 fi 45 if [ ! -f "$artifact" ] || ! cmp -s "$artifact" "$first"; then 46 stale=1 47 fi 48 cp "$first" "$artifact" 49 hash=$(sha256sum "$artifact" | cut -d' ' -f1) 50 printf '%s %s\n' "$hash" "$artifact" > "$sidecar" 51 printf '%s %s bytes sha256 %s\n' "$artifact" "$(wc -c < "$artifact" | tr -d ' ')" "$hash" 52 } 53 publish "$work/first.html" "$work/second.html" main.html main.html.sha256 54 publish "$work/first.allen.js" "$work/second.allen.js" ../../public/js/allen.js allen.js.sha256 55 printf 'omc sha256 %s\n' "$have" 56 if [ "$stale" = 1 ]; then 57 printf 'Generated artifacts were rewritten; commit them with their Omega sources\n' >&2 58 if [ "${OMEGA_ACCEPT_CHANGE:-0}" != 1 ]; then 59 exit 4 60 fi 61 fi