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 / research / atemporal / at0 / evaluator / run.sh

218 lines · 20544 bytes Raw Blame History
1#!/bin/sh
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# AT-0 Agent 4 qualification runner. Builds the evaluator, runs its own
18# red-before-green self-tests, the public corpus, the isolation-gate controls,
19# and (when a candidate is supplied) the candidate conformance and verification
20# tests. Writes results/qualification.json (machine-readable) and prints a table.
21#
22# sh run.sh [--self-only]
23# Candidate hooks (environment; each unset hook leaves its tests BLOCKED_NO_CANDIDATE):
24# AT0_CANDIDATE_CASE_TOOL command that takes a case path and prints AT0_CASE_OK <id>
25# (exit 0) or AT0_CASE_REFUSED <code> on stderr (exit 2)
26# AT0_CANDIDATE_RUN command that takes a case path and writes an
27# AT0_RESULT file to standard output (engine + oracle run)
28# AT0_CANDIDATE_OBJECTS space-separated compute objects/binaries for the isolation gate
29# AT0_HIDDEN_DIR directory holding the hidden case files (default ~/at0-private/agent4)
30# Statuses: PASS FAIL INCONCLUSIVE NOT_RUN BLOCKED_NO_CANDIDATE. UNISOLATED is a
31# property of the whole run (ISOLATION_REPORT.md), never a test status.
32set -u
33cd "$(dirname "$0")"
34T=build/at0-eval
35OUT=results
36TMP=${TMPDIR:-/tmp}/at0e-run-$$
37mkdir -p "$OUT" "$TMP"
38trap 'rm -rf "$TMP"' EXIT
39JSONL="$TMP/tests.jsonl"; : > "$JSONL"
40npass=0; nfail=0; ninc=0; nblk=0; nnr=0
41esc() { printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' | tr '\n\t' ' ' | cut -c1-400; }
42rec() { # id class status reason
43 case "$3" in PASS) npass=$((npass+1));; FAIL) nfail=$((nfail+1));; INCONCLUSIVE) ninc=$((ninc+1));; BLOCKED_NO_CANDIDATE) nblk=$((nblk+1));; *) nnr=$((nnr+1));; esac
44 printf '{"id":"%s","class":"%s","status":"%s","reason":"%s"}\n' "$1" "$2" "$3" "$(esc "$4")" >> "$JSONL"
45 printf '%-44s %-8s %-20s %s\n' "$1" "$2" "$3" "$(printf '%s' "$4" | cut -c1-70)"
46}
47SELF_ONLY=0; [ "${1:-}" = "--self-only" ] && SELF_ONLY=1
48
49# ---- build ----
50if make -s all >"$TMP/build.log" 2>&1; then rec SELF-BUILD build PASS "cc -std=c11 -Wall -Wextra -Werror -pedantic"; else rec SELF-BUILD build FAIL "$(tail -1 "$TMP/build.log")"; cat "$TMP/build.log"; exit 1; fi
51if make -s asan >"$TMP/asan.log" 2>&1; then rec SELF-BUILD-ASAN build PASS "ASan/UBSan build"; else rec SELF-BUILD-ASAN build INCONCLUSIVE "$(tail -1 "$TMP/asan.log")"; fi
52
53# ---- known-answer test (AT0_CASE_V1 section 6, AT0_FREEZE.md) ----
54K=cases/positive/P1-kat-ideal-qubit-n4.case
55fsha=$(sha256sum "$K" | cut -c1-64)
56kat=$($T case "$K" --detail 2>&1 | tr '\n' ' ')
57if [ "$fsha" = ed16c95c89bf312b0fbf95a4cd43bc352daa138954fabad78d8a170cd35b4e81 ] \
58 && printf '%s' "$kat" | grep -q 'AT0_CASE_OK 3cf4ca4f882b5b9691ddcd905e65e15010855adcd2be200e19ebc3184655b44d' \
59 && printf '%s' "$kat" | grep -q 'acceptance_id a13fb02dd674b8042ef8c0a197f03d58768709f782ba59cd26545eef6d41a228'; then
60 rec SELF-KAT-DIGESTS codec PASS "file, case_id and acceptance_id equal the published digests"
61else rec SELF-KAT-DIGESTS codec FAIL "$kat"; fi
62if $T gen name=at0-kat-ideal-qubit-n4 | cmp -s - "$K"; then rec SELF-GEN-ROUNDTRIP codec PASS "generator reproduces the example byte for byte"; else rec SELF-GEN-ROUNDTRIP codec FAIL "byte difference"; fi
63sh_out=$($T shadow "$K")
64if printf '%s\n' "$sh_out" | grep -q '^t0 *0.250000000 1.000000000 0.500000000 0.500000000' \
65 && printf '%s\n' "$sh_out" | grep -q '^t1 *0.250000000 0.500000000 1.000000000 0.500000000' \
66 && printf '%s\n' "$sh_out" | grep -q '^t2 *0.250000000 0.000000000 0.500000000 0.500000000' \
67 && printf '%s\n' "$sh_out" | grep -q '^t3 *0.250000000 0.500000000 0.000000000 0.500000000' \
68 && printf '%s\n' "$sh_out" | grep -q 'kernel_dim 2 .* povm_exact_identity 1'; then
69 rec SELF-SHADOW-HAND-TABLE shadow PASS "shadow oracle reproduces the section 6 hand table"
70else rec SELF-SHADOW-HAND-TABLE shadow FAIL "table differs"; fi
71
72# ---- public corpus: every case gives its manifest response ----
73mm=0; mt=0
74while IFS="$(printf '\t')" read -r path cls want; do
75 case "$path" in '#'*|'') continue;; esac
76 mt=$((mt+1))
77 got=$($T case "cases/$path" 2>&1 | head -1 | sed 's/ [0-9a-f]\{64\}$//')
78 [ "$got" = "$want" ] || { mm=$((mm+1)); rec "CORPUS-$(basename "$path" .case)" "$cls" FAIL "want [$want] got [$got]"; }
79done < cases/MANIFEST.tsv
80[ $mm = 0 ] && rec SELF-CORPUS-MANIFEST corpus PASS "$mt cases give their expected response" || rec SELF-CORPUS-MANIFEST corpus FAIL "$mm of $mt differ"
81
82# ---- hand derivations agree with shadow + exact checker (honest fixture -> expectation_met YES) ----
83bad=0; n=0
84for f in cases/positive/*.case cases/negative/*.case cases/hidden/*.case; do
85 n=$((n+1)); $T synth "$f" > "$TMP/h.result" 2>/dev/null || { bad=$((bad+1)); rec "DERIV-$(basename "$f" .case)" derivation FAIL "synth failed"; continue; }
86 em=$(grep '^expectation_met' "$TMP/h.result" | awk '{print $2}')
87 v=$($T result "$TMP/h.result" --case "$f" | head -1 | awk '{print $2}')
88 [ "$em" = YES ] && [ "$v" = PASS ] || { bad=$((bad+1)); rec "DERIV-$(basename "$f" .case)" derivation FAIL "expectation_met=$em verify=$v codes=$(grep '^failure_codes' "$TMP/h.result" | cut -d' ' -f2)"; }
89done
90[ $bad = 0 ] && rec SELF-DERIVATIONS derivation PASS "$n positive/negative cases: expected codes equal the derived codes" || rec SELF-DERIVATIONS derivation FAIL "$bad of $n disagree"
91
92# ---- red before green: every planted defect must be caught on a case where it bites ----
93# case:mutant pairs; see FAILURE_TAXONOMY.md section 3 for why each pair discriminates
94MATRIX="P1-kat-ideal-qubit-n4:axis_swap P1-kat-ideal-qubit-n4:y_sign_swap P1-kat-ideal-qubit-n4:conjugate_bug P1-kat-ideal-qubit-n4:reversed_reference
95P1-kat-ideal-qubit-n4:dephased_state P1-kat-ideal-qubit-n4:kernel_dim_wrong P1-kat-ideal-qubit-n4:residual_over_bound P1-kat-ideal-qubit-n4:nonfinite_hidden
96P1-kat-ideal-qubit-n4:evidence_corrupt P1-kat-ideal-qubit-n4:verdict_id_corrupt P1-kat-ideal-qubit-n4:case_id_altered P1-kat-ideal-qubit-n4:tolerance_altered
97P1-kat-ideal-qubit-n4:binding_rebound P1-kat-ideal-qubit-n4:times_reversed P1-kat-ideal-qubit-n4:oracle_is_engine P1-kat-ideal-qubit-n4:bound_none_nonzero
98P1-kat-ideal-qubit-n4:label_status_wrong P1-kat-ideal-qubit-n4:placeholder_with_values P1-kat-ideal-qubit-n4:crlf P1-kat-ideal-qubit-n4:trailing_space
99P1e-x-axis-rotation:conjugate_bug P1e-x-axis-rotation:y_sign_swap P1e-x-axis-rotation:axis_swap P1g-complex-psi-yplus:conjugate_bug P2-tilted-h0:axis_swap P5-large-rationals:conjugate_bug P5-large-rationals:axis_swap P5-large-rationals:hardcoded_table P1e-x-axis-rotation:reversed_reference P1g-complex-psi-yplus:reversed_reference
100P1b-ideal-n4-tau8-m8:hardcoded_table P1d-ref-offset-t2:hardcoded_table P1c-ideal-n6-m6:hardcoded_table N4-wrong-weight-2:wrong_weight_hidden N4b-wrong-weight-5:wrong_weight_hidden
101N2-half-covered:verdict_forged N3-broken-clock-tau3:verdict_forged N1-uncovered-spectrum:verdict_forged N6-zero-kernel-component:verdict_forged N7-unreachable-labels:verdict_forged N7-unreachable-labels:label_claimed_defined"
102esc_n=0; tot=0
103for pair in $MATRIX; do
104 c=${pair%%:*}; m=${pair##*:}; f=$(ls cases/*/"$c".case); tot=$((tot+1))
105 $T synth "$f" "$m" > "$TMP/m.result" 2>/dev/null || { esc_n=$((esc_n+1)); rec "MUTANT-$c-$m" mutant FAIL "synth failed"; continue; }
106 st=$($T result "$TMP/m.result" --case "$f" | head -1 | awk '{print $2}')
107 [ "$st" = FAIL ] || { esc_n=$((esc_n+1)); rec "MUTANT-$c-$m" mutant FAIL "defect not graded FAIL (status ${st:-none})"; }
108done
109# documented INCONCLUSIVE pairs (the defect is invisible on that case by construction)
110for pair in P1-kat-ideal-qubit-n4:hardcoded_table P1-kat-ideal-qubit-n4:wrong_weight_hidden P1-kat-ideal-qubit-n4:verdict_forged P1f-y-axis-rotation:conjugate_bug P2b-h0-shift-control:hardcoded_table P2-tilted-h0:reversed_reference N7-unreachable-labels:label_status_wrong P1-kat-ideal-qubit-n4:label_claimed_defined; do
111 c=${pair%%:*}; m=${pair##*:}; f=$(ls cases/*/"$c".case)
112 $T synth "$f" "$m" > "$TMP/m.result" 2>/dev/null; st=$($T result "$TMP/m.result" --case "$f" | head -1 | awk '{print $2}')
113 rec "MUTANT-BLIND-$c-$m" mutant INCONCLUSIVE "defect indistinguishable from truth on this case by construction (status $st); covered by another pair"
114done
115[ $esc_n = 0 ] && rec SELF-MUTANTS mutant PASS "$tot discriminating case/mutant pairs all caught" || rec SELF-MUTANTS mutant FAIL "$esc_n of $tot escaped"
116# dirty-tree and unknown contract commit are INCONCLUSIVE by design
117for m in dirty_tree contract_commit_wrong; do
118 $T synth "$K" "$m" > "$TMP/m.result"; st=$($T result "$TMP/m.result" --case "$K" | head -1 | awk '{print $2}')
119 [ "$st" = INCONCLUSIVE ] && rec "MUTANT-$m" mutant PASS "graded INCONCLUSIVE as designed (not citable)" || rec "MUTANT-$m" mutant FAIL "graded $st, expected INCONCLUSIVE"
120done
121# sanitizer run of the same paths
122if [ -x build/at0-eval-asan ]; then
123 ok=1
124 build/at0-eval-asan case "$K" >/dev/null 2>"$TMP/a.err" || ok=0
125 for m in evidence_corrupt crlf binding_rebound hardcoded_table; do build/at0-eval-asan synth "$K" "$m" > "$TMP/m.result" 2>>"$TMP/a.err" || ok=0; build/at0-eval-asan result "$TMP/m.result" --case "$K" >/dev/null 2>>"$TMP/a.err"; [ $? -gt 3 ] && ok=0; done
126 for f in cases/refuse/*.case; do build/at0-eval-asan case "$f" >/dev/null 2>>"$TMP/a.err"; [ $? -gt 2 ] && ok=0; done
127 grep -q 'ERROR: \(AddressSanitizer\|UndefinedBehaviorSanitizer\)\|runtime error' "$TMP/a.err" && ok=0
128 [ $ok = 1 ] && rec SELF-ASAN sanitizer PASS "codec, refusals, synth and verify clean under ASan/UBSan" || rec SELF-ASAN sanitizer FAIL "$(grep -m1 'ERROR\|runtime error' "$TMP/a.err")"
129else rec SELF-ASAN sanitizer NOT_RUN "no sanitizer binary"; fi
130
131# ---- isolation gate controls ----
132gate_build=1
133${CC:-cc} -std=c11 -Wall -Wextra -Werror -pedantic -O2 -D_POSIX_C_SOURCE=200809L -c gates/hidden_clock_mutant.c -o build/hidden_clock_mutant.o 2>"$TMP/g.err" || gate_build=0
134${CC:-cc} -std=c11 -Wall -Wextra -Werror -pedantic -O2 -c gates/clean_control.c -o build/clean_control.o 2>>"$TMP/g.err" || gate_build=0
135if [ $gate_build = 0 ]; then rec GATE-ISOLATION-MUTANT-CAUGHT gate NOT_RUN "control object failed to compile: $(head -1 "$TMP/g.err")"; rec GATE-ISOLATION-CLEAN-PASSES gate NOT_RUN "control object failed to compile"; else
136if sh gates/isolation.sh build/hidden_clock_mutant.o >/dev/null 2>&1; then rec GATE-ISOLATION-MUTANT-CAUGHT gate FAIL "hidden clock_gettime mutant passed the gate"; else rec GATE-ISOLATION-MUTANT-CAUGHT gate PASS "hidden-clock mutant rejected"; fi
137if sh gates/isolation.sh build/clean_control.o >/dev/null 2>&1; then rec GATE-ISOLATION-CLEAN-PASSES gate PASS "clean arithmetic object accepted"; else rec GATE-ISOLATION-CLEAN-PASSES gate FAIL "clean object rejected"; fi
138fi
139# hardened-libc alias control (Agent 5 finding, omega#358): __fread_chk / __open_2 must be read as fread / open
140if ${CC:-cc} -std=c11 -Wall -Wextra -Werror -pedantic -O2 -c gates/fortified_read_mutant.c -o build/fortified_read_mutant.o 2>"$TMP/g2.err"; then
141 if sh gates/isolation.sh build/fortified_read_mutant.o >/dev/null 2>&1; then rec GATE-ISOLATION-FORTIFIED-READ-CAUGHT gate FAIL "__fread_chk/__open_2 mutant passed the gate"; else rec GATE-ISOLATION-FORTIFIED-READ-CAUGHT gate PASS "hardened-libc file-read aliases (__fread_chk, __open_2) rejected"; fi
142else rec GATE-ISOLATION-FORTIFIED-READ-CAUGHT gate NOT_RUN "control object failed to compile: $(head -1 "$TMP/g2.err")"; fi
143# Rust controls (D5, omega#358): the oracle compute crate alone, plus a std::time mutant and an extern "C" clock mutant.
144ORACLE_SRC=../oracle/src/at0
145if command -v rustc >/dev/null 2>&1 && command -v ar >/dev/null 2>&1 && [ -d "$ORACLE_SRC" ]; then
146 RI="$TMP/riso"; rm -rf "$RI"; rbuild=1
147 RFL="--edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -C panic=abort -D warnings --crate-type lib --crate-name at0"
148 for m in clean m1 m2; do mkdir -p "$RI/$m" && cp -r "$ORACLE_SRC" "$RI/$m/at0"; done
149 printf '\npub fn hidden_clock() -> u64 { std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(0) }\n' >> "$RI/m1/at0/mod.rs"
150 printf '\n#[repr(C)] pub struct Ts { s: i64, n: i64 }\nextern "C" { fn clock_gettime(c: i32, t: *mut Ts) -> i32; }\npub fn hidden_clock() -> i64 { let mut t = Ts { s: 0, n: 0 }; unsafe { clock_gettime(0, &mut t); } t.n }\n' >> "$RI/m2/at0/mod.rs"
151 for m in clean m1 m2; do ( cd "$RI/$m" && rustc $RFL at0/mod.rs -o lib.rlib && ar x lib.rlib ) >"$TMP/r.err" 2>&1 || rbuild=0; done
152 if [ $rbuild = 0 ]; then rec GATE-ISOLATION-RUST-STD-TIME-CAUGHT gate NOT_RUN "rust control failed to build: $(head -1 "$TMP/r.err")"; rec GATE-ISOLATION-RUST-EXTERN-CLOCK-CAUGHT gate NOT_RUN "rust control failed to build"; rec GATE-ISOLATION-RUST-CLEAN-PASSES gate NOT_RUN "rust control failed to build"
153 else
154 if sh gates/isolation.sh "$RI"/m1/*.o >/dev/null 2>&1; then rec GATE-ISOLATION-RUST-STD-TIME-CAUGHT gate FAIL "Rust std::time::SystemTime mutant passed the gate (D5)"; else rec GATE-ISOLATION-RUST-STD-TIME-CAUGHT gate PASS "Rust std::time::SystemTime mutant rejected (v0/legacy mangling and demangled forms scanned)"; fi
155 if sh gates/isolation.sh "$RI"/m2/*.o >/dev/null 2>&1; then rec GATE-ISOLATION-RUST-EXTERN-CLOCK-CAUGHT gate FAIL "Rust extern clock_gettime mutant passed the gate"; else rec GATE-ISOLATION-RUST-EXTERN-CLOCK-CAUGHT gate PASS "Rust extern \"C\" clock_gettime mutant rejected"; fi
156 if sh gates/isolation.sh "$RI"/clean/*.o >/dev/null 2>&1; then rec GATE-ISOLATION-RUST-CLEAN-PASSES gate PASS "oracle compute crate alone ($(ls "$RI"/clean/*.o | wc -l | tr -d ' ') rlib members) accepted"; else rec GATE-ISOLATION-RUST-CLEAN-PASSES gate FAIL "oracle compute crate rejected: $(sh gates/isolation.sh "$RI"/clean/*.o 2>&1 | grep -m1 FAIL)"; fi
157 fi
158else rec GATE-ISOLATION-RUST-STD-TIME-CAUGHT gate NOT_RUN "rustc, ar or ../oracle/src/at0 not available"; fi
159
160# ---- hidden set commitment ----
161# hidden set: revealed at candidate freeze (omega#358, 2026-10-09); the committed digests must still match the published files
162if [ -d cases/hidden ]; then
163 if (cd cases/hidden && grep -v "^#" ../../HIDDEN_COMMITMENT.txt | sha256sum -c --quiet - >/dev/null 2>&1); then rec HIDDEN-COMMITMENT hidden PASS "published hidden cases match the digests committed before the candidate freeze (identity only, not non-access)"; else rec HIDDEN-COMMITMENT hidden FAIL "digest mismatch or missing hidden case"; fi
164else rec HIDDEN-COMMITMENT hidden FAIL "cases/hidden missing"; fi
165
166# ---- candidate ----
167if [ $SELF_ONLY = 1 ]; then :; else
168if [ -n "${AT0_CANDIDATE_CASE_TOOL:-}" ]; then
169 mm=0; mt=0
170 while IFS="$(printf '\t')" read -r path cls want; do
171 case "$path" in '#'*|'') continue;; esac
172 mt=$((mt+1)); got=$($AT0_CANDIDATE_CASE_TOOL "cases/$path" 2>&1 | head -1 | sed 's/ [0-9a-f]\{64\}$//')
173 [ "$got" = "$want" ] || { mm=$((mm+1)); rec "CAND-CODEC-$(basename "$path" .case)" "$cls" FAIL "want [$want] got [$got]"; }
174 done < cases/MANIFEST.tsv
175 [ $mm = 0 ] && rec CAND-CODEC-CONFORMANCE candidate PASS "$mt public cases answered exactly as the contract requires" || rec CAND-CODEC-CONFORMANCE candidate FAIL "$mm of $mt differ"
176 if [ -d cases/hidden ]; then hm=0; for f in cases/hidden/H*.case; do got=$($AT0_CANDIDATE_CASE_TOOL "$f" 2>&1 | head -1 | cut -d' ' -f1); [ "$got" = AT0_CASE_OK ] || hm=$((hm+1)); done; [ $hm = 0 ] && rec CAND-CODEC-HIDDEN candidate PASS "hidden cases accepted" || rec CAND-CODEC-HIDDEN candidate FAIL "$hm hidden cases refused"; fi
177else rec CAND-CODEC-CONFORMANCE candidate BLOCKED_NO_CANDIDATE "AT0_CANDIDATE_CASE_TOOL unset"; fi
178if [ -n "${AT0_CANDIDATE_RUN:-}" ]; then
179 for f in cases/positive/*.case cases/negative/*.case cases/hidden/*.case; do
180 id=$(basename "$f" .case)
181 $AT0_CANDIDATE_RUN "$f" > "$TMP/c.result" 2>"$TMP/c.err"; rc=$?
182 if [ $rc -ne 0 ]; then rec "CAND-RUN-$id" candidate FAIL "runner exit $rc : $(head -1 "$TMP/c.err")"; continue; fi
183 out=$($T result "$TMP/c.result" --case "$f" --json); st=$(printf '%s' "$out" | sed 's/.*"status":"\([A-Z]*\)".*/\1/')
184 em=$(grep '^expectation_met' "$TMP/c.result" | awk '{print $2}')
185 if [ "$st" = PASS ] && [ "$em" = YES ]; then rec "CAND-VERIFY-$id" candidate PASS "independent verification agrees; expectation met"
186 elif [ "$st" = PASS ]; then rec "CAND-VERIFY-$id" candidate FAIL "record is honest but expectation_met=$em: the physics did not do what the case expects"
187 else rec "CAND-VERIFY-$id" candidate "$st" "$(printf '%s' "$out" | sed 's/.*"findings":\[\(.*\)\]}/\1/' | cut -c1-200)"; fi
188 cp "$TMP/c.result" "$OUT/candidate-$id.result"
189 done
190 # wall-clock / environment independence: same case twice, different TZ and a pause
191 f=$K; TZ=UTC $AT0_CANDIDATE_RUN "$f" > "$TMP/r1.result" 2>/dev/null; sleep 2; TZ=Asia/Tokyo AT0_EVALUATOR_NOISE=1 $AT0_CANDIDATE_RUN "$f" > "$TMP/r2.result" 2>/dev/null
192 v1=$(grep '^verdict_id' "$TMP/r1.result"); v2=$(grep '^verdict_id' "$TMP/r2.result"); e1=$(grep '^evidence_digest' "$TMP/r1.result"); e2=$(grep '^evidence_digest' "$TMP/r2.result")
193 b1=$(sed -n '/^begin values/,/^end values/p' "$TMP/r1.result" | sha256sum); b2=$(sed -n '/^begin values/,/^end values/p' "$TMP/r2.result" | sha256sum)
194 if [ -n "$v1" ] && [ "$v1" = "$v2" ] && [ "$b1" = "$b2" ] && [ "$e1" != "$e2" ]; then rec CAND-WALLCLOCK-INDEPENDENCE control PASS "verdict_id and values identical across time/TZ; evidence digests differ"
195 elif [ -n "$v1" ] && [ "$e1" = "$e2" ]; then rec CAND-WALLCLOCK-INDEPENDENCE control FAIL "evidence digests equal: run times not recorded or record reused"
196 else rec CAND-WALLCLOCK-INDEPENDENCE control FAIL "verdict or values changed with wall clock or environment"; fi
197else rec CAND-VERIFY candidate BLOCKED_NO_CANDIDATE "AT0_CANDIDATE_RUN unset"; rec CAND-WALLCLOCK-INDEPENDENCE control BLOCKED_NO_CANDIDATE "AT0_CANDIDATE_RUN unset"; fi
198if [ -n "${AT0_CANDIDATE_OBJECTS:-}" ]; then
199 if sh gates/isolation.sh $AT0_CANDIDATE_OBJECTS > "$TMP/iso.log" 2>&1; then rec CAND-ISOLATION gate PASS "no clock/random/env/file/net/process/thread symbol in candidate compute objects"; else rec CAND-ISOLATION gate FAIL "$(grep -m1 FAIL "$TMP/iso.log")"; fi
200else rec CAND-ISOLATION gate BLOCKED_NO_CANDIDATE "AT0_CANDIDATE_OBJECTS unset"; fi
201fi
202
203# ---- summary ----
204omega_commit=$(git -C ../../../.. rev-parse HEAD 2>/dev/null || echo unknown)
205clean=$(git -C ../../../.. status --porcelain 2>/dev/null | grep -q . && echo NO || echo YES)
206now=$(date -u +%Y-%m-%dT%H:%M:%SZ)
207overall=PASS; [ $nfail -gt 0 ] && overall=FAIL
208{
209printf '{\n "program": "AT-0",\n "agent": "Agent 4 independent adversarial evaluator",\n "generated_utc": "%s",\n' "$now"
210printf ' "omega_commit": "%s",\n "omega_tree_clean": "%s",\n "contract_commit": "044c9d11256d8642f80eedd42cbae8763faf63f5",\n "charter_commit": "00e9f2308666f74e58f524b177b2a31eccdc69ba",\n "spec_draft_commit": "0efd1a14cbdf117bc694b556bb61d031cf80c8f9",\n' "$omega_commit" "$clean"
211printf ' "result_contract_version_expected": 2,\n "isolation": "UNISOLATED",\n "isolation_note": "single host, single user account, shared filesystem; hidden cases are withheld but their non-access cannot be proven (ISOLATION_REPORT.md)",\n'
212printf ' "verdict_scope": "software conformance of the AT-0 implementation to the frozen contracts; no scientific discovery verdict is awarded or implied",\n'
213printf ' "summary": {"pass": %d, "fail": %d, "inconclusive": %d, "blocked_no_candidate": %d, "not_run": %d, "self_test_overall": "%s"},\n' $npass $nfail $ninc $nblk $nnr "$overall"
214printf ' "tests": [\n'; sed '$!s/$/,/' "$JSONL" | sed 's/^/ /'; printf ' ]\n}\n'
215} > "$OUT/qualification.json"
216echo "---- summary: pass=$npass fail=$nfail inconclusive=$ninc blocked_no_candidate=$nblk not_run=$nnr (self-test overall $overall; isolation UNISOLATED)"
217echo "written $OUT/qualification.json"
218[ $nfail = 0 ]