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
GitHub aien-dev/aien-sovereign-core-mv#251 (code only)
Fetch it
curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/ef03a79da9fe11c2.bundle -o ef03a79da9fe11c2.bundle git fetch ef03a79da9fe11c2.bundle refs/pull/251/head
Provenance
github-import 1
aien-dev/aien-sovereign-core-mv
251
5458cad53d08898a21c8ed4f5f4829ccc9940fe0
{"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":251,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/251","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:31Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index a6565a0a..44ec25dd 100644 --- a/.crumb +++ b/.crumb @@ -77,14 +77,14 @@ } ], "children_root": "sha256:009593670dc7accc2b442a6a8c6f3b848ab73de4d6e61df57401bf4bf00b294a", - "compiled_at": "2026-10-06T23:31:02Z", + "compiled_at": "2026-10-06T23:42:37Z", "compiler": "crumb-compile/1", - "digest": "sha256:e0a75f92bf68c2b3a79131e513c355aa986d05caa755cc5d8f1615c6f25d9786", + "digest": "sha256:895beb9623c0f2f3f110ee49ecd6c9a8d00f06f17a9447327c3dd8076b3304eb", "evidence_files": 90, "evidence_root": "sha256:913405b594470a9dfda6998ea0386eba372f438bce4e9d05c062369a9f7b1e22", - "files": 950, - "generated_at_commit": "6e6b71ee90ca0251d2762f997ce177f837f68106", - "source_tree": "sha256:7b47e36edbbc29792dc6dd6c45bd07827974fe24303cf7ad83d8bcfb9800cb7a" + "files": 952, + "generated_at_commit": "9632b10920f7238d3c681f38882d858a346a3977", + "source_tree": "sha256:c5af629fb13f833c34efb0aa8d48de22727a50bc8f98e9342224fe4171f39ffd" } }, "history": [], diff --git a/docs/campaigns/next-phase-1/make-receipt.sh b/docs/campaigns/next-phase-1/make-receipt.sh index d18730b6..bb22b77c 100755 --- a/docs/campaigns/next-phase-1/make-receipt.sh +++ b/docs/campaigns/next-phase-1/make-receipt.sh @@ -9,6 +9,9 @@ set -eu R=$1 OUT=$2 SC=$3 OMC=$4 OMG=$5 RESCUES=${6:-0} NOTE=${7:-} S=$R/steps HERE=$(cd "$(dirname "$0")" && pwd) +# ACCEPTANCE-v7 Section 2: V6_ROWS picks the v6-row module, rows-v6.jq (default, +# every existing caller unchanged) or rows-v7.jq (run-v7.sh). Nothing else is accepted. +case ${V6_ROWS:=rows-v6.jq} in rows-v6.jq|rows-v7.jq) ;; *) echo "make-receipt: V6_ROWS must be rows-v6.jq or rows-v7.jq" >&2; exit 2 ;; esac # ACCEPTANCE-v5: TASK_ID (T1, T2, T3) turns on the v5 rows (rows-v5.jq) for # that task of tasks-v5.json (TASK_SPEC overrides the file). Without it the # receipt is the v1..v4 receipt, unchanged. @@ -83,7 +86,8 @@ jq -n --argjson run "$(j "$R/run.json")" \ --arg ws "$WS" --argjson committed "$COMMITTED" \ --arg v6 "$V6" --argjson v6task "$V6T" --arg ws6 "$WS6" --argjson committed6 "$COMMITTED6" \ --argjson seed "$SEED" --argjson ref "$REF" --arg max6 "${V6_MAX_TOKENS:-}" \ - "$(cat "$HERE/rows-v5.jq")$(cat "$HERE/rows-v6.jq")"' + --arg rows6 "$V6_ROWS" --arg rows6sha "$(sha256sum "$HERE/$V6_ROWS" | cut -d" " -f1)" \ + "$(cat "$HERE/rows-v5.jq")$(cat "$HERE/$V6_ROWS")"' def st($id): ($run.steps // []) | map(select(.step == $id)) | (.[0] // {}); def okv: if . then "PASS" else "FAIL" end; ($s3.report // {}) as $rep @@ -216,7 +220,8 @@ jq -n --argjson run "$(j "$R/run.json")" \ + (if $v6 == "1" then {task_v6:$v6task.id, acceptance_v6:(v6_evidence($run; $rep; $s1; $s4; $s5; $s6; $s8; $pre; $receipts; $v6task; $ws6; $committed6; $seed; $ref; $max6) + {a2_v5: (($v5rows.authority // []) | map(select(.row == "A2")) | .[0].result // null)} | v6_rows)} - else {} end)' >"$tmp" + else {} end) + + (if $v6 == "1" and $rows6 != "rows-v6.jq" then {v6_rows_module:{file:$rows6, sha256:$rows6sha}} else {} end)' >"$tmp" h=$(sha256sum "$tmp" | cut -d' ' -f1) mv "$tmp" "$OUT/$h.json" v=$(jq -r .verdict "$OUT/$h.json") diff --git a/docs/campaigns/next-phase-1/run-v7.sh b/docs/campaigns/next-phase-1/run-v7.sh new file mode 100755 index 00000000..5a78ce78 --- /dev/null +++ b/docs/campaigns/next-phase-1/run-v7.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +# NEXT-PHASE-1 v7 campaign (ACCEPTANCE-v7.md): run-v6.sh with the v7 wiring of +# ACCEPTANCE-v7 Section 2 and nothing else. Same five launches of tasks-v6.json +# (ACCEPTANCE-v6 Section 2, kept unchanged by ACCEPTANCE-v7 Section 1), same +# goals, max_tokens, T5 seed and CPU reference run; each receipt is built by +# make-receipt.sh with V6_ROWS=rows-v7.jq (the S3 committed-flag fix) and records +# that module and its sha256 as v6_rows_module; the verdict is score-rows.sh +# (scoring-v5) over np1-v7.decl.json. Usage (inside the caller's quietlock hold, +# ACCEPTANCE-v6 Section 8): +# AIEN_BIN=... AIEN_MODEL_PATH=... AIEN_TOKENIZER_PATH=... \ +# run-v7.sh RUN_BASE OUT_DIR SC_COMMIT OMEGA_COMPOSE_COMMIT OMEGA_GPU_COMMIT REFERENCE_BIN +# Writes RUN_BASE/<launch>/ (run roots), RUN_BASE/R1.reference.json, one +# receipt per launch in OUT_DIR, OUT_DIR/v7-results.jsonl and OUT_DIR/v7-score.json. +set -u +HERE=$(cd "$(dirname "$0")" && pwd) +BASE=${1:?RUN_BASE} OUT=${2:?OUT_DIR} SC=${3:?SC_COMMIT} OMC=${4:?OMEGA_COMPOSE} OMG=${5:?OMEGA_GPU} REFBIN=${6:?REFERENCE_BIN} +TASKS=$HERE/tasks-v6.json +DECL=$HERE/../scoring/declarations/np1-v7.decl.json +SCORER=$HERE/../scoring/score-rows.sh +[ -f "$DECL" ] && [ -x "$SCORER" ] && [ -x "$REFBIN" ] || { echo "run-v7: declaration, scorer or reference binary missing" >&2; exit 2; } +MODEL_DIR=$(dirname "${AIEN_MODEL_PATH:?}") +mkdir -p "$BASE" "$OUT" +RES=$OUT/v7-results.jsonl +: >"$RES" +for id in $(jq -r '.tasks[].id' "$TASKS"); do + t=$(jq -c --arg id "$id" '.tasks[] | select(.id == $id)' "$TASKS") + goal=$(jq -r .goal <<<"$t"); max=$(jq -r .max_tokens <<<"$t"); seed=$(jq -r '.seed // empty' <<<"$t") + seed_dir=; [ -n "$seed" ] && seed_dir=$HERE/$seed + NP1_GOAL=$goal AIEN_COMPOSE_MAX_TOKENS=$max NP1_SEED_DIR=$seed_dir \ + bash "$HERE/run-campaign.sh" "$BASE/$id" >"$BASE/$id.driver.out" 2>&1 + echo "launch $id driver exit $? (max_tokens $max${seed:+, seed $seed})" + ref= + if [ "$(jq -r .kind <<<"$t")" = identity ] && [ -d "$BASE/$id/ws" ]; then + ws=$(cd "$BASE/$id/ws" && pwd -P) + "$REFBIN" "$MODEL_DIR" "$goal" "$ws" "$max" new >"$BASE/$id.reference.json" 2>"$BASE/$id.reference.err" + echo "launch $id CPU reference exit $?" + ref=$BASE/$id.reference.json + fi + if [ -f "$BASE/$id/run.json" ]; then + v5env=(); [ "$(jq -r '.destination // empty' <<<"$t")" != "" ] && [ "${id#N}" = "$id" ] && \ + v5env=(TASK_ID="$id" TASK_SPEC="$TASKS" TASK_ACCEPTANCE="$HERE/ACCEPTANCE-v6.md") + env "${v5env[@]}" V6_ROWS=rows-v7.jq V6_TASK="$id" V6_MAX_TOKENS="$max" V6_REFERENCE="$ref" \ + SPEC="ACCEPTANCE-v7.md spec_version 7" bash "$HERE/make-receipt.sh" \ + "$BASE/$id" "$OUT" "$SC" "$OMC" "$OMG" 0 "NEXT-PHASE-1 v7 launch $id" >"$BASE/$id.receipt.out" 2>&1 + rec=$OUT/$(head -1 "$BASE/$id.receipt.out" | sed -n 's/.*receipt \([0-9a-f]*\.json\).*/\1/p') + if [ -f "$rec" ]; then bash "$HERE/v6-results.sh" "$id" "$rec" >>"$RES" + else bash "$HERE/v6-results.sh" "$id" - "$DECL" "receipt not written" >>"$RES"; fi + echo "launch $id receipt $(basename "$rec")" + else + bash "$HERE/v6-results.sh" "$id" - "$DECL" "launch failed: no run.json" >>"$RES" # ACCEPTANCE-v6 Section 7 + echo "launch $id FAILED to launch" + fi + jq -r --arg id "$id" 'select(.row | startswith($id + "/")) | select(.verdict != "PASS") | " \(.verdict) \(.row)"' "$RES" +done +bash "$SCORER" "$DECL" "$RES" >"$OUT/v7-score.json"; rc=$? +echo "NEXT-PHASE-1 v7 campaign verdict (scoring-v5, score-rows.sh exit $rc): $(jq -r .verdict "$OUT/v7-score.json" 2>/dev/null || echo ERROR)" +exit $rc diff --git a/docs/campaigns/next-phase-1/test-wiring-v7.sh b/docs/campaigns/next-phase-1/test-wiring-v7.sh new file mode 100755 index 00000000..5618b7b1 --- /dev/null +++ b/docs/campaigns/next-phase-1/test-wiring-v7.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +# NEXT-PHASE-1 v7: the v7 harness wiring (ACCEPTANCE-v7 Section 2). Shell + jq +# only. Usage: test-wiring-v7.sh. Exit 0 only if every case holds. +# +# 1. The real v4 run (tests-v5/v4-run) with its S3 report set to an explicit +# "committed": false, through make-receipt.sh as N1: the default module +# (rows-v6.jq, every existing caller) still turns false into null, and +# V6_ROWS=rows-v7.jq keeps it false and records the module and its sha256. +# Any other V6_ROWS is refused. +# 2. run-v7.sh differs from run-v6.sh only in the v7 wiring lines. +# 3. np1-v7.decl.json declares the same 73 rows as np1-v6.decl.json. +set -u +HERE=$(cd "$(dirname "$0")" && pwd) +pass=0 fail=0 +check() { # check NAME EXPECTED ACTUAL + if [ "$2" = "$3" ]; then pass=$((pass + 1)); echo "ok $1 (got: ${3:-none})" + else fail=$((fail + 1)); echo "FAIL $1: expected [${2}] got [${3}]"; fi +} + +# ---- 1. make-receipt.sh with and without V6_ROWS -------------------------------- +tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT +tmp=$(cd "$tmp" && pwd -P) +cp -R "$HERE/tests-v5/v4-run" "$tmp/run" +for f in "$tmp"/run/run.json "$tmp"/run/steps/*.json; do sed -i "s#@RUN@#$tmp/run#g" "$f"; done +jq '.report.committed = false' "$tmp/run/steps/S3.json" >"$tmp/s3" && cp "$tmp/s3" "$tmp/run/steps/S3.json" +rec() { # rec [extra env...] -> receipt path + local o; o=$(mktemp -d "$tmp/out.XXXX") + env "$@" V6_TASK=N1 V6_MAX_TOKENS=48 bash "$HERE/make-receipt.sh" "$tmp/run" "$o" t t t 0 >"$o.sum" 2>"$o.err" \ + || { echo "make-receipt.sh failed:"; cat "$o.err"; exit 1; } + ls "$o"/*.json +} +c3() { jq -r '[.acceptance_v6[] | select(.row == "N1-C")][0].value.s3_committed' "$1"; } +r6=$(rec); r7=$(rec V6_ROWS=rows-v7.jq) +check "default module: explicit false read as null (the v6 defect, unchanged)" "null" "$(c3 "$r6")" +check "default module: no v6_rows_module field" "null" "$(jq -r .v6_rows_module "$r6")" +check "V6_ROWS=rows-v7.jq: explicit false stays false" "false" "$(c3 "$r7")" +check "V6_ROWS=rows-v7.jq: receipt records the module" \ + "rows-v7.jq $(sha256sum "$HERE/rows-v7.jq" | cut -d' ' -f1)" "$(jq -r '"\(.v6_rows_module.file) \(.v6_rows_module.sha256)"' "$r7")" +check "V6_ROWS=rows-v7.jq: legacy verdict and other v6 rows as the default module" \ + "$(jq -c '[.verdict, (.acceptance_v6 | map(select(.row != "N1-C")) | map({row, result}))]' "$r6")" \ + "$(jq -c '[.verdict, (.acceptance_v6 | map(select(.row != "N1-C")) | map({row, result}))]' "$r7")" +check "V6_ROWS=anything else: refused" "refused" \ + "$(V6_ROWS=../rows-v6.jq V6_TASK=N1 bash "$HERE/make-receipt.sh" "$tmp/run" "$tmp/out-bad" t t t 0 >/dev/null 2>&1 && echo accepted || echo refused)" + +# ---- 2. run-v7.sh is run-v6.sh plus the v7 wiring ------------------------------ +check "run-v7.sh: only the v7 wiring lines differ from run-v6.sh" "5c5 7c7 10c10 29,31c29,31 42,43c42,43" \ + "$(diff <(sed -n '12,$p' "$HERE/run-v6.sh") <(sed -n '14,$p' "$HERE/run-v7.sh") | grep -E '^[0-9]' | paste -sd' ')" +check "run-v7.sh: v7 module, declaration and spec" "1 1 1" \ + "$(for p in 'V6_ROWS=rows-v7.jq V6_TASK=' 'declarations/np1-v7.decl.json' 'SPEC="ACCEPTANCE-v7.md spec_version 7"'; do grep -cF -- "$p" "$HERE/run-v7.sh"; done | paste -sd' ')" + +# ---- 3. the v7 declaration ------------------------------------------------------ +D=$HERE/../scoring/declarations +check "np1-v7.decl.json: same 73 rows as np1-v6" "73 true" \ + "$(jq -r --slurpfile v6 "$D/np1-v6.decl.json" '"\(.rows | length) \([.rows[].row] == [$v6[0].rows[].row])"' "$D/np1-v7.decl.json")" + +echo "test-wiring-v7: $pass passed, $fail failed" +[ "$fail" = 0 ]