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.
SC-MIRI and SC-INQUISITOR run on the Spark with no operator step (#600, #605)
merged27a2d5291ca94dc2 #682 · opened 2026-10-19 15:34 UTC · closed 2026-10-23 23:42 UTC · merged 2026-10-23 23:42 UTC
Imported from GitHub aien-dev/aien-sovereign-core-mv#682, by drakestapleton
Base d691a4dcc729d1f0425d2baab336eecb607511c8 · Head 458fc362e217a933df6c817781796872d272b159
Merged on GitHub as a24076008dca189aee8d55c1193bcb8f6fe8aa71; reachable from main 007ac4ac5ee5edc6f79f411b1706752293604044 (observed 2026-11-18T16:35:47Z)
drakestapleton wrote on 2026-10-19 15:34 UTC
What this fixes
Two gates that have never passed on the Spark, in one PR because each needs the other to get a full PASS: both change tests/gates/run.sh, which selects all 26 gates, so a PR with only the SC-MIRI fix would still fail SC-INQUISITOR and the other way round.
SC-MIRI (carries sc#649's two commits, #600). Miri needs a prebuilt standard-library sysroot. run.sh swaps in a fresh HOME when the sandbox HOME is read-only, which hid the sysroot, so miri tried to download it with no network and failed every time. install.sh now seeds the nightly toolchain and builds the miri sysroot once, offline, into the sandbox home; run.sh points MIRI_SYSROOT at it when it swaps HOME. The gate no longer needs an operator.
SC-INQUISITOR (#605). The step only knew how to fetch a GitHub PR diff with a token, so locally it always exited 3. The reviewer only reads the diff; run.sh now computes the same diff from git (merge base with origin/main ... HEAD; first parent for a head on main) and feeds it to the same reviewer with the same rules. Listed in .aien/always, cache: never, and the receipt records the base, the file count and whether the review was clean.
Evidence (Spark ~/workspace/gates-fix/evidence, report ~/handoffs/2026-10-19-gates-fix.md sections 2 and 3)
SC-MIRI before: miri-red-main-runsh.log (network error). After: miri-649-runsh.log, PASS in 14.5 min, and its planted memory bug (heap_dealloc_wrong_layout) is still caught.
SC-INQUISITOR before: inquisitor-red-main-runsh.log, exit 3. After: inquisitor-green.log, review PASS. Negative control: a planted .env file makes it fail (inquisitor-negative-control.log).
Pipeline note
Pipeline configuration change (rule A4): operator judge on the exact head. The miri sysroot has to exist under /var/lib/aien-run/.cache/miri before that run (install.sh step). Supersedes #649 (its commits are in here).
Fetch it
A git bundle of the pull request's head, 8264 bytes.
diff --git a/.aien/always b/.aien/always
index ed58dc1a..e8088d77 100644
--- a/.aien/always
+++ b/.aien/always
@@ -4,3 +4,4 @@ CRUMB-VERIFY
SC-ZERO-CUDA
SC-ZERO-DISK-SECRETS
SC-ANTI-SLOP
+SC-INQUISITOR
diff --git a/.crumb b/.crumb
index 13aa3164..66456d95 100644
--- a/.crumb
+++ b/.crumb
@@ -112,21 +112,21 @@
"purpose": ""
},
{
- "digest": "489b92d3d4363d2b403d6fee34a384284a40c25176df4dcc77eef07478ff8825",
- "last_commit": "96d89167",
+ "digest": "203ae832565f244db60aa12022b79754cbe7e149b1938d5634a4dee13c20c7fb",
+ "last_commit": "23849ce3",
"name": "tools/aien-local-ci",
"purpose": "Local CI sandbox exec contract (C8), aien-run user/caches install, Forgejo trigger hook, health "
}
],
- "children_root": "sha256:77e12a731b5dc9bca1bfe16166523fea1ad27cb510dd9a9703f53d01b8bef4a8",
- "compiled_at": "2026-10-23T21:02:33Z",
+ "children_root": "sha256:42ea2bf0f63e1ffb956d9615f1cb55bde3490da8deb33cbdd1e2e7191ec118ff",
+ "compiled_at": "2026-10-23T22:13:54Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:1acfc0480c559f6b67ff59a44ec07a9621ba1474acd90490c38426403910776d",
+ "digest": "sha256:22bf3b79a9a70f7812d7b7204b163629305aff031a329304cd51f99dffa7e4fd",
"evidence_files": 1578,
"evidence_root": "sha256:135e27a1a0704c4a8371cd2c1eb555f2b5beec61c212949b029a5457418a7160",
"files": 5894,
- "generated_at_commit": "3c3df25214ad0e848c549bc9ca840f8d10f9d77f",
- "source_tree": "sha256:c9e8831d76e8a233f017bbaeaff0994a24a1218d51abde8fe412523e90980bae"
+ "generated_at_commit": "edb047f1a6c3bd763fcb2ee5d0b4c9a8f7a3f456",
+ "source_tree": "sha256:60281c7f26903711299406a05d71ab77064967b7ed4d2c06458cb189b9c650ac"
}
},
"history": [],
diff --git a/tests/gates/run.sh b/tests/gates/run.sh
index 3514e894..e7c6a873 100755
--- a/tests/gates/run.sh
+++ b/tests/gates/run.sh
@@ -25,6 +25,11 @@ if [ -n "${HOME:-}" ] && [ ! -w "$HOME" ]; then
HOME="$(mktemp -d)"; export HOME
trap 'rm -rf "$HOME"' EXIT
if [ -f "$ro_home/.gitconfig" ]; then cp "$ro_home/.gitconfig" "$HOME/.gitconfig"; fi
+ # The miri sysroot that install.sh prebuilt under the read-only HOME (#600) stays the one miri uses;
+ # the fresh HOME would otherwise send `cargo miri setup` off to rebuild it offline, which cannot work.
+ if [ -z "${MIRI_SYSROOT:-}" ] && [ -d "$ro_home/.cache/miri/lib" ]; then
+ MIRI_SYSROOT="$ro_home/.cache/miri"; export MIRI_SYSROOT
+ fi
fi
obs() { printf 'AIEN-OBS %s %s\n' "$1" "$2"; }
# Inside the user sandbox (AIEN_SANDBOX_NESTED=1, set by the worker) five aien-test self-tests that would
@@ -169,11 +174,32 @@ case "$step" in
fi
bash scripts/test-release-real-tree.sh
;;
- # sovereign-inquisitor.yml (pull_request_target: needs the PR diff and GITHUB_TOKEN)
+ # sovereign-inquisitor.yml (pull_request_target). The hosted job fetched `gh pr diff` with GITHUB_TOKEN only to
+ # get the diff; the verdict (exit 1 unless the audit is clean) depends on nothing but the diff text, and the
+ # author, number and title only decorate the comment. The same diff is computed here from git: base...HEAD, where
+ # base is the merge base with the base line (what `gh pr diff` shows), or for a head already on the base line its
+ # first parent (the rule the worker's plan uses). The worker's base line is origin/main (AIEN_BASE_REF overrides).
+ # Posting the comment and labels stays a GitHub job; nothing here writes to GitHub.
inquisitor)
cargo build --release -p spark-inquisitor
- echo "run.sh: the review step needs a GitHub pull request diff and token (pull_request_target); nothing to run locally" >&2
- exit 3
+ base_ref="${AIEN_BASE_REF:-origin/main}"
+ if ! git rev-parse --verify -q "$base_ref^{commit}" >/dev/null; then
+ echo "run.sh: base $base_ref is not in this checkout; cannot compute the pull request diff" >&2
+ exit 3
+ fi
+ head="$(git rev-parse HEAD)"
+ base="$(git merge-base HEAD "$base_ref")"
+ if [ "$base" = "$head" ]; then base="$(git rev-parse HEAD^1)"; fi
+ diff_file="$(mktemp)"
+ git diff --no-color --no-ext-diff "$base" "$head" > "$diff_file"
+ obs inquisitor_base "\"$base\""
+ obs inquisitor_diff_files "$(git diff --name-only "$base" "$head" | grep -c . || true)"
+ rc=0
+ "$TARGET/release/spark-inquisitor" review --author local --pr 0 \
+ --title "$(git log -1 --format=%s "$head")" --diff "$diff_file" || rc=$?
+ rm -f "$diff_file"
+ obs inquisitor_clean "$([ "$rc" = 0 ] && echo true || echo false)"
+ exit "$rc"
;;
*) echo "run.sh: unknown step '$step'" >&2; exit 2 ;;
esac
diff --git a/tests/gates/sc-inquisitor.gate b/tests/gates/sc-inquisitor.gate
index 2e9aef9f..b334326b 100644
--- a/tests/gates/sc-inquisitor.gate
+++ b/tests/gates/sc-inquisitor.gate
@@ -1,12 +1,14 @@
# tests/gates/sc-inquisitor.gate
-# Mirrors hosted: sovereign-inquisitor.yml (pull_request_target): builds spark-inquisitor and reviews the PR diff fetched with GITHUB_TOKEN
-# requires: operator because the review needs a GitHub pull request diff and token (pull_request_target context) that do not exist locally.
+# Mirrors hosted: sovereign-inquisitor.yml (pull_request_target): builds spark-inquisitor and audits the pull request diff.
+# The hosted job needed GITHUB_TOKEN only to fetch the diff (gh pr diff); the verdict depends on the diff text alone.
+# run.sh computes the same diff from git (merge base with origin/main ... HEAD; first parent for a head on main), so the
+# gate runs with no operator and no token (sc #605). It is listed in .aien/always, so it runs on every change like the
+# hosted job did. Never cached: the diff depends on the base as well as the tree.
gate: SC-INQUISITOR
manifest_version: 2
owner: aien-sovereign-core
requires:
- host
- - operator
inputs:
- crates/spark-inquisitor/
- tests/gates/
@@ -15,7 +17,9 @@ run:
args: ["inquisitor"]
expects:
exit: 0
+ observe: ["inquisitor_clean == true"]
verdict: PASS
timeout: 30m
+cache: never
exactness: EXACT
cache_scope: machine
diff --git a/tests/gates/sc-miri.gate b/tests/gates/sc-miri.gate
index 87bf9144..7b3bab2f 100644
--- a/tests/gates/sc-miri.gate
+++ b/tests/gates/sc-miri.gate
@@ -1,12 +1,11 @@
# tests/gates/sc-miri.gate
# Mirrors hosted: hardening.yml miri: cargo +nightly miri test for aien-capability and aien-kv-cache + run_mutants.sh miri (hosted 1622 s)
-# requires: operator in addition to host because the nightly miri component is not installed on this machine (rustup component add miri --toolchain nightly); the operator decides whether to install it. Hosted installs it on every run.
+# requires: host only. The nightly toolchain with miri and a prebuilt miri sysroot are seeded read-only into the sandbox by tools/aien-local-ci/install.sh (#600), so the run needs no network and no operator step.
gate: SC-MIRI
manifest_version: 2
owner: aien-sovereign-core
requires:
- host
- - operator
inputs:
- crates/aien-capability/
- crates/aien-kv-cache/
diff --git a/tools/aien-local-ci/.crumb b/tools/aien-local-ci/.crumb
index 6a8042e3..7063f012 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-19T18:48:05Z",
+ "compiled_at": "2026-10-19T20:32:59Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:489b92d3d4363d2b403d6fee34a384284a40c25176df4dcc77eef07478ff8825",
+ "digest": "sha256:203ae832565f244db60aa12022b79754cbe7e149b1938d5634a4dee13c20c7fb",
"evidence_files": 0,
"evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"files": 18,
- "generated_at_commit": "96d8916795a0fab0f01cdcb1d3a9a8cfb12571b1",
- "source_tree": "sha256:c12a50cb169910de1a0bcf4c541fa5b90e07316865fc6c662bfdaad29723a80b"
+ "generated_at_commit": "5e82c2a94b039f887f74f89eb8d14277b46c5c33",
+ "source_tree": "sha256:a90164c0d2053478153d379efc5c841b2a13dd1faec78a66fd83d8bbb9d15706"
}
},
"layer": "infra",
diff --git a/tools/aien-local-ci/README.md b/tools/aien-local-ci/README.md
index a5ee7188..db8d6d31 100644
--- a/tools/aien-local-ci/README.md
+++ b/tools/aien-local-ci/README.md
@@ -111,7 +111,8 @@ added by this lane.
| `cargo/` | root 0755 | CARGO_HOME (cargo works with it read-only: `--locked --offline` builds need no writes there) |
| `cargo/registry`, `cargo/git` | root, read-only | seeded once from `~/.cargo` (1.9 GB + 1.3 GB; the git cache is needed because `Cargo.lock` has 3 git sources) |
| `cargo/bin` | root | the operator's `rustup` binary + proxy symlinks; no second rustup install |
-| `rustup/` | root, read-only | `settings.toml` (default 1.98.1) + `toolchains/1.98.1-aarch64-unknown-linux-gnu` copied (631 MB) |
+| `rustup/` | root, read-only | `settings.toml` (default 1.98.1) + `toolchains/1.98.1-aarch64-unknown-linux-gnu` copied (631 MB), plus `toolchains/nightly-aarch64-unknown-linux-gnu` with miri for SC-MIRI |
+| `.cache/miri` | root, read-only | miri sysroot built once by `install.sh` against the copied nightly (110 MB); `cargo +nightly miri setup` in the sandbox finds it and writes nothing (#600) |
| `.gitconfig` | root 0644 | `safe.directory = *` (git 2.43 has no path globs; aien-run reaches nothing else) |
| `/tmp/aien-gb10.lock` | root 0664, ACL `u:drakestapleton:rw-`, `u:aien-run:rw-` | the one GB10 chip lock for operator runs and sandboxed gb10 gates; root ownership gets past `fs.protected_regular=2` in sticky `/tmp`; `/etc/tmpfiles.d/aien-gb10.conf` recreates it at boot (#627); a gb10 gate waits for it in the kernel queue up to 30 min by default (`aien-test --gpu-wait`, between the live server's requests), then is NOT_RUN `gpu_lock`; the wait is in each receipt (`volatile.gpu_wait`) |
| `mirror/<repo>.git` | drakestapleton 0755 | bare mirror of the trusted clone, refreshed by `wt.sh sync`; unwritable by aien-run |
diff --git a/tools/aien-local-ci/install.sh b/tools/aien-local-ci/install.sh
index 57f8e4d6..18e2561e 100755
--- a/tools/aien-local-ci/install.sh
+++ b/tools/aien-local-ci/install.sh
@@ -20,6 +20,7 @@ RUN_HOME=/var/lib/aien-run
OPERATOR=${AIEN_OPERATOR:-drakestapleton}
OP_HOME=$(getent passwd "$OPERATOR" | cut -d: -f6)
TOOLCHAIN=${AIEN_TOOLCHAIN:-1.98.1-aarch64-unknown-linux-gnu}
+MIRI_TOOLCHAIN=${AIEN_MIRI_TOOLCHAIN:-nightly-aarch64-unknown-linux-gnu}
STATE="$OP_HOME/.local/state/aien-local-ci"
# crumb source: aien-architecture main at this commit (2026-10-11, on GitHub main), file tools/crumb/crumb.c
# (git blob 841f5317480b6643086061585c4309097975d8f9). Built with gcc 13.3.0 the binary's sha256 is
@@ -102,13 +103,34 @@ seed_ro() { # seed_ro SRC DST
seed_ro "$OP_HOME/.cargo/registry" "$RUN_HOME/cargo/registry"
seed_ro "$OP_HOME/.cargo/git" "$RUN_HOME/cargo/git"
seed_ro "$OP_HOME/.rustup/toolchains/$TOOLCHAIN" "$RUN_HOME/rustup/toolchains/$TOOLCHAIN"
+# SC-MIRI (#600): the operator's nightly (with the miri and rust-src components) is copied the same way, and
+# the miri sysroot is built once here, as root, into aien-run's default ~/.cache/miri. It has to be built against
+# the copied toolchain path (cargo-miri hashes the source path, so a sysroot built from ~/.rustup is rejected and
+# rebuilt, which fails on the read-only cache). The build fetches std's dependencies with a throwaway CARGO_HOME;
+# the sandbox then only reads the finished sysroot and `cargo +nightly miri setup` is a no-op.
+seed_ro "$OP_HOME/.rustup/toolchains/$MIRI_TOOLCHAIN" "$RUN_HOME/rustup/toolchains/$MIRI_TOOLCHAIN"
+if [[ -x $RUN_HOME/rustup/toolchains/$MIRI_TOOLCHAIN/bin/cargo-miri ]]; then
+ S install -d -o root -g root -m 0755 "$RUN_HOME/.cache"
+ if ! S test -d "$RUN_HOME/.cache/miri/lib"; then
+ S rm -rf "$RUN_HOME/.cache/miri" "$tmp/miri-cargo"
+ S env -i HOME=/root RUSTUP_HOME="$RUN_HOME/rustup" CARGO_HOME="$tmp/miri-cargo" \
+ MIRI_SYSROOT="$RUN_HOME/.cache/miri" PATH="$RUN_HOME/cargo/bin:/usr/bin:/bin" \
+ "$RUN_HOME/cargo/bin/cargo" "+$MIRI_TOOLCHAIN" miri setup
+ S rm -rf "$tmp/miri-cargo"
+ say "built miri sysroot $RUN_HOME/.cache/miri"
+ fi
+ S chown -R root:root "$RUN_HOME/.cache/miri"
+ S chmod -R a+rX,u-w,go-w "$RUN_HOME/.cache/miri"
+else
+ say "skip miri sysroot (no cargo-miri in $MIRI_TOOLCHAIN: rustup component add miri rust-src --toolchain nightly)"
+fi
# 4. rustup: the operator's rustup binary acts as the proxy (cargo/rustc/... are symlinks to it), with
# RUSTUP_HOME=/var/lib/aien-run/rustup holding only settings.toml + the copied toolchain. No rustup-init,
# no downloads: rust-toolchain.toml pins resolve against the copied toolchain only.
S install -d -o root -g root -m 0755 "$RUN_HOME/cargo/bin"
S install -o root -g root -m 0755 "$OP_HOME/.cargo/bin/rustup" "$RUN_HOME/cargo/bin/rustup"
-for p in cargo rustc rustdoc rustfmt cargo-fmt cargo-clippy clippy-driver rust-gdb rust-lldb; do
+for p in cargo rustc rustdoc rustfmt cargo-fmt cargo-clippy clippy-driver rust-gdb rust-lldb cargo-miri miri; do
S ln -sfn rustup "$RUN_HOME/cargo/bin/$p"
done
printf 'version = "12"\ndefault_toolchain = "%s"\nprofile = "minimal"\n\n[overrides]\n' "$TOOLCHAIN" > "$tmp/settings.toml"