From bc1f7c9e5468d21275d70765aa0198e1702bb31e Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 18 Oct 2026 08:36:28 -0500 Subject: [PATCH 1/5] local-ci: SC-MIRI runs inside the sandbox with a seeded nightly and miri sysroot (#600) install.sh copies the operator's nightly toolchain read-only next to 1.98.1, builds the miri sysroot once as root against that copied path into aien-run's ~/.cache/miri (cargo-miri hashes the source path, so a sysroot built from ~/.rustup is rejected), locks it read-only, and adds the cargo-miri and miri proxy links. `cargo +nightly miri setup` in the sandbox is then a no-op, so sc-miri.gate needs only `host`. Co-Authored-By: Claude Opus 5.5 --- tests/gates/sc-miri.gate | 3 +-- tools/aien-local-ci/README.md | 3 ++- tools/aien-local-ci/install.sh | 24 +++++++++++++++++++++++- 3 files changed, 26 insertions(+), 4 deletions(-) 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/README.md b/tools/aien-local-ci/README.md index af8d9224..b566fec7 100644 --- a/tools/aien-local-ci/README.md +++ b/tools/aien-local-ci/README.md @@ -88,7 +88,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) | | `mirror/.git` | drakestapleton 0755 | bare mirror of the trusted clone, refreshed by `wt.sh sync`; unwritable by aien-run | | `wt//` | root dir drakestapleton:aien-run 1775, `.git` root 0644, files aien-run | checkouts; aien-run can add files, cannot replace `.git` or write the mirror | diff --git a/tools/aien-local-ci/install.sh b/tools/aien-local-ci/install.sh index 807592a3..e1176a80 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 @@ -91,13 +92,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" From 61cd3f8cf7809759e2d182f15004c4e73759a5ed Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 18 Oct 2026 08:36:35 -0500 Subject: [PATCH 2/5] crumb: recompile with the pinned tool (aien-architecture d0f0b95) Co-Authored-By: Claude Opus 5.5 --- .crumb | 52 ++++---------------------------------- tools/aien-local-ci/.crumb | 8 +++--- 2 files changed, 9 insertions(+), 51 deletions(-) diff --git a/.crumb b/.crumb index d38130fb..d4d48e62 100644 --- a/.crumb +++ b/.crumb @@ -63,42 +63,6 @@ "extensions": { "generated": { "children": [ - { - "digest": "4e7f370019e67f6c71565d1544530851eb1b3b1bed61c2712f4ac7d9614a89bf", - "last_commit": "6bbe2ec2", - "name": "crates/aien-allen", - "purpose": "ALLEN identity gate: resolve-only subject check, host pin record, deployment record (ADR 0035). " - }, - { - "digest": "40a231c50dba92af7de2527ab33879c5d1eaaa6e7ea5d6a5ebaa9d60c7542075", - "last_commit": "b9b52f9c", - "name": "crates/aien-allen-memory", - "purpose": "ALLEN scoped memory store: scopes enforced at recall, inspect/correct/export, key-destroying for" - }, - { - "digest": "44dc482b8c9db8919a68ec69b019cd77967232a6ec8b1910c0dfe3cd4d71f141", - "last_commit": "b9b52f9c", - "name": "crates/aien-allen-profile", - "purpose": "ALLEN persona profile v1: versioned, user-editable profile bound to the engaged ALLEN identity; " - }, - { - "digest": "f5571bcc0bb95b44dd8bf8f0b47ded3bcb1e1ee76c81b4ff5edb87ac237d66d8", - "last_commit": "f8eea420", - "name": "crates/aien-cli", - "purpose": "" - }, - { - "digest": "25fd9f8afbea19702750f8ddba2ef4aeafc5bc4515aa695340a5af6931989c03", - "last_commit": "8cca8020", - "name": "crates/aien-scheduler/src/bin", - "purpose": "" - }, - { - "digest": "dd11ae9a698f7fcad7d1df386926426ea051d4131ee738da2ac81eb6a57b9473", - "last_commit": "afbbd804", - "name": "crates/spark-cockpit-rs", - "purpose": "" - }, { "digest": "34b010337138a65931ca4d0177631d839f71af021c5092583f52afd69ddd1b72", "last_commit": "fe3677c3", @@ -110,23 +74,17 @@ "last_commit": "fa73e778", "name": "skills", "purpose": "" - }, - { - "digest": "b787845b373f1f2ef48522c2575a6de8ad32e3584bef4b578ba61d2ab053187c", - "last_commit": "fe3677c3", - "name": "tools/aien-local-ci", - "purpose": "Local CI sandbox exec contract (C8), aien-run user/caches install, Forgejo trigger hook, health " } ], - "children_root": "sha256:111edf8bf001ed434f7dacbc6d8ab9d75f6bda2cd909d01264fb42bbe38b1d74", - "compiled_at": "2026-10-17T11:58:09Z", + "children_root": "sha256:bd742d6a3614d943dddc615cc1f2e6a2ff9b3b0274923cbb231b9a6660460503", + "compiled_at": "2026-10-18T13:36:29Z", "compiler": "crumb-compile/1", - "digest": "sha256:90138b1fd1cf3ffa4f762b157930e959f2bea50c41351c40b41330ae9edff05b", + "digest": "sha256:8489b8dd7d18fba632ea9a6360063e7aecb8c388fb773109f276ea152fa1091a", "evidence_files": 1578, "evidence_root": "sha256:135e27a1a0704c4a8371cd2c1eb555f2b5beec61c212949b029a5457418a7160", "files": 5891, - "generated_at_commit": "6fb606867d2cd502b9475cd2ff0cc85ab40b16c9", - "source_tree": "sha256:7ac140a01c7f7ef0cc9f91a7cf9ea94fb063f8ca7f24365f185b9da5b2ed26b9" + "generated_at_commit": "bc1f7c9e5468d21275d70765aa0198e1702bb31e", + "source_tree": "sha256:fde1e9f42acda7aa397081c5e1fe9ffb33dd929b2919a1b19a7d29f6e2ed0b06" } }, "history": [], diff --git a/tools/aien-local-ci/.crumb b/tools/aien-local-ci/.crumb index 61fb8264..fb3e9792 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-17T11:27:44Z", + "compiled_at": "2026-10-18T13:36:29Z", "compiler": "crumb-compile/1", - "digest": "sha256:b787845b373f1f2ef48522c2575a6de8ad32e3584bef4b578ba61d2ab053187c", + "digest": "sha256:f363b08e713fc95b31cfa39b73501f7c090c5f7f5fc77d05c0d221f3276fe9ac", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 12, - "generated_at_commit": "fe3677c38c6cd8219db0959d954c8d83e1c8a52c", - "source_tree": "sha256:9cfa14eaf95c90bacd4d1a84f592c18e7a0f9abe0eb5992f9b779cf1a78b9d52" + "generated_at_commit": "bc1f7c9e5468d21275d70765aa0198e1702bb31e", + "source_tree": "sha256:a7a2b88a2c25942a05a661cad6a59c7a6bee8af81e05af22ab00020be19be299" } }, "layer": "infra", From 0493fc018d86e1c6cf7c55799e324a472ff373a0 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 18 Oct 2026 08:39:05 -0500 Subject: [PATCH 3/5] gates: run.sh keeps the prebuilt miri sysroot when it swaps the read-only HOME (#600) Co-Authored-By: Claude Opus 5.5 --- tests/gates/run.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/gates/run.sh b/tests/gates/run.sh index 3514e894..b14bc381 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 From a2539f8cd411659af9440616e813a4e447f87dce Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 18 Oct 2026 08:39:13 -0500 Subject: [PATCH 4/5] crumb: recompile with the pinned tool (aien-architecture d0f0b95) Co-Authored-By: Claude Opus 5.5 --- .crumb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.crumb b/.crumb index d4d48e62..42de4903 100644 --- a/.crumb +++ b/.crumb @@ -77,14 +77,14 @@ } ], "children_root": "sha256:bd742d6a3614d943dddc615cc1f2e6a2ff9b3b0274923cbb231b9a6660460503", - "compiled_at": "2026-10-18T13:36:29Z", + "compiled_at": "2026-10-18T13:39:06Z", "compiler": "crumb-compile/1", - "digest": "sha256:8489b8dd7d18fba632ea9a6360063e7aecb8c388fb773109f276ea152fa1091a", + "digest": "sha256:eb561a9c3bf075b4cb11cf003286a82a0a89cd4737a02fca9306f52f57730bdd", "evidence_files": 1578, "evidence_root": "sha256:135e27a1a0704c4a8371cd2c1eb555f2b5beec61c212949b029a5457418a7160", "files": 5891, - "generated_at_commit": "bc1f7c9e5468d21275d70765aa0198e1702bb31e", - "source_tree": "sha256:fde1e9f42acda7aa397081c5e1fe9ffb33dd929b2919a1b19a7d29f6e2ed0b06" + "generated_at_commit": "0493fc018d86e1c6cf7c55799e324a472ff373a0", + "source_tree": "sha256:3f60c172ea68653b2b74fb092f824dbc16f98d3691fdc444b48ff7fb19c89a9b" } }, "history": [], From 7ffc10a0bc190370d19d373bbccd436760c793d6 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 18 Oct 2026 09:31:51 -0500 Subject: [PATCH 5/5] crumb: recompile with the CI-pinned tool (aien-architecture 94fffbcf) Co-Authored-By: Claude Opus 5.5 --- .crumb | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/.crumb b/.crumb index 42de4903..799aff6c 100644 --- a/.crumb +++ b/.crumb @@ -63,6 +63,42 @@ "extensions": { "generated": { "children": [ + { + "digest": "4e7f370019e67f6c71565d1544530851eb1b3b1bed61c2712f4ac7d9614a89bf", + "last_commit": "6bbe2ec2", + "name": "crates/aien-allen", + "purpose": "ALLEN identity gate: resolve-only subject check, host pin record, deployment record (ADR 0035). " + }, + { + "digest": "40a231c50dba92af7de2527ab33879c5d1eaaa6e7ea5d6a5ebaa9d60c7542075", + "last_commit": "b9b52f9c", + "name": "crates/aien-allen-memory", + "purpose": "ALLEN scoped memory store: scopes enforced at recall, inspect/correct/export, key-destroying for" + }, + { + "digest": "44dc482b8c9db8919a68ec69b019cd77967232a6ec8b1910c0dfe3cd4d71f141", + "last_commit": "b9b52f9c", + "name": "crates/aien-allen-profile", + "purpose": "ALLEN persona profile v1: versioned, user-editable profile bound to the engaged ALLEN identity; " + }, + { + "digest": "f5571bcc0bb95b44dd8bf8f0b47ded3bcb1e1ee76c81b4ff5edb87ac237d66d8", + "last_commit": "f8eea420", + "name": "crates/aien-cli", + "purpose": "" + }, + { + "digest": "25fd9f8afbea19702750f8ddba2ef4aeafc5bc4515aa695340a5af6931989c03", + "last_commit": "8cca8020", + "name": "crates/aien-scheduler/src/bin", + "purpose": "" + }, + { + "digest": "dd11ae9a698f7fcad7d1df386926426ea051d4131ee738da2ac81eb6a57b9473", + "last_commit": "afbbd804", + "name": "crates/spark-cockpit-rs", + "purpose": "" + }, { "digest": "34b010337138a65931ca4d0177631d839f71af021c5092583f52afd69ddd1b72", "last_commit": "fe3677c3", @@ -74,16 +110,22 @@ "last_commit": "fa73e778", "name": "skills", "purpose": "" + }, + { + "digest": "f363b08e713fc95b31cfa39b73501f7c090c5f7f5fc77d05c0d221f3276fe9ac", + "last_commit": "bc1f7c9e", + "name": "tools/aien-local-ci", + "purpose": "Local CI sandbox exec contract (C8), aien-run user/caches install, Forgejo trigger hook, health " } ], - "children_root": "sha256:bd742d6a3614d943dddc615cc1f2e6a2ff9b3b0274923cbb231b9a6660460503", - "compiled_at": "2026-10-18T13:39:06Z", + "children_root": "sha256:ed77ce5f1b500dee7cc37d79bd8f4fed6d2b6c07683e119715e07dc713e8edd4", + "compiled_at": "2026-10-18T14:31:50Z", "compiler": "crumb-compile/1", - "digest": "sha256:eb561a9c3bf075b4cb11cf003286a82a0a89cd4737a02fca9306f52f57730bdd", + "digest": "sha256:827a157b398d4bd7fbcd81ddfd7ce4736352e47bf104e14635cdb1f131224c7f", "evidence_files": 1578, "evidence_root": "sha256:135e27a1a0704c4a8371cd2c1eb555f2b5beec61c212949b029a5457418a7160", "files": 5891, - "generated_at_commit": "0493fc018d86e1c6cf7c55799e324a472ff373a0", + "generated_at_commit": "a2539f8cd411659af9440616e813a4e447f87dce", "source_tree": "sha256:3f60c172ea68653b2b74fb092f824dbc16f98d3691fdc444b48ff7fb19c89a9b" } },