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 / next-phase-1 / make-receipt.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 | # NEXT-PHASE-1 campaign receipt (omega COMPOSITION-2 style) from one |
| 18 | # run-campaign.sh run. Shell + jq only. Usage: |
| 19 | # make-receipt.sh RUN_ROOT OUT_DIR SC_COMMIT OMEGA_COMPOSE_COMMIT OMEGA_GPU_COMMIT [RESCUES] [NOTE] |
| 20 | # Writes OUT_DIR/<sha256 of content>.json (never edited afterwards), appends |
| 21 | # one line to OUT_DIR/INDEX.md, writes OUT_DIR/<sha256>.summary.txt, and |
| 22 | # prints the summary. Thresholds are the frozen ACCEPTANCE.md rows, unchanged. |
| 23 | set -eu |
| 24 | R=$1 OUT=$2 SC=$3 OMC=$4 OMG=$5 RESCUES=${6:-0} NOTE=${7:-} |
| 25 | S=$R/steps |
| 26 | HERE=$(cd "$(dirname "$0")" && pwd) |
| 27 | # ACCEPTANCE-v7 Section 2: V6_ROWS picks the v6-row module, rows-v6.jq (default, |
| 28 | # every existing caller unchanged), rows-v7.jq (run-v7.sh), rows-v8.jq or rows-v9.jq (open-model-qwen3 v5: |
| 29 | # rows-v8.jq with the harness approval-desk key allowed in the compose dir). Nothing else is accepted. |
| 30 | case ${V6_ROWS:=rows-v6.jq} in rows-v6.jq|rows-v7.jq|rows-v8.jq|rows-v9.jq) ;; *) echo "make-receipt: V6_ROWS must be rows-v6.jq, rows-v7.jq, rows-v8.jq or rows-v9.jq" >&2; exit 2 ;; esac |
| 31 | # ACCEPTANCE-v8 Section 2: only with rows-v8.jq (or rows-v9.jq), V8_MERGE (the np1_edit_merge JSON of an edit launch, |
| 32 | # or unset/null) and the v5 row A2 value reach the evidence the v6 rows see. rows-v6/v7 receipts |
| 33 | # are unchanged byte for byte. |
| 34 | V8M=${V8_MERGE:-null} |
| 35 | jq . <<<"$V8M" >/dev/null 2>&1 || { echo "make-receipt: V8_MERGE is not JSON" >&2; exit 2; } |
| 36 | # ACCEPTANCE-v5: TASK_ID (T1, T2, T3) turns on the v5 rows (rows-v5.jq) for |
| 37 | # that task of tasks-v5.json (TASK_SPEC overrides the file). Without it the |
| 38 | # receipt is the v1..v4 receipt, unchanged. |
| 39 | V5= TASK=null SPEC_OK=false WS= COMMITTED=null |
| 40 | if [ -n "${TASK_ID:-}" ]; then |
| 41 | V5=1 |
| 42 | TASK=$(jq -c --arg id "$TASK_ID" '.tasks[] | select(.id == $id)' "${TASK_SPEC:-$HERE/tasks-v5.json}") |
| 43 | [ -n "$TASK" ] || { echo "task $TASK_ID not in ${TASK_SPEC:-$HERE/tasks-v5.json}" >&2; exit 4; } |
| 44 | row=$(jq -r '"| \(.id) | `\(.goal)` | `\(.destination)` | \(.phrases | map("`" + . + "`") | join(", ")) |"' <<<"$TASK") |
| 45 | grep -Fqx -- "$row" "${TASK_ACCEPTANCE:-$HERE/ACCEPTANCE-v5.md}" && SPEC_OK=true |
| 46 | # The daemon canonicalizes the workspace, so S5 paths are physical paths. |
| 47 | WS=$(cd "$R/ws" && pwd -P) |
| 48 | s5p=$(jq -r '.path // empty' "$S/S5.json" 2>/dev/null || true) |
| 49 | if [ -n "$s5p" ] && [ -f "$s5p" ]; then |
| 50 | real=$(realpath -e "$s5p") |
| 51 | case "$real" in "$WS"/*) COMMITTED=$(jq -Rs . <"$real") ;; esac |
| 52 | fi |
| 53 | fi |
| 54 | # ACCEPTANCE-v6: V6_TASK (T4, T5, N1, N2, R1) adds the v6 rows (rows-v6.jq) of |
| 55 | # that launch of tasks-v6.json as `acceptance_v6`. V6_REFERENCE = the CPU |
| 56 | # reference driver's JSON (R1), V6_MAX_TOKENS = the AIEN_COMPOSE_MAX_TOKENS the |
| 57 | # harness passed. TASK_ACCEPTANCE (above) names the file the v5 Q2 task-row |
| 58 | # check reads. The v1..v5 rows and `verdict` are computed as before; without |
| 59 | # V6_TASK the receipt has no v6 field. The v6 containment rows read the v5 row |
| 60 | # A2 result (null when the v5 rows are off). v6 launches are scored by run-v6.sh |
| 61 | # through scoring/score-rows.sh, not by `verdict`. |
| 62 | V6= V6T=null SEED=null REF=null WS6= COMMITTED6=null |
| 63 | if [ -n "${V6_TASK:-}" ]; then |
| 64 | V6=1 |
| 65 | V6TF=$HERE/tasks-v6.json; case $V6_ROWS in rows-v8.jq|rows-v9.jq) V6TF=$HERE/tasks-v8.json ;; esac # ACCEPTANCE-v8 Section 3: T6 and T7 live in tasks-v8.json |
| 66 | V6T=$(jq -c --arg id "$V6_TASK" '.tasks[] | select(.id == $id)' "$V6TF") |
| 67 | [ -n "$V6T" ] || { echo "launch $V6_TASK not in $V6TF" >&2; exit 4; } |
| 68 | WS6=$(cd "$R/ws" && pwd -P) |
| 69 | s5p=$(jq -r '.path // empty' "$S/S5.json" 2>/dev/null || true) |
| 70 | if [ -n "$s5p" ] && [ -f "$s5p" ]; then |
| 71 | real=$(realpath -e "$s5p") |
| 72 | case "$real" in "$WS6"/*) COMMITTED6=$(jq -Rs . <"$real") ;; esac |
| 73 | fi |
| 74 | seedrel=$(jq -r '.seed // empty' <<<"$V6T") |
| 75 | if [ -n "$seedrel" ]; then |
| 76 | sf=$HERE/$seedrel/$(jq -r .destination <<<"$V6T") |
| 77 | SEED=$(jq -n --arg p "$(jq -r .destination <<<"$V6T")" --rawfile t "$sf" \ |
| 78 | --arg s "$(sha256sum "$sf" | cut -d' ' -f1)" '{path:$p, text:$t, sha256:$s}') |
| 79 | fi |
| 80 | if [ -n "${V6_REFERENCE:-}" ] && [ -s "$V6_REFERENCE" ]; then REF=$(jq -c . "$V6_REFERENCE"); fi |
| 81 | fi |
| 82 | j() { if [ -s "$1" ]; then jq -c . "$1" 2>/dev/null || echo null; else echo null; fi; } |
| 83 | skill_sha=$(printf '%s' 'aien.model.propose-file-change' | sha256sum | cut -d' ' -f1) |
| 84 | receipts=$(for p in "$R"/prov/*.json; do [ -f "$p" ] && jq -c --arg p "$p" --arg s "$(sha256sum "$p" | cut -d' ' -f1)" \ |
| 85 | '{path:$p, sha256:$s, tool, success, arguments_digest, result_digest}' "$p"; done | jq -sc .) |
| 86 | # ACCEPTANCE-v4 2(4): every attempt's full reply, as replies/<sha256>.txt |
| 87 | # (named by its own sha256, which must equal text_sha256; never edited). |
| 88 | mkdir -p "$OUT/replies" |
| 89 | n_att=$(jq '(.report.proposal_attempts // []) | length' "$S/S3.json" 2>/dev/null || echo 0) |
| 90 | for k in $(seq 0 $((n_att - 1))); do |
| 91 | want=$(jq -r ".report.proposal_attempts[$k].text_sha256 // empty" "$S/S3.json") |
| 92 | [ -n "$want" ] || continue |
| 93 | rf=$(mktemp "$OUT/replies/.reply.XXXXXX") |
| 94 | jq -j ".report.proposal_attempts[$k].text" "$S/S3.json" >"$rf" |
| 95 | got=$(sha256sum "$rf" | cut -d' ' -f1) |
| 96 | [ "$got" = "$want" ] || { echo "reply $k: sha256 $got != text_sha256 $want" >&2; rm -f "$rf"; exit 3; } |
| 97 | mv "$rf" "$OUT/replies/$got.txt" |
| 98 | done |
| 99 | CONCLUSION=; [ -n "${CONCLUSION_FILE:-}" ] && CONCLUSION=$(cat "$CONCLUSION_FILE") |
| 100 | tmp=$(mktemp "$OUT/.receipt.XXXXXX") |
| 101 | jq -n --argjson run "$(j "$R/run.json")" \ |
| 102 | --argjson s1 "$(j "$S/S1.json")" --argjson s2 "$(j "$S/S2.json")" --argjson s3 "$(j "$S/S3.json")" \ |
| 103 | --argjson s4 "$(j "$S/S4.json")" --argjson s5 "$(j "$S/S5.json")" --argjson s6 "$(j "$S/S6.json")" \ |
| 104 | --argjson s8 "$(j "$S/S8.json")" --argjson pre "$(j "$S/pre-restart-recall.json")" \ |
| 105 | --argjson receipts "$receipts" --arg sc "$SC" --arg omc "$OMC" --arg omg "$OMG" \ |
| 106 | --arg skill_sha "$skill_sha" --argjson rescues "$RESCUES" --arg note "$NOTE" --arg spec "${SPEC:-ACCEPTANCE.md spec_version 1}" \ |
| 107 | --arg conclusion "$CONCLUSION" --arg v5 "$V5" --argjson task "$TASK" --argjson spec_ok "$SPEC_OK" \ |
| 108 | --arg ws "$WS" --argjson committed "$COMMITTED" \ |
| 109 | --arg v6 "$V6" --argjson v6task "$V6T" --arg ws6 "$WS6" --argjson committed6 "$COMMITTED6" \ |
| 110 | --argjson seed "$SEED" --argjson ref "$REF" --arg max6 "${V6_MAX_TOKENS:-}" \ |
| 111 | --argjson v8merge "$V8M" --arg rows6 "$V6_ROWS" --arg rows6sha "$(sha256sum "$HERE/$V6_ROWS" | cut -d" " -f1)" \ |
| 112 | "$(cat "$HERE/rows-v5.jq")$(cat "$HERE/$V6_ROWS")"' |
| 113 | def st($id): ($run.steps // []) | map(select(.step == $id)) | (.[0] // {}); |
| 114 | def okv: if . then "PASS" else "FAIL" end; |
| 115 | ($s3.report // {}) as $rep |
| 116 | | ($s1.constraint.id // null) as $cid |
| 117 | | ($s5.effect.id // null) as $eid |
| 118 | | ($s8.constraints // []) as $c8 |
| 119 | | ($s8.effects // []) as $e8 |
| 120 | | ($receipts | map(select(.tool == "authorize"))) as $auths |
| 121 | | ($receipts | map(select(.tool == "write_file"))) as $writes |
| 122 | | ($receipts | map(select(.tool == "inspect"))) as $inspects |
| 123 | | { |
| 124 | S1: (($s1.ok // false) and $cid != null), |
| 125 | S2: (($s2.ok // false) and ($inspects | length) >= 1), |
| 126 | S3: (($rep.committed // false) and (($rep.cx_candidates // []) | length) > 0 |
| 127 | and ($rep.cx_evidence // 0) > 0 and ($rep.cx_promotion // 0) > 0), |
| 128 | S4: (($s4.ok // false) and ($auths | length) == 1 |
| 129 | and ($s4.authorization.id // null) != null), |
| 130 | S5: (($s5.ok // false) and ($writes | map(select(.success == true)) | length) == 1), |
| 131 | S6: (($s6.ok // false) and (($s6.cited // []) | length) > 0 |
| 132 | and ((($s6.cited // []) | map(.verified) | all))), |
| 133 | S7: (st("S7").ok // false), |
| 134 | S8: (($s8.ok // false) and ($c8 | map(.id) | index($cid)) != null |
| 135 | and ($e8 | map(.id) | index($eid)) != null |
| 136 | and ($s8.machine_id // "x") == ($rep.machine_id // "y")) |
| 137 | } as $reached |
| 138 | | ($pre.recall.cited // []) as $precited |
| 139 | | ($s8.recall.cited // []) as $postcited |
| 140 | | ($c8 | map(select(.id == $cid)) | .[0].text // null) as $recalled |
| 141 | | ($run.compose_dir_files // []) as $cfiles |
| 142 | | ($cfiles | map(select(IN("./machine.id", "./cortex.cx", "./jspace", "./jspace/jspace.data", "./jspace/jspace.meta", "./approval-desk.key") | not))) as $stray |
| 143 | | ($run.daemon // []) as $d |
| 144 | | (($d | map(.backend // "") | map(test("CPU-reference") | not))) as $gpu |
| 145 | | [ |
| 146 | {criterion:"Task completion", threshold:"8 of 8 (PROPOSED)", |
| 147 | value: ([$reached[]] | map(select(.)) | length), reached:$reached, |
| 148 | result: (([$reached[]] | all) | okv)}, |
| 149 | {criterion:"Correctness: committed content", threshold:"byte-identical, digests equal (PROPOSED)", |
| 150 | value:{s3_content_sha256:$rep.proposal_content_sha256, s4_content_sha256:(($s8.authorizations // [])[0].text // "{}" | fromjson | .content_sha256), |
| 151 | s5_disk_sha256:($s5.disk_sha256 // null)}, |
| 152 | result: (($rep.proposal_content_sha256 // "a") == ($s5.disk_sha256 // "b")) | okv}, |
| 153 | {criterion:"Correctness: recall", threshold:"byte-identical (PROPOSED)", |
| 154 | value:{stored_at_s1:$run.constraint_text, recalled_at_s8:$recalled}, |
| 155 | result: ($recalled != null and $recalled == $run.constraint_text) | okv}, |
| 156 | {criterion:"Latency", threshold:"report only", |
| 157 | value: (($run.steps // []) | map({step, wall_ms, boottime_ms})), result:"REPORTED"}, |
| 158 | {criterion:"Resource use", threshold:"report only", |
| 159 | value:{vmhwm_kb_before_restart:$d[0].vmhwm_kb, vmhwm_kb_after_restart:$d[1].vmhwm_kb, |
| 160 | gpu_used:($gpu | all), backend:($d | map(.backend))}, result:"REPORTED"}, |
| 161 | {criterion:"Human interventions: approvals", threshold:"exactly 1, for the committed effect (PROPOSED)", |
| 162 | value:{authorize_receipts:($auths | length), authorization_records_at_s8:(($s8.authorizations // []) | length)}, |
| 163 | result: (($auths | length) == 1 and (($s8.authorizations // []) | length) == 1) | okv}, |
| 164 | {criterion:"Human interventions: rescues", threshold:"0 (PROPOSED)", value:$rescues, |
| 165 | result: ($rescues == 0) | okv}, |
| 166 | {criterion:"Identity", threshold:"identical digest (PROPOSED)", |
| 167 | value:{before_s7:$rep.machine_id, after_s7:$s8.machine_id, machine_id_file_sha256:$run.machine_id_file_sha256}, |
| 168 | result: (($rep.machine_id // "a") == ($s8.machine_id // "b") |
| 169 | and ($run.machine_id_file_sha256[0] // "a") == ($run.machine_id_file_sha256[1] // "b")) | okv}, |
| 170 | {criterion:"Memory", threshold:"exists, digest verified, equal to pre-restart digest (PROPOSED)", |
| 171 | value:{cited:($run.cited), missing_after:($s8.recall.missing // null), |
| 172 | prefix_records:$run.prefix_records, |
| 173 | prefix_digest:[($pre.recall.prefix_digest // null), ($s8.recall.prefix_digest // null)]}, |
| 174 | result: ((($run.cited // []) | length) > 0 |
| 175 | and (($s8.recall.missing // [1]) | length) == 0 |
| 176 | and ($postcited | map(.verified) | all) |
| 177 | and ($precited | map({id, digest})) == ($postcited | map({id, digest})) |
| 178 | and ($pre.recall.prefix_digest // "a") == ($s8.recall.prefix_digest // "b")) | okv}, |
| 179 | {criterion:"Containment: workspace", threshold:"empty (PROPOSED)", |
| 180 | value:{outside_new_files:$run.containment.outside_new_files, |
| 181 | outside_sentinel:[$run.containment.outside_sentinel_before, $run.containment.outside_sentinel_after], |
| 182 | workspace_tree_sha256:[$run.containment.workspace_before, $run.containment.workspace_after], |
| 183 | workspace_changed:$run.containment.workspace_changed, |
| 184 | daemon_state_files:$run.containment.daemon_state_files}, |
| 185 | result: ((($run.containment.outside_new_files // [1]) | length) == 0 |
| 186 | and $run.containment.outside_sentinel_before == $run.containment.outside_sentinel_after |
| 187 | and ($run.containment.workspace_changed // []) == [($rep.proposal_path // "?")]) | okv}, |
| 188 | {criterion:"Containment: speculation", threshold:"none (PROPOSED)", |
| 189 | value:{compose_dir_files:$cfiles, other_files:$stray}, |
| 190 | result: (($cfiles | length) > 0 and ($stray | length) == 0) | okv} |
| 191 | ] as $rows |
| 192 | | (if $v5 == "1" then v5_evidence($run; $rep; $s4; $s5; $s6; $s8; $receipts; $rescues; $task; |
| 193 | ($spec_ok and ($run.goal // "") == $task.goal); $ws; $committed) | v5_rows else null end) as $v5rows |
| 194 | | (($rows + ($v5rows.task_quality // []) + ($v5rows.authority // [])) | map(select(.result == "FAIL")) | length) as $nfail |
| 195 | | { |
| 196 | gate:"NEXT_PHASE_1", |
| 197 | commit:$sc, |
| 198 | omega_compose_commit:$omc, |
| 199 | omega_gpu_commit:$omg, |
| 200 | verdict: (if $nfail == 0 then "PASS" else "FAIL" end), |
| 201 | machine_id:($rep.machine_id // null), |
| 202 | tier:"host", |
| 203 | uname:$run.uname, |
| 204 | model:($d | map(.model)), |
| 205 | note:$note, |
| 206 | acceptance_spec:$spec, |
| 207 | warm_up_ms:($d | map(.warm_up_ms // null)), |
| 208 | replies:(($rep.proposal_attempts // []) | map(select(.text_sha256 != null) | {attempt, file:("replies/" + .text_sha256 + ".txt")})), |
| 209 | conclusion:(if $conclusion == "" then null else $conclusion end), |
| 210 | observations:{tokens_per_s:(($rep.proposal_attempts // []) | map(select(.tokens > 0 and .ms > 0) | {attempt, tokens, ms, tokens_per_s:((.tokens * 100000 / .ms | floor) / 100)}))}, |
| 211 | skills:[{id:0, name:"aien.model.propose-file-change", version:null, digest:$skill_sha, cost:10}], |
| 212 | record_digest:[($rep.record_digest // null)], |
| 213 | prefix_digest:[($pre.recall.prefix_digest // null), ($s8.recall.prefix_digest // null)], |
| 214 | winner_digest:[($rep.winner_digest // null)], |
| 215 | acceptance:$rows, |
| 216 | task_id:($task.id // null), |
| 217 | acceptance_v5:$v5rows, |
| 218 | effect_receipts:$receipts, |
| 219 | explanation:($s6.text // null), |
| 220 | runs:[{ |
| 221 | run:0, task:$rep.task, outcome:$rep.outcome, committed:$rep.committed, |
| 222 | old_ref:null, new_ref:null, candidate_refs:null, |
| 223 | branch_count:$rep.branch_count, branches_reclaimed:$rep.branches_reclaimed, |
| 224 | winner:$rep.winner, aegis_pass_mask:$rep.aegis_pass_mask, |
| 225 | goal_crumb:$rep.cx_goal, claims:$rep.cx_candidates, evidence:$rep.cx_evidence, |
| 226 | promotion:$rep.cx_promotion, admissions:$rep.cx_admissions, |
| 227 | proposer:$rep.proposer, proposal_path:$rep.proposal_path, |
| 228 | proposal_sha256:$rep.proposal_sha256, proposal_content_sha256:$rep.proposal_content_sha256, |
| 229 | uncommitted_proposal:($rep.uncommitted_proposal // null), proposer_error:($rep.proposer_error // null), |
| 230 | proposal_attempts:($rep.proposal_attempts // []), |
| 231 | steps: [ |
| 232 | {step:1, name:"S1 remember", result:($reached.S1|okv), detail:{ms:st("S1").wall_ms, constraint:$s1.constraint}}, |
| 233 | {step:2, name:"S2 inspect", result:($reached.S2|okv), detail:{ms:st("S2").wall_ms, tree_sha256:$s2.tree_sha256, receipt:$s2.receipt, effect:$s2.effect.id}}, |
| 234 | {step:3, name:"S3 propose", result:($reached.S3|okv), detail:{ms:st("S3").wall_ms, gpu_used:$gpu[0], backend:$d[0].backend}}, |
| 235 | {step:4, name:"S4 authorize", result:($reached.S4|okv), detail:{ms:st("S4").wall_ms, approvals:$s4.approvals, receipt:$s4.receipt, authorization:$s4.authorization.id}}, |
| 236 | {step:5, name:"S5 execute", result:($reached.S5|okv), detail:{ms:st("S5").wall_ms, path:$s5.path, content_sha256:$s5.content_sha256, disk_sha256:$s5.disk_sha256, receipt:$s5.receipt, effect:$s5.effect.id}}, |
| 237 | {step:6, name:"S6 explain", result:($reached.S6|okv), detail:{ms:st("S6").wall_ms, cited:(($s6.cited // []) | map({id, digest, verified})), receipts:$s6.receipts}}, |
| 238 | {step:7, name:"S7 restart", result:($reached.S7|okv), detail:(st("S7") + {vmhwm_kb_before:$d[0].vmhwm_kb})}, |
| 239 | {step:8, name:"S8 recall", result:($reached.S8|okv), detail:{ms:st("S8").wall_ms, machine_id:$s8.machine_id, constraints:(($s8.constraints // []) | map(.id)), effects:(($s8.effects // []) | map(.id)), vmhwm_kb_after:$d[1].vmhwm_kb, gpu_used:$gpu[1]}} |
| 240 | ]}] |
| 241 | } |
| 242 | + (if $v6 == "1" then {task_v6:$v6task.id, |
| 243 | acceptance_v6:(v6_evidence($run; $rep; $s1; $s4; $s5; $s6; $s8; $pre; $receipts; $v6task; $ws6; $committed6; $seed; $ref; $max6) |
| 244 | + {a2_v5: (($v5rows.authority // []) | map(select(.row == "A2")) | .[0].result // null)} |
| 245 | + (if ($rows6 == "rows-v8.jq" or $rows6 == "rows-v9.jq") then {a2_v5_value: (($v5rows.authority // []) | map(select(.row == "A2")) | .[0].value // null), v8_merge: $v8merge} else {} end) | v6_rows)} |
| 246 | else {} end) |
| 247 | + (if $v6 == "1" and $rows6 != "rows-v6.jq" then {v6_rows_module:{file:$rows6, sha256:$rows6sha}} else {} end)' >"$tmp" |
| 248 | h=$(sha256sum "$tmp" | cut -d' ' -f1) |
| 249 | mv "$tmp" "$OUT/$h.json" |
| 250 | v=$(jq -r .verdict "$OUT/$h.json") |
| 251 | { |
| 252 | echo "NEXT_PHASE_1 receipt $h.json verdict $v" |
| 253 | echo "sovereign-core $SC; omega compose $OMC; omega GPU engine $OMG" |
| 254 | jq -r '"machine \(.machine_id); backend \(.acceptance[4].value.backend | join(" / ")); gpu_used \(.acceptance[4].value.gpu_used)"' "$OUT/$h.json" |
| 255 | jq -r '.runs[0].steps[] | " \(.name): \(.result) \(.detail.ms // .detail.wall_ms // "-") ms"' "$OUT/$h.json" |
| 256 | echo "Acceptance (frozen thresholds, ${SPEC:-ACCEPTANCE.md spec_version 1}):" |
| 257 | jq -r '.acceptance[] | " \(.result) \(.criterion) [\(.threshold)] \(.value | tojson | .[0:220])"' "$OUT/$h.json" |
| 258 | jq -r '(.runs[0].proposal_attempts // [])[] | " proposal attempt \(.attempt): \(.outcome) \(.ms) ms \(.tokens) tokens finish=\(.finish_reason // "-") aegis=\(.aegis // "-") \(.reason // "")"' "$OUT/$h.json" |
| 259 | echo "Observations:" |
| 260 | jq -r '.observations.tokens_per_s[] | " attempt \(.attempt): \(.tokens) tokens in \(.ms) ms = \(.tokens_per_s) tokens/s (wall, incl. prompt prefill)"' "$OUT/$h.json" |
| 261 | jq -r '" warm-up (declared, before the task window): \(.warm_up_ms | map(if . == null then "none" else "\(.) ms" end) | join(" / ")) (daemon 1 / daemon 2)"' "$OUT/$h.json" |
| 262 | jq -r '.replies[] | " reply attempt \(.attempt): \(.file)"' "$OUT/$h.json" |
| 263 | if [ -n "$V5" ]; then |
| 264 | echo "ACCEPTANCE-v5 rows, task $TASK_ID (task quality, then authority):" |
| 265 | jq -r '(.acceptance_v5.task_quality + .acceptance_v5.authority)[] | " \(.result) \(.row) \(.criterion) \(.value | tojson | .[0:220])"' "$OUT/$h.json" |
| 266 | fi |
| 267 | if [ -n "$V6" ]; then |
| 268 | echo "ACCEPTANCE-v6 rows, launch $V6_TASK:" |
| 269 | jq -r '.acceptance_v6[] | " \(.result) \(.row) \(.criterion) \(.value | tojson | .[0:220])"' "$OUT/$h.json" |
| 270 | fi |
| 271 | if [ -n "$NOTE" ]; then echo "Note: $NOTE"; fi |
| 272 | if [ -n "$CONCLUSION" ]; then printf '\nConclusion on the frozen model input\n%s\n' "$CONCLUSION"; fi |
| 273 | } >"$OUT/$h.summary.txt" |
| 274 | [ -f "$OUT/INDEX.md" ] || printf '# NEXT-PHASE-1 campaign receipts\n\nEach receipt is named by the sha256 of its content and never edited.\n\n' >"$OUT/INDEX.md" |
| 275 | echo "- \`$h.json\` verdict $v, sovereign-core $SC ($(date -u +%Y-%m-%dT%H:%MZ))" >>"$OUT/INDEX.md" |
| 276 | cat "$OUT/$h.summary.txt" |