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#657 (code only)

closed derived c43a5478c8868a88 #657

Imported from GitHub aien-dev/aien-sovereign-core-mv#657 (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 e6852de85dfe503347d37ed2438d1ce6f1ac8c3a · Head e3c23f7779219d03fe21f84074f4f75be2a2393c

Fetch it

A git bundle of the pull request's head, 5410 bytes.

curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/c43a5478c8868a88.bundle -o c43a5478c8868a88.bundle
git fetch c43a5478c8868a88.bundle refs/pull/657/head

Raw bundle · 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
657
e3c23f7779219d03fe21f84074f4f75be2a2393c
{"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":657,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/657","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:47Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index f5e6e78e..481f82fd 100644
--- a/.crumb
+++ b/.crumb
@@ -112,21 +112,21 @@
           "purpose": ""
         },
         {
-          "digest": "90c677cb8afe33fc2222566f7412cf862ead0c5ab437d70f1be48cca600cc64c",
-          "last_commit": "0aa99f9e",
+          "digest": "f44f81600d98021f83fd88d23ed440f13acaa945ce54b2ef276bdd27487f19b6",
+          "last_commit": "28e3da97",
           "name": "tools/aien-local-ci",
           "purpose": "Local CI sandbox exec contract (C8), aien-run user/caches install, Forgejo trigger hook, health "
         }
       ],
-      "children_root": "sha256:b85c8810abe85be616a42d2802e5637c38014f05e3c06d23705fef6ea5a766f2",
-      "compiled_at": "2026-10-18T15:37:23Z",
+      "children_root": "sha256:5f336a15f17c63933efa0604715564620ad61d5e6f37fa82f14d9114f3b1e99a",
+      "compiled_at": "2026-10-18T17:36:55Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:2dbc3bfc48f62db17b27a04f0fd028ee3ad19f77af8d9cac6f93d3e77d147f7b",
+      "digest": "sha256:1100a0609391c3c0d09d9d25ca44eefef6043727c1f9c71d2cb96cbbddb5e06d",
       "evidence_files": 1578,
       "evidence_root": "sha256:135e27a1a0704c4a8371cd2c1eb555f2b5beec61c212949b029a5457418a7160",
       "files": 5891,
-      "generated_at_commit": "6b58967d3b40455d5180fa7f22237f0b46912b98",
-      "source_tree": "sha256:1769c5da9a48ba6c23bc738850153c93581c418175c8ef5ac9e31926c116dfb0"
+      "generated_at_commit": "28e3da9787b480b6b71ed92079261098b9d5f996",
+      "source_tree": "sha256:d6893f876ac8deff9c84931096b77dda5de8bff1794f37b06eaa888c8fd1bd7d"
     }
   },
   "history": [],
diff --git a/tools/aien-local-ci/.crumb b/tools/aien-local-ci/.crumb
index 2acf39bd..821b30b3 100644
--- a/tools/aien-local-ci/.crumb
+++ b/tools/aien-local-ci/.crumb
@@ -3,14 +3,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-18T13:50:54Z",
+      "compiled_at": "2026-10-18T17:36:55Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:90c677cb8afe33fc2222566f7412cf862ead0c5ab437d70f1be48cca600cc64c",
+      "digest": "sha256:f44f81600d98021f83fd88d23ed440f13acaa945ce54b2ef276bdd27487f19b6",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 12,
-      "generated_at_commit": "0aa99f9e7cff0338a0cca3eb4b65d5a820589b64",
-      "source_tree": "sha256:0d356db7e69b41404d1009d5fdb31b3f9cf1f9950bf8f44905a2f88872567123"
+      "generated_at_commit": "28e3da9787b480b6b71ed92079261098b9d5f996",
+      "source_tree": "sha256:682b3ef8e09a99c9b7c95bf14db2e8eacc74ee3013264df68b6162155b525221"
     }
   },
   "layer": "infra",
diff --git a/tools/aien-local-ci/pipeline.sh b/tools/aien-local-ci/pipeline.sh
index 14e16676..fce02659 100755
--- a/tools/aien-local-ci/pipeline.sh
+++ b/tools/aien-local-ci/pipeline.sh
@@ -57,6 +57,7 @@ if [[ $cmd != publish ]]; then command -v "$GH" >/dev/null || die "gh ($GH) not
 mkdir -p "$STATE"
 JOURNAL=$STATE/pipeline.jsonl
 RERUNS=$STATE/pipeline-reruns
+RERUN_FAILS=$STATE/pipeline-rerun-fails
 PUBLISHED=$STATE/pipeline-published
 exec 9>>"$STATE/pipeline.lock"
 flock -n 9 || exit 0
