interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

GitHub aien-dev/aienux#375 (code only)

closed derived a99c5d3312dab241 #375

Imported from GitHub aien-dev/aienux#375 (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 09e59a82fc28252d504046a19628a64b3cbfdba2 · Head 6f34d19403e44889dcb595855b97b6f771e68033

Apply it

git checkout -b patch-a99c5d3312dab241 09e59a82fc28252d504046a19628a64b3cbfdba2
curl -fsSL https://interplane.io/drakestapleton/aienux/patches/a99c5d3312dab241.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
375
6f34d19403e44889dcb595855b97b6f771e68033
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":375,"url":"https://github.com/aien-dev/aienux/pull/375","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:17Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index 6bd73706..6af3466a 100644
--- a/.crumb
+++ b/.crumb
@@ -21,39 +21,39 @@
     "generated": {
       "children": [
         {
-          "digest": "df4df0910e1e6440d896fa87d0ffbaa9a0dec14ec9015d7087f1d5fe116887ed",
-          "last_commit": "f78977a",
+          "digest": "466c7583bcaac7482c12dae2af453909aa4eb917d288bc37d36f799e3b51612c",
+          "last_commit": "c31f632",
           "name": "crates",
           "purpose": "Directory crates. Purpose not yet described by a human."
         },
         {
-          "digest": "ff76e6265945af4c3821b297bdbb0af9fbe44ae8d04ae03cf8d70b42cf92802c",
-          "last_commit": "f78977a",
+          "digest": "ff8f5dc4524c2dc667b2c3c6f14d4683daf9f0e0e02355eda4e6f62cece58337",
+          "last_commit": "c31f632",
           "name": "docs",
           "purpose": "Directory docs. Purpose not yet described by a human."
         },
         {
-          "digest": "c4788a6bd2633e3ad2933270f03e65212b0003f61e629a09f3b637ec9ff4a481",
-          "last_commit": "f78977a",
+          "digest": "10e9c2e0ebceb8e60113783dfa5c83ddaf7ef3fef3d700d6c489cae331117f11",
+          "last_commit": "c31f632",
           "name": "native",
           "purpose": "Directory native. Purpose not yet described by a human."
         },
         {
-          "digest": "ffc301dd27d8282fead7987c2f7ac1c8bb3ff262994bf324dc804ef2d36db01e",
-          "last_commit": "f78977a",
+          "digest": "e148d5bd0c19501efe0f07f59aae88ed1209904d1cf3e79bf9a1187877b8b11c",
+          "last_commit": "c31f632",
           "name": "scripts",
           "purpose": "Directory scripts. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:5ab26260ace77fb758d67a3202a1979bca3efec42d41bdccdecb3c1c2aa9262d",
-      "compiled_at": "2026-10-14T01:16:45Z",
+      "children_root": "sha256:3d44c2b03d3fd9d35b31671a134f0e3c4e05239ccad677aaccd6bcf9738a89bb",
+      "compiled_at": "2026-10-14T02:20:15Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:6858b2acd9a36d56f36cd08e1549f654a0ebb44046c9d42c37b9e3c43fdb7d20",
+      "digest": "sha256:9a8082b0c2fd3f3cd8e622a4d27de034908ded49b3d767b7ee347072f65ca723",
       "evidence_files": 156,
       "evidence_root": "sha256:cd53ab119be9de6ce28c4f5949b106c9622f1fe105611de3de21c3bce7932694",
-      "files": 3224,
-      "generated_at_commit": "f78977a6ce33ea89a5b3b1952c0a0e403d4504fa",
-      "source_tree": "sha256:ad1a6280cd760e4bc45458ef28f544a40c1f0a0aa96b8c2aba39b150aa0f07e6"
+      "files": 3230,
+      "generated_at_commit": "7cd74cbbd0a45def4384618e7f82513c76021aad",
+      "source_tree": "sha256:91ba5ebfcbb5df23e9f032b6054c3cca0aa1e5840e43c79ea09a2327dcf7449a"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/crates/.crumb b/crates/.crumb
index f7a216b1..94d20035 100644
--- a/crates/.crumb
+++ b/crates/.crumb
@@ -83,8 +83,8 @@
           "purpose": "Directory crates/aienos-agent-state. Purpose not yet described by a human."
         },
         {
-          "digest": "a265db4553bf11e9299c94fd916b36c5059fd749a2b824512dc0ab9c243e728c",
-          "last_commit": "bb3a5f4",
+          "digest": "ffb6a9a637e1eca1408280c4522ea52b283d740a90b8efad30350082900cbcdc",
+          "last_commit": "c31f632",
           "name": "aienos-artifact",
           "purpose": "Directory crates/aienos-artifact. Purpose not yet described by a human."
         },
@@ -138,7 +138,7 @@
         },
         {
           "digest": "622300849736c15c24036d522c7629061ac688ee94d689ac0c0cf80c7d0e6e48",
-          "last_commit": "f78977a",
+          "last_commit": "09e59a8",
           "name": "aienos-kernel",
           "purpose": "Directory crates/aienos-kernel. Purpose not yet described by a human."
         },
@@ -149,15 +149,15 @@
           "purpose": "Directory crates/aienos-store-tool. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:04d062db199d27bde53281e013ec91d9eb06362bd70be8ff50b47c1f7c84adf4",
-      "compiled_at": "2026-10-14T01:16:45Z",
+      "children_root": "sha256:743f1632e1cc07c03b57a67a7e3b5871a8de01492d9f1594e31c35f000f48313",
+      "compiled_at": "2026-10-14T02:20:15Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:df4df0910e1e6440d896fa87d0ffbaa9a0dec14ec9015d7087f1d5fe116887ed",
+      "digest": "sha256:466c7583bcaac7482c12dae2af453909aa4eb917d288bc37d36f799e3b51612c",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 248,
-      "generated_at_commit": "f78977a6ce33ea89a5b3b1952c0a0e403d4504fa",
-      "source_tree": "sha256:387e2d6fe48f47019f3b895350a85d85e63c4b7b083e77391a22317be7d90420"
+      "generated_at_commit": "7cd74cbbd0a45def4384618e7f82513c76021aad",
+      "source_tree": "sha256:267f54c885d5c276cebae4cad7bdd26fbe31a4b421fc952fe765669b3056e2dd"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/crates/aienos-artifact/.crumb b/crates/aienos-artifact/.crumb
index d96f402a..6e095876 100644
--- a/crates/aienos-artifact/.crumb
+++ b/crates/aienos-artifact/.crumb
@@ -13,21 +13,21 @@
     "generated": {
       "children": [
         {
-          "digest": "e7ed37a16332ed63780e226496a4bf449cddeb4a4ae93655acf7e64fbe426871",
-          "last_commit": "bb3a5f4",
+          "digest": "72839a0b74ae80e6e1a4c702fd619096974eb051aff136506d974522ac6c5651",
+          "last_commit": "8307a68",
           "name": "src",
           "purpose": "Directory crates/aienos-artifact/src. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:d47b8610ed8ea27683d0b0fa1d2e474428f541eb4e621d7f4c4ba1f2a771bf25",
-      "compiled_at": "2026-10-04T13:47:18Z",
+      "children_root": "sha256:13e8558a828816f21f57e02ca246057abb20a456f1bb257cc4c0392203981f3a",
+      "compiled_at": "2026-10-14T01:54:45Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:a265db4553bf11e9299c94fd916b36c5059fd749a2b824512dc0ab9c243e728c",
+      "digest": "sha256:ffb6a9a637e1eca1408280c4522ea52b283d740a90b8efad30350082900cbcdc",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 13,
-      "generated_at_commit": "a863d5c1f5bd89c88c5f6671eecfd27b599ee512",
-      "source_tree": "sha256:0247de5f43dd7d116461eecab416d53f228fb6182f446024319d6b61ae93b221"
+      "generated_at_commit": "8307a68a2eedcc5c8d6c2a6ffbf7c12f398c094b",
+      "source_tree": "sha256:1d331b83e3479a7cb19bd437c3402f13ed2d89917dc90a623af90eb4cc93d649"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/crates/aienos-artifact/src/.crumb b/crates/aienos-artifact/src/.crumb
index 72412f0e..f9f2afc8 100644
--- a/crates/aienos-artifact/src/.crumb
+++ b/crates/aienos-artifact/src/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-04T13:47:18Z",
+      "compiled_at": "2026-10-14T01:54:45Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:e7ed37a16332ed63780e226496a4bf449cddeb4a4ae93655acf7e64fbe426871",
+      "digest": "sha256:72839a0b74ae80e6e1a4c702fd619096974eb051aff136506d974522ac6c5651",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 12,
-      "generated_at_commit": "a863d5c1f5bd89c88c5f6671eecfd27b599ee512",
-      "source_tree": "sha256:c6ff1082c58fdb6b276cb2be93020d362ae0420c41437c1b62cd25ec98074af5"
+      "generated_at_commit": "8307a68a2eedcc5c8d6c2a6ffbf7c12f398c094b",
+      "source_tree": "sha256:3dc9736a359478ce0c6cc8d522b63556fe5a62b4de2ef1fe16016a9c17cdfb2f"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/crates/aienos-artifact/src/receipt.rs b/crates/aienos-artifact/src/receipt.rs
index f0d6c350..8d61dfdd 100644
--- a/crates/aienos-artifact/src/receipt.rs
+++ b/crates/aienos-artifact/src/receipt.rs
@@ -51,6 +51,7 @@ pub enum ReceiptDecision {
 pub enum QualificationTier {
     Seed0bQemu = 1,
     Seed0bMachine1 = 2,
+    Seed0bPi5 = 3,
 }
 
 /// Offset 64; ยง7.3 mapping of the task runtime outcome.
@@ -204,6 +205,7 @@ impl QualificationTier {
         match v {
             1 => Some(Self::Seed0bQemu),
             2 => Some(Self::Seed0bMachine1),
+            3 => Some(Self::Seed0bPi5),
             _ => None,
         }
     }
@@ -212,6 +214,7 @@ impl QualificationTier {
         match self {
             Self::Seed0bQemu => "SEED-0B-QEMU",
             Self::Seed0bMachine1 => "SEED-0B-MACHINE1",
+            Self::Seed0bPi5 => "SEED-0B-PI5",
         }
     }
 }
diff --git a/crates/aienos-artifact/src/receipt_tests.rs b/crates/aienos-artifact/src/receipt_tests.rs
index 4f39cdf2..eccb12a2 100644
--- a/crates/aienos-artifact/src/receipt_tests.rs
+++ b/crates/aienos-artifact/src/receipt_tests.rs
@@ -283,6 +283,17 @@ fn rejects_unknown_flags_and_nonzero_reserved_bytes() {
     assert_eq!(decode(&s), Err(ArtifactError::BadSignatureFormat));
 }
 
+#[test]
+fn pi5_tier_round_trips_with_its_label() {
+    let r = Receipt {
+        tier: QualificationTier::Seed0bPi5,
+        ..admitted()
+    };
+    let back = decode(&encode(&r)).unwrap();
+    assert_eq!(back.tier, QualificationTier::Seed0bPi5);
+    assert_eq!(back.tier.label(), "SEED-0B-PI5");
+}
+
 #[test]
 fn rejects_unknown_enum_and_code_values() {
     let b = encode(&admitted());
@@ -298,7 +309,7 @@ fn rejects_unknown_enum_and_code_values() {
             "decision {v}"
         );
     }
-    for v in [0u16, 3, 0xffff] {
+    for v in [0u16, 4, 0xffff] {
         assert_eq!(
             decode(&m16(22, v)),
             Err(ArtifactError::MalformedReceipt),
diff --git a/docs/.crumb b/docs/.crumb
index fda5f779..f595887a 100644
--- a/docs/.crumb
+++ b/docs/.crumb
@@ -18,26 +18,26 @@
       "children": [
         {
           "digest": "e84f072935b7d6d9f5a7bcaedb3fc366b4f73f8f609abcc2ea450e65665c64fa",
-          "last_commit": "f78977a",
+          "last_commit": "09e59a8",
           "name": "adr",
           "purpose": "Directory docs/adr. Purpose not yet described by a human."
         },
         {
           "digest": "5dc4f124f1c023aa4786f45336a671138fce9fa046478364cdc7454307d7b588",
-          "last_commit": "f78977a",
+          "last_commit": "09e59a8",
           "name": "crumbs",
           "purpose": "Directory docs/crumbs. Purpose not yet described by a human."
         }
       ],
       "children_root": "sha256:491e93c09b6185b662afda8b29d24bb3ee81bc2aed9009757fdf4674d197be31",
-      "compiled_at": "2026-10-14T01:16:45Z",
+      "compiled_at": "2026-10-14T02:20:15Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:ff76e6265945af4c3821b297bdbb0af9fbe44ae8d04ae03cf8d70b42cf92802c",
+      "digest": "sha256:ff8f5dc4524c2dc667b2c3c6f14d4683daf9f0e0e02355eda4e6f62cece58337",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 83,
-      "generated_at_commit": "f78977a6ce33ea89a5b3b1952c0a0e403d4504fa",
-      "source_tree": "sha256:602540ab7e21ae87b2a97e53c05d577398c6016cb275e4367cca845cac7786b9"
+      "files": 84,
+      "generated_at_commit": "7cd74cbbd0a45def4384618e7f82513c76021aad",
+      "source_tree": "sha256:cc02a480ee7c60cb98ba0e9607abaad277a62d512867aebd1cc7bd93893a64c8"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/docs/native/PI5-7-ARTIFACT-RUNS.md b/docs/native/PI5-7-ARTIFACT-RUNS.md
index 84e5044f..de72f472 100644
--- a/docs/native/PI5-7-ARTIFACT-RUNS.md
+++ b/docs/native/PI5-7-ARTIFACT-RUNS.md
@@ -80,7 +80,7 @@ artifacts: candidates=6 admitted=5 rejected=1
 
 ## Limits
 
-- The receipt record's `tier` field still reads `SEED-0B-QEMU` on the Pi (fixed in the loader's receipt writer, unchanged here); the separate line `artifact_receipt_tier: SEED-0B-PI5` is the Pi tier.
+- Run a1 predates PI5-8 Q3: its receipt record `tier` field read `SEED-0B-QEMU` on the Pi. Since PI5-8 Q3 the Pi image writes `SEED-0B-PI5` into the receipt itself (run `pi5-artifact-a2`, see PI5-8-QUALIFICATION.md).
 - Isolation was shown for the three attack classes above against the two kernel addresses used; it is not a proof for every kernel address, and the kernel does not itself
   re-read the targets after the stores (the faulting stores never retire, FAR names the address).
 - `contained=yes` in `artifact_fault:` means the fault handler terminated the task and returned to the kernel; it is not an independent audit.
diff --git a/docs/native/PI5-8-QUALIFICATION.md b/docs/native/PI5-8-QUALIFICATION.md
new file mode 100644
index 00000000..0522266e
--- /dev/null
+++ b/docs/native/PI5-8-QUALIFICATION.md
@@ -0,0 +1,62 @@
+# PI5-8 groundwork: release qualification evidence (Pi 5)
+
+QUALIFICATION ONLY, TEST keys only. This is the evidence package for qualifying the Pi, not a public release. No owner or
+release key exists, was generated or was used.
+
+## Q1 Reproducible builds
+
+`scripts/ck_pi5_repro_check.sh [commit]` makes two clean detached worktrees of one commit at two different paths, builds all
+eleven Pi images in each (pi5, pi5-store, pi5-unlock, pi5-unlock-card, pi5-fact, pi5-infer, pi5-agent, pi5-lifecycle,
+pi5-artifact, pi5-pcie, pi5-net) with the same toolchain, and compares sha256 of each `BOOTAA64.EFI` and `aienos-ck.elf`.
+
+Finding and fix: the first run matched for the eight C-only images and differed for the three that link the Rust inference
+library (pi5-infer, pi5-agent, pi5-lifecycle). The Rust panic messages carry the absolute source path
+(`<checkout>/crates/aienos-infer/src/*.rs`). Fix at the source: the three Makefile rules that build that library pass
+`RUSTFLAGS=--remap-path-prefix=$(REPO)=/aienos`, so the checkout path no longer enters the image. What the image does is
+unchanged (only path strings in panic messages). After the fix every `BOOTAA64.EFI` matches byte for byte.
+
+Remaining, understood difference: in the same three images the raw `aienos-ck.elf` still differs in symbol NAMES only (Rust
+crate-hash suffixes: cargo hashes the absolute path of the path dependency `aienos-infer`, which lies outside the infer-kernel
+crate's own workspace). Symbols are not in `BOOTAA64.EFI`. The script accepts that case only when the ELF is byte-identical
+after `strip -s`, and prints it as `match-stripped`.
+
+Toolchain recorded by the script on every run. Used: GNU Make 4.3, gcc 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1), GNU ld and
+objcopy 2.42, rustc 1.98.1 (48a229cea 2026-09-01), cargo 1.98.1 (797e8a9bc 2026-08-05).
+
+The kernel embeds the commit id (`aienos_commit:`), so two builds are comparable only from the same commit. For the
+QEMU/Spark images (default `all`, `full`, `full` with the TEST anchor, and the QEMU artifact-card twin) byte identity against
+origin/main was checked by building both with the same pinned commit string: all identical.
+
+## Q3 Receipt tier on the Pi
+
+The artifact loader used to write receipt `tier` = SEED-0B-QEMU (record offset 22) even in the Pi image. Now
+`CKA_IMAGE_TIER` (native/kernel/artifact/ck_artifact.h) is `CKR_TIER_SEED0B_PI5` (3) when the image is built with `CK_PI5`
+and `CKR_TIER_SEED0B_QEMU` (1) otherwise; decode accepts the Pi tier only in the Pi image and in hosted tools (the
+verifier), so the QEMU/Spark kernels keep their code unchanged. The Rust receipt codec (`aienos-artifact`) knows tier 3 too.
+The host tool prints the tier it decoded. Host test: `test_artifact` (default build expects QEMU, `-DCK_PI5` build expects
+PI5, round trip, signature covers the tier, tiers 2 and 4 refused). Mutant: `make artifact-tier-mutant` (Pi build that still
+writes the QEMU tier) must fail the test, and does.
+
+Pi run `pi5-artifact-a2` (same card bundle as a1, sha256 0757c5c5...6d70, no MODEL.MAP on the card):
+`artifact_receipt_tier: SEED-0B-PI5`, `artifacts: candidates=6 admitted=5 rejected=1`, six receipts. On the host,
+`ck_artifact_tool receipt check` (bound to the supplied artifacts), TEST-ONLY `sign-test` and `verify` all PASS for the six
+receipts with `tier=SEED-0B-PI5` and the digests equal to the ones printed in the log.
+
+## Q6 Receipts manifest (no signing key yet)
+
+`scripts/pi5_receipts_manifest.sh <run-folder>... | --all <runs-root>` reads each run folder's `kernel.log` and `run.log` and
+prints a deterministic manifest: per run tag (sorted), image EFI sha256, aienos_commit, kernel.log sha256 and the verdict
+lines picked by the checked-in table `scripts/pi5_receipts_verdicts.tsv` (PI5-3 storage, PI5-4 unlock A-E, PI5-5 F1-F3,
+PI5-6 infer and G1-G3, PI5-7 L1-L3, power cut P1, artifact a1 and a2, pi5-pcie-1, pi5-net-1, pi5-net-3-r1). It refuses to
+print anything if a folder is missing, a field is absent or a table row matches no line. Plain ASCII, LF only, no timestamps or paths.
+
+Signing design: the signature is a detached Ed25519 signature (RFC 8032, 64 raw bytes) over the exact manifest bytes.
+`native/kernel/tools/ck_manifest_sig.c verify MANIFEST SIG PUBKEYHEX` checks it with the in-tree verifier; its only signing
+command, `sign-test`, uses the public RFC 8032 TEST 1 key and says TEST ONLY. `scripts/ck_pi5_manifest_check.sh` proves the
+round trip (and that a tampered manifest, a tampered signature and a different key all fail).
+
+## Limits
+
+- All Pi evidence is one Pi, one card, TEST keys. The manifest is unsigned for real: only a TEST signature was made.
+- Run folders live on the Spark (`~/workspace/pi5-runs`), not in the repository; the manifest records their hashes.
+- The Pi image tier change affects every Pi image that links the artifact loader (none of the other Pi images presents candidates).
diff --git a/native/.crumb b/native/.crumb
index 53312f4a..83857bfa 100644
--- a/native/.crumb
+++ b/native/.crumb
@@ -50,7 +50,7 @@
       "children": [
         {
           "digest": "50aa2fbd6ca356b7703517bc7ecf439f7b6e0a6b935d0ca6ca4c6f7caf23ce34",
-          "last_commit": "f78977a",
+          "last_commit": "09e59a8",
           "name": "argus",
           "purpose": "Directory native/argus. Purpose not yet described by a human."
         },
@@ -79,8 +79,8 @@
           "purpose": "Directory native/disk. Purpose not yet described by a human."
         },
         {
-          "digest": "1ea30e8921bc8f61835ecaa6e3896b1084c4b0a6034ff00493f21390a98f1b25",
-          "last_commit": "f78977a",
+          "digest": "48357362d2e3f9fa0d22b866d4503fa63953378c4841d5c87c64797bc77932c6",
+          "last_commit": "c31f632",
           "name": "kernel",
           "purpose": "Directory native/kernel. Purpose not yet described by a human."
         },
@@ -109,15 +109,15 @@
           "purpose": "Directory native/store. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:f717850d29ca52ae372b396eee8f4323cb090798258f2b4eea23bbe5ce4f92cb",
-      "compiled_at": "2026-10-14T01:16:45Z",
+      "children_root": "sha256:6a6528f2ebd9224370f98ec6bb454dfcdf6e3adddb0c32966ff52acea7bb1c64",
+      "compiled_at": "2026-10-14T02:20:15Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:c4788a6bd2633e3ad2933270f03e65212b0003f61e629a09f3b637ec9ff4a481",
+      "digest": "sha256:10e9c2e0ebceb8e60113783dfa5c83ddaf7ef3fef3d700d6c489cae331117f11",
       "evidence_files": 4,
       "evidence_root": "sha256:e410b845507e00568e15b51a5797af32a97e0e4b8ab4e8487bb7c98e7e0cf335",
-      "files": 561,
-      "generated_at_commit": "f78977a6ce33ea89a5b3b1952c0a0e403d4504fa",
-      "source_tree": "sha256:9bbd7b42a9f48a2cbc7b805a8ad5973bce1ef2f1950fc66d4933575f20f54d8c"
+      "files": 562,
+      "generated_at_commit": "7cd74cbbd0a45def4384618e7f82513c76021aad",
+      "source_tree": "sha256:df21964cda544ea6321f93e03355d98405d1626fd8d1876096e71b65c9ffaede"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/.crumb b/native/kernel/.crumb
index 42d74ef3..71c59069 100644
--- a/native/kernel/.crumb
+++ b/native/kernel/.crumb
@@ -51,14 +51,14 @@
           "purpose": "Directory native/kernel/arch. Purpose not yet described by a human."
         },
         {
-          "digest": "f3973e5baeb129ef1f92cbf9719c69062a24c3f901be911951b31491a0cabc82",
-          "last_commit": "f78977a",
+          "digest": "29a3372d4ab6170718cb870e8d586c94f9828a20755277bf052588376e47333e",
+          "last_commit": "c31f632",
           "name": "artifact",
           "purpose": "Directory native/kernel/artifact. Purpose not yet described by a human."
         },
         {
-          "digest": "cb321e8501900b217910e4f33f40364fda20d2fbd9e88db637ee2d1e63da7e58",
-          "last_commit": "e9d39a9",
+          "digest": "9333ad224a18c87c3e0e241c69209b761a27f72d7f2067354f0658b917cd77ef",
+          "last_commit": "c31f632",
           "name": "core",
           "purpose": "Directory native/kernel/core. Purpose not yet described by a human."
         },
@@ -87,27 +87,27 @@
           "purpose": "Directory native/kernel/svc. Purpose not yet described by a human."
         },
         {
-          "digest": "8e39b06bf4949cf9db10b8499b7cef56c9759b9692efc859575ce502df0a0c0a",
-          "last_commit": "e9d39a9",
+          "digest": "67f43d00adce9780c2ae75ece209ac453a1b9debc74d735d9acdb72f36e6df77",
+          "last_commit": "c31f632",
           "name": "tests",
           "purpose": "Directory native/kernel/tests. Purpose not yet described by a human."
         },
         {
-          "digest": "0edc3f7461724a676c9514bce12eb8fa4bd9eabb45a4802192aca7c50aaf8e20",
-          "last_commit": "0735543",
+          "digest": "f3d6c345756daa6db11e27a2f19d4c1f3ff0101cb999ff08a6c938a7cc031969",
+          "last_commit": "c31f632",
           "name": "tools",
           "purpose": "Hosted (Linux-built) checkers for the native kernel, run by `make -C native/kernel test`; nothin"
         }
       ],
-      "children_root": "sha256:1b7a80fcf6c87bcc51d8301826e8733a27dd1e2d604296931c105ccb9d21ac2f",
-      "compiled_at": "2026-10-14T01:16:45Z",
+      "children_root": "sha256:a54967a5384a7acacb8b4f5532afdcd4be6c0e5b0eb1af9b693bfbb688a81574",
+      "compiled_at": "2026-10-14T02:20:15Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:1ea30e8921bc8f61835ecaa6e3896b1084c4b0a6034ff00493f21390a98f1b25",
+      "digest": "sha256:48357362d2e3f9fa0d22b866d4503fa63953378c4841d5c87c64797bc77932c6",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 380,
-      "generated_at_commit": "f78977a6ce33ea89a5b3b1952c0a0e403d4504fa",
-      "source_tree": "sha256:f9c6f1e2520c0c18b24e243f9b6150c62a45da232f7d2d6c405affc81e2d4aca"
+      "files": 381,
+      "generated_at_commit": "7cd74cbbd0a45def4384618e7f82513c76021aad",
+      "source_tree": "sha256:2f910836a1405c22674d09861b8b357f0f25cb41dd1a4ac35176e583005c331d"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/Makefile b/native/kernel/Makefile
index 9174582c..13db0a4e 100644
--- a/native/kernel/Makefile
+++ b/native/kernel/Makefile
@@ -1459,8 +1459,8 @@ smmu-l2-mutants: $(OUT)/host/test_smmu
 	else echo "mutant flag refused under CK_HARDWARE_STAGING"; fi; \
 	if [ $$fail = 0 ]; then echo "CK_SMMU_L2_MUTANTS: PASS"; else echo "CK_SMMU_L2_MUTANTS: FAIL"; exit 1; fi
 
-test: $(addprefix $(OUT)/host/,$(TESTS)) handoff-mutant acpi-dev-mutant iort-mutants smmu-l2-mutants osh-op-mutant context-mutant agent-cmd-mutant artifact-card-mutant test-continuity-subject-restart gsp-fw-inspect-test gsp-cot-test gsp-bindata-test gsp-bootargs-test gsp-rpc-test slot-test slot-free package-test slot-loader-check
-	@fail=0; for t in $(filter-out handoff-mutant acpi-dev-mutant iort-mutants smmu-l2-mutants osh-op-mutant context-mutant agent-cmd-mutant artifact-card-mutant test-continuity-subject-restart gsp-fw-inspect-test gsp-cot-test gsp-bindata-test gsp-bootargs-test gsp-rpc-test slot-test slot-free package-test slot-loader-check,$^); do $$t || fail=1; done; \
+test: $(addprefix $(OUT)/host/,$(TESTS)) handoff-mutant acpi-dev-mutant iort-mutants smmu-l2-mutants osh-op-mutant context-mutant agent-cmd-mutant artifact-card-mutant artifact-tier-pi5 artifact-tier-mutant test-continuity-subject-restart gsp-fw-inspect-test gsp-cot-test gsp-bindata-test gsp-bootargs-test gsp-rpc-test slot-test slot-free package-test slot-loader-check
+	@fail=0; for t in $(filter-out handoff-mutant acpi-dev-mutant iort-mutants smmu-l2-mutants osh-op-mutant context-mutant agent-cmd-mutant artifact-card-mutant artifact-tier-pi5 artifact-tier-mutant test-continuity-subject-restart gsp-fw-inspect-test gsp-cot-test gsp-bindata-test gsp-bootargs-test gsp-rpc-test slot-test slot-free package-test slot-loader-check,$^); do $$t || fail=1; done; \
 	if [ $$fail = 0 ]; then echo "CK_CORE_HOST: PASS"; else echo "CK_CORE_HOST: FAIL"; exit 1; fi
 
 sanitize: $(addprefix $(OUT)/host-san/,$(TESTS))
@@ -1490,6 +1490,23 @@ $(OUT)/host/test_artifact: $(KDIR)/tests/test_artifact.c $(ART_HOST_DEPS) $(KDIR
 	@mkdir -p $(dir $@)
 	$(HOSTCC) $(HCFLAGS) $(ART_HOST_INC) -o $@ $< $(ART_HOST_SRCS)
 
+# PI5-8 Q3: the receipt tier is chosen by the image. test_artifact built with -DCK_PI5 (the Pi image's define) must see
+# SEED-0B-PI5; the mutant (-DCKA_TIER_MUTANT, Pi image still writes the QEMU tier) must make that test FAIL.
+$(OUT)/host/test_artifact_pi5: $(KDIR)/tests/test_artifact.c $(ART_HOST_DEPS) $(KDIR)/tests/ck_test.h
+	@mkdir -p $(dir $@)
+	$(HOSTCC) $(HCFLAGS) $(ART_HOST_INC) -DCK_PI5 -o $@ $< $(ART_HOST_SRCS)
+
+$(OUT)/host/test_artifact_pi5_mutant: $(KDIR)/tests/test_artifact.c $(ART_HOST_DEPS) $(KDIR)/tests/ck_test.h
+	@mkdir -p $(dir $@)
+	$(HOSTCC) $(HCFLAGS) $(ART_HOST_INC) -DCK_PI5 -DCKA_TIER_MUTANT -o $@ $< $(ART_HOST_SRCS)
+
+artifact-tier-pi5: $(OUT)/host/test_artifact_pi5
+	@$<
+
+artifact-tier-mutant: $(OUT)/host/test_artifact_pi5_mutant
+	@if $< > $<.log 2>&1; then cat $<.log; echo "test_artifact Pi tier mutant (Pi image writes the QEMU tier): PASSED, test does not catch it"; exit 1; \
+	else echo "test_artifact Pi tier mutant (Pi image writes the QEMU tier): FAILS as required"; fi
+
 $(OUT)/host/test_osc_unit: $(KDIR)/tests/test_osc_unit.c $(ART_HOST_DEPS) $(KDIR)/tests/ck_test.h
 	@mkdir -p $(dir $@)
 	$(HOSTCC) $(HCFLAGS) $(ART_HOST_INC) -DOSC_FIXTURE_DIR='"$(abspath $(KDIR)/tests/fixtures/osc_unit)"' -o $@ $< $(ART_HOST_SRCS)
@@ -2091,9 +2108,11 @@ pi5-diag: $(PI5DIAG_EFI)
 pi5-store:
 	$(MAKE) CK_PI5_STORE=1 full
 
+# PI5-8 Q1: --remap-path-prefix keeps the build directory out of the Rust panic-location strings, so the three Pi images
+# that link this library are byte-identical when built from different checkout paths (scripts/ck_pi5_repro_check.sh).
 PI5_INFER_LIB := $(REPO)/target/infer-kernel/aarch64-unknown-none/release/libaienos_infer_kernel.a
 pi5-infer:
-	CARGO_TARGET_DIR=$(REPO)/target/infer-kernel cargo build -q --release --target aarch64-unknown-none --manifest-path $(REPO)/crates/aienos-infer-kernel/Cargo.toml
+	RUSTFLAGS="--remap-path-prefix=$(REPO)=/aienos" CARGO_TARGET_DIR=$(REPO)/target/infer-kernel cargo build -q --release --target aarch64-unknown-none --manifest-path $(REPO)/crates/aienos-infer-kernel/Cargo.toml
 	$(MAKE) CK_PI5_INFER=1 CK_INFER_LIB=$(PI5_INFER_LIB) all
 pi5-unlock:
 	$(MAKE) CK_PI5_UNLOCK=1 full
@@ -2105,11 +2124,11 @@ pi5-fact:
 	$(MAKE) CK_PI5_UNLOCK=1 CK_PI5_UNLOCK_CARD=1 CK_PI5_FACT=1 full
 
 pi5-agent:
-	CARGO_TARGET_DIR=$(REPO)/target/infer-kernel cargo build -q --release --target aarch64-unknown-none --manifest-path $(REPO)/crates/aienos-infer-kernel/Cargo.toml
+	RUSTFLAGS="--remap-path-prefix=$(REPO)=/aienos" CARGO_TARGET_DIR=$(REPO)/target/infer-kernel cargo build -q --release --target aarch64-unknown-none --manifest-path $(REPO)/crates/aienos-infer-kernel/Cargo.toml
 	$(MAKE) CK_PI5_UNLOCK=1 CK_PI5_UNLOCK_CARD=1 CK_PI5_AGENT=1 CK_INFER_LIB=$(PI5_INFER_LIB) full
 
 pi5-lifecycle:
-	CARGO_TARGET_DIR=$(REPO)/target/infer-kernel cargo build -q --release --target aarch64-unknown-none --manifest-path $(REPO)/crates/aienos-infer-kernel/Cargo.toml
+	RUSTFLAGS="--remap-path-prefix=$(REPO)=/aienos" CARGO_TARGET_DIR=$(REPO)/target/infer-kernel cargo build -q --release --target aarch64-unknown-none --manifest-path $(REPO)/crates/aienos-infer-kernel/Cargo.toml
 	$(MAKE) CK_PI5_UNLOCK=1 CK_PI5_UNLOCK_CARD=1 CK_PI5_LIFECYCLE=1 CK_INFER_LIB=$(PI5_INFER_LIB) full
 
 pi5-artifact:
@@ -2173,6 +2192,7 @@ $(OUT)/host-san/test_pi5_rng: $(KDIR)/tests/test_pi5_rng.c $(PI5_RNG_SRCS) $(KDI
 
 FORCE:
 .PHONY: uefi-vars slot-loader slot-loader-check pi5-diag
+.PHONY: artifact-tier-pi5 artifact-tier-mutant
 .PHONY: all full pi5 pi5-store pi5-infer pi5-unlock pi5-unlock-card pi5-fact pi5-agent pi5-lifecycle pi5-artifact artifact-card-mutant test sanitize context-mutant agent-cmd-mutant cortex-image handoff-mutant acpi-dev-mutant iort-mutants smmu-l2-mutants acpi-scan clean print-kcflags udp-echo tool store-image gpt-image cont-tool owner-gen fb-check continuity-mutants continuity-resolve-mutants FORCE
 
 # AIENOS-PI5 step 3 marker + Pi card GPT test (hosted; a file stands in for the card, QEMU cannot model the Pi SD host).
diff --git a/native/kernel/artifact/.crumb b/native/kernel/artifact/.crumb
index 774875c0..f85ab2bc 100644
--- a/native/kernel/artifact/.crumb
+++ b/native/kernel/artifact/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-14T01:16:45Z",
+      "compiled_at": "2026-10-14T02:20:15Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:f3973e5baeb129ef1f92cbf9719c69062a24c3f901be911951b31491a0cabc82",
+      "digest": "sha256:29a3372d4ab6170718cb870e8d586c94f9828a20755277bf052588376e47333e",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 9,
-      "generated_at_commit": "f78977a6ce33ea89a5b3b1952c0a0e403d4504fa",
-      "source_tree": "sha256:e8af6c3da56a9bae598a7c119d713642e0f505d8435d6222d7a6450dd634aa53"
+      "generated_at_commit": "7cd74cbbd0a45def4384618e7f82513c76021aad",
+      "source_tree": "sha256:97063e311a1ca103b8e9b5c82abbea0a70a928b172b050ec99a4dba8110e15c9"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/artifact/ck_artifact.h b/native/kernel/artifact/ck_artifact.h
index fe1867e8..21ed5abf 100644
--- a/native/kernel/artifact/ck_artifact.h
+++ b/native/kernel/artifact/ck_artifact.h
@@ -151,7 +151,21 @@ int cka_evaluate(const struct cka_policy *pol, const struct cka_parsed *p,
 #define CKA_RECEIPT_SIZE 512u
 #define CKA_RECEIPT_SIGNED_LEN 400u
 enum { CKR_ADMITTED = 1, CKR_REJECTED = 2 };
-enum { CKR_TIER_SEED0B_QEMU = 1 };
+enum { CKR_TIER_SEED0B_QEMU = 1, CKR_TIER_SEED0B_PI5 = 3 };
+/* Tier a receipt carries, chosen by the image: the Pi image (CK_PI5) writes SEED-0B-PI5, every other image
+ * (QEMU, Spark) writes SEED-0B-QEMU exactly as before. CKA_TIER_MUTANT is a host-test mutant only. */
+#if defined(CK_PI5) && !defined(CKA_TIER_MUTANT)
+#define CKA_IMAGE_TIER CKR_TIER_SEED0B_PI5
+#else
+#define CKA_IMAGE_TIER CKR_TIER_SEED0B_QEMU
+#endif
+/* Tiers decode accepts: the Pi tier only in the Pi image and in hosted tools (the verifier); the QEMU and
+ * Spark kernels still accept SEED-0B-QEMU only, so their code is unchanged. */
+#if defined(CK_PI5) || (defined(__STDC_HOSTED__) && __STDC_HOSTED__)
+#define CKA_TIER_OK(t) ((t) == CKR_TIER_SEED0B_QEMU || (t) == CKR_TIER_SEED0B_PI5)
+#else
+#define CKA_TIER_OK(t) ((t) == CKR_TIER_SEED0B_QEMU)
+#endif
 enum {
     CKR_NOT_RUN = 0, CKR_EXITED, CKR_TIMEOUT, CKR_FAULT, CKR_BAD_SYSCALL, CKR_RESOURCE_OVERRUN,
 };
diff --git a/native/kernel/artifact/receipt.c b/native/kernel/artifact/receipt.c
index ad1ff857..aab29865 100644
--- a/native/kernel/artifact/receipt.c
+++ b/native/kernel/artifact/receipt.c
@@ -109,7 +109,7 @@ int cka_receipt_decode(const uint8_t b[CKA_RECEIPT_SIZE], struct cka_receipt *r)
     r->tier = cka_rd16(b + 22);
     r->status = cka_rd32(b + 64);
     if ((r->decision != CKR_ADMITTED && r->decision != CKR_REJECTED) ||
-        r->tier != CKR_TIER_SEED0B_QEMU || r->status > CKR_RESOURCE_OVERRUN)
+        !CKA_TIER_OK(r->tier) || r->status > CKR_RESOURCE_OVERRUN)
         return CKA_MALFORMED_RECEIPT;
     r->seq = cka_rd64(b + 24);
     put(r->nonce, b + 32, 16);
diff --git a/native/kernel/core/.crumb b/native/kernel/core/.crumb
index 251350d6..cbc47a56 100644
--- a/native/kernel/core/.crumb
+++ b/native/kernel/core/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-14T00:20:37Z",
+      "compiled_at": "2026-10-14T01:54:45Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:cb321e8501900b217910e4f33f40364fda20d2fbd9e88db637ee2d1e63da7e58",
+      "digest": "sha256:9333ad224a18c87c3e0e241c69209b761a27f72d7f2067354f0658b917cd77ef",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 69,
-      "generated_at_commit": "a3e9c23dfc5b0ed0f9701132904b28edac14b71f",
-      "source_tree": "sha256:c66ee9b515ec33e09871eb7960d1139b13d65de7a7017dfdfbac193c2562a883"
+      "generated_at_commit": "8307a68a2eedcc5c8d6c2a6ffbf7c12f398c094b",
+      "source_tree": "sha256:d7b7e5c99b8d6cdb89349e4d4e2aa115ea53302976425ee3bf5da97fb302f0d0"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/core/artifact_loader.c b/native/kernel/core/artifact_loader.c
index 232a1c87..8ceee3eb 100644
--- a/native/kernel/core/artifact_loader.c
+++ b/native/kernel/core/artifact_loader.c
@@ -1003,7 +1003,7 @@ static void print_receipt(const char *name, const struct report *r)
     memset(&rc, 0, sizeof rc);
     int adm = r->admitted;
     rc.decision = adm ? CKR_ADMITTED : CKR_REJECTED;
-    rc.tier = CKR_TIER_SEED0B_QEMU;
+    rc.tier = CKA_IMAGE_TIER;
     rc.seq = seq;
     memcpy(rc.verifier, verifier_id, 32);
     cka_receipt_nonce(verifier_id, seq, rc.nonce);
diff --git a/native/kernel/tests/.crumb b/native/kernel/tests/.crumb
index a2e359ff..5bd45a84 100644
--- a/native/kernel/tests/.crumb
+++ b/native/kernel/tests/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-14T00:20:37Z",
+      "compiled_at": "2026-10-14T01:54:45Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:8e39b06bf4949cf9db10b8499b7cef56c9759b9692efc859575ce502df0a0c0a",
+      "digest": "sha256:67f43d00adce9780c2ae75ece209ac453a1b9debc74d735d9acdb72f36e6df77",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 165,
-      "generated_at_commit": "a3e9c23dfc5b0ed0f9701132904b28edac14b71f",
-      "source_tree": "sha256:8a193e74853836c8f0d1d91b673225a9775581faf6f219065a41cfa41518a19b"
+      "generated_at_commit": "8307a68a2eedcc5c8d6c2a6ffbf7c12f398c094b",
+      "source_tree": "sha256:01254316e00d1bce77c10d8ac08c618006b73522f6d0da0816da80fef5a065f7"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/tests/test_artifact.c b/native/kernel/tests/test_artifact.c
index fd9b3ab8..883fe365 100644
--- a/native/kernel/tests/test_artifact.c
+++ b/native/kernel/tests/test_artifact.c
@@ -110,6 +110,51 @@ static void test_receipt(void)
     }
 }
 
+/* Receipt tier by image: a Pi image (build with -DCK_PI5) writes SEED-0B-PI5, any other image SEED-0B-QEMU; the
+ * hosted verifier decodes both, round-trips the Pi tier, signs and verifies it, and refuses any other value. */
+static void test_tier(void)
+{
+    struct cka_receipt r, back;
+    uint8_t rec[CKA_RECEIPT_SIZE], ver[32];
+#ifdef CK_PI5
+    CHECK(CKA_IMAGE_TIER == CKR_TIER_SEED0B_PI5);
+#else
+    CHECK(CKA_IMAGE_TIER == CKR_TIER_SEED0B_QEMU);
+#endif
+    memset(&r, 0, sizeof r);
+    cka_verifier_identity("0123456789abcdef0123456789abcdef01234567", 1, ver);
+    r.decision = CKR_ADMITTED;
+    r.tier = CKA_IMAGE_TIER;
+    r.seq = 1;
+    memcpy(r.verifier, ver, 32);
+    cka_receipt_nonce(ver, 1, r.nonce);
+    r.status = CKR_EXITED;
+    r.result_flags = 0xff;
+    memset(r.id, 0x11, 32);
+    memset(r.payload, 0x22, 32);
+    memset(r.signer, 0x33, 32);
+    memset(r.policy, 0x44, 32);
+    memset(r.requested, 0x55, 32);
+    memset(r.granted, 0x66, 32);
+    memset(r.resources, 0x77, 32);
+    cka_receipt_encode(&r, rec);
+    CHECK(cka_receipt_decode(rec, &back) == 0 && back.tier == CKA_IMAGE_TIER);
+    CHECK(rec[22] == (uint8_t)CKA_IMAGE_TIER && rec[23] == 0);
+    r.tier = CKR_TIER_SEED0B_PI5;
+    cka_receipt_encode(&r, rec);
+    CHECK(cka_receipt_decode(rec, &back) == 0 && back.tier == CKR_TIER_SEED0B_PI5);
+    CHECK(cka_receipt_sign(rec, test2_seed) == 0);
+    CHECK(cka_receipt_verify(rec, &cka_test2_pk, 1) == 0);
+    rec[22] = 1; /* the tier is covered by the signature */
+    CHECK(cka_receipt_verify(rec, &cka_test2_pk, 1) != 0);
+    r.tier = 2;
+    cka_receipt_encode(&r, rec);
+    CHECK(cka_receipt_decode(rec, &back) != 0);
+    r.tier = 4;
+    cka_receipt_encode(&r, rec);
+    CHECK(cka_receipt_decode(rec, &back) != 0);
+}
+
 static void test_names(void)
 {
     CHECK(strcmp(cka_error_name(CKA_UNTRUSTED_SIGNER), "UntrustedSigner") == 0);
@@ -122,6 +167,7 @@ int main(void)
 {
     test_verify_and_admit();
     test_receipt();
+    test_tier();
     test_names();
     return ck_t_verdict("test_artifact");
 }
diff --git a/native/kernel/tools/.crumb b/native/kernel/tools/.crumb
index fc289a19..a55976d6 100644
--- a/native/kernel/tools/.crumb
+++ b/native/kernel/tools/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-13T21:27:22Z",
+      "compiled_at": "2026-10-14T01:54:45Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:0edc3f7461724a676c9514bce12eb8fa4bd9eabb45a4802192aca7c50aaf8e20",
+      "digest": "sha256:f3d6c345756daa6db11e27a2f19d4c1f3ff0101cb999ff08a6c938a7cc031969",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 22,
-      "generated_at_commit": "03de8681ae58720bd01a45ccb5311c792f1d517b",
-      "source_tree": "sha256:d3e56f0f6001d51aed06633ee74a86b63e32f01284be40438806b3e254864c94"
+      "files": 23,
+      "generated_at_commit": "8307a68a2eedcc5c8d6c2a6ffbf7c12f398c094b",
+      "source_tree": "sha256:a756674e9c3048b930ddacd4151b5812999d5fefa5a19ea392a860a63d372bf1"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/tools/ck_artifact_tool.c b/native/kernel/tools/ck_artifact_tool.c
index e2424669..68a4d16c 100644
--- a/native/kernel/tools/ck_artifact_tool.c
+++ b/native/kernel/tools/ck_artifact_tool.c
@@ -587,6 +587,11 @@ static void decoded(const uint8_t *b, struct cka_receipt *r)
     }
 }
 
+static const char *tier_name(uint16_t t)
+{
+    return t == CKR_TIER_SEED0B_PI5 ? "SEED-0B-PI5" : "SEED-0B-QEMU";
+}
+
 static const char *decision(const struct cka_receipt *r)
 {
     return r->decision == CKR_ADMITTED ? "Admitted" : "Rejected";
@@ -653,9 +658,9 @@ static int receipt(int argc, char **argv)
         uint8_t d[32];
         cka_receipt_digest(rec, d);
         hex(d, 32, h);
-        printf("RECEIPT_CHECK: PASS digest=%s decision=%s tier=SEED-0B-QEMU stage=%u reason=0x%x "
+        printf("RECEIPT_CHECK: PASS digest=%s decision=%s tier=%s stage=%u reason=0x%x "
                "status=%s exit=%d syscalls=%u reads_ok=%u denials=%u flags=0x%02x\n",
-               h, decision(&r), r.stage, r.reason, cka_status_name(r.status), r.exit, r.syscalls,
+               h, decision(&r), tier_name(r.tier), r.stage, r.reason, cka_status_name(r.status), r.exit, r.syscalls,
                r.reads, r.denials, r.result_flags);
         return 0;
     }
@@ -683,8 +688,8 @@ static int receipt(int argc, char **argv)
         uint8_t d[32];
         cka_receipt_digest(rec, d);
         hex(d, 32, h);
-        printf("RECEIPT_VERIFY: PASS digest=%s decision=%s tier=SEED-0B-QEMU "
-               "trust=SEED-0B-TEST-ONLY\n", h, decision(&r));
+        printf("RECEIPT_VERIFY: PASS digest=%s decision=%s tier=%s "
+               "trust=SEED-0B-TEST-ONLY\n", h, decision(&r), tier_name(r.tier));
         return 0;
     }
     die("usage: receipt from-hex HEX OUT | check REC ARTIFACT | sign-test IN OUT | verify REC");
diff --git a/native/kernel/tools/ck_manifest_sig.c b/native/kernel/tools/ck_manifest_sig.c
new file mode 100644
index 00000000..46a6a433
--- /dev/null
+++ b/native/kernel/tools/ck_manifest_sig.c
@@ -0,0 +1,109 @@
+/* ck_manifest_sig.c -- PI5-8 Q6: detached Ed25519 signature over the exact bytes of a Pi receipts manifest
+ * (scripts/pi5_receipts_manifest.sh), using the in-tree Ed25519 (native/sig, RFC 8032 pure Ed25519).
+ *
+ *   ck_manifest_sig verify MANIFEST SIG PUBKEYHEX   exit 0 only if SIG (64 raw bytes) is valid over MANIFEST
+ *   ck_manifest_sig sign-test MANIFEST SIGOUT       signs with the PUBLIC RFC 8032 TEST 1 secret key
+ *
+ * There is deliberately no way to sign with any other key: no key file, no key argument. An owner or release
+ * signature will be made by the owner's own signing tool; this tool only verifies those. "sign-test" exists to
+ * prove the manifest bytes are signable and verifiable, and its output says TEST ONLY. */
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "aienos_sig.h"
+
+/* RFC 8032 section 7.1 TEST 1 (public, published in the RFC; protects nothing). */
+static const char *const TEST1_SK = "9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60";
+static const char *const TEST1_PK = "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a";
+
+static int unhex(const char *s, uint8_t *o, size_t n)
+{
+    if (strlen(s) != 2 * n)
+        return -1;
+    for (size_t i = 0; i < n; i++) {
+        unsigned v = 0;
+        for (int k = 0; k < 2; k++) {
+            char c = s[2 * i + k];
+            unsigned d = c >= '0' && c <= '9' ? (unsigned)(c - '0')
+                         : c >= 'a' && c <= 'f' ? (unsigned)(c - 'a' + 10)
+                         : c >= 'A' && c <= 'F' ? (unsigned)(c - 'A' + 10) : 99u;
+            if (d > 15)
+                return -1;
+            v = v * 16 + d;
+        }
+        o[i] = (uint8_t)v;
+    }
+    return 0;
+}
+
+static uint8_t *readf(const char *path, size_t *n)
+{
+    FILE *f = fopen(path, "rb");
+    if (!f) {
+        fprintf(stderr, "error: cannot read %s\n", path);
+        exit(2);
+    }
+    size_t cap = 1 << 16, len = 0;
+    uint8_t *p = malloc(cap);
+    size_t r;
+    while (p && (r = fread(p + len, 1, cap - len, f)) > 0) {
+        len += r;
+        if (len == cap) {
+            cap *= 2;
+            p = realloc(p, cap);
+        }
+    }
+    fclose(f);
+    if (!p) {
+        fprintf(stderr, "error: out of memory\n");
+        exit(2);
+    }
+    *n = len;
+    return p;
+}
+
+int main(int argc, char **argv)
+{
+    uint8_t sig[64], pk[32], sk[32];
+    size_t mn, sn;
+    if (argc == 5 && !strcmp(argv[1], "verify")) {
+        uint8_t *m = readf(argv[2], &mn);
+        uint8_t *s = readf(argv[3], &sn);
+        if (sn != 64 || unhex(argv[4], pk, 32)) {
+            fprintf(stderr, "error: SIG must be 64 raw bytes and PUBKEYHEX 64 hex digits\n");
+            return 2;
+        }
+        memcpy(sig, s, 64);
+        if (aienos_ed25519_verify(sig, m, mn, pk) != AIENOS_SIG_OK) {
+            printf("MANIFEST_SIG: FAIL signature does not verify (%zu manifest bytes)\n", mn);
+            return 1;
+        }
+        printf("MANIFEST_SIG: PASS signature verifies over %zu manifest bytes, public key %s%s\n", mn,
+               argv[4], strcmp(argv[4], TEST1_PK) ? "" : " (RFC 8032 TEST 1 key: TEST ONLY, not an owner or release key)");
+        return 0;
+    }
+    if (argc == 4 && !strcmp(argv[1], "sign-test")) {
+        uint8_t *m = readf(argv[2], &mn);
+        uint8_t pk2[32];
+        if (unhex(TEST1_SK, sk, 32) || unhex(TEST1_PK, pk, 32) || aienos_ed25519_public_key(pk2, sk) != 0 ||
+            memcmp(pk, pk2, 32)) {
+            fprintf(stderr, "error: RFC 8032 TEST 1 key self-check failed\n");
+            return 2;
+        }
+        if (aienos_ed25519_sign(sig, m, mn, sk) != AIENOS_SIG_OK) {
+            fprintf(stderr, "error: sign failed\n");
+            return 2;
+        }
+        FILE *f = fopen(argv[3], "wb");
+        if (!f || fwrite(sig, 1, 64, f) != 64 || fclose(f)) {
+            fprintf(stderr, "error: cannot write %s\n", argv[3]);
+            return 2;
+        }
+        printf("MANIFEST_SIGN: TEST ONLY, signed %zu manifest bytes with the public RFC 8032 TEST 1 key %s "
+               "(not an owner or release key)\n", mn, TEST1_PK);
+        return 0;
+    }
+    fprintf(stderr, "usage: ck_manifest_sig verify MANIFEST SIG PUBKEYHEX | sign-test MANIFEST SIGOUT\n");
+    return 2;
+}
diff --git a/scripts/.crumb b/scripts/.crumb
index 8ae15a77..074bd6ce 100644
--- a/scripts/.crumb
+++ b/scripts/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-14T01:16:45Z",
+      "compiled_at": "2026-10-14T02:20:15Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:ffc301dd27d8282fead7987c2f7ac1c8bb3ff262994bf324dc804ef2d36db01e",
+      "digest": "sha256:e148d5bd0c19501efe0f07f59aae88ed1209904d1cf3e79bf9a1187877b8b11c",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 98,
-      "generated_at_commit": "f78977a6ce33ea89a5b3b1952c0a0e403d4504fa",
-      "source_tree": "sha256:a3e582cf4995d987847b39d8b1c1a12d742abfa71f699a01d289a161002cea52"
+      "files": 102,
+      "generated_at_commit": "7cd74cbbd0a45def4384618e7f82513c76021aad",
+      "source_tree": "sha256:4994ece1623fa0138f9791f115c93d61dc43e33840d2a8f578242c7ca32ec3e7"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/scripts/ck_pi5_manifest_check.sh b/scripts/ck_pi5_manifest_check.sh
new file mode 100755
index 00000000..16f9b6b5
--- /dev/null
+++ b/scripts/ck_pi5_manifest_check.sh
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+# ck_pi5_manifest_check.sh -- PI5-8 Q6 gate: the receipts manifest tool and its TEST-key signature round trip.
+#   1. synthetic run folders -> manifest; second run gives identical bytes; order of arguments does not matter;
+#   2. a missing run folder, an absent verdict line and an unknown run tag each make the tool fail with no output;
+#   3. sign the manifest with the public RFC 8032 TEST 1 key (TEST ONLY) and verify with the in-tree Ed25519;
+#      a flipped manifest byte, a flipped signature byte and a different public key must all fail to verify.
+# No owner or release key is generated or used. Set PI5_RUNS=<dir> to also build the manifest of real runs.
+set -euo pipefail
+root="$(cd "$(dirname "$0")/.." && pwd)"
+tmp="$(mktemp -d)"; trap 'rm -rf "${tmp}"' EXIT
+fail=0
+ok() { echo "PASS $*"; }
+bad() { echo "FAIL $*"; fail=1; }
+cc -std=gnu11 -O1 -Wall -Wextra -Werror -I"${root}/native/sig" -o "${tmp}/sig" \
+    "${root}/native/kernel/tools/ck_manifest_sig.c" "${root}/native/sig/ed25519.c" "${root}/native/sig/sha512.c" "${root}/native/sig/ct.c"
+mk() { # tag efi commit log-lines...
+    local t="$1" e="$2" c="$3"; shift 3
+    mkdir -p "${tmp}/runs/${t}"
+    echo "[00:00:00Z] run ${t}: efi=/x/BOOTAA64.EFI sha256=${e}" > "${tmp}/runs/${t}/run.log"
+    { echo "aienos_commit: ${c}"; printf '%s\r\n' "$@"; } > "${tmp}/runs/${t}/kernel.log"
+}
+e1=$(printf 'a%.0s' $(seq 64)); e2=$(printf 'b%.0s' $(seq 64)); c1=$(printf '1%.0s' $(seq 40))
+printf 'pi5-x1\tT first\t^good: \npi5-x1\tT first\t^also=[0-9]+$\npi5-x2\tT second\t^other ok$\n' > "${tmp}/t.tsv"
+mk pi5-x1 "${e1}" "${c1}" "good: yes" "noise" "also=42"
+mk pi5-x2 "${e2}" "${c1}" "other ok"
+M="${root}/scripts/pi5_receipts_manifest.sh"
+"${M}" -t "${tmp}/t.tsv" "${tmp}/runs/pi5-x2" "${tmp}/runs/pi5-x1" > "${tmp}/m1"
+"${M}" -t "${tmp}/t.tsv" "${tmp}/runs/pi5-x1" "${tmp}/runs/pi5-x2" > "${tmp}/m2"
+if cmp -s "${tmp}/m1" "${tmp}/m2" && [ -s "${tmp}/m1" ]; then ok "manifest is deterministic and independent of argument order"; else bad "manifest not deterministic"; fi
+grep -q "^efi_sha256 ${e1}$" "${tmp}/m1" && grep -q "^aienos_commit ${c1}$" "${tmp}/m1" && grep -q "^  | good: yes$" "${tmp}/m1" && grep -q "^runs 2$" "${tmp}/m1" \
+    && ok "manifest carries efi sha256, commit, verdict lines (CR stripped)" || bad "manifest content"
+if ! grep -q $'\r' "${tmp}/m1"; then ok "manifest has no carriage returns"; else bad "CR in manifest"; fi
+if "${M}" -t "${tmp}/t.tsv" "${tmp}/runs/pi5-x1" "${tmp}/runs/pi5-nope" > "${tmp}/o" 2>"${tmp}/e"; then bad "missing run folder accepted"; elif [ ! -s "${tmp}/o" ] && grep -q MISSING "${tmp}/e"; then ok "missing run folder refused, no manifest"; else bad "missing run folder handling"; fi
+printf 'pi5-x1\tT first\t^never matches$\n' > "${tmp}/t2.tsv"
+if "${M}" -t "${tmp}/t2.tsv" "${tmp}/runs/pi5-x1" > "${tmp}/o" 2>"${tmp}/e"; then bad "absent verdict line accepted"; elif [ ! -s "${tmp}/o" ]; then ok "absent verdict line refused, no manifest"; else bad "absent verdict output"; fi
+if "${M}" -t "${tmp}/t.tsv" "${tmp}/runs/pi5-x1" "${tmp}/runs/pi5-x2" "${tmp}/runs/pi5-x1" > "${tmp}/o3" 2>/dev/null && cmp -s "${tmp}/o3" "${tmp}/m1"; then ok "duplicate folder argument is folded"; else bad "duplicate folder"; fi
+mkdir -p "${tmp}/runs/pi5-x3"; cp "${tmp}/runs/pi5-x1/"* "${tmp}/runs/pi5-x3/"
+if "${M}" -t "${tmp}/t.tsv" "${tmp}/runs/pi5-x3" > "${tmp}/o" 2>/dev/null; then bad "run tag without table rows accepted"; else ok "run tag without table rows refused"; fi
+# TEST-key signature round trip over the exact manifest bytes
+TPK=d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a
+"${tmp}/sig" sign-test "${tmp}/m1" "${tmp}/m1.sig" | tee "${tmp}/s.out"
+grep -q "TEST ONLY" "${tmp}/s.out" && ok "sign-test says TEST ONLY" || bad "sign-test label"
+"${tmp}/sig" verify "${tmp}/m1" "${tmp}/m1.sig" "${TPK}" | tee "${tmp}/v.out" && grep -q "^MANIFEST_SIG: PASS" "${tmp}/v.out" && ok "signature verifies with the in-tree Ed25519" || bad "verify"
+cp "${tmp}/m1" "${tmp}/m1.bad"; printf 'X' | dd of="${tmp}/m1.bad" bs=1 seek=40 conv=notrunc 2>/dev/null
+if "${tmp}/sig" verify "${tmp}/m1.bad" "${tmp}/m1.sig" "${TPK}" >/dev/null; then bad "tampered manifest verified"; else ok "tampered manifest fails to verify"; fi
+cp "${tmp}/m1.sig" "${tmp}/s.bad"; printf 'Z' | dd of="${tmp}/s.bad" bs=1 seek=10 conv=notrunc 2>/dev/null
+if "${tmp}/sig" verify "${tmp}/m1" "${tmp}/s.bad" "${TPK}" >/dev/null; then bad "tampered signature verified"; else ok "tampered signature fails to verify"; fi
+if "${tmp}/sig" verify "${tmp}/m1" "${tmp}/m1.sig" 3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c >/dev/null; then bad "wrong key verified"; else ok "wrong public key fails to verify"; fi
+if [ -n "${PI5_RUNS:-}" ]; then
+    "${M}" --all "${PI5_RUNS}" > "${tmp}/real" && echo "real manifest: $(grep -c '^run ' "${tmp}/real") runs, $(wc -c < "${tmp}/real") bytes, sha256 $(sha256sum < "${tmp}/real" | cut -d' ' -f1)" || bad "real runs manifest"
+fi
+[ "${fail}" = 0 ] && echo "PASS ck_pi5_manifest_check" || { echo "FAIL ck_pi5_manifest_check"; exit 1; }
diff --git a/scripts/ck_pi5_repro_check.sh b/scripts/ck_pi5_repro_check.sh
new file mode 100755
index 00000000..6e9dca42
--- /dev/null
+++ b/scripts/ck_pi5_repro_check.sh
@@ -0,0 +1,70 @@
+#!/usr/bin/env bash
+# ck_pi5_repro_check.sh -- PI5-8 Q1, reproducible builds of every Raspberry Pi 5 image.
+#
+#   scripts/ck_pi5_repro_check.sh [commit]        (default: HEAD of this checkout)
+#
+# Makes two clean detached worktrees of the SAME commit at two DIFFERENT paths (so build-directory
+# paths that leak into an image show up as a difference), builds every Pi image in each with the same
+# toolchain, and compares the sha256 of each BOOTAA64.EFI and aienos-ck.elf byte for byte. Prints a
+# table and PASS/FAIL (exit 0 only when every BOOTAA64.EFI and every stripped ELF matches; a raw ELF may differ only in Rust symbol-name hash suffixes, see below). Records the toolchain versions used.
+# Env: REPRO_KEEP=1 keeps the worktrees; REPRO_TMP=<dir> sets where they go (default: mktemp -d).
+set -euo pipefail
+root="$(cd "$(dirname "$0")/.." && pwd)"
+commit="$(git -C "${root}" rev-parse "${1:-HEAD}")"
+tmp="${REPRO_TMP:-$(mktemp -d "${TMPDIR:-/tmp}/aienos-repro.XXXXXX")}"
+mkdir -p "${tmp}"
+cleanup() {
+    if [ "${REPRO_KEEP:-}" != 1 ]; then
+        for d in a/aienos-repro b/aienos-repro; do
+            git -C "${root}" worktree remove --force "${tmp}/${d}" 2>/dev/null || true
+        done
+        rm -rf "${tmp}"
+    fi
+}
+trap cleanup EXIT
+# target name -> output directory (relative to the worktree) that holds BOOTAA64.EFI and aienos-ck.elf
+images="pi5:target/native-kernel-pi5
+pi5-store:target/native-kernel-pi5-store/full-pi5-store
+pi5-unlock:target/native-kernel-pi5-unlock/full-pi5-unlock
+pi5-unlock-card:target/native-kernel-pi5-unlock-card/full-pi5-unlock-card
+pi5-fact:target/native-kernel-pi5-unlock-card-fact/full-pi5-unlock-card-fact
+pi5-infer:target/native-kernel-pi5-infer
+pi5-agent:target/native-kernel-pi5-unlock-card-agent/full-pi5-unlock-card-agent
+pi5-lifecycle:target/native-kernel-pi5-unlock-card-lifecycle/full-pi5-unlock-card-lifecycle
+pi5-artifact:target/native-kernel-pi5-artifact
+pi5-pcie:target/native-kernel-pi5-pcie
+pi5-net:target/native-kernel-pi5-net"
+
+echo "commit: ${commit}"
+echo "toolchain:"
+for c in "make --version" "cc --version" "ld --version" "objcopy --version" "rustc -Vv" "cargo -V"; do
+    out="$(${c} 2>&1)"; printf "  %s: %s\n" "${c%% *}" "${out%%$'\n'*}"
+done
+git -C "${root}" worktree prune
+for d in a b; do
+    mkdir -p "${tmp}/${d}"
+    git -C "${root}" worktree add -q --detach "${tmp}/${d}/aienos-repro" "${commit}"
+done
+for d in a b; do
+    echo "== build set ${d} (${tmp}/${d}/aienos-repro)"
+    while IFS=: read -r tgt _; do
+        make -C "${tmp}/${d}/aienos-repro/native/kernel" "${tgt}" >"${tmp}/${d}.${tgt}.log" 2>&1 \
+            || { echo "FAIL build ${tgt} in set ${d}; see ${tmp}/${d}.${tgt}.log"; REPRO_KEEP=1; tail -20 "${tmp}/${d}.${tgt}.log"; exit 2; }
+    done <<<"${images}"
+done
+fail=0
+printf '%-16s %-10s %-64s %s\n' IMAGE FILE SHA256 RESULT
+while IFS=: read -r tgt dir; do
+    for f in BOOTAA64.EFI aienos-ck.elf; do
+        pa="${tmp}/a/aienos-repro/${dir}/${f}"; pb="${tmp}/b/aienos-repro/${dir}/${f}"
+        if [ ! -s "${pa}" ] || [ ! -s "${pb}" ]; then printf '%-16s %-10s %-64s %s\n' "${tgt}" "${f}" "-" "MISSING"; fail=1; continue; fi
+        ha="$(sha256sum "${pa}" | cut -d' ' -f1)"; hb="$(sha256sum "${pb}" | cut -d' ' -f1)"
+        if [ "${ha}" = "${hb}" ]; then printf '%-16s %-10s %-64s %s\n' "${tgt}" "${f}" "${ha}" "match"
+        elif [ "${f}" = aienos-ck.elf ] && strip -s -o "${tmp}/sa.elf" "${pa}" && strip -s -o "${tmp}/sb.elf" "${pb}" && cmp -s "${tmp}/sa.elf" "${tmp}/sb.elf"; then
+            # Rust crate-hash suffixes in symbol NAMES (cargo hashes the absolute path of a path dependency outside the crate's
+            # own workspace). Symbols are not in BOOTAA64.EFI; the stripped ELF (all code and data) is byte-identical.
+            printf '%-16s %-10s %-64s %s\n' "${tgt}" "${f}" "${ha}/${hb}" "match-stripped (symbol-name hash suffix only)"
+        else printf '%-16s %-10s %-64s %s\n' "${tgt}" "${f}" "${ha}/${hb}" "DIFFER"; fail=1; fi
+    done
+done <<<"${images}"
+if [ "${fail}" = 0 ]; then echo "PASS ck_pi5_repro_check: every Pi image built twice from ${commit} is byte-identical (EFI exact; Rust-linked ELFs exact once stripped)"; else echo "FAIL ck_pi5_repro_check"; exit 1; fi
diff --git a/scripts/pi5_receipts_manifest.sh b/scripts/pi5_receipts_manifest.sh
new file mode 100755
index 00000000..6f9d562c
--- /dev/null
+++ b/scripts/pi5_receipts_manifest.sh
@@ -0,0 +1,80 @@
+#!/usr/bin/env bash
+# pi5_receipts_manifest.sh -- PI5-8 Q6: canonical, deterministic manifest of Pi run evidence.
+#
+#   scripts/pi5_receipts_manifest.sh [-t verdicts.tsv] <run-folder>...      (folders like ~/workspace/pi5-runs/<tag>)
+#   scripts/pi5_receipts_manifest.sh [-t verdicts.tsv] --all <runs-root>   (every tag in the table)
+#
+# Each run folder holds kernel.log and run.log (written by the Pi run harness). The manifest has, per run tag
+# (sorted bytewise): the image EFI sha256 (run.log first line), aienos_commit (kernel.log), the sha256 of
+# kernel.log, and the verdict lines picked by the checked-in table (scripts/pi5_receipts_verdicts.tsv).
+# Output is plain ASCII, LF line endings, no timestamps, no absolute paths: same inputs, same bytes.
+#
+# SIGNING (not done here): the manifest bytes on stdout are the message. A signature is an Ed25519 detached
+# signature over exactly those bytes (RFC 8032 pure Ed25519), checked with the in-tree verifier
+# (native/sig/ed25519.c) by native/kernel/tools/ck_manifest_sig.c ("verify MANIFEST SIG PUBKEYHEX").
+# No owner or release key exists yet; scripts/ck_pi5_manifest_check.sh proves sign+verify with the public
+# RFC 8032 TEST 1 key only.
+#
+# Exit 0 and a manifest on stdout only when every run folder exists, every field was found and every table
+# row matched at least one line. Otherwise nothing goes to stdout; problems go to stderr (exit 1 evidence
+# missing, exit 2 usage or missing run folder).
+set -euo pipefail
+export LC_ALL=C
+here="$(cd "$(dirname "$0")" && pwd)"
+table="${here}/pi5_receipts_verdicts.tsv"
+if [ "${1:-}" = "-t" ]; then table="${2:?table}"; shift 2; fi
+[ -r "${table}" ] || { echo "no verdict table ${table}" >&2; exit 2; }
+rows="$(grep -v '^#' "${table}" | grep -v '^$')"
+dirs=()
+if [ "${1:-}" = "--all" ]; then
+    root="${2:?runs root}"
+    while IFS= read -r t; do dirs+=("${root}/${t}"); done < <(cut -f1 <<<"${rows}" | sort -u)
+else
+    [ $# -ge 1 ] || { echo "usage: $0 [-t table] <run-folder>... | --all <runs-root>" >&2; exit 2; }
+    dirs=("$@")
+fi
+# sorted unique tags, tag -> folder
+declare -A folder
+tags=""
+for d in "${dirs[@]}"; do
+    d="${d%/}"; t="${d##*/}"
+    folder[$t]="$d"; tags="${tags}${t}"$'\n'
+done
+tags="$(printf '%s' "${tags}" | sort -u)"
+missing=0
+while IFS= read -r t; do
+    d="${folder[$t]}"
+    for f in kernel.log run.log; do
+        [ -r "${d}/${f}" ] || { echo "MISSING ${d}/${f}" >&2; missing=1; }
+    done
+done <<<"${tags}"
+[ "${missing}" = 0 ] || exit 2
+bad=0
+out="AIENOS-PI5-RECEIPTS-MANIFEST-V1"$'\n'
+out+="verdict_table_sha256 $(grep -v '^#' "${table}" | grep -v '^$' | sha256sum | cut -d' ' -f1)"$'\n'
+out+="runs $(grep -c . <<<"${tags}")"$'\n'
+while IFS= read -r t; do
+    d="${folder[$t]}"
+    efi="$(head -n 1 "${d}/run.log" | grep -ao 'sha256=[0-9a-f]\{64\}' | head -n 1 | cut -d= -f2 || true)"
+    commit="$(grep -a -m1 '^aienos_commit: [0-9a-f]\{40\}' "${d}/kernel.log" | cut -d' ' -f2 || true)"
+    [ -n "${efi}" ] || { echo "no image sha256 in ${d}/run.log first line" >&2; bad=1; }
+    [ -n "${commit}" ] || { echo "no aienos_commit in ${d}/kernel.log" >&2; bad=1; }
+    out+="run ${t}"$'\n'
+    out+="efi_sha256 ${efi:-NONE}"$'\n'
+    out+="aienos_commit ${commit:-NONE}"$'\n'
+    out+="kernel_log_sha256 $(sha256sum < "${d}/kernel.log" | cut -d' ' -f1)"$'\n'
+    nrow=0
+    while IFS=$'\t' read -r rt ms pat; do
+        [ "${rt}" = "${t}" ] || continue
+        nrow=$((nrow + 1))
+        m="$(tr -d '\r' < "${d}/kernel.log" | grep -aE -e "${pat}" | tr -c '\11\12\40-\176' '?' || true)"
+        if [ -z "${m}" ]; then n=0; h="NONE"; echo "no line matches [${ms}] /${pat}/ in ${t}" >&2; bad=1
+        else n="$(grep -c '' <<<"${m}")"; h="$(printf '%s\n' "${m}" | sha256sum | cut -d' ' -f1)"; fi
+        out+="verdict ${ms} | /${pat}/ | lines=${n} sha256=${h}"$'\n'
+        [ "${n}" = 0 ] || out+="$(sed 's/^/  | /' <<<"${m}")"$'\n'
+    done <<<"${rows}"
+    [ "${nrow}" -gt 0 ] || { echo "run ${t} has no row in the verdict table" >&2; bad=1; }
+done <<<"${tags}"
+out+="end"$'\n'
+[ "${bad}" = 0 ] || exit 1
+printf '%s' "${out}"
diff --git a/scripts/pi5_receipts_verdicts.tsv b/scripts/pi5_receipts_verdicts.tsv
new file mode 100644
index 00000000..8efcc6e4
--- /dev/null
+++ b/scripts/pi5_receipts_verdicts.tsv
@@ -0,0 +1,72 @@
+# PI5-8 Q6: verdict-line table for scripts/pi5_receipts_manifest.sh.
+# Columns (TAB separated): run tag, milestone label, grep -E pattern matched against that run's kernel.log.
+# A row whose pattern matches no line makes the manifest tool fail (the evidence is not there). Tags and the
+# milestone each belongs to follow docs/native/PI5-*-RUNS.md; PI5-3 storage runs are the SD/Store/RNG runs
+# of the first Pi cuts (their run logs are on the Spark under ~/workspace/pi5-runs). Lines are matched
+# after carriage returns are removed; the manifest records every matching line verbatim (non-ASCII as ?).
+#
+# PI5-3 storage (microSD, sealed Store with TEST keys, RNG200)
+pi5-sd1a	PI5-3 storage	^pi5_sd: read sector 0 rc=0 signature=55aa
+pi5-sd1a	PI5-3 storage	^pi5_store_layer: formatted .* generation=1 
+pi5-sd1b	PI5-3 storage	^pi5_store_layer: reopened .* generation=2 
+pi5-store1	PI5-3 storage	^store: blank disk .*formatted TEST store
+pi5-store1	PI5-3 storage	^store: opened generation=1 
+pi5-store1	PI5-3 storage	^stage store: ok$
+pi5-store2	PI5-3 storage	^store: opened generation=2 
+pi5-store2	PI5-3 storage	^store: committed generation=3 
+pi5-store2	PI5-3 storage	^stage store: ok$
+pi5-store3	PI5-3 storage	^pi5_store_layer: formatted .* generation=1 
+pi5-store3	PI5-3 storage	^store: blank disk .*formatted TEST store
+pi5-store3	PI5-3 storage	^stage store: ok$
+pi5-store4	PI5-3 storage	^pi5_store_layer: reopened .* generation=2 
+pi5-store4	PI5-3 storage	^store: opened generation=2 
+pi5-store4	PI5-3 storage	^stage store: ok$
+pi5-rng1	PI5-3 rng	^entropy: source=rng200 
+# PI5-4 recovery-secret unlock runs A-E
+pi5-unlock-a	PI5-4 unlock A	^store: blank disk .*formatted production store
+pi5-unlock-a	PI5-4 unlock A	^store: opened generation=1 
+pi5-unlock-a	PI5-4 unlock A	^stage store: ok$
+pi5-unlock-b	PI5-4 unlock B	^store: opened generation=2 
+pi5-unlock-b	PI5-4 unlock B	^store: security manifest sequence=2 
+pi5-unlock-b	PI5-4 unlock B	^stage store: ok$
+pi5-unlock-c	PI5-4 unlock C	^store: REFUSED .*RecoverySecretRejected
+pi5-unlock-c	PI5-4 unlock C	^stage store: FAIL rc=-2004$
+pi5-unlock-d	PI5-4 unlock D	^store: REFUSED .*CorruptRecoveryRequired
+pi5-unlock-d	PI5-4 unlock D	^stage store: FAIL rc=-105$
+pi5-unlock-e	PI5-4 unlock E	^store: opened generation=3 
+pi5-unlock-e	PI5-4 unlock E	^store: security manifest sequence=3 
+pi5-unlock-e	PI5-4 unlock E	^stage store: ok$
+# PI5-5 Cortex fact runs F1-F3
+pi5-fact-f1	PI5-5 fact F1	^fact_stage: remember records=1 
+pi5-fact-f1	PI5-5 fact F1	^stage store: ok$
+pi5-fact-f2	PI5-5 fact F2	^fact_stage: recall records=1 
+pi5-fact-f2	PI5-5 fact F2	^stage store: ok$
+pi5-fact-f3	PI5-5 fact F3	^fact_stage: NOTHING RECALLED
+pi5-fact-f3	PI5-5 fact F3	^stage store: FAIL rc=-2004$
+# PI5-6 inference (scalar, then SDOT) and agent runs G1-G3
+pi5-infer-a	PI5-6 infer	^infer: sha256=3f5a22426976ab26cfe84dba63c1d08391717abb1af893e10f1b2968d862dcc1 
+pi5-infer-a	PI5-6 infer	^AIENOS_CK_INFER_SESSION: PASS$
+pi5-infer-b	PI5-6 infer	^infer: dot_path=sdot 
+pi5-infer-b	PI5-6 infer	^AIENOS_CK_INFER_SESSION: PASS$
+pi5-agent-g1	PI5-6 agent G1	^AIENOS_PI5_AGENT: GENERATED PASS$
+pi5-agent-g2	PI5-6 agent G2	^AIENOS_PI5_AGENT: RECOVERED PASS$
+pi5-agent-g3	PI5-6 agent G3	^AIENOS_PI5_AGENT: NOSTORE$
+# PI5-7 resident lifecycle L1-L3, real power cut P1, EL0 artifact loader a1
+pi5-lifecycle-l1	PI5-7 lifecycle L1	^lifecycle: (cortex open|facts|evidence) 
+pi5-lifecycle-l1	PI5-7 lifecycle L1	^lifecycle: recall gen=12 kind=reply 
+pi5-lifecycle-l2	PI5-7 lifecycle L2	^lifecycle: (cortex open|facts|evidence) 
+pi5-lifecycle-l2	PI5-7 lifecycle L2	^lifecycle: recall gen=12 kind=reply 
+pi5-lifecycle-l3	PI5-7 lifecycle L3	^lifecycle: evidence 
+pi5-lifecycle-powercut	PI5-7 powercut P1	^lifecycle: (cortex open|facts|evidence) 
+pi5-lifecycle-powercut	PI5-7 powercut P1	^lifecycle: recall gen=12 kind=reply 
+pi5-artifact-a1	PI5-7 artifact a1	^artifact_receipt_tier: 
+pi5-artifact-a1	PI5-7 artifact a1	^artifact: [A-Z0-9]*\.AIEN (admitted|rejected) 
+pi5-artifact-a1	PI5-7 artifact a1	^artifacts: candidates=
+pi5-artifact-a2	PI5-8 artifact a2 (Pi tier in the receipt)	^artifact_receipt_tier: SEED-0B-PI5$
+pi5-artifact-a2	PI5-8 artifact a2 (Pi tier in the receipt)	^receipt: [A-Z0-9]+\.AIEN seq=[0-9]+ digest=[0-9a-f]{64} record=.{44}0300
+pi5-artifact-a2	PI5-8 artifact a2 (Pi tier in the receipt)	^artifacts: candidates=6 admitted=5 rejected=1$
+# Network lane: PCIe/RP1 enumerator, inbound DMA window, GEM frame test
+pi5-pcie-1	NET pi5-pcie-1	^pi5_dma: hw_window=
+pi5-net-1	NET pi5-net-1	^pi5_dma: hw_window (before|after)=
+pi5-net-1	NET pi5-net-1	^pi5_dma: apply rc=0 
+pi5-net-3-r1	NET pi5-net-3-r1	^pi5_gem: (CONFINEMENT [AB] result|LOOPBACK .* PASS|WIRE tx PASS)