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 / v3-rows.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 v3 (ACCEPTANCE-v3.md Section 4, FROZEN): the extra rows of one launch, |
| 18 | # computed from the run directory beside the v8 receipt. Shell + jq only. Usage: |
| 19 | # v3-rows.sh RUN_ROOT LAUNCH_ID TASKS.json OUT_DIR RECEIPT_BASENAME |
| 20 | # Writes OUT_DIR/<sha256 of content>.v3rows.json (never edited afterwards) and prints one scoring-v5 |
| 21 | # result line per row: {row: "<id>/<row>", rep: 1, verdict, receipt}. |
| 22 | set -eu |
| 23 | R=${1:?RUN_ROOT} ID=${2:?LAUNCH_ID} TASKS=${3:?TASKS} OUT=${4:?OUT_DIR} REC=${5:?RECEIPT} |
| 24 | HERE=$(cd "$(dirname "$0")" && pwd) |
| 25 | S=$R/steps |
| 26 | task=$(jq -c --arg id "$ID" '.tasks[] | select(.id == $id)' "$TASKS") |
| 27 | [ -n "$task" ] || { echo "v3-rows: launch $ID not in $TASKS" >&2; exit 4; } |
| 28 | j() { if [ -s "$1" ]; then jq -c . "$1" 2>/dev/null || echo null; else echo null; fi; } |
| 29 | ws=$(cd "$R/ws" && pwd -P) |
| 30 | committed='{"path_rel":null,"text":null,"file_sha256":null}' |
| 31 | s5p=$(jq -r '.path // empty' "$S/S5.json" 2>/dev/null || true) |
| 32 | if [ -n "$s5p" ] && [ -f "$s5p" ]; then |
| 33 | real=$(realpath -e "$s5p") |
| 34 | case "$real" in "$ws"/*) |
| 35 | committed=$(jq -n --arg p "${real#"$ws"/}" --rawfile t "$real" --arg h "$(sha256sum "$real" | cut -d' ' -f1)" \ |
| 36 | '{path_rel: $p, text: $t, file_sha256: $h}') ;; |
| 37 | esac |
| 38 | fi |
| 39 | tmp=$(mktemp "$OUT/.v3rows.XXXXXX") |
| 40 | jq -n --argjson task "$task" --argjson report "$(j "$R/s3-report.json")" --argjson s5 "$(j "$S/S5.json")" \ |
| 41 | --argjson s8 "$(j "$S/S8.json")" --argjson committed "$committed" --arg rec "$REC" --arg mod "$(sha256sum "$HERE/rows-oq3-v3.jq" | cut -d' ' -f1)" \ |
| 42 | "$(cat "$HERE/rows-oq3-v3.jq")"' |
| 43 | def j2: (try fromjson catch null); |
| 44 | {task: $task, report: $report, s5: ($s5 // {}), committed: $committed, |
| 45 | auths: (($s8.authorizations // []) | map((.text // "" | j2) + {id, verified}))} as $ev |
| 46 | | {launch: $task.id, receipt: $rec, rows_module_sha256: $mod, rows: ($ev | v3_rows)}' >"$tmp" |
| 47 | h=$(sha256sum "$tmp" | cut -d' ' -f1) |
| 48 | mv "$tmp" "$OUT/$h.v3rows.json" |
| 49 | jq -c --arg id "$ID" --arg rec "$REC" --arg f "$h.v3rows.json" \ |
| 50 | '.rows[] | {row: ($id + "/" + .row), rep: 1, verdict: .result, receipt: $rec, extra_rows_file: $f}' "$OUT/$h.v3rows.json" |