interplane.Get Omega
Read in your language

aegis-runtime-mv

Native Rust agent runtime: Axum WebSocket/SSE/REST gateway, heartbeat scheduler, dependency-aware task workflow, SQLite storage. Attachment of AienOS. Pre-alpha.

Brought by drakestapleton

branch main Branches Tags History

aegis-runtime-mv / om / gate.sh

34 lines · 1667 bytes Raw Blame History
1#!/bin/sh
2set -eu
3OMC="${OMC:-/home/drakestapleton/canon/omega-mv/seed/out/omc}"
4[ -x "$OMC" ] || { echo "NOT_RUN: set OMC to seed/out/omc"; exit 3; }
5SCR=$(mktemp -d)
6trap "rm -rf $SCR" EXIT
7
8build_det() {
9 name=$1; shift
10 cat "$@" > "$SCR/$name.om"
11 "$OMC" < "$SCR/$name.om" > "$SCR/$name.1" 2> "$SCR/$name.err" || { echo "FAIL compile $name"; cat "$SCR/$name.err"; exit 1; }
12 "$OMC" < "$SCR/$name.om" > "$SCR/$name.2" 2>> "$SCR/$name.err" || { echo "FAIL compile2 $name"; exit 1; }
13 cmp -s "$SCR/$name.1" "$SCR/$name.2" || { echo "FAIL nondeterministic $name"; exit 1; }
14 chmod +x "$SCR/$name.1"
15 echo "BUILD_OK $name bytes=$(wc -c < "$SCR/$name.1") sha256=$(sha256sum "$SCR/$name.1" | awk "{print \$1}")"
16}
17
18build_det aegis_test om/om2.om om/sha2.om om/dag.om om/heartbeat.om om/policy.om om/journal.om om/gateway.om om/test.om
19"$SCR/aegis_test.1"
20
21build_det aegis_main om/om2.om om/sha2.om om/dag.om om/heartbeat.om om/policy.om om/journal.om om/gateway.om om/main.om
22printf "INIT 4 10 5\nTOKEN aegis_operator_secret_token_012345\nREQ GET /health -\nVERIFY\nQUIT\n" | "$SCR/aegis_main.1"
23
24# Planted mutant control: weaken unconfigured-token refusal -> aegis_test MUST fail
25sed "s/ret POL_DENY_NO_TOKEN_CONFIG/ret POL_ALLOW/" om/policy.om > "$SCR/policy_mut.om"
26cat om/om2.om om/sha2.om om/dag.om om/heartbeat.om "$SCR/policy_mut.om" om/journal.om om/gateway.om om/test.om > "$SCR/mut.om"
27"$OMC" < "$SCR/mut.om" > "$SCR/mut.bin" || { echo "FAIL mutant failed to compile"; exit 1; }
28chmod +x "$SCR/mut.bin"
29if "$SCR/mut.bin" >/dev/null 2>&1; then
30 echo "FAIL mutant escaped"
31 exit 1
32fi
33echo "MUTANT_CAUGHT policy_bypass_refused"
34echo "AEGIS-OM-GATE PASS"