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/8a94f82243f09408 # 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#304 (code only) closed derived `8a94f82243f09408` #304 Imported from GitHub aien-dev/aienux#304 (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 `3b2004b692a703d8085c8f4f2ba545de1deb8667` · Head `e623b9e2860e67cc34efc7f5fd3dbdad1066d8c9` ### Apply it ``` git checkout -b patch-8a94f82243f09408 3b2004b692a703d8085c8f4f2ba545de1deb8667 curl -fsSL https://interplane.io/drakestapleton/aienux/patches/8a94f82243f09408.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 304 e623b9e2860e67cc34efc7f5fd3dbdad1066d8c9 ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aienux","number":304,"url":"https://github.com/aien-dev/aienux/pull/304","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:10Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.aien/always b/.aien/always new file mode 100644 index 00000000..b201db8a --- /dev/null +++ b/.aien/always @@ -0,0 +1,5 @@ +# Gates that run on every commit regardless of changed paths (ADR 0033 Decision 12 +# allow-list; inventory contract C6). One gate name per line. Read from the base ref. +CRUMB-VERIFY +AIENOS-CRYPTO-BOUNDARY +AIENOS-ZERO-DISK-SECRETS diff --git a/.aien/unmapped-ok b/.aien/unmapped-ok new file mode 100644 index 00000000..ceb0d3a7 --- /dev/null +++ b/.aien/unmapped-ok @@ -0,0 +1,10 @@ +# Changed paths matching these globs need only the always-run set (.aien/always). +# Everything else must be covered by a manifest's inputs or the commit is NOT_RUN. +# Conservative: only paths every hosted workflow path-filter leaves out and no suite +# compiles or reads. Read from the base ref. +docs/** +*.md +LICENSE +NOTICE +.gitignore +funding.json diff --git a/.aien/verify.pub b/.aien/verify.pub new file mode 100644 index 00000000..3e654113 --- /dev/null +++ b/.aien/verify.pub @@ -0,0 +1 @@ +01368e0b02dc1113ae7425ad6ab00fdf5aa7dd97e0690745918a52f051d5cf68 diff --git a/.crumb b/.crumb index f1657082..7c3e2aaa 100644 --- a/.crumb +++ b/.crumb @@ -28,7 +28,7 @@ }, { "digest": "3ee624a79df42f92ed58adfd80a511bc2f68dad065fd2cd8b8ce97176879fda0", - "last_commit": "b40d23f", + "last_commit": "3b2004b", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -46,14 +46,14 @@ } ], "children_root": "sha256:eb85eae85331edd701f4123676822a283f17968b79937a88acc0fb6a6887102f", - "compiled_at": "2026-10-11T14:02:56Z", + "compiled_at": "2026-10-11T19:13:15Z", "compiler": "crumb-compile/1", - "digest": "sha256:de899ad3e8ef3e1edb3c0ff1fd40d38bdc82970b79bbe0051015ff2fe5ef435e", + "digest": "sha256:b8a38ecb845333d61d8e0ba508aa727a3b288344fd7ef239247785a111b2a044", "evidence_files": 155, "evidence_root": "sha256:d59c0cef4e7dd5172923754a95b411ca54b01f35baca4587f792f1b259f1eaf7", - "files": 3039, - "generated_at_commit": "b40d23ffe805b2044cb3cd1da6f79e03db3d7517", - "source_tree": "sha256:4da7de6f9224c5a9ab966ecf68b3526bc113b5e2a1fc58f9e1dfaf933895be96" + "files": 3065, + "generated_at_commit": "1f65b022134cb14fae8622bd7ed5cd405f9c6d71", + "source_tree": "sha256:d63cc0e56c625ba315cb233e373c6d910f523916214efa260e1656c791569bb8" }, "owner_lane": "", "provenance": { diff --git a/.github/workflows/aien-verification.yml b/.github/workflows/aien-verification.yml new file mode 100644 index 00000000..126e8c91 --- /dev/null +++ b/.github/workflows/aien-verification.yml @@ -0,0 +1,186 @@ +# AIEN Verification: the GitHub thin gate (ADR 0033 Decision 11, inventory contract C5). +# +# PHASE 2 DRAFT (2026-10-11, lane REPOS). This workflow is NOT a required check yet. It runs +# beside the existing hosted workflows so that, for N >= 3 commits, the hosted verdict and the +# locally signed bundle verdict can be compared (advisor amendment A7). Nothing here changes +# the repository's required contexts; that switch is phase 3 and needs Drake's agreement. +# +# What it does: checkout; read the trust anchors from the BASE ref (origin/main), never from +# the head under test (amendment A1); crumb verify; fetch //bundle.json from +# aien-dev/aien-receipts; verify the bundle signature and content with the pinned aien-test +# build; run the repository's portable smoke set (gates whose requires is only "portable"). +# +# GitHub-hosted compute: this workflow compiles only the two pinned verifier tools (the crumb +# checker, and aien-test once the repository is enrolled). It never builds or tests this +# repository's own code; the portable smoke set is text scans and format checks only. +# +# PHASE 3 FLIPS (marked "PHASE3" below): a missing bundle becomes NOT_RUN (status pending with +# a retry window) instead of a neutral note, and a trust-surface change becomes a failure +# unless the operator ran it by hand (BLOCKED_OPERATOR). +name: AIEN Verification + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + verify: + name: AIEN Verification + runs-on: ubuntu-latest + timeout-minutes: 30 + env: + REPO_SLUG: aien-dev/aienos + AIEN_TEST_PIN: c26f4d7ac3156088469b27462390f5b08ef4f436 + RECEIPTS_RAW: https://raw.githubusercontent.com/aien-dev/aien-receipts/main + steps: + - name: Checkout the head under test + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Resolve the commit under test and the base ref + id: ids + run: | + if [ "${{ github.event_name }}" = pull_request ]; then + sha="${{ github.event.pull_request.head.sha }}" + else + sha="${{ github.sha }}" + fi + git fetch -q origin main + echo "sha=$sha" >> "$GITHUB_OUTPUT" + echo "base=$(git rev-parse origin/main)" >> "$GITHUB_OUTPUT" + echo "commit under test: $sha" + echo "base (trust anchors): $(git rev-parse origin/main)" + + - name: "Trust anchors from the base ref (A1: never from the head under test)" + id: anchors + run: | + mkdir -p "$RUNNER_TEMP/anchors" + base="${{ steps.ids.outputs.base }}" + if git show "$base:.aien/verify.pub" > "$RUNNER_TEMP/anchors/verify.pub" 2>/dev/null; then + echo "enrolled=true" >> "$GITHUB_OUTPUT" + git show "$base:.aien/always" > "$RUNNER_TEMP/anchors/always" 2>/dev/null || : > "$RUNNER_TEMP/anchors/always" + git show "$base:.aien/unmapped-ok" > "$RUNNER_TEMP/anchors/unmapped-ok" 2>/dev/null || : > "$RUNNER_TEMP/anchors/unmapped-ok" + echo "verify.pub (base): $(cat "$RUNNER_TEMP/anchors/verify.pub")" + else + echo "enrolled=false" >> "$GITHUB_OUTPUT" + echo "::notice::.aien/verify.pub is not on the base ref yet: this repository is not enrolled. Phase 2: neutral." + fi + # Trust-surface changes are run by the operator by hand (A1): BLOCKED_OPERATOR. + changed=$(git diff --name-only "$base...${{ steps.ids.outputs.sha }}" -- .aien tests/gates .github/workflows .forgejo tools/aien-test || true) + if [ -n "$changed" ]; then + echo "blocked=true" >> "$GITHUB_OUTPUT" + echo "::notice::BLOCKED_OPERATOR: this head changes the trust surface:"; echo "$changed" + # PHASE3: fail here unless an operator attestation for this sha is present. + else + echo "blocked=false" >> "$GITHUB_OUTPUT" + fi + + - name: Checkout the pinned crumb tool source (aien-architecture @ d0f0b95d344b4c6628c3d868346932fd247ce168) + uses: actions/checkout@v4 + with: + repository: aien-dev/aien-architecture + ref: d0f0b95d344b4c6628c3d868346932fd247ce168 + path: .crumb-tool-src + + - name: Build the crumb tool, then remove its source from this tree + run: | + make -C .crumb-tool-src/tools/crumb crumb + mkdir -p "$RUNNER_TEMP/bin" && cp .crumb-tool-src/tools/crumb/crumb "$RUNNER_TEMP/bin/crumb" + rm -rf .crumb-tool-src + echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH" + + - name: Crumbs must be exactly what the compiler produces now (stays GitHub-hosted, D11) + run: crumb verify . + + - name: Install Stable Rust Toolchain (for the pinned aien-test build and the smoke set) + if: steps.anchors.outputs.enrolled == 'true' + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: Checkout the pinned aien-test source (aien-sovereign-core @ ${{ env.AIEN_TEST_PIN }}) + if: steps.anchors.outputs.enrolled == 'true' + uses: actions/checkout@v4 + with: + repository: aien-dev/aien-sovereign-core + ref: ${{ env.AIEN_TEST_PIN }} + path: .aien-test-src + + - name: Cache the pinned aien-test build + if: steps.anchors.outputs.enrolled == 'true' + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + .aien-test-src/target + key: aien-test-${{ runner.os }}-${{ env.AIEN_TEST_PIN }} + + - name: Build aien-test from the pin (never from the tree under test), then remove the source + if: steps.anchors.outputs.enrolled == 'true' + run: | + cargo build --release -p aien-test --manifest-path .aien-test-src/Cargo.toml + cp .aien-test-src/target/release/aien-test "$RUNNER_TEMP/bin/aien-test" 2>/dev/null || { mkdir -p "$RUNNER_TEMP/bin"; cp .aien-test-src/target/release/aien-test "$RUNNER_TEMP/bin/aien-test"; } + echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH" + rm -rf .aien-test-src + git status --porcelain --untracked-files=normal + + - name: Fetch the signed verification bundle for this commit + id: bundle + run: | + url="$RECEIPTS_RAW/aienos/${{ steps.ids.outputs.sha }}/bundle.json" + echo "bundle url: $url" + if curl -fsSL "$url" -o "$RUNNER_TEMP/bundle.json"; then + echo "present=true" >> "$GITHUB_OUTPUT" + else + echo "present=false" >> "$GITHUB_OUTPUT" + echo "::notice::bundle not published yet for ${{ steps.ids.outputs.sha }} (phase 2: neutral)." + # PHASE3: exit 2 here (NOT_RUN, status pending with a retry window) instead of a neutral note. + fi + + - name: Verify the bundle with the base-ref public key + if: steps.bundle.outputs.present == 'true' && steps.anchors.outputs.enrolled == 'true' + run: | + required=$(grep -v '^#' "$RUNNER_TEMP/anchors/always" | grep -v '^$' | paste -sd, -) + set +e + aien-test verify-bundle "$RUNNER_TEMP/bundle.json" \ + --repo "github.com/$REPO_SLUG" \ + --commit "${{ steps.ids.outputs.sha }}" \ + --pubkey "$RUNNER_TEMP/anchors/verify.pub" \ + ${required:+--require "$required"} + rc=$? + set -e + echo "verify-bundle exit $rc (0 PASS, 1 FAIL, 2 NOT_RUN, 3 REJECTED)" + [ "$rc" = 0 ] || exit "$rc" + + - name: Portable smoke set (gates whose requires is only portable, named at the base ref) + if: steps.anchors.outputs.enrolled == 'true' && steps.anchors.outputs.blocked == 'false' + run: | + base="${{ steps.ids.outputs.base }}" + names=$(for f in $(git ls-tree -r --name-only "$base" -- tests/gates | grep '\.gate$'); do + git show "$base:$f" | awk ' + /^gate:/ {g=$2} + /^requires:/ {inr=1; next} + inr && /^ - / { if ($2 != "portable") other=1; next } + /^[a-z]/ {inr=0} + END { if (g != "" && !other) print g }' + done) + echo "portable smoke set: $(echo $names)" + mkdir -p "$RUNNER_TEMP/evidence" + fail=0 + for g in $names; do + echo "::group::$g" + if timeout 600 aien-test run "$g" --evidence-dir "$RUNNER_TEMP/evidence"; then echo "$g: PASS"; else echo "::error::$g: not PASS"; fail=1; fi + echo "::endgroup::" + done + exit $fail + + - name: "Not enrolled or blocked: nothing to verify in this phase" + if: steps.anchors.outputs.enrolled != 'true' || steps.anchors.outputs.blocked == 'true' + run: | + echo "AIEN Verification: neutral (enrolled=${{ steps.anchors.outputs.enrolled }}, blocked=${{ steps.anchors.outputs.blocked }}). PHASE3 turns this into a failure." diff --git a/tests/gates/aienos-ck-b7b-probe.gate b/tests/gates/aienos-ck-b7b-probe.gate new file mode 100644 index 00000000..c8ca7105 --- /dev/null +++ b/tests/gates/aienos-ck-b7b-probe.gate @@ -0,0 +1,27 @@ +# tests/gates/aienos-ck-b7b-probe.gate +# Mirrors hosted: ck-kernel.yml 'B7b preparation probe' (aienos#286): scripts/qemu_ck_b7b_probe_test.sh --self-test, plain, --positive +gate: AIENOS-CK-B7B-PROBE +manifest_version: 2 +owner: aienos +requires: + - qemu +inputs: + - native/kernel/ + - scripts/ck_gates.sh + - scripts/lib_ck_m1_checks.sh + - scripts/lib_gate_hold.sh + - scripts/gate_hold_selftest.sh + - scripts/ck_owner_keys_check.sh + - crates/aienos-fpu-probe/ + - crates/aienos-infer-kernel/ + - tests/gates/ + - scripts/ +run: + exec: tests/gates/run.sh + args: ["ck-b7b-probe"] +expects: + exit: 0 + verdict: PASS +timeout: 30m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-ck-gate-selftest.gate b/tests/gates/aienos-ck-gate-selftest.gate new file mode 100644 index 00000000..f7fcf34d --- /dev/null +++ b/tests/gates/aienos-ck-gate-selftest.gate @@ -0,0 +1,26 @@ +# tests/gates/aienos-ck-gate-selftest.gate +# Mirrors hosted: ck-kernel.yml 'Gate runner self-test': bash scripts/ck_gates.sh --self-test +gate: AIENOS-CK-GATE-SELFTEST +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/kernel/ + - scripts/ck_gates.sh + - scripts/lib_ck_m1_checks.sh + - scripts/lib_gate_hold.sh + - scripts/gate_hold_selftest.sh + - scripts/ck_owner_keys_check.sh + - crates/aienos-fpu-probe/ + - crates/aienos-infer-kernel/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["ck-gate-selftest"] +expects: + exit: 0 + verdict: PASS +timeout: 10m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-ck-hold-selftest.gate b/tests/gates/aienos-ck-hold-selftest.gate new file mode 100644 index 00000000..1fe49723 --- /dev/null +++ b/tests/gates/aienos-ck-hold-selftest.gate @@ -0,0 +1,26 @@ +# tests/gates/aienos-ck-hold-selftest.gate +# Mirrors hosted: ck-kernel.yml 'Gate hold self-test' (aienos#278): bash scripts/gate_hold_selftest.sh +gate: AIENOS-CK-HOLD-SELFTEST +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/kernel/ + - scripts/ck_gates.sh + - scripts/lib_ck_m1_checks.sh + - scripts/lib_gate_hold.sh + - scripts/gate_hold_selftest.sh + - scripts/ck_owner_keys_check.sh + - crates/aienos-fpu-probe/ + - crates/aienos-infer-kernel/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["ck-hold-selftest"] +expects: + exit: 0 + verdict: PASS +timeout: 10m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-ck-host-tests.gate b/tests/gates/aienos-ck-host-tests.gate new file mode 100644 index 00000000..b3f9cb0c --- /dev/null +++ b/tests/gates/aienos-ck-host-tests.gate @@ -0,0 +1,26 @@ +# tests/gates/aienos-ck-host-tests.gate +# Mirrors hosted: ck-kernel.yml 'Host unit tests (plain and ASan + UBSan)': make -C native/kernel test sanitize +gate: AIENOS-CK-HOST-TESTS +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/kernel/ + - scripts/ck_gates.sh + - scripts/lib_ck_m1_checks.sh + - scripts/lib_gate_hold.sh + - scripts/gate_hold_selftest.sh + - scripts/ck_owner_keys_check.sh + - crates/aienos-fpu-probe/ + - crates/aienos-infer-kernel/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["ck-host-tests"] +expects: + exit: 0 + verdict: PASS +timeout: 30m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-ck-owner-keys.gate b/tests/gates/aienos-ck-owner-keys.gate new file mode 100644 index 00000000..d0cd33a5 --- /dev/null +++ b/tests/gates/aienos-ck-owner-keys.gate @@ -0,0 +1,27 @@ +# tests/gates/aienos-ck-owner-keys.gate +# Mirrors hosted: ck-kernel.yml 'Hardware staging image refuses TEST keys (build only)': bash scripts/ck_owner_keys_check.sh with quiet flag and gate lock in a temp dir +gate: AIENOS-CK-OWNER-KEYS +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/kernel/ + - scripts/ck_gates.sh + - scripts/lib_ck_m1_checks.sh + - scripts/lib_gate_hold.sh + - scripts/gate_hold_selftest.sh + - scripts/ck_owner_keys_check.sh + - crates/aienos-fpu-probe/ + - crates/aienos-infer-kernel/ + - tests/gates/ + - scripts/ +run: + exec: tests/gates/run.sh + args: ["ck-owner-keys"] +expects: + exit: 0 + verdict: PASS +timeout: 30m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-ck-qemu-gates.gate b/tests/gates/aienos-ck-qemu-gates.gate new file mode 100644 index 00000000..7ebbb030 --- /dev/null +++ b/tests/gates/aienos-ck-qemu-gates.gate @@ -0,0 +1,28 @@ +# tests/gates/aienos-ck-qemu-gates.gate +# Mirrors hosted: ck-kernel.yml 'QEMU TCG gates': bash scripts/ck_gates.sh --out DIR, every C-implemented gate except FPU/INFER must print AIENOS_CK_: PASS (hosted job 2340 s total) +gate: AIENOS-CK-QEMU-GATES +manifest_version: 2 +owner: aienos +requires: + - qemu +inputs: + - native/kernel/ + - scripts/ck_gates.sh + - scripts/lib_ck_m1_checks.sh + - scripts/lib_gate_hold.sh + - scripts/gate_hold_selftest.sh + - scripts/ck_owner_keys_check.sh + - crates/aienos-fpu-probe/ + - crates/aienos-infer-kernel/ + - tests/gates/ + - scripts/ +run: + exec: tests/gates/run.sh + args: ["ck-qemu-gates"] +expects: + exit: 0 + observe: ["required_gates_pass >= 1"] + verdict: PASS +timeout: 60m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-ck-stage-tests.gate b/tests/gates/aienos-ck-stage-tests.gate new file mode 100644 index 00000000..af76e173 --- /dev/null +++ b/tests/gates/aienos-ck-stage-tests.gate @@ -0,0 +1,26 @@ +# tests/gates/aienos-ck-stage-tests.gate +# Mirrors hosted: ck-kernel.yml 'Stage host tests': make -C native/kernel stage-test stage-sanitize +gate: AIENOS-CK-STAGE-TESTS +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/kernel/ + - scripts/ck_gates.sh + - scripts/lib_ck_m1_checks.sh + - scripts/lib_gate_hold.sh + - scripts/gate_hold_selftest.sh + - scripts/ck_owner_keys_check.sh + - crates/aienos-fpu-probe/ + - crates/aienos-infer-kernel/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["ck-stage-tests"] +expects: + exit: 0 + verdict: PASS +timeout: 30m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-crypto-boundary.gate b/tests/gates/aienos-crypto-boundary.gate new file mode 100644 index 00000000..f923bce0 --- /dev/null +++ b/tests/gates/aienos-crypto-boundary.gate @@ -0,0 +1,23 @@ +# tests/gates/aienos-crypto-boundary.gate +# Mirrors hosted: crypto-boundary.yml: cargo test/clippy of aienos-crypto, aienos-kernel crypto:: tests, no_std check of aienos-kernel (hosted 23 s; always-run) +gate: AIENOS-CRYPTO-BOUNDARY +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - crates/aienos-crypto/ + - crates/aienos-kernel/ + - Cargo.toml + - Cargo.lock + - vendor/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["crypto-boundary"] +expects: + exit: 0 + verdict: PASS +timeout: 15m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-disk-qemu.gate b/tests/gates/aienos-disk-qemu.gate new file mode 100644 index 00000000..d8ac7a13 --- /dev/null +++ b/tests/gates/aienos-disk-qemu.gate @@ -0,0 +1,21 @@ +# tests/gates/aienos-disk-qemu.gate +# Mirrors hosted: native-suites.yml 'native/disk qemu NVMe payload': bash scripts/qemu_native_nvme_test.sh, AIENOS_STORE_NVME_QEMU: PASS required (hosted 27 s) +gate: AIENOS-DISK-QEMU +manifest_version: 2 +owner: aienos +requires: + - qemu +inputs: + - native/disk/ + - scripts/qemu_native_nvme_test.sh + - scripts/lib_gate_hold.sh + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["disk-qemu"] +expects: + exit: 0 + verdict: PASS +timeout: 15m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-infer-crate.gate b/tests/gates/aienos-infer-crate.gate new file mode 100644 index 00000000..9110ee81 --- /dev/null +++ b/tests/gates/aienos-infer-crate.gate @@ -0,0 +1,21 @@ +# tests/gates/aienos-infer-crate.gate +# Mirrors hosted: infer-crate.yml: fmt, clippy, test and aarch64-unknown-none build of aienos-infer (hosted 24 s) +gate: AIENOS-INFER-CRATE +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - crates/aienos-infer/ + - Cargo.toml + - Cargo.lock + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["infer-crate"] +expects: + exit: 0 + verdict: PASS +timeout: 15m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-native-argus.gate b/tests/gates/aienos-native-argus.gate new file mode 100644 index 00000000..ffb04708 --- /dev/null +++ b/tests/gates/aienos-native-argus.gate @@ -0,0 +1,20 @@ +# tests/gates/aienos-native-argus.gate +# Mirrors hosted: native-suites.yml matrix suite argus: make -C native/argus plus explicit pass markers, no NOT_RUN (hosted 87 s) +gate: AIENOS-NATIVE-ARGUS +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/argus/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["native-argus"] +expects: + exit: 0 + observe: ["not_run_in_log == false"] + verdict: PASS +timeout: 10m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-native-capability.gate b/tests/gates/aienos-native-capability.gate new file mode 100644 index 00000000..e2410afb --- /dev/null +++ b/tests/gates/aienos-native-capability.gate @@ -0,0 +1,20 @@ +# tests/gates/aienos-native-capability.gate +# Mirrors hosted: native-suites.yml matrix suite capability: make -C native/capability plus explicit pass markers, no NOT_RUN (hosted 47 s) +gate: AIENOS-NATIVE-CAPABILITY +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/capability/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["native-capability"] +expects: + exit: 0 + observe: ["not_run_in_log == false"] + verdict: PASS +timeout: 10m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-native-crypto.gate b/tests/gates/aienos-native-crypto.gate new file mode 100644 index 00000000..7025555f --- /dev/null +++ b/tests/gates/aienos-native-crypto.gate @@ -0,0 +1,20 @@ +# tests/gates/aienos-native-crypto.gate +# Mirrors hosted: native-suites.yml matrix suite crypto: make -C native/crypto plus explicit pass markers, no NOT_RUN (hosted 19 s) +gate: AIENOS-NATIVE-CRYPTO +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/crypto/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["native-crypto"] +expects: + exit: 0 + observe: ["not_run_in_log == false"] + verdict: PASS +timeout: 10m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-native-disk.gate b/tests/gates/aienos-native-disk.gate new file mode 100644 index 00000000..ec58574c --- /dev/null +++ b/tests/gates/aienos-native-disk.gate @@ -0,0 +1,20 @@ +# tests/gates/aienos-native-disk.gate +# Mirrors hosted: native-suites.yml matrix suite disk: make -C native/disk plus explicit pass markers, no NOT_RUN (hosted 185 s) +gate: AIENOS-NATIVE-DISK +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/disk/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["native-disk"] +expects: + exit: 0 + observe: ["not_run_in_log == false"] + verdict: PASS +timeout: 15m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-native-m5.gate b/tests/gates/aienos-native-m5.gate new file mode 100644 index 00000000..5682a090 --- /dev/null +++ b/tests/gates/aienos-native-m5.gate @@ -0,0 +1,20 @@ +# tests/gates/aienos-native-m5.gate +# Mirrors hosted: native-suites.yml matrix suite m5: make -C native/m5 plus explicit pass markers, no NOT_RUN (hosted 149 s) +gate: AIENOS-NATIVE-M5 +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/m5/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["native-m5"] +expects: + exit: 0 + observe: ["not_run_in_log == false"] + verdict: PASS +timeout: 15m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-native-net.gate b/tests/gates/aienos-native-net.gate new file mode 100644 index 00000000..ac8d497c --- /dev/null +++ b/tests/gates/aienos-native-net.gate @@ -0,0 +1,20 @@ +# tests/gates/aienos-native-net.gate +# Mirrors hosted: native-suites.yml matrix suite net: make -C native/net plus explicit pass markers, no NOT_RUN (hosted 368 s) +gate: AIENOS-NATIVE-NET +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/net/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["native-net"] +expects: + exit: 0 + observe: ["not_run_in_log == false"] + verdict: PASS +timeout: 20m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-native-sig.gate b/tests/gates/aienos-native-sig.gate new file mode 100644 index 00000000..ca3a7dbc --- /dev/null +++ b/tests/gates/aienos-native-sig.gate @@ -0,0 +1,20 @@ +# tests/gates/aienos-native-sig.gate +# Mirrors hosted: native-suites.yml matrix suite sig: make -C native/sig plus explicit pass markers, no NOT_RUN (hosted 76 s) +gate: AIENOS-NATIVE-SIG +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/sig/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["native-sig"] +expects: + exit: 0 + observe: ["not_run_in_log == false"] + verdict: PASS +timeout: 10m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-store-native.gate b/tests/gates/aienos-store-native.gate new file mode 100644 index 00000000..f7c3bfb2 --- /dev/null +++ b/tests/gates/aienos-store-native.gate @@ -0,0 +1,19 @@ +# tests/gates/aienos-store-native.gate +# Mirrors hosted: ci.yml (disabled_manually on GitHub) 'make -C native/store test mutants'; not covered by any active workflow +gate: AIENOS-STORE-NATIVE +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - native/store/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["store-native"] +expects: + exit: 0 + verdict: PASS +timeout: 15m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-verify-all.gate b/tests/gates/aienos-verify-all.gate new file mode 100644 index 00000000..0803fd82 --- /dev/null +++ b/tests/gates/aienos-verify-all.gate @@ -0,0 +1,21 @@ +# tests/gates/aienos-verify-all.gate +# 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 +owner: aienos +requires: + - qemu +inputs: + - scripts/verify_all.sh + - crates/ + - native/boot/ + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["verify-all"] +expects: + exit: 0 + verdict: PASS +timeout: 30m +exactness: EXACT +cache_scope: machine diff --git a/tests/gates/aienos-zero-disk-secrets.gate b/tests/gates/aienos-zero-disk-secrets.gate new file mode 100644 index 00000000..39784085 --- /dev/null +++ b/tests/gates/aienos-zero-disk-secrets.gate @@ -0,0 +1,19 @@ +# tests/gates/aienos-zero-disk-secrets.gate +# Mirrors hosted: no hosted step; the zero-disk-secrets invariant of the Rust repos (always-run) +gate: AIENOS-ZERO-DISK-SECRETS +manifest_version: 2 +owner: aienos +requires: + - portable +inputs: + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["zero-disk-secrets"] +expects: + exit: 0 + observe: ["env_files_found == false"] + verdict: PASS +timeout: 2m +exactness: EXACT +cache_scope: portable diff --git a/tests/gates/crumb.gate b/tests/gates/crumb.gate new file mode 100644 index 00000000..03c1ba23 --- /dev/null +++ b/tests/gates/crumb.gate @@ -0,0 +1,24 @@ +# tests/gates/crumb.gate +# Mirrors hosted: crumb.yml 'crumb verify .' with the tool built from crumb.lock (hosted job 9 s) +# cache: never because crumbs live in many directories and inputs are literal paths; the check is sub-second. +# requires: host because run.sh builds the tool from the sibling ../aien-architecture checkout, which a +# GitHub runner does not have (portable means the tree alone). The thin gate runs crumb verify itself. +gate: CRUMB-VERIFY +manifest_version: 2 +owner: aienos +requires: + - host +inputs: + - .crumb + - crumb.lock + - tests/gates/ +run: + exec: tests/gates/run.sh + args: ["crumb-verify"] +expects: + exit: 0 + verdict: PASS +timeout: 5m +exactness: EXACT +cache_scope: machine +cache: never diff --git a/tests/gates/run.sh b/tests/gates/run.sh new file mode 100755 index 00000000..1efeedad --- /dev/null +++ b/tests/gates/run.sh @@ -0,0 +1,135 @@ +#!/usr/bin/env bash +# tests/gates/run.sh: the one entry point for the local verification gates of aienos. +# Every step runs the SAME command as the hosted job it mirrors (.github/workflows/ck-kernel.yml, +# native-suites.yml, crypto-boundary.yml, infer-crate.yml, crumb.yml; ci.yml is disabled on +# GitHub and its two surviving suites are declared here too). Manifests under tests/gates/ name +# this script plus one step word, so no manifest needs shell expansion (ADR 0028 P6). +set -euo pipefail +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +cd "$ROOT" +step="${1:?usage: tests/gates/run.sh }" +obs() { printf 'AIEN-OBS %s %s\n' "$1" "$2"; } + +# The hosted jobs keep the quiet flag and the QEMU gate lock in the runner's temp dir, never +# in ~/workspace (ck-kernel.yml, native-suites.yml). Same here. +TMP="$(mktemp -d /tmp/aienos-gate.XXXXXX)" +trap 'rm -rf "$TMP"' EXIT +export AIENOS_QUIET_FLAG="$TMP/spark-quiet" +export AIENOS_GATE_LOCK="$TMP/qemu-gate-lock" + +# native-suites.yml: make must succeed AND every suite must print its own pass marker, and +# never NOT_RUN. $1 = suite dir, $2 = make targets, $3 = required marker regexes joined by |. +native_suite() { + local suite="$1" targets="$2" req="$3" log="$TMP/suite.log" found=0 + set -o pipefail + # native/crypto has no .gitignore for its out/ (the other suites do), so the build output + # would stay in the tree; the hosted job throws its checkout away. Remove an out/ that this + # step created, and only when git does not already ignore it. The gate itself is unchanged. + if [ ! -e "native/$suite/out" ] && ! git check-ignore -q "native/$suite/out"; then + CLEAN_OUT="$ROOT/native/$suite/out" + trap 'rm -rf "$TMP" "$CLEAN_OUT"' EXIT + fi + # shellcheck disable=SC2086 + make -C "native/$suite" $targets 2>&1 | tee "$log" + while IFS= read -r m; do + grep -qE "$m" "$log" || { echo "missing marker: $m"; obs markers_missing 1; exit 1; } + echo "found: $m"; found=$((found + 1)) + done < <(printf '%s\n' "$req" | tr '|' '\n') + if grep -q 'NOT_RUN' "$log"; then echo 'NOT_RUN in log'; obs not_run_in_log true; exit 1; fi + obs markers_found "$found" + obs not_run_in_log false +} + +case "$step" in + crumb-verify) + # Hosted crumb.yml builds the crumb tool from the aien-architecture commit in crumb.lock. + # Same here, from the sibling checkout ../aien-architecture into a temp dir outside the + # tree, so a newer crumb on PATH can never change the verdict. + if [ ! -d ../aien-architecture ]; then + echo "run.sh: ../aien-architecture is missing; the hosted job checks out aien-dev/aien-architecture at crumb.lock" >&2 + exit 3 + fi + pin=$(tr -d '[:space:]' < crumb.lock) + git -C ../aien-architecture archive "$pin" tools/crumb | tar -x -C "$TMP" + make -s -C "$TMP/tools/crumb" crumb + obs crumb_tool_commit "\"$pin\"" + "$TMP/tools/crumb/crumb" verify . + ;; + # ck-kernel.yml, host steps (ubuntu-24.04-arm there, AArch64 here) + ck-host-tests) make -C native/kernel test sanitize ;; + ck-stage-tests) make -C native/kernel stage-test stage-sanitize ;; + ck-gate-selftest) bash scripts/ck_gates.sh --self-test ;; + ck-hold-selftest) bash scripts/gate_hold_selftest.sh ;; + ck-owner-keys) bash scripts/ck_owner_keys_check.sh ;; + # ck-kernel.yml, QEMU TCG gates: every gate with a C implementation except FPU and INFER + ck-qemu-gates) + mkdir -p "$TMP/ck-receipt" + set +e + bash scripts/ck_gates.sh --out "$TMP/ck-receipt" | tee "$TMP/ck-gates.txt" + rc=${PIPESTATUS[0]} + set -e + echo "ck_gates.sh exit ${rc}" + [ "${rc}" = 0 ] || exit 1 + required=$(sed -n "/^CK_GATE_TABLE='/,/^'/p" scripts/ck_gates.sh | awk -F'|' 'NF==3 && $2!="missing" && $1!="FPU" && $1!="INFER" {print $1}') + [ -n "${required}" ] || { echo "could not read the gate table"; exit 1; } + fail=0; n=0 + for g in ${required}; do + if grep -q "^AIENOS_CK_${g}: PASS" "$TMP/ck-gates.txt"; then echo "required gate ${g}: PASS"; n=$((n + 1)) + else echo "required gate ${g}: not PASS"; fail=1; fi + done + obs required_gates_pass "$n" + exit ${fail} + ;; + ck-b7b-probe) + bash scripts/qemu_ck_b7b_probe_test.sh --self-test + bash scripts/qemu_ck_b7b_probe_test.sh + bash scripts/qemu_ck_b7b_probe_test.sh --positive + ;; + # native-suites.yml matrix + native-net) native_suite net "test sanitize mutants" 'AIENOS_NET_SECURE_TESTS: PASS|NET_SANITIZE: PASS|NET_SECURE_MUTANTS: [0-9]+/[0-9]+ killed' ;; + native-sig) native_suite sig "test sanitize mutants" 'AIENOS_SIG_NATIVE: PASS|AIENOS_SIG_MUTANTS: PASS' ;; + native-crypto) native_suite crypto "test sanitize mutants" 'AIENOS_CRYPTO_NATIVE: PASS|AIENOS_CRYPTO_MUTANTS: PASS' ;; + native-m5) native_suite m5 "test sanitize mutants" 'M5_NATIVE: PASS|M5_NATIVE_MUTANTS: PASS' ;; + native-disk) native_suite disk "test sanitize mutants" 'AIENOS_DISK_NATIVE: PASS|AIENOS_DISK_SANITIZE: PASS|AIENOS_DISK_MUTANTS: PASS' ;; + native-argus) native_suite argus "test sanitize" 'GATE CONTAIN_TEST PASS|GATE CONTAIN_DETERMINISM PASS' ;; + native-capability) native_suite capability "mutants" 'AIENOS_CAP_MUTANTS: PASS' ;; + disk-qemu) + set -o pipefail + bash scripts/qemu_native_nvme_test.sh 2>&1 | tee "$TMP/qemu.log" + # The script exits 0 on NOT_RUN; only an explicit PASS counts. + grep -qx 'AIENOS_STORE_NVME_QEMU: PASS' "$TMP/qemu.log" + ;; + # crypto-boundary.yml (one job, four commands) + crypto-boundary) + cargo test --locked --offline -p aienos-crypto + cargo test --locked --offline -p aienos-kernel crypto:: + cargo clippy --locked --offline -p aienos-crypto --all-targets -- -D warnings + cargo check --locked --offline -p aienos-kernel --target aarch64-unknown-none --no-default-features + ;; + # infer-crate.yml (one job: fmt, clippy, test, no_std build) + infer-crate) + export AIENOS_MODEL="${AIENOS_MODEL:-/nonexistent/no-model.gguf}" # hosted runner has no model file; forward tests SKIP + test -f crates/aienos-infer/Cargo.toml + cargo fmt -p aienos-infer --check + cargo clippy -p aienos-infer --all-targets -- -D warnings + cargo test -p aienos-infer + cargo build -p aienos-infer --target aarch64-unknown-none + ;; + # ci.yml (disabled on GitHub since the CK workflow took over): the suites it still names + store-native) make -C native/store test mutants ;; + verify-all) bash scripts/verify_all.sh ;; + zero-disk-secrets) + echo "Auditing repository for prohibited plaintext secret files..." + if find . -maxdepth 4 -name ".env*" -not -path "*/.git/*" -not -path "*/target/*" -not -path "*/vendor/*" | grep -q .; then + echo "::error::Prohibited plaintext .env file found. Use an approved AIEN SecretProvider." + obs env_files_found true + exit 1 + fi + obs env_files_found false + echo "Zero plaintext .env files verified." + ;; + *) + echo "run.sh: unknown step '$step'" >&2 + exit 2 + ;; +esac ```