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
aien-sovereign-core-mv / docs / campaigns / open-model-qwen3 / g6-gate.sh
| 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 | # OPEN-MODEL-QWEN3 v7 gate G6 (SPEC-v7-DRAFT.md Section 2): the dry run must prove the harness, not the model. |
| 18 | # g6-gate.sh DRY_RESULTS.jsonl DECLARATION.json DRY_RUN_BASE LAUNCH... exit 0 = G6 PASS, 1 = G6 FAIL (reasons on stdout) |
| 19 | # For every launch named on the command line (D1 D2 D3 for v7): |
| 20 | # 1. $BASE/$L/run.json exists; steps S1, S2, S7, S8 are ok; the daemon logged "ALLEN: engaged". |
| 21 | # 2. Always required (product rows; independent of the model's text): every declared row of the launch whose id ends in |
| 22 | # -PRE -OPR -BE -PIN, and "v1 Identity", "v1 Human interventions: rescues", "v1 Containment: speculation", |
| 23 | # "v1 Correctness: recall". |
| 24 | # 2a. -DEC and -MEAS are product rows too, but by the frozen v5 rules an attempt the product ended by timeout has no decoding |
| 25 | # and no token ids, so both rows FAIL whenever the model was too slow for the task budget (v7 dry attempt 2, D3). They are |
| 26 | # required unless $BASE/$L/s3-report.json shows an attempt with outcome "timeout"; then they are listed NOT CHECKED (model |
| 27 | # timeout) with a NOTE line. The timeout itself is a model finding for the campaign, not a harness fault. |
| 28 | # 3. If the launch committed (S4 and S5 ok), every other declared row of the launch must be PASS too, except the four |
| 29 | # model-behaviour rows -RQ<k>, -CUT, -F, -SB (v6 failure class (a)), which are listed but may FAIL. "v1 Memory" is in this |
| 30 | # group: a refused reply writes no memory record, so the row FAILs on every uncommitted launch (v6 class (a); v7 dry attempt 2 |
| 31 | # D1 and D3) and only a committed launch can show it. If the launch did not commit, only 1, 2 and 2a apply and the rest is |
| 32 | # listed as NOT CHECKED (model). |
| 33 | # 4. A required row missing from the results is a FAIL. |
| 34 | set -u |
| 35 | RES=${1:?DRY_RESULTS.jsonl} DECL=${2:?DECLARATION.json} BASE=${3:?DRY_RUN_BASE}; shift 3 |
| 36 | [ $# -gt 0 ] || { echo "g6-gate: give the launch ids" >&2; exit 2; } |
| 37 | fail=0 |
| 38 | say() { echo "$*"; } |
| 39 | for L in "$@"; do |
| 40 | rj=$BASE/$L/run.json |
| 41 | if [ ! -f "$rj" ]; then say "FAIL $L no run.json"; fail=1; continue; fi |
| 42 | for s in S1 S2 S7 S8; do |
| 43 | [ "$(jq -r --arg s $s '[.steps[] | select(.step == $s)][0].ok // false' "$rj")" = true ] || { say "FAIL $L step $s not ok"; fail=1; } |
| 44 | done |
| 45 | jq -e '(.allen.engaged_log_line // "") | startswith("ALLEN: engaged")' "$rj" >/dev/null || { say "FAIL $L daemon did not log ALLEN: engaged"; fail=1; } |
| 46 | committed=$(jq -r '([.steps[] | select(.step == "S4" or .step == "S5") | .ok] | length == 2 and all)' "$rj") |
| 47 | timeouts=0 |
| 48 | [ -f "$BASE/$L/s3-report.json" ] && timeouts=$(jq -r '[.proposal_attempts[]? | select(.outcome == "timeout") | .attempt] | join(",")' "$BASE/$L/s3-report.json") |
| 49 | [ "$timeouts" = 0 ] || [ -z "$timeouts" ] && timeouts=0 |
| 50 | [ "$timeouts" = 0 ] || say "NOTE $L attempt $timeouts ended by timeout (model too slow for the task budget): -DEC -MEAS not checked, campaign finding" |
| 51 | nreq=0 nok=0 nskip=0 ntimeout=0 |
| 52 | while IFS= read -r row; do |
| 53 | id=${row#"$L/"} |
| 54 | case $id in |
| 55 | "$L"-PRE|"$L"-OPR|"$L"-BE|"$L"-PIN|"v1 Identity"|"v1 Human interventions: rescues"|"v1 Containment: speculation"|"v1 Correctness: recall") need=always ;; |
| 56 | "$L"-DEC|"$L"-MEAS) need=notimeout ;; |
| 57 | "$L"-RQ*|"$L"-CUT|"$L"-F|"$L"-SB) need=model ;; |
| 58 | "v1 Memory") need=committed ;; |
| 59 | *) need=committed ;; |
| 60 | esac |
| 61 | if [ $need = notimeout ] && [ "$timeouts" != 0 ]; then ntimeout=$((ntimeout + 1)); continue; fi |
| 62 | if [ $need = model ] || { [ $need = committed ] && [ "$committed" != true ]; }; then nskip=$((nskip + 1)); continue; fi |
| 63 | nreq=$((nreq + 1)) |
| 64 | v=$(jq -r --arg r "$row" 'select(.row == $r) | .verdict' "$RES" | head -1) |
| 65 | if [ "$v" = PASS ]; then nok=$((nok + 1)); else say "FAIL $L row '$id' = ${v:-missing}"; fail=1; fi |
| 66 | done < <(jq -r --arg l "$L" '.rows[] | select(.row | startswith($l + "/")) | .row' "$DECL") |
| 67 | say "$L committed=$committed required=$nreq pass=$nok not_checked_model=$nskip not_checked_timeout=$ntimeout" |
| 68 | done |
| 69 | [ $fail = 0 ] && say "G6 PASS" || say "G6 FAIL" |
| 70 | exit $fail |