AIENOS-VERIFY-ALL passes on the Spark judge: own target dir, 60m, no-sudo kernel copy, sbin on PATH
merged3b1a868b0fffe313 #437 · opened 2026-10-19 13:48 UTC · closed 2026-10-19 16:43 UTC · merged 2026-10-19 16:43 UTC
Imported from GitHub aien-dev/aienux#437, by drakestapleton
Labels: ready-to-merge
Base 5d039d8b94b59fa248f9ca7c673bf2f28bc14ff9 · Head 94b37eac942273ecf494da85a3aa09e055d4f4dd
Merged on GitHub as 18e276590424593647cd7c39c6d16c2f9f8d6027; reachable from main d01b2f19cccf3e173a6bdb3541813d467f537a76 (observed 2026-11-18T16:35:38Z)
drakestapleton wrote on 2026-10-19 13:48 UTC
Makes the AIENOS-VERIFY-ALL gate pass on the Spark judge. It has failed on every aienos head that selected it since 2026-10-16 (so main would fail it too), and it blocks the crumb migration #434. #436 (merged) fixed the first cause, unoptimized model tests that ran past the timeout. This PR fixes the rest, each found by running the gate the way the judge does:
Wrong target directory. The harness and its QEMU scripts read build output from target/ in the checkout (target/aarch64-unknown-uefi/release/aienos-boot.efi), but the judge sets CARGO_TARGET_DIR to a shared directory, so the UEFI image check failed with No such file or directory (fa1adc07). The shared directory also handed test binaries built in another head's worktree, whose fixture paths no longer existed (3 forward tests NotFound, c3cc26f8 and 09f8040f). Fix: verify_all.sh exports CARGO_TARGET_DIR="$REPO_ROOT/target".
Gate timeout. With its own cold target/ the whole harness took 1591 s on an idle Spark and 2226 s in the operator run of 6dd74fa2 while other judges ran. tests/gates/aienos-verify-all.gate timeout goes from 30 to 60 min. Command, inputs and expected verdict unchanged.
No sudo in the judge. The TRUST-1 Gate 1 recovery boot copies the host kernel /boot/vmlinuz-* (root 0600) with sudo -n; the judge runs with no_new_privs, so it failed there (sudo: The "no new privileges" flag is set, operator run of 6dd74fa2). Fix: qemu_verify_recovery_media.sh first tries a readable kernel, then sudo -n, then a read-only copy of the same kernel at $HOME/boot/vmlinuz, the same way the judge already provides $HOME/models. The desk placed that copy on the Spark: /var/lib/aien-run/boot/vmlinuz, root 0644, byte-identical to /boot/vmlinuz-7.0.0-1019-nvidia (sha256 ddd5a25c2326fbfd...). It prints a NOTE line when it uses it.
No sbin on the judge's PATH. The recovery initrd build runs modprobe --show-depends (unprivileged, reads /lib/modules), but the judge PATH has no /usr/sbin: modprobe: command not found. Fix: verify_all.sh appends /usr/sbin:/sbin to PATH (earlier entries keep precedence).
Checked on the Spark with the judge's conditions reproduced (setpriv --no-new-privs, cleared environment, judge PATH, read-only HOME, the judge's read-only CARGO_HOME/RUSTUP_HOME, an outside CARGO_TARGET_DIR): the full harness ran to Gate 1 and failed exactly as the judge did on causes 3 and 4; with the fixes, Gate 1 and every later step (recovery tool manifest, TRUST-1 measurement tools, Secure Boot signing in QEMU, key ceremony self-test, receipt label lint) exit 0. Without the judge restrictions the whole harness ends VERIFY_ALL: PASS. crumb verify . OK (crumbs recompiled with the pinned tool, crumb commit last).
This changes tests/gates/, so it is a pipeline configuration change (rule A4): the desk runs the operator judge on the exact head and merges on PASS. Hardware columns stay NOT_RUN.
Apply it
git checkout -b patch-3b1a868b0fffe3135d039d8b94b59fa248f9ca7c673bf2f28bc14ff9
curl -fsSL https://interplane.io/drakestapleton/aienux/patches/3b1a868b0fffe313.patch | git am
diff --git a/.crumb b/.crumb
index 953ce9de..b35a3b6e 100644
--- a/.crumb
+++ b/.crumb
@@ -39,21 +39,21 @@
"purpose": "Directory native. Purpose not yet described by a human."
},
{
- "digest": "9adb69cc749bc97fa48e268f0397b900da83c84191ab6a9373358e8b9ab57922",
- "last_commit": "44cf2dd",
+ "digest": "28cf2363c4d527a9d7ecc2974f3dcda3e065959cbddaed7863d9c9354f166967",
+ "last_commit": "00d7759",
"name": "scripts",
"purpose": "Directory scripts. Purpose not yet described by a human."
}
],
- "children_root": "sha256:19cc8f21ac13e49018f60836bdaf7c4c23477cf558624048754f1e83c6d88cac",
- "compiled_at": "2026-10-19T13:11:36Z",
+ "children_root": "sha256:9dce6ec60d33531c951ea265c84962b9a7e5ca0199cd76e63ba01585a7c01928",
+ "compiled_at": "2026-10-19T15:08:12Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:d016b3e604f217ae98d70b17bc081f831a3b0d3882bc68d58e80d8744b93a19b",
+ "digest": "sha256:ea1028946ad65a777ed93ea1a58dee8a194f58035dbf961f631a313b044ee868",
"evidence_files": 211,
"evidence_root": "sha256:3a8f56415109a697e4beb6048c85805c50c9c6c4089629057f4e8b3e76863981",
"files": 3491,
- "generated_at_commit": "ff0728caef20cab9bc34f541b07e4eb4b55a9f2e",
- "source_tree": "sha256:0abb215a81dab9d845014dbf6882c36eee65e4c189474b574292d62e41dccd67"
+ "generated_at_commit": "00d77597386501631f08ac78ea5c0c3a0795348f",
+ "source_tree": "sha256:68db139dcb9eaed72ca1bd7795960ebd933df55d7f3f5b9d3495639071aba901"
},
"owner_lane": "",
"provenance": {
diff --git a/scripts/.crumb b/scripts/.crumb
index 2bac4872..610b7ddd 100644
--- a/scripts/.crumb
+++ b/scripts/.crumb
@@ -7,14 +7,14 @@
"generated": {
"children": [],
"children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
- "compiled_at": "2026-10-17T01:30:44Z",
+ "compiled_at": "2026-10-19T15:08:12Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:9adb69cc749bc97fa48e268f0397b900da83c84191ab6a9373358e8b9ab57922",
+ "digest": "sha256:28cf2363c4d527a9d7ecc2974f3dcda3e065959cbddaed7863d9c9354f166967",
"evidence_files": 0,
"evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"files": 119,
- "generated_at_commit": "44cf2dd5925747aebf105136d31c8db58d8851a4",
- "source_tree": "sha256:8ae58db519604c153d7140c6898139a24d1664716d187229aa125e147d370af1"
+ "generated_at_commit": "00d77597386501631f08ac78ea5c0c3a0795348f",
+ "source_tree": "sha256:be5e87b53a3b65b5663691620e616c5490a3a866f959349e7b608ead2a5ffcf6"
},
"owner_lane": "",
"provenance": {
diff --git a/scripts/qemu_verify_recovery_media.sh b/scripts/qemu_verify_recovery_media.sh
index 5676f2ee..ab47833e 100755
--- a/scripts/qemu_verify_recovery_media.sh
+++ b/scripts/qemu_verify_recovery_media.sh
@@ -28,11 +28,20 @@ if [[ -z "${PROD_VMLINUZ}" ]]; then
fi
KERNEL_IMAGE="${WORK_DIR}/vmlinuz"
+# /boot/vmlinuz-* is root 0600 on Ubuntu. The Spark judge runs gates as aien-run with no_new_privs, so sudo
+# cannot copy it there; the operator keeps a read-only copy of the same kernel at $HOME/boot/vmlinuz (root 0644,
+# HOME=/var/lib/aien-run), the way it provides $HOME/models. Use that copy only when the kernel cannot be read.
+JUDGE_VMLINUZ="${HOME:-/nonexistent}/boot/vmlinuz"
if [[ -r "${PROD_VMLINUZ}" ]]; then
cp "${PROD_VMLINUZ}" "${KERNEL_IMAGE}"
-else
- sudo -n cp "${PROD_VMLINUZ}" "${KERNEL_IMAGE}"
+elif sudo -n cp "${PROD_VMLINUZ}" "${KERNEL_IMAGE}" 2>/dev/null; then
sudo -n chown "$(id -u):$(id -g)" "${KERNEL_IMAGE}"
+elif [[ -r "${JUDGE_VMLINUZ}" ]]; then
+ echo "NOTE ${PROD_VMLINUZ} is not readable and sudo is unavailable; using the read-only copy ${JUDGE_VMLINUZ}"
+ cp "${JUDGE_VMLINUZ}" "${KERNEL_IMAGE}"
+else
+ echo "Error: cannot read ${PROD_VMLINUZ} (no sudo, no ${JUDGE_VMLINUZ})" >&2
+ exit 1
fi
INITRD_TMP="${WORK_DIR}/aienos-recovery-standalone-initrd.img"
diff --git a/scripts/verify_all.sh b/scripts/verify_all.sh
index 254d084a..dec4c3a7 100755
--- a/scripts/verify_all.sh
+++ b/scripts/verify_all.sh
@@ -19,6 +19,17 @@ if [[ -n "${AIENOS_LOG_DIR:-}" ]]; then
fi
cd "${REPO_ROOT}"
+# This harness and the QEMU scripts it calls read build output from target/ in this
+# checkout (for example target/aarch64-unknown-uefi/release/aienos-boot.efi). A caller's
+# CARGO_TARGET_DIR elsewhere (the Spark judge sets a shared one per repository) made the
+# UEFI image check fail with "No such file or directory", and a shared directory can hand
+# a test binary built from another checkout. Build into this checkout's own target/.
+export CARGO_TARGET_DIR="${REPO_ROOT}/target"
+# The Spark judge runs gates with PATH=/var/lib/aien-run/cargo/bin:/usr/local/bin:/usr/bin:/bin, without the sbin
+# directories. Unprivileged tools from there are still needed (the recovery initrd build runs
+# `modprobe --show-depends`), so append them; earlier PATH entries keep precedence.
+export PATH="${PATH}:/usr/sbin:/sbin"
+
# shellcheck source=scripts/lib_verify_summary.sh
source "${REPO_ROOT}/scripts/lib_verify_summary.sh"
diff --git a/tests/gates/aienos-verify-all.gate b/tests/gates/aienos-verify-all.gate
index 0803fd82..39690c64 100644
--- a/tests/gates/aienos-verify-all.gate
+++ b/tests/gates/aienos-verify-all.gate
@@ -1,4 +1,5 @@
# tests/gates/aienos-verify-all.gate
+# Timeout 60m: with its own cold target/ the full harness took 1591 s (26.5 min) on the Spark on 2026-10-19.
# Mirrors hosted: ci.yml (disabled_manually on GitHub) 'bash scripts/verify_all.sh' (verification harness + QEMU boot test); declared, not an active hosted job
gate: AIENOS-VERIFY-ALL
manifest_version: 2
@@ -16,6 +17,6 @@ run:
expects:
exit: 0
verdict: PASS
-timeout: 30m
+timeout: 60m
exactness: EXACT
cache_scope: machine