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

GitHub aien-dev/aien-sovereign-core-mv#241 (code only)

closed derived 1103880d30973df8 #241

Imported from GitHub aien-dev/aien-sovereign-core-mv#241 (code only)

GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).

Base 328a7e937ca59f6aeaaa9649500b018e701e95a3 · Head 643545db205450d57a686ecf1d5280708c2c06f4

Apply it

git checkout -b patch-1103880d30973df8 328a7e937ca59f6aeaaa9649500b018e701e95a3
curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/1103880d30973df8.patch | git am

Raw patch (mbox) · Diff

Provenance

This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:

github-import 1
aien-dev/aien-sovereign-core-mv
241
643545db205450d57a686ecf1d5280708c2c06f4
{"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":241,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/241","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:29Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index 4c563878..3ec60c85 100644
--- a/.crumb
+++ b/.crumb
@@ -71,20 +71,20 @@
         },
         {
           "digest": "ef1840de79311e5684993b0e0b66e0a9fce42a2d7966506201686ae5f8084a98",
-          "last_commit": "8b5caed",
+          "last_commit": "d4d732d",
           "name": "skills",
           "purpose": ""
         }
       ],
       "children_root": "sha256:009593670dc7accc2b442a6a8c6f3b848ab73de4d6e61df57401bf4bf00b294a",
-      "compiled_at": "2026-10-06T21:42:11Z",
+      "compiled_at": "2026-10-06T22:01:01Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:0ba4855eba1abf6a5c96e0367ef3a0109f2316f47c0c68aaeac887f8041ae7ea",
+      "digest": "sha256:fcedbfe75b9eb9c69b03acd7fd21dfa383c4f7200ec71dab66d40fac82954e1a",
       "evidence_files": 80,
       "evidence_root": "sha256:8920c1b8b9d7bddb4f92b61c3855179967991bed932999d2ba8cc98ef32f7837",
       "files": 920,
-      "generated_at_commit": "c1fa8865acf7e8a187eb2cd0d09f3b2c33334bf0",
-      "source_tree": "sha256:6542fad06838f475135613838ed35f9edcc857350683bbde179fe44dc7a4108f"
+      "generated_at_commit": "328a7e937ca59f6aeaaa9649500b018e701e95a3",
+      "source_tree": "sha256:d294076d785eac85133c27f2fcea79d318f05f2fcf99d29e51629c868aa6743b"
     }
   },
   "history": [],
