interplane.Get Omega
Read in your language

aien

aien-dev/aien

Brought by drakestapleton

branch main Branches Tags History

aien / scripts / goal_microjobs / recovery-build.sh

13 lines · 566 bytes Raw Blame History
1#!/bin/sh
2# Migration-only build adapter, aien-dev/aien#22; runtime decisions are Omega.
3set -eu
4HERE=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)
5OUT=${1:?output binary}
6SOURCE=${2:-$HERE/src/goal_microjobs/recovery.om}
7[ "$(sha256sum < "${OMEGA_OMC:?pinned omc}" | cut -c1-64)" = 2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f ] || { echo 'BLOCKED: omc hash mismatch' >&2; exit 3; }
8T=$(mktemp -d)
9trap 'rm -rf "$T"' EXIT HUP INT TERM
10"$OMEGA_OMC" < "$SOURCE" > "$T/recovery"
11chmod +x "$T/recovery"
12mv "$T/recovery" "$OUT"
13sha256sum "$OUT"