interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core-mv / docs / campaigns / next-phase-1 / selftest-v7.sh

61 lines · 4082 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# NEXT-PHASE-1 v7 self-test of rows-v7.jq: the S3 committed flag (VERDICT-v6.md Section 2).
18# Shell + jq only. Exit 0 only if every case gives the expected result.
19# Runs v6_evidence on synthetic S3 reports, splices the resulting s3.committed into the
20# frozen good evidence (tests-v6/good-*.evidence.json, read only) and scores the rows.
21# Case 1 also runs the v6 module to show the defect (red) before the v7 fix (green).
22set -u
23HERE=$(cd "$(dirname "$0")" && pwd)
24T=$HERE/tests-v6
25V7=$(cat "$HERE/rows-v7.jq"); V6=$(cat "$HERE/rows-v6.jq")
26pass=0 fail=0
27check() { if [ "$2" = "$3" ]; then pass=$((pass + 1)); echo "ok $1 (got: ${3:-none})"
28 else fail=$((fail + 1)); echo "FAIL $1: expected [${2}] got [${3}]"; fi; }
29# committed_of MODULE REPORT_JSON -> the s3.committed value v6_evidence produces
30committed_of() { jq -nc "$1"'
31v6_evidence(null; '"$2"'; null; null; null; null; null; null; []; {}; "/ws"; null; null; null; "") | .s3.committed'; }
32# fails_with MODULE LAUNCH COMMITTED_JSON -> failing rows of the good evidence with s3.committed set
33fails_with() { jq -c --argjson c "$3" '.s3.committed = $c' "$T/good-$2.evidence.json" \
34 | jq -r "$1"'
35v6_rows | [.[] | select(.result != "PASS") | "\(.row)\(if .result == "NOT_RUN" then ":NOT_RUN" else "" end)"] | join(",")'; }
36
37# 1. refused, uncommitted run: report says committed=false
38check "v6 module turns false into null (the defect)" "null" "$(committed_of "$V6" '{committed: false}')"
39check "v7 keeps false as false" "false" "$(committed_of "$V7" '{committed: false}')"
40check "v6 module: N1 uncommitted FAILs N1-C,N1-B (defect shown)" "N1-C,N1-B" "$(fails_with "$V6" N1 "$(committed_of "$V6" '{committed: false}')")"
41check "v6 module: N2 uncommitted FAILs N2-F,N2-C (defect shown)" "N2-F,N2-C" "$(fails_with "$V6" N2 "$(committed_of "$V6" '{committed: false}')")"
42check "v7: N1 refused uncommitted run scores PASS" "" "$(fails_with "$V7" N1 "$(committed_of "$V7" '{committed: false}')")"
43check "v7: N2 refused uncommitted run scores PASS" "" "$(fails_with "$V7" N2 "$(committed_of "$V7" '{committed: false}')")"
44# 2. committed=true scores as before
45check "v7 keeps true as true" "true" "$(committed_of "$V7" '{committed: true}')"
46check "v7: N1 committed run is not REFUSED" "N1-C,N1-B" "$(fails_with "$V7" N1 "$(committed_of "$V7" '{committed: true}')")"
47check "v7: N2 committed run is not REFUSED" "N2-F,N2-C" "$(fails_with "$V7" N2 "$(committed_of "$V7" '{committed: true}')")"
48for k in T4 T5 R1; do
49 check "v7: $k good evidence with committed=true still all PASS" "" "$(fails_with "$V7" $k "$(committed_of "$V7" '{committed: true}')")"
50 check "v6 and v7 agree on $k with committed=true" "$(fails_with "$V6" $k true)" "$(fails_with "$V7" $k true)"
51done
52# 3. missing field is null, not false, and never makes a negative launch pass
53check "v7: report without committed gives null" "null" "$(committed_of "$V7" '{}')"
54check "v7: null report gives null" "null" "$(committed_of "$V7" 'null')"
55check "v7: N1 with missing committed is not PASS" "N1-C,N1-B" "$(fails_with "$V7" N1 "$(committed_of "$V7" '{}')")"
56check "v7: N2 with missing committed is not PASS" "N2-F,N2-C" "$(fails_with "$V7" N2 "$(committed_of "$V7" '{}')")"
57# 4. the module has no other boolean read through // (explicit false must survive)
58check "no .committed read through //" "0" "$(grep -c 'committed // ' "$HERE/rows-v7.jq")"
59
60echo "selftest-v7: $pass passed, $fail failed"
61[ "$fail" -eq 0 ]