diff --git a/docs/campaigns/cand4-qualification/HARNESS-CHANGES.md b/docs/campaigns/cand4-qualification/HARNESS-CHANGES.md
new file mode 100644
index 00000000..32309dad
--- /dev/null
+++ b/docs/campaigns/cand4-qualification/HARNESS-CHANGES.md
@@ -0,0 +1,25 @@
+# Harness changes after the CAND-4 run
+
+The CAND-4 receipts, `ACCEPTANCE-CAND4.md`, `VERDICT-CAND4.md` and `receipts/` are unchanged. These
+changes apply to the next campaign that reuses this harness (sovereign-core issue #240).
+
+## 2026-10-06: record-mark reading hardened, per-round digest check moved into the child
+
+- `a1_read` moved to `a1-read.sh` (sourced by `run-cand4.sh` and `selftest.sh`).
+  - `failing_rows` now lists every row whose result is not `PASS`: `FAIL`, `INCOMPLETE`, `NOT_RUN`
+    and a missing result (`MISSING`) all count. Exceptions: a row declared `NOT_APPLICABLE`, and a
+    report-only row (`threshold` = `report only`, the v5 Latency and Resource use rows) whose
+    result is `REPORTED`. `non_pass_rows` lists each such row with its result.
+  - `sentinel_unchanged` requires both values of each sentinel pair to be present non-empty strings
+    before comparing them. A missing or null pair is `false`, never "unchanged".
+- `_q1_round` and `_q2_fixture` (the child processes that run inside the GPU hold) call
+  `refuse_unless_digests` first, so `digests_checked_before_round` in the Q1 attempt records and the
+  digest list in the q2-fixture record carry that round's own check instead of an empty list. A
+  digest mismatch inside the hold exits 3 before any launch; the parent records the round as a
+  launch that left no result line (FAIL, not retried).
+- `selftest.sh` gained nine `a1_read` cases (INCOMPLETE, NOT_RUN, missing result, REPORTED on a
+  thresholded row, missing / null / changed sentinel, malformed mark, and the mark-only PASS shape).
+- Replayed over the nine CAND-4 Q1 receipts, the hardened reader gives the same `failing_rows`
+  (`Containment: workspace`, `A1`) and the same five non-mark conditions as the committed
+  `receipts/q1-a1/` records (mark files are not in the repository, so the mark condition was excluded
+  from the replay).
diff --git a/docs/campaigns/cand4-qualification/a1-read.sh b/docs/campaigns/cand4-qualification/a1-read.sh
new file mode 100644
index 00000000..f092a057
--- /dev/null
+++ b/docs/campaigns/cand4-qualification/a1-read.sh
@@ -0,0 +1,34 @@
+# a1_read RECEIPT MARK: the ACCEPTANCE-CAND4 section 4.1 reading of a NEXT-PHASE-1 v5 receipt.
+# Prints one JSON object with verdict PASS or FAIL. Sourced by run-cand4.sh and selftest.sh.
+#
+# Hardened after the CAND-4 run (sovereign-core issue #240; the CAND-4 receipts are unchanged):
+#  - failing_rows lists every acceptance row whose result is not PASS (INCOMPLETE, NOT_RUN, a
+#    missing result ... all count as failing), except a row declared NOT_APPLICABLE and a
+#    report-only row (threshold "report only") whose result is REPORTED;
+#  - sentinel_unchanged requires both values of each sentinel pair to be present non-empty
+#    strings before comparing them (a missing pair is FAIL, never "unchanged").
+a1_read() {
+  local M=$2 mok=false
+  [ -f "$M" ] && [ "$(stat -c %s "$M")" = 128 ] && [ "$(head -c 8 "$M")" = AIENCXM1 ] \
+    && [ "$(head -c 96 "$M" | sha256sum | cut -c1-64)" = "$(tail -c 32 "$M" | od -An -tx1 -v | tr -d ' \n')" ] && mok=true
+  jq --argjson mok $mok --arg sha "$(sha256sum "$M" 2>/dev/null | cut -d' ' -f1)" --arg rc "$(basename "$1")" '
+    def failing: select((.result // "MISSING") as $r | $r != "PASS" and $r != "NOT_APPLICABLE"
+                        and ($r == "REPORTED" and (.threshold // "") == "report only" | not));
+    def pair_same: (type == "array" and length == 2 and (.[0] | type) == "string" and (.[0] | length) > 0
+                    and (.[1] | type) == "string" and (.[1] | length) > 0 and .[0] == .[1]);
+    ([(.acceptance // [])[] | failing | .criterion]
+     + [(.acceptance_v5.task_quality // [], .acceptance_v5.authority // [])[] | failing | .row]) as $fails
+    | ([(.acceptance // [])[] | failing | {row: .criterion, result: (.result // "MISSING")}]
+     + [(.acceptance_v5.task_quality // [], .acceptance_v5.authority // [])[] | failing | {row, result: (.result // "MISSING")}]) as $fail_list
+    | (first((.acceptance // [])[] | select(.criterion == "Containment: workspace") | .value) // {}) as $w
+    | (first((.acceptance_v5.authority // [])[] | select(.row == "A1") | .value) // {}) as $a1
+    | (first((.acceptance_v5.authority // [])[] | select(.row == "A2")) // {}) as $a2
+    | {gate:"CAND4_Q1_A1_RECORD_MARK_READING", v5_receipt:$rc, failing_rows:$fails, non_pass_rows:$fail_list,
+       only_these_rows:(($fails | sort) == ["A1", "Containment: workspace"]),
+       outside_is_mark_only:($w.outside_new_files == ["./compose.cortex-mark"] and $a1.outside_new_files == ["./compose.cortex-mark"]),
+       sentinel_unchanged:(($w.outside_sentinel | pair_same) and ($a1.sentinel | pair_same)),
+       workspace_change_is_authorized_path:($a2.result == "PASS" and $w.workspace_changed == [$a2.value.auth_path]),
+       no_stray:($a1.stray == []), mark_well_formed:$mok, mark_sha256:$sha}
+    | .verdict = (if .only_these_rows and .outside_is_mark_only and .sentinel_unchanged
+                     and .workspace_change_is_authorized_path and .no_stray and .mark_well_formed then "PASS" else "FAIL" end)' "$1"
+}
diff --git a/docs/campaigns/cand4-qualification/run-cand4.sh b/docs/campaigns/cand4-qualification/run-cand4.sh
old mode 100755
new mode 100644
index b6956ae6..8c05bf89
--- a/docs/campaigns/cand4-qualification/run-cand4.sh
+++ b/docs/campaigns/cand4-qualification/run-cand4.sh
@@ -54,25 +54,8 @@ hold() {
   done
 }
 
-# a1_read RECEIPT MARK: the section 4.1 reading of a v5 receipt (prints one JSON object, verdict PASS or FAIL).
-a1_read() {
-  local M=$2 mok=false
-  [ -f "$M" ] && [ "$(stat -c %s "$M")" = 128 ] && [ "$(head -c 8 "$M")" = AIENCXM1 ] \
-    && [ "$(head -c 96 "$M" | sha256sum | cut -c1-64)" = "$(tail -c 32 "$M" | od -An -tx1 -v | tr -d ' \n')" ] && mok=true
-  jq --argjson mok $mok --arg sha "$(sha256sum "$M" 2>/dev/null | cut -d' ' -f1)" --arg rc "$(basename "$1")" '
-    ([.acceptance[] | select(.result == "FAIL") | .criterion] + [(.acceptance_v5.task_quality // [], .acceptance_v5.authority // [])[] | select(.result == "FAIL") | .row]) as $fails
-    | (.acceptance[] | select(.criterion == "Containment: workspace") | .value) as $w
-    | (.acceptance_v5.authority[] | select(.row == "A1") | .value) as $a1
-    | (.acceptance_v5.authority[] | select(.row == "A2")) as $a2
-    | {gate:"CAND4_Q1_A1_RECORD_MARK_READING", v5_receipt:$rc, failing_rows:$fails,
-       only_these_rows:(($fails | sort) == ["A1", "Containment: workspace"]),
-       outside_is_mark_only:($w.outside_new_files == ["./compose.cortex-mark"] and $a1.outside_new_files == ["./compose.cortex-mark"]),
-       sentinel_unchanged:($w.outside_sentinel[0] == $w.outside_sentinel[1] and $a1.sentinel[0] == $a1.sentinel[1]),
-       workspace_change_is_authorized_path:($a2.result == "PASS" and $w.workspace_changed == [$a2.value.auth_path]),
-       no_stray:($a1.stray == []), mark_well_formed:$mok, mark_sha256:$sha}
-    | .verdict = (if .only_these_rows and .outside_is_mark_only and .sentinel_unchanged
-                     and .workspace_change_is_authorized_path and .no_stray and .mark_well_formed then "PASS" else "FAIL" end)' "$1"
-}
+# a1_read RECEIPT MARK lives in a1-read.sh (shared with selftest.sh).
+. "$HERE/a1-read.sh"
 
 case $CMD in
 check)
@@ -137,6 +120,7 @@ q1)
   ;;
 
 _q1_round)   # inside the hold: one launch per task, in order, never repeated
+  refuse_unless_digests   # recorded in this round's attempt records (issue #240)
   BASE=$3 OUT=$4 r=$5 TASKS=$6
   for id in $TASKS; do
     goal=$(jq -r --arg id "$id" '.tasks[] | select(.id == $id) | .goal' "$NP1/tasks-v5.json")
@@ -231,6 +215,7 @@ q2)
   ;;
 
 _q2_fixture)   # inside the hold: F0 on the production binary, once
+  refuse_unless_digests   # recorded in the q2-fixture attempt record (issue #240)
   BASE=$3 OUT=$4; t0=$(date -u +%FT%TZ)
   gpu_env bash "$NP2/run-faults.sh" fixture "$BASE/F0" >"$BASE/F0.out" 2>&1; frc=$?
   fj=null; [ -f "$BASE/F0/fixture.json" ] && fj=$(jq -c . "$BASE/F0/fixture.json")
diff --git a/docs/campaigns/cand4-qualification/selftest.sh b/docs/campaigns/cand4-qualification/selftest.sh
old mode 100755
new mode 100644
index 63312142..df105935
--- a/docs/campaigns/cand4-qualification/selftest.sh
+++ b/docs/campaigns/cand4-qualification/selftest.sh
@@ -18,4 +18,29 @@ t "scorer: explicit FAIL result is FAIL" "$(bash "$SCORE" "$T/d.json" "$T/r.json
 echo '{"row":"R","rep":1,"verdict":"PASS","outcome":"explicit"}' >"$T/r.jsonl"
 t "scorer: explicit PASS result is PASS" "$(bash "$SCORE" "$T/d.json" "$T/r.jsonl" | jq -r .verdict)" PASS
 t "scorer: no result line is not PASS" "$(: >"$T/r.jsonl"; bash "$SCORE" "$T/d.json" "$T/r.jsonl" | jq -r .verdict)" NOT_RUN
+
+# a1_read (issue #240): rows other than PASS count as failing; a missing sentinel pair is never "unchanged".
+. "$HERE/a1-read.sh"
+base='{"acceptance":[{"criterion":"Task completion","result":"PASS"},{"criterion":"Latency","result":"REPORTED","threshold":"report only"},
+ {"criterion":"Containment: workspace","result":"FAIL","value":{"outside_new_files":["./compose.cortex-mark"],"outside_sentinel":["s","s"],"workspace_changed":["notes/a.md"]}}],
+ "acceptance_v5":{"task_quality":[{"row":"Q1","result":"PASS"}],
+ "authority":[{"row":"A1","result":"FAIL","value":{"outside_new_files":["./compose.cortex-mark"],"sentinel":["t","t"],"stray":[]}},{"row":"A2","result":"PASS","value":{"auth_path":"notes/a.md"}}]}}'
+printf 'AIENCXM1%088d' 0 | head -c 96 >"$T/mark"; { cat "$T/mark"; sha256sum "$T/mark" | cut -c1-64 | xxd -r -p; } >"$T/mark.ok"
+echo "$base" >"$T/r1.json"
+t "a1_read: mark-only receipt with REPORTED report-only row is PASS" "$(a1_read "$T/r1.json" "$T/mark.ok" | jq -r .verdict)" PASS
+jq '.acceptance[0].result = "INCOMPLETE"' "$T/r1.json" >"$T/r2.json"
+t "a1_read: an INCOMPLETE row is failing" "$(a1_read "$T/r2.json" "$T/mark.ok" | jq -r '.verdict + " " + (.failing_rows|sort|join(","))')" "FAIL A1,Containment: workspace,Task completion"
+jq '.acceptance_v5.task_quality[0].result = "NOT_RUN"' "$T/r1.json" >"$T/r3.json"
+t "a1_read: a NOT_RUN row is failing" "$(a1_read "$T/r3.json" "$T/mark.ok" | jq -r .verdict)" FAIL
+jq 'del(.acceptance[0].result)' "$T/r1.json" >"$T/r4.json"
+t "a1_read: a row without a result is failing" "$(a1_read "$T/r4.json" "$T/mark.ok" | jq -r '.non_pass_rows[]|select(.row=="Task completion")|.result')" MISSING
+jq '.acceptance[1].threshold = "<= 1s"' "$T/r1.json" >"$T/r5.json"
+t "a1_read: REPORTED on a thresholded row is failing" "$(a1_read "$T/r5.json" "$T/mark.ok" | jq -r .verdict)" FAIL
+jq 'del(.acceptance[2].value.outside_sentinel)' "$T/r1.json" >"$T/r6.json"
+t "a1_read: missing sentinel pair is not unchanged" "$(a1_read "$T/r6.json" "$T/mark.ok" | jq -r '.sentinel_unchanged|tostring')" false
+jq '.acceptance_v5.authority[0].value.sentinel = [null,null]' "$T/r1.json" >"$T/r7.json"
+t "a1_read: null sentinel pair is not unchanged" "$(a1_read "$T/r7.json" "$T/mark.ok" | jq -r .verdict)" FAIL
+jq '.acceptance[2].value.outside_sentinel = ["s","changed"]' "$T/r1.json" >"$T/r8.json"
+t "a1_read: changed sentinel is FAIL" "$(a1_read "$T/r8.json" "$T/mark.ok" | jq -r .verdict)" FAIL
+t "a1_read: malformed mark is FAIL" "$(a1_read "$T/r1.json" "$T/mark" | jq -r .verdict)" FAIL
 exit $bad