@@ -226,6 +227,15 @@ do_rerun() {
       pdig=$(published "$repo" "$sha")
       [[ -n $pdig ]] || continue
       grep -qxF "$repo $sha $pdig" "$RERUNS" 2>/dev/null && continue
+      # A refused rerun is not retried every tick: each refusal trips the gh guard and stalls every
+      # chat on this machine. Back off one hour after a failure, give up after three.
+      if [[ -f $RERUN_FAILS ]]; then
+        local nfail lastfail
+        nfail=$(grep -c "^$repo $sha $pdig " "$RERUN_FAILS" || true)
+        lastfail=$(grep "^$repo $sha $pdig " "$RERUN_FAILS" | tail -1 | cut -d" " -f4)
+        (( nfail >= 3 )) && continue
+        [[ -n $lastfail ]] && (( $(date -u +%s) - lastfail < 3600 )) && continue
+      fi
       if ! run=$("$GH" api "repos/$s/actions/runs?head_sha=$sha&per_page=20" --jq \
         "[.workflow_runs[] | select(.name == \"$WORKFLOW_NAME\")] | sort_by(.created_at) | last
          | if . == null then \"\" else \"\(.id) \(.status) \(.run_started_at // .created_at)\" end"); then
@@ -247,7 +257,8 @@ do_rerun() {
         echo "$repo $sha $pdig" >> "$RERUNS"
         journal action=rerun repo="$repo" pr="$num" sha="$sha" digest="$pdig" result=rerun reason="run $id predates publication"
       else
-        journal action=rerun repo="$repo" pr="$num" sha="$sha" result=failed reason="rerun request for run $id failed"
+        echo "$repo $sha $pdig $(date -u +%s)" >> "$RERUN_FAILS"
+        journal action=rerun repo="$repo" pr="$num" sha="$sha" result=failed reason="rerun request for run $id failed (backing off 1h)"
       fi
     done <<< "$prs"
   done
@@ -264,6 +275,15 @@ merge_one() {
   read -r state head _ <<< "$pr"
   [[ $head == "$sha" ]] || { merge_refuse "head moved to $head"; return 0; }
   [[ ${pr##* } == false ]] || { merge_refuse "draft"; return 0; }
+  # Up to date with the base. GitHub does not require it here (strict=false), and two PRs merged
+  # back to back each pass alone but leave main with a stale root crumb (Drake 2026-10-18: "don't
+  # make them all collapse").
+  if ! "$GIT" -C "$clone" cat-file -e "$sha^{commit}" 2>/dev/null; then
+    "$GIT" -C "$clone" fetch -q origin "pull/$num/head" 2>/dev/null || true
+  fi
+  if ! "$GIT" -C "$clone" merge-base --is-ancestor "origin/$base" "$sha" 2>/dev/null; then
+    merge_refuse "behind origin/$base: merge the base in, recompile crumbs, let checks rerun"; return 0
+  fi
   [[ $state != dirty ]] || { merge_refuse "mergeable state dirty (conflicts)"; return 0; }
   lfile=$STATE/bundles/$repo/$sha/bundle.json
   [[ -f $lfile ]] || { merge_refuse "no local bundle for head"; return 0; }
@@ -302,6 +322,7 @@ merge_one() {
   [[ $active == 0 ]] || { merge_refuse "$WORKFLOW_NAME run queued or in progress"; return 0; }
   if "$GH" pr merge "$num" -R "$s" --merge --match-head-commit "$sha"; then
     journal action=merge repo="$repo" pr="$num" sha="$sha" digest="$ldig" result=merged reason="all guards green"
+    MERGED_REPO=$repo
   else
     journal action=merge repo="$repo" pr="$num" sha="$sha" result=failed reason="gh pr merge failed"
   fi
@@ -309,6 +330,9 @@ merge_one() {
 
 do_merge() {
   local repo s prs num sha base draft labeled
+  MERGED_REPO=""
+  # Drake 2026-10-18: "stop all agents from trying to merge". Merge-only stop; publish and rerun keep going.
+  if [[ -e $STATE/MERGE-PAUSE ]]; then journal action=merge result=paused reason="MERGE-PAUSE present"; return 0; fi
   if ! fetch_receipts; then journal action=merge result=refused reason="receipts fetch failed"; return 0; fi
   for repo in "${repo_list[@]}"; do
     [[ -d $CLONES/$repo ]] || continue
@@ -322,6 +346,8 @@ do_merge() {
     fi
     while IFS=$'\t' read -r num sha base draft labeled; do
       [[ -n $num ]] || continue
+      # One merge per repository per round: the next one must first catch up with the new base.
+      [[ $MERGED_REPO != "$repo" ]] || break
       if [[ ! $sha =~ ^[0-9a-f]{40}$ ]]; then
         journal action=merge repo="$repo" pr="$num" result=refused reason="bad head sha"; continue
       fi
diff --git a/tools/aien-local-ci/tests/pipeline_test.sh b/tools/aien-local-ci/tests/pipeline_test.sh
index 9a760aa4..f31161ef 100755
--- a/tools/aien-local-ci/tests/pipeline_test.sh
+++ b/tools/aien-local-ci/tests/pipeline_test.sh
@@ -86,7 +86,11 @@ remote_commits() { git --git-dir="$T/receipts.git" rev-list --count main; }
 jl() { jq -c "select($1)" "$AIEN_STATE/pipeline.jsonl" | wc -l; }
 
 A=$(sha 1) B=$(sha 2) C=$(sha 3) D=$(sha 4) E=$(sha 5) F=$(sha 6) W=$(sha 7) P=$(sha 8)
-M1=$(sha 21) M2=$(sha 22) M3=$(sha 23) M4=$(sha 24) M5=$(sha 25) M6=$(sha 26) M7=$(sha 27) M8=$(sha 28) M9=$(sha 29)
+# Merge candidates are real commits on top of the trusted clone's origin/main: the merge guard requires
+# a head that already contains its base.
+head_on_main() { git -C "$AIEN_CLONES/demo" commit-tree -p origin/main -m "pr head $1" "origin/main^{tree}"; }
+M1=$(head_on_main 1) M2=$(head_on_main 2) M3=$(head_on_main 3) M4=$(head_on_main 4) M5=$(head_on_main 5)
+M6=$(head_on_main 6) M7=$(head_on_main 7) M8=$(head_on_main 8) M9=$(head_on_main 9)
 bundle demo "$A" "$K2" 0            # PASS, current key
 bundle demo "$B" "$K2" 1            # FAIL, still published
 bundle demo "$C" "$K3" 0            # key not in verify.pub: REJECTED (3) with both keys
@@ -190,10 +194,11 @@ echo "== merge"
 CTX1="Workspace Verification & Invariant Audit" CTX2="AIEN Verification (Spark)"
 ghset "repos/$S/branches/main/protection/required_status_checks" "{\"contexts\":[\"$CTX1\",\"$CTX2\"]}"
 L=ready-to-merge
-pulls "41:$M1:false:$L" "42:$M2:false:" "43:$M3:true:$L" "44:$M4:false:$L" "45:$M5:false:$L" \
-      "46:$M6:false:$L" "47:$M7:false:$L" "48:$M8:false:$L" "49:$M9:false:ready-to-merge-later"
+# 41 (all green) is listed last: one merge per round, so the refusals ahead of it are all evaluated.
+pulls "42:$M2:false:" "43:$M3:true:$L" "44:$M4:false:$L" "45:$M5:false:$L" \
+      "46:$M6:false:$L" "47:$M7:false:$L" "48:$M8:false:$L" "49:$M9:false:ready-to-merge-later" "41:$M1:false:$L"
 for i in 1 2 3 4 5 6 7 8 9; do
-  m=$(sha $((20 + i)))
+  mv=M$i; m=${!mv}
   state=clean; [[ $i == 8 ]] && state=dirty
   draft=false; [[ $i == 3 ]] && draft=true
   ghset "repos/$S/pulls/4$i" "{\"number\":4$i,\"draft\":$draft,\"mergeable_state\":\"$state\",\"head\":{\"sha\":\"$m\"}}"
@@ -226,6 +231,26 @@ bash "$PIPE" merge > "$T/out8" 2>&1
 check "no local bundle: refused" refused 41 "no local bundle"
 check "still exactly one merge call" [ "$(grep -c '^gh pr merge' "$FAKE_LOG")" = 1 ]
 
+echo "== merge order"
+M11=$(head_on_main 11) M12=$(head_on_main 12)
+pulls "51:$M11:false:$L" "52:$M12:false:$L"
+for n in 51 52; do
+  mv=M$((n - 40)); m=${!mv}
+  bundle demo "$m" "$K2" 0
+  ghset "repos/$S/pulls/$n" "{\"number\":$n,\"draft\":false,\"mergeable_state\":\"clean\",\"head\":{\"sha\":\"$m\"}}"
+  ghset "repos/$S/commits/$m/check-runs?per_page=100" "{\"check_runs\":[{\"name\":\"$CTX1\",\"status\":\"completed\",\"conclusion\":\"success\"}]}"
+  ghset "repos/$S/commits/$m/status?per_page=100" "{\"statuses\":[{\"context\":\"$CTX2\",\"state\":\"success\"}]}"
+  runs "$m" "$(run $((200 + n)) 'AIEN Verification' completed 2099-01-01T00:00:00Z)"
+done
+bash "$PIPE" publish > "$T/out8a" 2>&1
+bash "$PIPE" merge > "$T/out8b" 2>&1
+check "two green PRs: only the first merges this round" [ "$(merges 51)$(merges 52)" = 10 ]
+check "second PR left for the next round, no journal line" [ "$(jl ".action==\"merge\" and .pr==\"52\"")" = 0 ]
+echo moved > "$AIEN_CLONES/demo/MOVED" && git -C "$AIEN_CLONES/demo" add MOVED && git -C "$AIEN_CLONES/demo" commit -q -m moved && git -C "$AIEN_CLONES/demo" push -q origin main
+bash "$PIPE" merge > "$T/out8c" 2>&1
+check "base moved: head behind origin/main refused" refused 52 "behind origin/main"
+check "base moved: nothing merged" [ "$(merges 51)$(merges 52)" = 10 ]
+
 echo "== single instance"
 bundle demo "$(sha 99)" "$K2" 0
 exec 8>>"$AIEN_STATE/pipeline.lock"