Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/patches/c36f5e7086dc6a68 # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/aienux#262 (code only) closed derived `c36f5e7086dc6a68` #262 Imported from GitHub aien-dev/aienux#262 (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 `4dee261c83eab79cd1e12ca2c71183c2f0000930` · Head `4f13a1ffd17f3a0299792c598e4e148b66d5bb97` greptile-apps[bot] reviewed (COMMENTED) on 2026-10-05 03:58 UTC `aien-dev` has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan . ### Apply it ``` git checkout -b patch-c36f5e7086dc6a68 4dee261c83eab79cd1e12ca2c71183c2f0000930 curl -fsSL https://interplane.io/drakestapleton/aienux/patches/c36f5e7086dc6a68.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/aienux 262 4f13a1ffd17f3a0299792c598e4e148b66d5bb97 ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aienux","number":262,"url":"https://github.com/aien-dev/aienux/pull/262","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:05Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index b72a93fc..2bc38f56 100644 --- a/.crumb +++ b/.crumb @@ -28,7 +28,7 @@ }, { "digest": "8b848e5392b8d0fd71fe3fb6e5c8101f73369579446f76d994623d1da0374740", - "last_commit": "9d41efc", + "last_commit": "4dee261", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -39,21 +39,21 @@ "purpose": "Directory native. Purpose not yet described by a human." }, { - "digest": "07ca1d2521f97f9ca307c0d11fd0793cb00558b2a429f581c9bd3c2b91e4f1cf", - "last_commit": "9d41efc", + "digest": "b5c64f0277790e020d9c0fde19cc064fafc5c64e1d37d4e92ed88f5a40e36da3", + "last_commit": "2d5c343", "name": "scripts", "purpose": "Directory scripts. Purpose not yet described by a human." } ], - "children_root": "sha256:0f6bd8efc5885d6a70fb4aefbaa4d52d0c3be0aa2cb7c29226e33f1c875958a2", - "compiled_at": "2026-10-05T03:30:04Z", + "children_root": "sha256:d9069cba40ca4d11003bfc6ffc01428b9939792045a8e59d54cea281c0e1a907", + "compiled_at": "2026-10-05T04:05:50Z", "compiler": "crumb-compile/1", - "digest": "sha256:572d27997bf2f5a7138da1a99c5760968eb4f79246eb6a678c3df22b44ce0057", + "digest": "sha256:98c3326f77f4903e4c3706e7dc41a4605ac726e6895ecd4b6cf27ee34bf0e789", "evidence_files": 147, "evidence_root": "sha256:3f1c80574189eaded43ead3929d21a74c01f77dee31e7b2e2bd3858e67155dc7", "files": 2853, - "generated_at_commit": "9d41efc9d1bea31be0640ca70eeeec9d1d000fad", - "source_tree": "sha256:64bc674f6af5963292d2604131afb93a2ea5e7ce8e1638a357dd904a0809780c" + "generated_at_commit": "2d5c34342b6b54e986ab56d0be7f95a4027ba56c", + "source_tree": "sha256:6e40957cad1b88a60d04872b5903d75e1c18a8cb437600dd351e15da4dfcb07a" }, "owner_lane": "", "provenance": { diff --git a/scripts/.crumb b/scripts/.crumb index d6b09735..ba7c2930 100644 --- a/scripts/.crumb +++ b/scripts/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-05T02:01:59Z", + "compiled_at": "2026-10-05T03:53:55Z", "compiler": "crumb-compile/1", - "digest": "sha256:07ca1d2521f97f9ca307c0d11fd0793cb00558b2a429f581c9bd3c2b91e4f1cf", + "digest": "sha256:b5c64f0277790e020d9c0fde19cc064fafc5c64e1d37d4e92ed88f5a40e36da3", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 63, - "generated_at_commit": "71d5b326eea6a330f3cc1c4377fc4bc2d134d5aa", - "source_tree": "sha256:ec0193ea6eed88a2b80cd9ab91a52708e5cf613af4a4f719531eee4ac77d624d" + "generated_at_commit": "9d41efc9d1bea31be0640ca70eeeec9d1d000fad", + "source_tree": "sha256:41d218b96b3ce89b24b934fa7f023dc268c71d1b113e1a18e2b64a1e58b2e094" }, "owner_lane": "", "provenance": { diff --git a/scripts/trust1_m5_qualify.sh b/scripts/trust1_m5_qualify.sh index 41a8ef34..b3f77210 100755 --- a/scripts/trust1_m5_qualify.sh +++ b/scripts/trust1_m5_qualify.sh @@ -113,10 +113,53 @@ refuse_if_dirty() { fi } +# ------------------------------------------------- prerequisite host builds +# Some checks need a binary this script used to expect to exist already. A +# fresh checkout has none, so the check reported NOT_RUN ("a required tool is +# missing") even though cargo could build it. These helpers build the binary +# for THIS commit into the run's work folder. Return codes follow the row's +# notrun_rc: 0 ready; the NOTRUN code (cargo or the UEFI target is absent, the +# check cannot run, NOT_RUN and the verdict stays NOT_QUALIFIED); 1 the build +# itself failed (a real FAIL: the code at this commit does not build). +QUAL_CARGO="${QUAL_CARGO:-cargo}" +QUAL_RUSTC="${QUAL_RUSTC:-rustc}" +STORE_TOOL_BIN=""; LOADER_EFI="" +prereq_store_tool() { # prereq_store_tool NOTRUN_RC + if [[ -n "${RUST_STORE_TOOL:-}" ]]; then STORE_TOOL_BIN="${RUST_STORE_TOOL}"; return 0; fi + command -v "${QUAL_CARGO}" >/dev/null 2>&1 || { echo "prerequisite: cargo not found, cannot build aienos-store-tool"; return "$1"; } + local td="${work_dir}/build/cargo-store-tool" + echo "prerequisite: building aienos-store-tool at $(git -C "${repo_root}" rev-parse --short HEAD) into ${td}" + (cd "${repo_root}" && "${QUAL_CARGO}" build --quiet --release -p aienos-store-tool --target-dir "${td}") \ + || { echo "prerequisite build FAILED: aienos-store-tool"; return 1; } + STORE_TOOL_BIN="${td}/release/aienos-store-tool" + [[ -x "${STORE_TOOL_BIN}" ]] || { echo "prerequisite build FAILED: ${STORE_TOOL_BIN} not produced"; return 1; } +} +prereq_loader() { # prereq_loader NOTRUN_RC + if [[ -n "${AIENOS_KEY_CEREMONY_EFI:-}" ]]; then LOADER_EFI="${AIENOS_KEY_CEREMONY_EFI}"; return 0; fi + command -v "${QUAL_CARGO}" >/dev/null 2>&1 || { echo "prerequisite: cargo not found, cannot build the EFI loader"; return "$1"; } + local libdir; libdir="$("${QUAL_RUSTC}" --print target-libdir --target aarch64-unknown-uefi 2>/dev/null)" + [[ -n "${libdir}" && -d "${libdir}" ]] || { echo "prerequisite: rust target aarch64-unknown-uefi not installed, cannot build the EFI loader"; return "$1"; } + local td="${work_dir}/build/cargo-loader" + echo "prerequisite: building aienos-handoff.efi at $(git -C "${repo_root}" rev-parse --short HEAD) into ${td}" + (cd "${repo_root}" && AIENOS_COMMIT="$(git rev-parse HEAD)" AIENOS_RESTART_SECS=1 "${QUAL_CARGO}" build --quiet --release \ + -p aienos-boot --target aarch64-unknown-uefi --features handoff --bin aienos-handoff --target-dir "${td}") \ + || { echo "prerequisite build FAILED: aienos-handoff.efi"; return 1; } + LOADER_EFI="${td}/aarch64-unknown-uefi/release/aienos-handoff.efi" + [[ -f "${LOADER_EFI}" ]] || { echo "prerequisite build FAILED: ${LOADER_EFI} not produced"; return 1; } +} + # --------------------------------------------------------------- gate runners # Each runner writes everything to stdout/stderr; the caller logs it. run_measurement_tools() { bash "${repo_root}/scripts/test_trust1_measurement_tools.sh"; } -run_key_ceremony() { bash "${repo_root}/scripts/test_trust1_key_ceremony.sh"; } +run_key_ceremony() { + # The Boot Signer check needs a built EFI loader. Build one into this run's + # own work folder (never the repo's target/, so a stale prebuilt loader + # from another commit cannot stand in) unless AIENOS_KEY_CEREMONY_EFI + # names one. Exit 3 (NOT_RUN) only if the tools to build it are missing. + prereq_loader 3 || return $? + AIENOS_KEY_CEREMONY_EFI="${AIENOS_KEY_CEREMONY_EFI:-${LOADER_EFI}}" \ + bash "${repo_root}/scripts/test_trust1_key_ceremony.sh" +} run_gate7_preflight() { bash "${repo_root}/scripts/trust1_gate7_preflight.sh"; } run_recovery_tools() { bash "${repo_root}/scripts/verify_recovery_tools.sh"; } # The native Makefiles run ./$(TEST), so OUT must be relative to the @@ -127,14 +170,16 @@ native_make_test() { make -C "${dir}" OUT="$(realpath --relative-to="${dir}" "${out}")" test } run_store_c() { native_make_test store; } -# Rust cross-check of C-written stores: needs a built aienos-store-tool -# (RUST_STORE_TOOL, else target/release/aienos-store-tool); exit 2 = NOT_RUN. +# Rust cross-check of C-written stores: builds aienos-store-tool for this +# commit into the work folder (RUST_STORE_TOOL overrides); exit 2 = NOT_RUN only +# if cargo is absent, 1 if the build fails. run_store_rust_xcheck() { + prereq_store_tool 2 || return $? local dir="${repo_root}/native/store" out="${work_dir}/build/store-xcheck" mkdir -p "${out}" local rel; rel="$(realpath --relative-to="${dir}" "${out}")" make -C "${dir}" OUT="${rel}" "${rel}/store_xcheck" || return 1 - (cd "${dir}" && sh tests/rust_crosscheck.sh "./${rel}/store_xcheck" "${rel}") + (cd "${dir}" && RUST_STORE_TOOL="${STORE_TOOL_BIN}" sh tests/rust_crosscheck.sh "./${rel}/store_xcheck" "${rel}") } run_cargo_crypto() { (cd "${repo_root}" && cargo test -p aienos-crypto); } run_cargo_kernel() { (cd "${repo_root}" && cargo test -p aienos-kernel --lib -- crypto:: security::); } @@ -525,6 +570,51 @@ self_test() { expect qemu_quiet NOT_RUN; expect qemu_off NOT_RUN [[ ! -e "${sentinel}" ]] && ok "blocked/missing/vetoed gates never ran their runner" || bad "a blocked/missing/vetoed runner ran" + # Prerequisite builds (no real cargo): a missing tool is the row's NOT_RUN + # code, a failed build is FAIL (1), a built artifact is ready (0), and an + # override skips the build. Never a silent pass. + fake_cargo_build_ok() { # fake cargo: create what the real build would, under --target-dir + local td="" a; while [[ $# -gt 0 ]]; do [[ "$1" == --target-dir ]] && td="$2"; shift; done + mkdir -p "${td}/release" "${td}/aarch64-unknown-uefi/release" + : >"${td}/release/aienos-store-tool"; chmod +x "${td}/release/aienos-store-tool" + : >"${td}/aarch64-unknown-uefi/release/aienos-handoff.efi" + } + fake_cargo_build_bad() { return 101; } + fake_cargo_build_none() { return 0; } + fake_rustc_has_uefi() { echo "${tmp}"; } + fake_rustc_no_uefi() { echo "${tmp}/no-such-libdir"; } + prc() { # prc WANTED_RC DESCRIPTION CMD... + local want="$1" desc="$2" got; shift 2 + "$@" >/dev/null 2>&1; got=$? + [[ "${got}" == "${want}" ]] && ok "prereq: ${desc} -> exit ${want}" || bad "prereq: ${desc} -> exit ${got}, expected ${want}" + } + local saved_cargo="${QUAL_CARGO}" saved_rustc="${QUAL_RUSTC}" saved_tool="${RUST_STORE_TOOL:-}" saved_efi="${AIENOS_KEY_CEREMONY_EFI:-}" + unset RUST_STORE_TOOL AIENOS_KEY_CEREMONY_EFI + QUAL_CARGO=cargo_that_does_not_exist_anywhere; QUAL_RUSTC=fake_rustc_has_uefi + prc 2 "no cargo, store tool is NOT_RUN" prereq_store_tool 2 + prc 3 "no cargo, loader is NOT_RUN" prereq_loader 3 + QUAL_CARGO=fake_cargo_build_bad + prc 1 "failed store tool build is FAIL, not NOT_RUN" prereq_store_tool 2 + prc 1 "failed loader build is FAIL, not NOT_RUN" prereq_loader 3 + QUAL_CARGO=fake_cargo_build_none + prc 1 "build that produced no store tool is FAIL" prereq_store_tool 2 + prc 1 "build that produced no loader is FAIL" prereq_loader 3 + QUAL_CARGO=fake_cargo_build_ok; QUAL_RUSTC=fake_rustc_no_uefi + prc 3 "UEFI rust target absent, loader is NOT_RUN" prereq_loader 3 + QUAL_RUSTC=fake_rustc_has_uefi + prc 0 "store tool built" prereq_store_tool 2 + [[ -x "${STORE_TOOL_BIN}" && "${STORE_TOOL_BIN}" == "${work_dir}"/* ]] && ok "prereq: store tool lives in the work folder, not the repo target/" || bad "prereq: store tool path ${STORE_TOOL_BIN}" + prc 0 "loader built" prereq_loader 3 + [[ -f "${LOADER_EFI}" && "${LOADER_EFI}" == "${work_dir}"/* ]] && ok "prereq: loader lives in the work folder, not the repo target/" || bad "prereq: loader path ${LOADER_EFI}" + QUAL_CARGO=cargo_that_does_not_exist_anywhere + RUST_STORE_TOOL=/some/tool AIENOS_KEY_CEREMONY_EFI=/some/loader.efi + prc 0 "RUST_STORE_TOOL override skips the build" prereq_store_tool 2 + prc 0 "AIENOS_KEY_CEREMONY_EFI override skips the build" prereq_loader 3 + QUAL_CARGO="${saved_cargo}"; QUAL_RUSTC="${saved_rustc}" + unset RUST_STORE_TOOL AIENOS_KEY_CEREMONY_EFI + [[ -n "${saved_tool}" ]] && export RUST_STORE_TOOL="${saved_tool}" + [[ -n "${saved_efi}" ]] && export AIENOS_KEY_CEREMONY_EFI="${saved_efi}" + # Counts come only from the table: 2 PASS, 5 FAIL, 3 NOT_RUN, 2 blocked, 2 missing. count_results [[ "${n_pass}/${n_fail}/${n_notrun}/${n_blocked}/${n_missing}/${n_total}" == "2/5/3/2/2/14" ]] \ ```