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/tests/one_layer/acceptance/ola.sh # 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 / tests / one_layer / acceptance / ola.sh` 265 lines ยท 15201 bytes Raw Blame History 1 #!/usr/bin/env bash 2 # SPDX-License-Identifier: Apache-2.0 3 # Copyright 2026 Drake Stapleton (AIEN / aien-dev) 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 17 # tests/one_layer/acceptance/ola.sh -- one-layer hostile acceptance harness (stage 1 omega#443, stage 2 omega#445). 18 # Contracts: HARNESS_INTERFACE.md (v1) and HARNESS_INTERFACE_V2.md (v2) next to this file; their sha256 19 # are pinned in RULES and checked here. 20 # 21 # ola.sh score v1, unchanged (evidence/ONE-LAYER-1) 22 # ola.sh score-v2 v2 corpus with kind oscir (evidence/ONE-LAYER-2) 23 # ola.sh tasks-public only requirement + prompt of every task 24 # ola.sh experiment score candidate sets, no LABELS, RUN VALID|INVALID 25 # ola.sh tasks-check experiment with no sets: references only 26 # 27 # Refuses a dirty git tree. Writes evidence/ONE-LAYER-<1|2>/runs// (never overwritten) with 28 # verdicts.txt, probes.log, score.txt (+ replay/verdicts.txt, meta.txt) and content-addressed receipts 29 # under evidence/ONE-LAYER-<1|2>/receipts/. Steps: 30 # 1 clean tree, contract hash, build ola + ola_runner from this commit 31 # 2 ola untar: sealed hash check, member validation, extract WITHOUT corpus/LABELS (private dir) 32 # 3 pass A: every case run in the sandbox (ola_runner), verdict + receipt 33 # 4 pass B: a second clean extraction and execution; verdicts must be byte-identical 34 # 5 LABELS extracted only now; isolation probes (each blocked AND logged, each with a control; 35 # the evidence probe aims at a private copy of verdicts.txt, the real one is made read-only) 36 # 6 rules and harness re-hashed (unchanged), tally -> score.txt (GATE PASS|FAIL) 37 # experiment (V2 section 3.3) follows the same steps with sets// instead of one verdicts.txt, 38 # the task references as set `references`, the read_labels probe aimed at a hidden/reference.osc, and 39 # score.txt ending RUN VALID|INVALID. 40 # Untracked output allowed by the clean-tree check: evidence/ONE-LAYER-1/(runs|receipts)/ and 41 # evidence/ONE-LAYER-2/(runs|receipts|generations)/ (generations = the exp445 driver's request logs). 42 # Selftest-only knobs (each forces GATE FAIL / RUN INVALID): OLA_ALLOW_DIRTY=1, OLA_EVIDENCE_ROOT=. 43 # OLA_PROBE_ONLY (a probe subset for `ola probes`) is cleared here and also forces GATE FAIL; tally 44 # independently requires every probe in probes.log. The sandbox is aarch64-only: other machines are refused. 45 set -euo pipefail 46 HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 47 ROOT="$(cd "$HERE/../../.." && pwd)" 48 cd "$ROOT" 49 50 die() { echo "ola.sh: $*" >&2; exit 2; } 51 kv() { awk -F= -v k="$1" '$1 == k { print substr($0, length(k) + 2); exit }' "$HERE/RULES"; } 52 sha() { sha256sum "$1" | awk '{print $1}'; } 53 54 # harness identity: every tracked file of the harness and its make fragment, in name order 55 harness_sha() { 56 { git ls-files -z -- tests/one_layer/acceptance mk/one-layer-acceptance.mk | sort -z | xargs -0 sha256sum; } | sha256sum | awk '{print $1}' 57 } 58 59 # common start of every scoring command: sets clean, commit, rules_sha, harness, bin, evid ($1 = 1|2) 60 prepare() { 61 [ "$(uname -m)" = aarch64 ] || die "the sandbox (seccomp allow-list) is aarch64-only; refusing to score on $(uname -m)" 62 # 1. clean tree: no change to tracked files, nothing untracked except earlier harness output 63 clean=1 64 local dirty 65 dirty="$(git status --porcelain=v1 --untracked-files=all | 66 grep -Ev '^\?\? evidence/(ONE-LAYER-1/(runs|receipts)|ONE-LAYER-2/(runs|receipts|generations))/' || true)" 67 if [ -n "$dirty" ]; then 68 if [ "${OLA_ALLOW_DIRTY:-0}" = 1 ]; then clean=0; echo "ola.sh: DIRTY tree allowed for a selftest: the gate cannot pass" >&2 69 else echo "$dirty" | head -20 >&2; die "refusing a dirty git tree (commit or stash first)"; fi 70 fi 71 evid="$ROOT/evidence/ONE-LAYER-$1" 72 if [ -n "${OLA_EVIDENCE_ROOT:-}" ]; then evid="$OLA_EVIDENCE_ROOT"; clean=0; fi 73 if [ -n "${OLA_PROBE_ONLY:-}" ]; then 74 echo "ola.sh: OLA_PROBE_ONLY is a selftest knob: cleared, every probe runs, the gate cannot pass" >&2 75 clean=0 76 fi 77 unset OLA_PROBE_ONLY 78 [ "$(sha "$HERE/HARNESS_INTERFACE.md")" = "$(kv interface_sha256)" ] || die "HARNESS_INTERFACE.md does not match the pinned v1 hash" 79 if [ "$1" = 2 ]; then 80 [ "$(sha "$HERE/HARNESS_INTERFACE_V2.md")" = "$(kv interface_v2_sha256)" ] || die "HARNESS_INTERFACE_V2.md does not match the pinned v2 hash" 81 fi 82 commit="$(git rev-parse HEAD)" 83 [ "$clean" = 1 ] || commit="$commit-dirty" 84 make -s PHYSICS_DIR=/nonexistent PHYSICS_LOCK_CHECK=0 one-layer-acceptance-tools >&2 85 bin="$ROOT/${OUT_DIR:-build}/one_layer" # mk/one-layer-acceptance.mk: OLA_DIR = $(OUT_DIR)/one_layer 86 rules_sha="$(sha "$HERE/RULES")" 87 harness="$(harness_sha)" 88 # 2. private directory (never inside the repo, never visible to a candidate) 89 priv="$(mktemp -d "${TMPDIR:-/tmp}/ola-priv.XXXXXXXX")" # global: the EXIT trap removes it 90 chmod 700 "$priv" 91 trap 'rm -rf "${priv:-}"' EXIT 92 mkdir "$priv/A" "$priv/B" "$priv/scratch" "$priv/keys" "$priv/outside" 93 head -c 32 /dev/urandom > "$priv/keys/decoy.key" # a key-shaped secret the probes try to read 94 } 95 96 write_meta() { # write_meta 97 { 98 echo "commit=$commit"; echo "harness_sha256=$harness"; echo "rules_sha256=$rules_sha" 99 echo "corpus_sha256=$1"; echo "time_ms=$(kv time_ms)"; echo "mem_mb=$(kv mem_mb)" 100 } > "$priv/meta" 101 cp "$priv/meta" "$2/meta.txt" 102 } 103 104 new_run() { # new_run -> sets run, run_id 105 run_id="$(date -u +%Y%m%dT%H%M%SZ)-${1:0:12}-$$" 106 mkdir -p "$evid/runs" "$evid/receipts" 107 run="$evid/runs/$run_id" 108 mkdir "$run" || die "run directory $run exists: never overwritten" 109 } 110 111 probes() { # probes