interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / evidence / AT1 / replication-macbook / 20261010T051932Z-ff81466-mac / tools / p2-hidden.sh

54 lines · 3665 bytes Raw Blame History
1#!/bin/bash
2# AT-1 Agent 7 phase 2: hidden cases through engine, oracle and evaluator (detached; never killed)
3export LC_ALL=C TZ=UTC
4W=$HOME/at1-replication/run-ff814662a19c
5H=$HOME/at1-hidden
6LOG=$W/receipt-commands.log
7cd "$W"
8r() { echo "\$ $*" >> "$LOG"; "$@"; rc=$?; echo "exit $rc" >> "$LOG"; return $rc; }
9# 0. the hidden set still equals the posted commitment
10( cd "$H/cases" && for f in $(ls | sort); do shasum -a 256 "$f"; done ) > hidden-manifest.recomputed
11cmp hidden-manifest.recomputed "$H/MANIFEST" && echo "manifest-unchanged" >> "$LOG"
12echo "commitment $(shasum -a 256 "$H/MANIFEST" | cut -c1-64)" >> "$LOG"
13# 1. separate fresh clone of the freeze commit for the hidden-run binaries
14rm -rf hsrc
15r git clone -q --no-hardlinks omega hsrc
16r git -C hsrc checkout -q --detach ff814662a19cf7da6b183f3e667c6c921e0ead21
17AT1=$W/hsrc/research/atemporal/at1
18( cd "$AT1/oracle" && r sh build.sh ) > hidden-build-oracle.log 2>&1
19( cd "$AT1/model" && r make CC=cc ) > hidden-build-model.log 2>&1
20( cd "$AT1/evaluator" && r make all ) > hidden-build-evaluator.log 2>&1
21echo "hsrc status lines $(git -C hsrc status --porcelain | wc -l | tr -d ' ')" >> "$LOG"
22MODEL=$AT1/model/build/at1-model; ORACLE=$AT1/oracle/target/at1-oracle; EVAL=$AT1/evaluator/build/at1-eval
23shasum -a 256 "$MODEL" "$ORACLE" "$EVAL" > hidden-binaries.sha256
24# 2. case folder: the 21 hidden files by class, plus the public worked example (KAT, T9 probe)
25C=$W/hidden-run/cases; rm -rf "$W/hidden-run"; mkdir -p "$C/positive" "$C/negative" "$C/refuse"
26printf '# path\tclass\texpected tool response\n' > "$C/MANIFEST.tsv"
27cp "$AT1/evaluator/cases/positive/P2-kat-rotated-level-n4.case" "$C/positive/"
28printf 'positive/P2-kat-rotated-level-n4.case\tP2\tAT1_CASE_OK\n' >> "$C/MANIFEST.tsv"
29tail -n +2 "$H/cases/EXPECTED.tsv" | while IFS="$(printf '\t')" read -r f cls kind out codes chk cid aid att; do
30 case "$cls" in P*) sub=positive;; N*) sub=negative;; *) sub=refuse;; esac
31 cp "$H/cases/$f" "$C/$sub/$f"
32 if [ "$kind" = REFUSED ]; then exp="AT1_CASE_REFUSED $out"; else exp=AT1_CASE_OK; fi
33 printf '%s/%s\t%s\t%s\n' "$sub" "$f" "$cls" "$exp" >> "$C/MANIFEST.tsv"
34done
35# 3. provenance for the engine shim (same lines run.sh writes; host names the Mac)
36CLEAN=YES; [ -n "$(git -C hsrc status --porcelain)" ] && CLEAN=NO
37P=$W/hidden-run/prov.static
38{ echo "source_repo aien-dev/omega"; echo "source_commit ff814662a19cf7da6b183f3e667c6c921e0ead21"; echo "source_tree_clean $CLEAN"
39 echo "contract_commit cbe4c8ed88d28bb96d5209327ecd30aa9cddaf7a"; echo "engine_sha256 $(shasum -a 256 "$MODEL" | cut -c1-64)"
40 echo "oracle_repo aien-dev/omega"; echo "oracle_commit ff814662a19cf7da6b183f3e667c6c921e0ead21"; echo "oracle_sha256 $(shasum -a 256 "$ORACLE" | cut -c1-64)"
41 echo "build_cc $(cc --version | head -1) (engine); $(rustc --version) (oracle)"
42 echo "build_flags engine: model/Makefile CFLAGS -lm; oracle: oracle/build.sh"
43 echo "host $(hostname) $(sw_vers -productName) $(sw_vers -productVersion) $(uname -m)"; } > "$P"
44export AT1_MODEL_BIN=$MODEL AT1_ORACLE_BIN=$ORACLE AT1_PROV_STATIC=$P
45INT=$AT1/integration
46# 4. the evaluator's own qualify over the hidden folder
47cd "$AT1/evaluator"
48r ./build/at1-eval qualify --cases "$C" --engine "sh $INT/engine_shim.sh {case} {out}" --oracle "sh $INT/oracle_shim.sh {case} {out}" --out "$W/hidden-run/out" > "$W/hidden-run/qualify.console.log" 2>&1
49echo $? > "$W/hidden-run/qualify.exit"
50# 5. values against the committed exact tables
51cd "$W"
52r "$H/phase2/cmpvals" "$H/cases/DETAILS.txt" "$W/hidden-run/out/spliced" 1e-12 > "$W/hidden-run/VALUES_VS_DETAILS.tsv" 2>&1
53echo $? > "$W/hidden-run/cmpvals.exit"
54echo done > "$W/hidden-run/DONE"