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#12 (code only)

closed derived c5f5a1246da211db #12

Imported from GitHub aien-dev/aienux#12 (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 180020af8103bbe22891c7511b4288d143f3b5ea · Head cf83e5c87f3f40707383437a2fd31cc47c96f1e3

Apply it

git checkout -b patch-c5f5a1246da211db 180020af8103bbe22891c7511b4288d143f3b5ea
curl -fsSL https://interplane.io/drakestapleton/aienux/patches/c5f5a1246da211db.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
12
cf83e5c87f3f40707383437a2fd31cc47c96f1e3
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":12,"url":"https://github.com/aien-dev/aienux/pull/12","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:35:46Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/Cargo.lock b/Cargo.lock
index b9a81445..f616cca6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -55,6 +55,14 @@ dependencies = [
  "serde_json",
 ]
 
+[[package]]
+name = "aienos-evidence"
+version = "0.1.0"
+dependencies = [
+ "aienos-kernel",
+ "serde_json",
+]
+
 [[package]]
 name = "aienos-kernel"
 version = "0.1.0"
diff --git a/Cargo.toml b/Cargo.toml
index d64b3346..e7f26787 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,6 +8,7 @@ members = [
     "crates/aienos-c1-tree",
     "crates/aienos-boot",
     "crates/aienos-accel",
+    "crates/aienos-evidence",
 ]
 
 [workspace.package]
diff --git a/crates/aienos-evidence/Cargo.toml b/crates/aienos-evidence/Cargo.toml
new file mode 100644
index 00000000..a2788530
--- /dev/null
+++ b/crates/aienos-evidence/Cargo.toml
@@ -0,0 +1,16 @@
+[package]
+name = "aienos-evidence"
+version.workspace = true
+edition.workspace = true
+authors.workspace = true
+license.workspace = true
+repository.workspace = true
+description = "Host-side Config A capture and evidence verification for the AIENOS reference freeze"
+
+[dependencies]
+aienos-kernel = { workspace = true }
+serde_json = { version = "1.0", features = ["std"] }
+
+[[bin]]
+name = "aienos-evidence"
+path = "src/main.rs"
diff --git a/crates/aienos-evidence/src/canon.rs b/crates/aienos-evidence/src/canon.rs
new file mode 100644
index 00000000..1e37db0a
--- /dev/null
+++ b/crates/aienos-evidence/src/canon.rs
@@ -0,0 +1,93 @@
+//! Canonical JSON and the bundle checksum.
+//!
+//! The checksum covers a canonical encoding (object keys sorted, no
+//! insignificant whitespace) of the bundle without its checksum field, so it
+//! does not depend on how the file is pretty-printed or on serde_json's map
+//! ordering features.
+
+use aienos_kernel::crypto::sha256;
+use serde_json::Value;
+
+pub const CHECKSUM_FIELD: &str = "bundle_checksum_sha256";
+
+pub fn canonical(value: &Value) -> String {
+    let mut out = String::new();
+    write(value, &mut out);
+    out
+}
+
+fn write(value: &Value, out: &mut String) {
+    match value {
+        Value::Object(map) => {
+            let mut keys: Vec<&String> = map.keys().collect();
+            keys.sort();
+            out.push('{');
+            for (i, key) in keys.iter().enumerate() {
+                if i > 0 {
+                    out.push(',');
+                }
+                out.push_str(&Value::String((*key).clone()).to_string());
+                out.push(':');
+                write(&map[*key], out);
+            }
+            out.push('}');
+        }
+        Value::Array(items) => {
+            out.push('[');
+            for (i, item) in items.iter().enumerate() {
+                if i > 0 {
+                    out.push(',');
+                }
+                write(item, out);
+            }
+            out.push(']');
+        }
+        scalar => out.push_str(&scalar.to_string()),
+    }
+}
+
+pub fn hex(bytes: &[u8]) -> String {
+    bytes.iter().map(|b| format!("{b:02x}")).collect()
+}
+
+/// SHA-256 of the canonical bundle with the checksum field removed.
+pub fn checksum(bundle: &Value) -> String {
+    let mut body = bundle.clone();
+    if let Value::Object(map) = &mut body {
+        map.remove(CHECKSUM_FIELD);
+    }
+    hex(&sha256::hash(canonical(&body).as_bytes()))
+}
+
+/// Returns the bundle with a fresh checksum field.
+pub fn seal(mut bundle: Value) -> Value {
+    let sum = checksum(&bundle);
+    if let Value::Object(map) = &mut bundle {
+        map.insert(CHECKSUM_FIELD.into(), Value::String(sum));
+    }
+    bundle
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use serde_json::json;
+
+    #[test]
+    fn key_order_and_whitespace_do_not_change_the_checksum() {
+        let a: Value = serde_json::from_str(r#"{"b": 1, "a": {"y": [1, 2], "x": "s"}}"#).unwrap();
+        let b: Value = serde_json::from_str(r#"{"a":{"x":"s","y":[1,2]},"b":1}"#).unwrap();
+        assert_eq!(canonical(&a), r#"{"a":{"x":"s","y":[1,2]},"b":1}"#);
+        assert_eq!(checksum(&a), checksum(&b));
+    }
+
+    #[test]
+    fn sealed_bundle_verifies_and_any_edit_breaks_it() {
+        let sealed = seal(json!({"schema_version": "3.0.0", "value": 7}));
+        let stored = sealed[CHECKSUM_FIELD].as_str().unwrap().to_string();
+        assert_eq!(stored, checksum(&sealed));
+        let mut edited = sealed.clone();
+        edited["value"] = json!(8);
+        assert_ne!(stored, checksum(&edited));
+    }
+}
diff --git a/crates/aienos-evidence/src/capture.rs b/crates/aienos-evidence/src/capture.rs
new file mode 100644
index 00000000..7b05d356
--- /dev/null
+++ b/crates/aienos-evidence/src/capture.rs
@@ -0,0 +1,305 @@
+//! Read-only capture of the Linux reference machine (Config A).
+//!
+//! Sources are procfs, sysfs, git, and the local inference endpoint. GPU
+//! identity comes from PCI sysfs rather than vendor userspace tools, and no
+//! host boot state is changed.
+
+use crate::http::{self, Endpoint};
+use aienos_kernel::crypto::sha256::Sha256;
+use serde_json::{json, Map, Value};
+use std::collections::BTreeMap;
+use std::fs;
+use std::io::Read;
+use std::path::{Path, PathBuf};
+use std::process::Command;
+
+pub struct Options {
+    pub model: PathBuf,
+    pub endpoint: String,
+    pub prompt: String,
+    pub max_tokens: u32,
+    pub samples: usize,
+    pub warmup: usize,
+    pub repos: Vec<(String, PathBuf)>,
+    pub allow_dirty: bool,
+}
+
+pub const DEFAULT_PROMPT: &str = "Explain in about two hundred words how a copy-on-write page table lets two processes share memory until one of them writes, and what the kernel does on that first write.";
+
+fn read(path: impl AsRef<Path>) -> Option<String> {
+    fs::read_to_string(path).ok().map(|s| s.trim().to_string())
+}
+
+fn command(program: &str, args: &[&str]) -> Option<String> {
+    let out = Command::new(program).args(args).output().ok()?;
+    out.status
+        .success()
+        .then(|| String::from_utf8_lossy(&out.stdout).trim().to_string())
+}
+
+/// `CPU part` counts from /proc/cpuinfo, e.g. {"0xd85": 10, "0xd87": 10}.
+pub fn cpu_parts(cpuinfo: &str) -> BTreeMap<String, u64> {
+    let mut parts = BTreeMap::new();
+    for line in cpuinfo.lines() {
+        if let Some((key, value)) = line.split_once(':') {
+            if key.trim() == "CPU part" {
+                *parts.entry(value.trim().to_string()).or_insert(0) += 1;
+            }
+        }
+    }
+    parts
+}
+
+pub fn os_release_pretty(text: &str) -> Option<String> {
+    text.lines()
+        .find_map(|l| l.strip_prefix("PRETTY_NAME="))
+        .map(|v| v.trim_matches('"').to_string())
+}
+
+fn meminfo_kb(text: &str, key: &str) -> Option<u64> {
+    text.lines()
+        .find_map(|l| l.strip_prefix(key)?.strip_prefix(':'))
+        .and_then(|v| v.split_whitespace().next()?.parse().ok())
+}
+
+fn accelerators() -> Vec<Value> {
+    let mut found = Vec::new();
+    let Ok(entries) = fs::read_dir("/sys/bus/pci/devices") else {
+        return found;
+    };
+    for entry in entries.flatten() {
+        let dev = entry.path();
+        let vendor = read(dev.join("vendor")).unwrap_or_default();
+        let class = read(dev.join("class")).unwrap_or_default();
+        // NVIDIA display or 3D controller.
+        if vendor != "0x10de" || !class.starts_with("0x03") {
+            continue;
+        }
+        let device = read(dev.join("device")).unwrap_or_default();
+        let driver = fs::read_link(dev.join("driver"))
+            .ok()
+            .and_then(|p| p.file_name().map(|n| n.to_string_lossy().into_owned()));
+        let driver_version = driver
+            .as_ref()
+            .and_then(|d| read(format!("/sys/module/{d}/version")));
+        found.push(json!({
+            "pci_bus_id": entry.file_name().to_string_lossy(),
+            "vendor_device": format!("{}:{}", vendor.trim_start_matches("0x"), device.trim_start_matches("0x")),
+            "class": class,
+            "driver": driver,
+            "driver_version": driver_version,
+        }));
+    }
+    found.sort_by_key(|v| v["pci_bus_id"].as_str().unwrap_or_default().to_string());
+    found
+}
+
+fn block_devices() -> Vec<Value> {
+    let mut devices = Vec::new();
+    let Ok(entries) = fs::read_dir("/sys/block") else {
+        return devices;
+    };
+    for entry in entries.flatten() {
+        let name = entry.file_name().to_string_lossy().into_owned();
+        if ["loop", "ram", "zram"].iter().any(|p| name.starts_with(p)) {
+            continue;
+        }
+        let dev = entry.path();
+        let sectors: u64 = read(dev.join("size"))
+            .and_then(|s| s.parse().ok())
+            .unwrap_or(0);
+        devices.push(json!({
+            "name": name,
+            "size_bytes": sectors * 512,
+            "model": read(dev.join("device/model")),
+        }));
+    }
+    devices.sort_by_key(|v| v["name"].as_str().unwrap_or_default().to_string());
+    devices
+}
+
+pub fn file_sha256(path: &Path) -> std::io::Result<(u64, String)> {
+    let mut file = fs::File::open(path)?;
+    let mut hasher = Sha256::new();
+    let mut buf = vec![0u8; 4 << 20];
+    let mut size = 0u64;
+    loop {
+        let n = file.read(&mut buf)?;
+        if n == 0 {
+            break;
+        }
+        size += n as u64;
+        hasher.update(&buf[..n]);
+    }
+    Ok((size, crate::canon::hex(&hasher.finalize())))
+}
+
+fn repositories(repos: &[(String, PathBuf)]) -> Result<Vec<Value>, String> {
+    let mut out = Vec::new();
+    for (name, path) in repos {
+        let p = path.to_string_lossy();
+        let commit = command("git", &["-C", &p, "rev-parse", "HEAD"])
+            .ok_or_else(|| format!("{name}: not a git checkout at {p}"))?;
+        let status = command("git", &["-C", &p, "status", "--porcelain"])
+            .ok_or_else(|| format!("{name}: git status failed"))?;
+        out.push(json!({
+            "name": name,
+            "commit": commit,
+            "branch": command("git", &["-C", &p, "branch", "--show-current"]).filter(|b| !b.is_empty()),
+            "dirty": !status.is_empty(),
+        }));
+    }
+    Ok(out)
+}
+
+fn workload(opts: &Options) -> Result<Value, String> {
+    let ep = Endpoint::parse(&opts.endpoint)?;
+    let model = http::model_ids(&ep)?
+        .into_iter()
+        .next()
+        .ok_or("endpoint lists no models")?;
+    for _ in 0..opts.warmup {
+        http::chat_sample(&ep, &model, &opts.prompt, opts.max_tokens)?;
+    }
+    let mut samples = Vec::new();
+    for index in 0..opts.samples {
+        let s = http::chat_sample(&ep, &model, &opts.prompt, opts.max_tokens)?;
+        let round = |x: f64| (x * 1000.0).round() / 1000.0;
+        samples.push(json!({
+            "index": index,
+            "ttft_ms": round(s.ttft_ms),
+            "total_ms": round(s.total_ms),
+            "output_tokens": s.output_tokens,
+            "decode_tokens_per_second": round(s.decode_tokens_per_second),
+        }));
+    }
+    Ok(json!({
+        "endpoint": opts.endpoint,
+        "model": model,
+        "prompt": opts.prompt,
+        "max_tokens": opts.max_tokens,
+        "temperature": 0,
+        "warmup_samples": opts.warmup,
+        "samples": samples,
+    }))
+}
+
+pub fn capture(opts: &Options) -> Result<Value, String> {
+    let repos = repositories(&opts.repos)?;
+    let dirty: Vec<&str> = repos
+        .iter()
+        .filter(|r| r["dirty"] == json!(true))
+        .filter_map(|r| r["name"].as_str())
+        .collect();
+    if !dirty.is_empty() && !opts.allow_dirty {
+        return Err(format!(
+            "refusing to freeze dirty repositories: {} (commit or use --allow-dirty)",
+            dirty.join(", ")
+        ));
+    }
+    let (model_size, model_sha) =
+        file_sha256(&opts.model).map_err(|e| format!("model {}: {e}", opts.model.display()))?;
+    let cpuinfo = read("/proc/cpuinfo").unwrap_or_default();
+    let meminfo = read("/proc/meminfo").unwrap_or_default();
+    let parts = cpu_parts(&cpuinfo);
+
+    let mut bundle = Map::new();
+    bundle.insert("schema_version".into(), json!(crate::SCHEMA_VERSION));
+    bundle.insert("generated_at_utc".into(), json!(crate::time::now_utc()));
+    bundle.insert(
+        "capture_tool".into(),
+        json!({"name": "aienos-evidence", "version": env!("CARGO_PKG_VERSION")}),
+    );
+    bundle.insert(
+        "config_identity".into(),
+        json!({
+            "host": read("/proc/sys/kernel/hostname"),
+            "kernel": read("/proc/sys/kernel/osrelease"),
+            "architecture": std::env::consts::ARCH,
+            "os_distribution": read("/etc/os-release").as_deref().and_then(os_release_pretty),
+            "kernel_command_line": read("/proc/cmdline"),
+        }),
+    );
+    bundle.insert(
+        "machine_capsule".into(),
+        json!({
+            "firmware": {
+                "uefi_present": Path::new("/sys/firmware/efi").is_dir(),
+                "platform_bits": read("/sys/firmware/efi/fw_platform_size"),
+            },
+            "cpu": {
+                "architecture": std::env::consts::ARCH,
+                "cores": parts.values().sum::<u64>(),
+                "parts": parts,
+            },
+            "accelerators": accelerators(),
+            "memory": {
+                "total_kb": meminfo_kb(&meminfo, "MemTotal"),
+                "swap_kb": meminfo_kb(&meminfo, "SwapTotal"),
+            },
+            "block_devices": block_devices(),
+        }),
+    );
+    bundle.insert(
+        "toolchains".into(),
+        json!({
+            "rustc": command("rustc", &["--version"]),
+            "cargo": command("cargo", &["--version"]),
+        }),
+    );
+    bundle.insert(
+        "baseline_model".into(),
+        json!({"path": opts.model, "size_bytes": model_size, "sha256": model_sha}),
+    );
+    bundle.insert("workspace_repositories".into(), Value::Array(repos));
+    bundle.insert("reference_workload".into(), workload(opts)?);
+    bundle.insert(
+        "recovery_procedure".into(),
+        json!({"status": "documented_only", "native_boot_rollback_tested": false}),
+    );
+    Ok(crate::canon::seal(Value::Object(bundle)))
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn counts_heterogeneous_cpu_parts() {
+        let info = "processor\t: 0\nCPU part\t: 0xd85\n\nprocessor\t: 1\nCPU part\t: 0xd87\n\nprocessor\t: 2\nCPU part\t: 0xd87\n";
+        let parts = cpu_parts(info);
+        assert_eq!(parts.get("0xd85"), Some(&1));
+        assert_eq!(parts.get("0xd87"), Some(&2));
+    }
+
+    #[test]
+    fn reads_os_release_and_meminfo() {
+        assert_eq!(
+            os_release_pretty("NAME=\"Ubuntu\"\nPRETTY_NAME=\"Ubuntu 24.04.5 LTS\"\n").as_deref(),
+            Some("Ubuntu 24.04.5 LTS")
+        );
+        assert_eq!(
+            meminfo_kb(
+                "MemTotal:       127598748 kB\nSwapTotal: 0 kB\n",
+                "MemTotal"
+            ),
+            Some(127_598_748)
+        );
+        assert_eq!(meminfo_kb("MemTotal: 1 kB\n", "SwapTotal"), None);
+    }
+
+    #[test]
+    fn streams_file_hash_matches_one_shot_hash() {
+        let path =
+            std::env::temp_dir().join(format!("aienos-evidence-hash-{}", std::process::id()));
+        let data: Vec<u8> = (0..(9 << 20)).map(|i| (i % 251) as u8).collect();
+        fs::write(&path, &data).unwrap();
+        let (size, digest) = file_sha256(&path).unwrap();
+        fs::remove_file(&path).unwrap();
+        assert_eq!(size, data.len() as u64);
+        assert_eq!(
+            digest,
+            crate::canon::hex(&aienos_kernel::crypto::sha256::hash(&data))
+        );
+    }
+}
diff --git a/crates/aienos-evidence/src/http.rs b/crates/aienos-evidence/src/http.rs
new file mode 100644
index 00000000..12c42b21
--- /dev/null
+++ b/crates/aienos-evidence/src/http.rs
@@ -0,0 +1,286 @@
+//! Minimal HTTP/1.1 client for a local OpenAI-compatible inference endpoint.
+//!
+//! Plain `http://` only: the reference workload runs against a server on this
+//! machine, so no TLS stack is pulled into the evidence path.
+
+use serde_json::{json, Value};
+use std::io::{self, BufRead, BufReader, Read, Write};
+use std::net::TcpStream;
+use std::time::{Duration, Instant};
+
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct Endpoint {
+    pub host: String,
+    pub port: u16,
+    pub base_path: String,
+}
+
+impl Endpoint {
+    pub fn parse(url: &str) -> Result<Self, String> {
+        let rest = url
+            .strip_prefix("http://")
+            .ok_or_else(|| format!("only http:// endpoints are supported: {url}"))?;
+        let (authority, path) = match rest.find('/') {
+            Some(i) => (&rest[..i], &rest[i..]),
+            None => (rest, ""),
+        };
+        let (host, port) = match authority.rsplit_once(':') {
+            Some((h, p)) => (h, p.parse().map_err(|_| format!("bad port in {url}"))?),
+            None => (authority, 80),
+        };
+        if host.is_empty() {
+            return Err(format!("missing host in {url}"));
+        }
+        Ok(Self {
+            host: host.to_string(),
+            port,
+            base_path: path.trim_end_matches('/').to_string(),
+        })
+    }
+}
+
+/// Decodes a `Transfer-Encoding: chunked` body.
+pub struct Dechunk<R: BufRead> {
+    inner: R,
+    remaining: usize,
+    done: bool,
+}
+
+impl<R: BufRead> Dechunk<R> {
+    pub fn new(inner: R) -> Self {
+        Self {
+            inner,
+            remaining: 0,
+            done: false,
+        }
+    }
+}
+
+impl<R: BufRead> Read for Dechunk<R> {
+    fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
+        if self.done || buf.is_empty() {
+            return Ok(0);
+        }
+        if self.remaining == 0 {
+            let mut line = String::new();
+            if self.inner.read_line(&mut line)? == 0 {
+                self.done = true;
+                return Ok(0);
+            }
+            let size_text = line.trim().split(';').next().unwrap_or("");
+            let size = usize::from_str_radix(size_text, 16)
+                .map_err(|_| io::Error::new(io::ErrorKind::InvalidData, "bad chunk size"))?;
+            if size == 0 {
+                self.done = true;
+                return Ok(0);
+            }
+            self.remaining = size;
+        }
+        let want = buf.len().min(self.remaining);
+        let n = self.inner.read(&mut buf[..want])?;
+        if n == 0 {
+            return Err(io::Error::new(
+                io::ErrorKind::UnexpectedEof,
+                "chunk truncated",
+            ));
+        }
+        self.remaining -= n;
+        if self.remaining == 0 {
+            let mut crlf = String::new();
+            self.inner.read_line(&mut crlf)?;
+        }
+        Ok(n)
+    }
+}
+
+fn send(
+    ep: &Endpoint,
+    method: &str,
+    path: &str,
+    body: Option<&str>,
+) -> Result<Box<dyn BufRead>, String> {
+    let mut stream = TcpStream::connect((ep.host.as_str(), ep.port))
+        .map_err(|e| format!("connect {}:{}: {e}", ep.host, ep.port))?;
+    stream.set_read_timeout(Some(Duration::from_secs(300))).ok();
+    let body = body.unwrap_or("");
+    let request = format!(
+        "{method} {}{path} HTTP/1.1\r\nHost: {}\r\nConnection: close\r\nAccept: */*\r\nContent-Type: application/json\r\nContent-Length: {}\r\n\r\n{body}",
+        ep.base_path,
+        ep.host,
+        body.len()
+    );
+    stream
+        .write_all(request.as_bytes())
+        .map_err(|e| e.to_string())?;
+    let mut reader = BufReader::new(stream);
+    let mut status = String::new();
+    reader.read_line(&mut status).map_err(|e| e.to_string())?;
+    let code: u16 = status
+        .split_whitespace()
+        .nth(1)
+        .and_then(|c| c.parse().ok())
+        .ok_or_else(|| format!("bad status line: {}", status.trim()))?;
+    let mut chunked = false;
+    loop {
+        let mut header = String::new();
+        if reader.read_line(&mut header).map_err(|e| e.to_string())? == 0
+            || header.trim().is_empty()
+        {
+            break;
+        }
+        let lower = header.to_ascii_lowercase();
+        if lower.starts_with("transfer-encoding:") && lower.contains("chunked") {
+            chunked = true;
+        }
+    }
+    if !(200..300).contains(&code) {
+        return Err(format!("{method} {path} returned HTTP {code}"));
+    }
+    Ok(if chunked {
+        Box::new(BufReader::new(Dechunk::new(reader)))
+    } else {
+        Box::new(reader)
+    })
+}
+
+pub fn model_ids(ep: &Endpoint) -> Result<Vec<String>, String> {
+    let mut body = String::new();
+    send(ep, "GET", "/models", None)?
+        .read_to_string(&mut body)
+        .map_err(|e| e.to_string())?;
+    let v: Value = serde_json::from_str(&body).map_err(|e| format!("models JSON: {e}"))?;
+    Ok(v["data"]
+        .as_array()
+        .into_iter()
+        .flatten()
+        .filter_map(|m| m["id"].as_str().map(str::to_string))
+        .collect())
+}
+
+#[derive(Debug, Clone, PartialEq)]
+pub struct Sample {
+    pub ttft_ms: f64,
+    pub total_ms: f64,
+    pub output_tokens: u64,
+    /// Tokens after the first, divided by the time after the first token.
+    pub decode_tokens_per_second: f64,
+}
+
+/// Pulls timing and token counts out of an SSE chat-completion stream.
+/// `clock` returns milliseconds since the request was sent.
+pub fn read_stream(body: impl BufRead, mut clock: impl FnMut() -> f64) -> Result<Sample, String> {
+    let mut first: Option<f64> = None;
+    let mut chunks = 0u64;
+    let mut usage: Option<u64> = None;
+    for line in body.lines() {
+        let line = line.map_err(|e| e.to_string())?;
+        let Some(data) = line.strip_prefix("data: ") else {
+            continue;
+        };
+        if data.trim() == "[DONE]" {
+            break;
+        }
+        let chunk: Value = serde_json::from_str(data).map_err(|e| format!("stream JSON: {e}"))?;
+        if let Some(n) = chunk["usage"]["completion_tokens"].as_u64() {
+            usage = Some(n);
+        }
+        let has_content = chunk["choices"].as_array().into_iter().flatten().any(|c| {
+            c["delta"]["content"]
+                .as_str()
+                .is_some_and(|s| !s.is_empty())
+        });
+        if has_content {
+            chunks += 1;
+            if first.is_none() {
+                first = Some(clock());
+            }
+        }
+    }
+    let total_ms = clock();
+    let ttft_ms = first.ok_or("stream produced no content")?;
+    let output_tokens = usage.unwrap_or(chunks);
+    let decode_ms = total_ms - ttft_ms;
+    let decode_tokens_per_second = if output_tokens > 1 && decode_ms > 0.0 {
+        (output_tokens - 1) as f64 / (decode_ms / 1000.0)
+    } else {
+        0.0
+    };
+    Ok(Sample {
+        ttft_ms,
+        total_ms,
+        output_tokens,
+        decode_tokens_per_second,
+    })
+}
+
+pub fn chat_sample(
+    ep: &Endpoint,
+    model: &str,
+    prompt: &str,
+    max_tokens: u32,
+) -> Result<Sample, String> {
+    let body = json!({
+        "model": model,
+        "messages": [{"role": "user", "content": prompt}],
+        "temperature": 0,
+        "max_tokens": max_tokens,
+        "stream": true,
+        "stream_options": {"include_usage": true}
+    })
+    .to_string();
+    let started = Instant::now();
+    let reader = send(ep, "POST", "/chat/completions", Some(&body))?;
+    read_stream(reader, || started.elapsed().as_secs_f64() * 1000.0)
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::io::Cursor;
+
+    #[test]
+    fn parses_endpoints() {
+        let ep = Endpoint::parse("http://127.0.0.1:18094/v1/").unwrap();
+        assert_eq!(
+            (ep.host.as_str(), ep.port, ep.base_path.as_str()),
+            ("127.0.0.1", 18094, "/v1")
+        );
+        assert!(Endpoint::parse("https://example.com/v1").is_err());
+    }
+
+    #[test]
+    fn dechunks_bodies_with_extensions() {
+        let raw = "5;x=1\r\nhello\r\n7\r\n, world\r\n0\r\n\r\n";
+        let mut out = String::new();
+        Dechunk::new(Cursor::new(raw))
+            .read_to_string(&mut out)
+            .unwrap();
+        assert_eq!(out, "hello, world");
+    }
+
+    #[test]
+    fn stream_timing_uses_first_content_and_usage() {
+        let sse = concat!(
+            "data: {\"choices\":[{\"delta\":{\"role\":\"assistant\"}}]}\n\n",
+            "data: {\"choices\":[{\"delta\":{\"content\":\"a\"}}]}\n\n",
+            "data: {\"choices\":[{\"delta\":{\"content\":\"b\"}}]}\n\n",
+            "data: {\"choices\":[],\"usage\":{\"completion_tokens\":11}}\n\n",
+            "data: [DONE]\n\n"
+        );
+        let mut t = 0.0;
+        let s = read_stream(Cursor::new(sse), || {
+            t += 100.0;
+            t
+        })
+        .unwrap();
+        assert_eq!(s.ttft_ms, 100.0);
+        assert_eq!(s.total_ms, 200.0);
+        assert_eq!(s.output_tokens, 11);
+        assert!((s.decode_tokens_per_second - 100.0).abs() < 1e-9);
+    }
+
+    #[test]
+    fn empty_stream_is_an_error() {
+        assert!(read_stream(Cursor::new("data: [DONE]\n"), || 1.0).is_err());
+    }
+}
diff --git a/crates/aienos-evidence/src/lib.rs b/crates/aienos-evidence/src/lib.rs
new file mode 100644
index 00000000..2fd0adb0
--- /dev/null
+++ b/crates/aienos-evidence/src/lib.rs
@@ -0,0 +1,16 @@
+//! Host-side evidence tooling for the M0 reference freeze.
+//!
+//! Replaces the former Python capture and verification scripts. Everything
+//! here reads the Linux reference machine directly (procfs, sysfs, git, and a
+//! local inference endpoint) and hashes with the kernel's own SHA-256, so the
+//! evidence path has no interpreter and no vendor userspace tools.
+
+pub mod canon;
+pub mod capture;
+pub mod http;
+pub mod pe;
+pub mod time;
+pub mod verify;
+
+/// Evidence schema written by `capture` and accepted by `verify`.
+pub const SCHEMA_VERSION: &str = "3.0.0";
diff --git a/crates/aienos-evidence/src/main.rs b/crates/aienos-evidence/src/main.rs
new file mode 100644
index 00000000..fb9ca7ea
--- /dev/null
+++ b/crates/aienos-evidence/src/main.rs
@@ -0,0 +1,203 @@
+//! aienos-evidence CLI.
+//!
+//!   aienos-evidence capture --model PATH --repo NAME=PATH... [--endpoint URL]
+//!                           [--samples N] [--warmup N] [--max-tokens N]
+//!                           [--prompt TEXT] [--out PATH] [--allow-dirty]
+//!   aienos-evidence verify [BUNDLE]
+//!   aienos-evidence verify-efi IMAGE...
+//!   aienos-evidence models [--endpoint URL]
+
+use aienos_evidence::{capture, http, pe, verify};
+use std::path::PathBuf;
+use std::process::exit;
+
+const DEFAULT_BUNDLE: &str = "evidence/config_a_reference_bundle.json";
+const DEFAULT_ENDPOINT: &str = "http://127.0.0.1:18094/v1";
+const USAGE: &str = "usage:
+  aienos-evidence capture --model PATH --repo NAME=PATH... [--endpoint URL] [--samples N]
+                          [--warmup N] [--max-tokens N] [--prompt TEXT] [--out PATH] [--allow-dirty]
+  aienos-evidence verify [BUNDLE]
+  aienos-evidence verify-efi IMAGE...
+  aienos-evidence models [--endpoint URL]";
+
+fn fail(msg: impl std::fmt::Display) -> ! {
+    eprintln!("{msg}");
+    exit(1)
+}
+
+struct Args {
+    flags: Vec<(String, String)>,
+    switches: Vec<String>,
+    positional: Vec<String>,
+}
+
+fn parse(args: &[String], switches: &[&str]) -> Args {
+    let mut a = Args {
+        flags: vec![],
+        switches: vec![],
+        positional: vec![],
+    };
+    let mut i = 0;
+    while i < args.len() {
+        let arg = &args[i];
+        if switches.contains(&arg.as_str()) {
+            a.switches.push(arg.clone());
+        } else if arg.starts_with("--") {
+            let value = args
+                .get(i + 1)
+                .unwrap_or_else(|| fail(format!("{arg} needs a value\n{USAGE}")));
+            a.flags.push((arg.clone(), value.clone()));
+            i += 1;
+        } else {
+            a.positional.push(arg.clone());
+        }
+        i += 1;
+    }
+    a
+}
+
+impl Args {
+    fn get(&self, name: &str) -> Option<&str> {
+        self.flags
+            .iter()
+            .rev()
+            .find(|(k, _)| k == name)
+            .map(|(_, v)| v.as_str())
+    }
+
+    fn all(&self, name: &str) -> Vec<&str> {
+        self.flags
+            .iter()
+            .filter(|(k, _)| k == name)
+            .map(|(_, v)| v.as_str())
+            .collect()
+    }
+
+    fn num<T: std::str::FromStr>(&self, name: &str, default: T) -> T {
+        self.get(name)
+            .map(|v| {
+                v.parse()
+                    .unwrap_or_else(|_| fail(format!("{name}: not a number: {v}")))
+            })
+            .unwrap_or(default)
+    }
+}
+
+fn cmd_capture(args: &[String]) {
+    let a = parse(args, &["--allow-dirty"]);
+    let model = a
+        .get("--model")
+        .map(PathBuf::from)
+        .or_else(|| std::env::var_os("AIENOS_BASELINE_MODEL").map(PathBuf::from))
+        .unwrap_or_else(|| fail(format!("--model is required\n{USAGE}")));
+    let repos: Vec<(String, PathBuf)> = a
+        .all("--repo")
+        .into_iter()
+        .map(|r| {
+            let (name, path) = r
+                .split_once('=')
+                .unwrap_or_else(|| fail(format!("--repo expects NAME=PATH, got {r}")));
+            (name.to_string(), PathBuf::from(path))
+        })
+        .collect();
+    if repos.is_empty() {
+        fail(format!(
+            "at least one --repo NAME=PATH is required\n{USAGE}"
+        ));
+    }
+    let opts = capture::Options {
+        model,
+        endpoint: a.get("--endpoint").unwrap_or(DEFAULT_ENDPOINT).to_string(),
+        prompt: a
+            .get("--prompt")
+            .unwrap_or(capture::DEFAULT_PROMPT)
+            .to_string(),
+        max_tokens: a.num("--max-tokens", 256),
+        samples: a.num("--samples", 5),
+        warmup: a.num("--warmup", 1),
+        repos,
+        allow_dirty: a.switches.iter().any(|s| s == "--allow-dirty"),
+    };
+    let bundle = capture::capture(&opts).unwrap_or_else(|e| fail(format!("capture failed: {e}")));
+    let out = PathBuf::from(a.get("--out").unwrap_or(DEFAULT_BUNDLE));
+    if let Some(dir) = out.parent().filter(|d| !d.as_os_str().is_empty()) {
+        std::fs::create_dir_all(dir).unwrap_or_else(|e| fail(e));
+    }
+    let text = serde_json::to_string_pretty(&bundle).unwrap_or_else(|e| fail(e)) + "\n";
+    std::fs::write(&out, text).unwrap_or_else(|e| fail(format!("{}: {e}", out.display())));
+    let samples = bundle["reference_workload"]["samples"]
+        .as_array()
+        .map_or(0, Vec::len);
+    println!(
+        "Captured Config A: {} ({samples} measured samples)",
+        out.display()
+    );
+}
+
+fn cmd_verify(args: &[String]) {
+    let path = args.first().map(String::as_str).unwrap_or(DEFAULT_BUNDLE);
+    let text = std::fs::read_to_string(path)
+        .unwrap_or_else(|e| fail(format!("Evidence unavailable: {e}")));
+    let bundle: serde_json::Value =
+        serde_json::from_str(&text).unwrap_or_else(|e| fail(format!("Evidence unreadable: {e}")));
+    let report = verify::check(&bundle);
+    if !report.errors.is_empty() {
+        for e in &report.errors {
+            println!("FAIL: {e}");
+        }
+        exit(1);
+    }
+    let samples = &bundle["reference_workload"]["samples"];
+    let rates: Vec<f64> = samples
+        .as_array()
+        .into_iter()
+        .flatten()
+        .filter_map(|s| s["decode_tokens_per_second"].as_f64())
+        .collect();
+    let mean = rates.iter().sum::<f64>() / rates.len().max(1) as f64;
+    println!(
+        "Config A capture verified for {}: {} samples, mean decode {mean:.1} tokens/s",
+        bundle["config_identity"]["host"].as_str().unwrap_or("?"),
+        rates.len()
+    );
+    if report.m0_open.is_empty() {
+        println!("M0 closable: yes");
+    } else {
+        println!("M0 closable: no ({})", report.m0_open.join("; "));
+    }
+}
+
+fn cmd_verify_efi(args: &[String]) {
+    if args.is_empty() {
+        fail(USAGE);
+    }
+    for path in args {
+        let data = std::fs::read(path)
+            .unwrap_or_else(|e| fail(format!("UEFI image verification failed: {path}: {e}")));
+        match pe::verify_efi_application(&data) {
+            Ok(()) => println!("AArch64 PE32+ EFI application verified: {path}"),
+            Err(e) => fail(format!("UEFI image verification failed: {path}: {e}")),
+        }
+    }
+}
+
+fn cmd_models(args: &[String]) {
+    let a = parse(args, &[]);
+    let url = a.get("--endpoint").unwrap_or(DEFAULT_ENDPOINT);
+    let ep = http::Endpoint::parse(url).unwrap_or_else(|e| fail(e));
+    for id in http::model_ids(&ep).unwrap_or_else(|e| fail(format!("{url}: {e}"))) {
+        println!("{id}");
+    }
+}
+
+fn main() {
+    let args: Vec<String> = std::env::args().skip(1).collect();
+    let rest = args.get(1..).unwrap_or(&[]);
+    match args.first().map(String::as_str) {
+        Some("capture") => cmd_capture(rest),
+        Some("verify") => cmd_verify(rest),
+        Some("verify-efi") => cmd_verify_efi(rest),
+        Some("models") => cmd_models(rest),
+        _ => fail(USAGE),
+    }
+}
diff --git a/crates/aienos-evidence/src/pe.rs b/crates/aienos-evidence/src/pe.rs
new file mode 100644
index 00000000..4d3df35b
--- /dev/null
+++ b/crates/aienos-evidence/src/pe.rs
@@ -0,0 +1,63 @@
+//! Structural check that a file is an AArch64 PE32+ EFI application.
+//! This verifies the artifact format only, not that the image boots.
+
+fn u16_at(data: &[u8], at: usize) -> Option<u16> {
+    Some(u16::from_le_bytes(data.get(at..at + 2)?.try_into().ok()?))
+}
+
+fn u32_at(data: &[u8], at: usize) -> Option<u32> {
+    Some(u32::from_le_bytes(data.get(at..at + 4)?.try_into().ok()?))
+}
+
+const MACHINE_ARM64: u16 = 0xAA64;
+const PE32_PLUS: u16 = 0x20B;
+const SUBSYSTEM_EFI_APPLICATION: u16 = 10;
+
+pub fn verify_efi_application(data: &[u8]) -> Result<(), String> {
+    if data.len() < 0x100 || &data[..2] != b"MZ" {
+        return Err("missing DOS image header".into());
+    }
+    let pe = u32_at(data, 0x3C).ok_or("truncated DOS header")? as usize;
+    if data.get(pe..pe + 4) != Some(b"PE\0\0".as_slice()) {
+        return Err("missing PE header".into());
+    }
+    let optional = pe + 4 + 20;
+    let machine = u16_at(data, pe + 4).ok_or("truncated COFF header")?;
+    let magic = u16_at(data, optional).ok_or("truncated optional header")?;
+    let subsystem = u16_at(data, optional + 68).ok_or("truncated optional header")?;
+    if (machine, magic, subsystem) != (MACHINE_ARM64, PE32_PLUS, SUBSYSTEM_EFI_APPLICATION) {
+        return Err(format!(
+            "unexpected machine/PE/subsystem: {machine:#x}/{magic:#x}/{subsystem}"
+        ));
+    }
+    Ok(())
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    fn image(machine: u16, subsystem: u16) -> Vec<u8> {
+        let mut d = vec![0u8; 0x200];
+        d[..2].copy_from_slice(b"MZ");
+        d[0x3C..0x40].copy_from_slice(&0x80u32.to_le_bytes());
+        d[0x80..0x84].copy_from_slice(b"PE\0\0");
+        d[0x84..0x86].copy_from_slice(&machine.to_le_bytes());
+        let optional = 0x80 + 24;
+        d[optional..optional + 2].copy_from_slice(&PE32_PLUS.to_le_bytes());
+        d[optional + 68..optional + 70].copy_from_slice(&subsystem.to_le_bytes());
+        d
+    }
+
+    #[test]
+    fn accepts_arm64_efi_application() {
+        assert!(verify_efi_application(&image(MACHINE_ARM64, 10)).is_ok());
+    }
+
+    #[test]
+    fn rejects_wrong_machine_subsystem_and_garbage() {
+        assert!(verify_efi_application(&image(0x8664, 10)).is_err());
+        assert!(verify_efi_application(&image(MACHINE_ARM64, 3)).is_err());
+        assert!(verify_efi_application(b"not an image").is_err());
+    }
+}
diff --git a/crates/aienos-evidence/src/time.rs b/crates/aienos-evidence/src/time.rs
new file mode 100644
index 00000000..fc64da27
--- /dev/null
+++ b/crates/aienos-evidence/src/time.rs
@@ -0,0 +1,49 @@
+//! UTC timestamps without a date library.
+
+use std::time::{SystemTime, UNIX_EPOCH};
+
+/// Civil date from days since 1970-01-01 (Howard Hinnant's algorithm).
+fn civil(days: i64) -> (i64, u32, u32) {
+    let z = days + 719_468;
+    let era = z.div_euclid(146_097);
+    let doe = z.rem_euclid(146_097);
+    let yoe = (doe - doe / 1_460 + doe / 36_524 - doe / 146_096) / 365;
+    let doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
+    let mp = (5 * doy + 2) / 153;
+    let day = (doy - (153 * mp + 2) / 5 + 1) as u32;
+    let month = if mp < 10 { mp + 3 } else { mp - 9 } as u32;
+    let year = yoe + era * 400 + i64::from(month <= 2);
+    (year, month, day)
+}
+
+pub fn iso_utc(secs: u64) -> String {
+    let (y, m, d) = civil((secs / 86_400) as i64);
+    let rem = secs % 86_400;
+    format!(
+        "{y:04}-{m:02}-{d:02}T{:02}:{:02}:{:02}Z",
+        rem / 3_600,
+        rem % 3_600 / 60,
+        rem % 60
+    )
+}
+
+pub fn now_utc() -> String {
+    iso_utc(
+        SystemTime::now()
+            .duration_since(UNIX_EPOCH)
+            .map(|d| d.as_secs())
+            .unwrap_or(0),
+    )
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn known_instants() {
+        assert_eq!(iso_utc(0), "1970-01-01T00:00:00Z");
+        assert_eq!(iso_utc(951_782_400), "2000-02-29T00:00:00Z");
+        assert_eq!(iso_utc(1_790_205_008), "2026-09-23T23:10:08Z");
+    }
+}
diff --git a/crates/aienos-evidence/src/verify.rs b/crates/aienos-evidence/src/verify.rs
new file mode 100644
index 00000000..c86ccccc
--- /dev/null
+++ b/crates/aienos-evidence/src/verify.rs
@@ -0,0 +1,204 @@
+//! Config A bundle verification.
+//!
+//! `errors` means the capture itself cannot be trusted as reference evidence.
+//! `m0_open` lists what still keeps the M0 freeze from closing even when the
+//! capture is sound (for example, an untested native-boot rollback).
+
+use crate::canon::{checksum, CHECKSUM_FIELD};
+use serde_json::Value;
+
+/// Output tokens below this measure start-up latency, not decode speed.
+pub const MIN_OUTPUT_TOKENS: u64 = 32;
+pub const MIN_SAMPLES: usize = 3;
+
+#[derive(Debug, Default)]
+pub struct Report {
+    pub errors: Vec<String>,
+    pub m0_open: Vec<String>,
+}
+
+fn nonempty(v: &Value) -> bool {
+    v.as_str().is_some_and(|s| !s.trim().is_empty())
+}
+
+fn is_hex(v: &Value, len: usize) -> bool {
+    v.as_str().is_some_and(|s| {
+        s.len() == len
+            && s.bytes()
+                .all(|b| b.is_ascii_digit() || (b'a'..=b'f').contains(&b))
+    })
+}
+
+pub fn check(bundle: &Value) -> Report {
+    let mut r = Report::default();
+    let mut err = |m: &str| r.errors.push(m.to_string());
+
+    if bundle[CHECKSUM_FIELD].as_str() != Some(checksum(bundle).as_str()) {
+        err("bundle checksum mismatch");
+    }
+    if bundle["schema_version"] != crate::SCHEMA_VERSION {
+        err("unsupported evidence schema");
+    }
+    let id = &bundle["config_identity"];
+    if ![
+        "host",
+        "kernel",
+        "architecture",
+        "os_distribution",
+        "kernel_command_line",
+    ]
+    .iter()
+    .all(|k| nonempty(&id[*k]))
+    {
+        err("incomplete host identity");
+    }
+    let capsule = &bundle["machine_capsule"];
+    if capsule["firmware"]["uefi_present"] != true {
+        err("UEFI was not observed");
+    }
+    let accel = capsule["accelerators"].as_array();
+    if !accel.is_some_and(|a| {
+        !a.is_empty()
+            && a.iter()
+                .all(|g| nonempty(&g["pci_bus_id"]) && nonempty(&g["vendor_device"]))
+    }) {
+        err("GPU identity was not observed");
+    }
+    let cores = capsule["cpu"]["cores"].as_u64().unwrap_or(0);
+    let part_sum: u64 = capsule["cpu"]["parts"]
+        .as_object()
+        .map(|m| m.values().filter_map(Value::as_u64).sum())
+        .unwrap_or(0);
+    if cores == 0 || part_sum != cores {
+        err("CPU core inventory missing or inconsistent with core types");
+    }
+    if capsule["memory"]["total_kb"].as_u64().unwrap_or(0) == 0 {
+        err("memory size missing");
+    }
+    if capsule["block_devices"]
+        .as_array()
+        .is_none_or(Vec::is_empty)
+    {
+        err("block device inventory missing");
+    }
+    let model = &bundle["baseline_model"];
+    if !is_hex(&model["sha256"], 64) || model["size_bytes"].as_u64().unwrap_or(0) == 0 {
+        err("baseline model digest or size missing");
+    }
+    match bundle["workspace_repositories"].as_array() {
+        Some(repos) if !repos.is_empty() => {
+            for repo in repos {
+                let name = repo["name"].as_str().unwrap_or("?");
+                if !is_hex(&repo["commit"], 40) {
+                    err(&format!("repository {name} has no commit"));
+                }
+                if repo["dirty"] != false {
+                    err(&format!(
+                        "repository {name} was dirty at capture; the freeze is not reproducible"
+                    ));
+                }
+            }
+        }
+        _ => err("workspace commit inventory missing"),
+    }
+    let samples = bundle["reference_workload"]["samples"]
+        .as_array()
+        .cloned()
+        .unwrap_or_default();
+    let complete = samples.iter().all(|s| {
+        s["ttft_ms"].as_f64().unwrap_or(0.0) > 0.0
+            && s["output_tokens"].as_u64().unwrap_or(0) >= MIN_OUTPUT_TOKENS
+            && s["decode_tokens_per_second"].as_f64().unwrap_or(0.0) > 0.0
+    });
+    if samples.len() < MIN_SAMPLES || !complete {
+        err(&format!(
+            "{MIN_SAMPLES}+ inference samples with at least {MIN_OUTPUT_TOKENS} output tokens and a measured decode rate required"
+        ));
+    }
+
+    let recovery = &bundle["recovery_procedure"];
+    if recovery["status"] != "verified" {
+        r.m0_open.push(format!(
+            "recovery procedure is {}",
+            recovery["status"].as_str().unwrap_or("unknown")
+        ));
+    }
+    if recovery["native_boot_rollback_tested"] != true {
+        r.m0_open
+            .push("native boot rollback has not been tested on Machine 1".into());
+    }
+    r
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::canon::seal;
+    use serde_json::json;
+
+    fn good() -> Value {
+        let sample = |i| json!({"index": i, "ttft_ms": 80.0, "total_ms": 2080.0, "output_tokens": 256, "decode_tokens_per_second": 127.5});
+        json!({
+            "schema_version": crate::SCHEMA_VERSION,
+            "config_identity": {"host": "spark", "kernel": "7.0", "architecture": "aarch64", "os_distribution": "Ubuntu", "kernel_command_line": "ro"},
+            "machine_capsule": {
+                "firmware": {"uefi_present": true},
+                "accelerators": [{"pci_bus_id": "000f:01:00.0", "vendor_device": "10de:2e12"}],
+                "cpu": {"cores": 20, "parts": {"0xd85": 10, "0xd87": 10}},
+                "memory": {"total_kb": 127598748},
+                "block_devices": [{"name": "nvme0n1", "size_bytes": 4000000000000u64}]
+            },
+            "baseline_model": {"sha256": "3f5a22426976ab26cfe84dba63c1d08391717abb1af893e10f1b2968d862dcc1", "size_bytes": 807694368},
+            "workspace_repositories": [{"name": "aienos", "commit": "f6350b548cccc53ec03825021112be75c2b30667", "dirty": false}],
+            "reference_workload": {"samples": [sample(0), sample(1), sample(2)]},
+            "recovery_procedure": {"status": "documented_only", "native_boot_rollback_tested": false}
+        })
+    }
+
+    #[test]
+    fn sound_capture_passes_but_m0_stays_open_until_rollback_is_tested() {
+        let r = check(&seal(good()));
+        assert!(r.errors.is_empty(), "{:?}", r.errors);
+        assert_eq!(r.m0_open.len(), 2);
+    }
+
+    #[test]
+    fn tampering_dirty_repos_and_toy_workloads_are_rejected() {
+        let mut tampered = seal(good());
+        tampered["machine_capsule"]["cpu"]["cores"] = json!(21);
+        assert!(check(&tampered)
+            .errors
+            .iter()
+            .any(|e| e.contains("checksum")));
+
+        let mut dirty = good();
+        dirty["workspace_repositories"][0]["dirty"] = json!(true);
+        assert!(check(&seal(dirty))
+            .errors
+            .iter()
+            .any(|e| e.contains("dirty")));
+
+        let mut toy = good();
+        toy["reference_workload"]["samples"][1]["output_tokens"] = json!(2);
+        assert!(check(&seal(toy))
+            .errors
+            .iter()
+            .any(|e| e.contains("output tokens")));
+
+        let mut mismatched = good();
+        mismatched["machine_capsule"]["cpu"]["parts"] = json!({"0xd85": 10});
+        assert!(check(&seal(mismatched))
+            .errors
+            .iter()
+            .any(|e| e.contains("CPU")));
+    }
+
+    #[test]
+    fn verified_recovery_closes_m0() {
+        let mut closed = good();
+        closed["recovery_procedure"] =
+            json!({"status": "verified", "native_boot_rollback_tested": true});
+        let r = check(&seal(closed));
+        assert!(r.errors.is_empty() && r.m0_open.is_empty());
+    }
+}
diff --git a/evidence/config_a_reference_bundle.json b/evidence/config_a_reference_bundle.json
index 94f387fa..95c0afd2 100644
--- a/evidence/config_a_reference_bundle.json
+++ b/evidence/config_a_reference_bundle.json
@@ -1,340 +1,134 @@
 {
-  "schema_version": "2.0.0",
-  "generated_at_utc": "2026-09-23T23:10:08.215161+00:00",
+  "baseline_model": {
+    "path": "/home/drakestapleton/models/aien-mail/Llama-3.2-1B-Instruct-Q4_K_M.gguf",
+    "sha256": "3f5a22426976ab26cfe84dba63c1d08391717abb1af893e10f1b2968d862dcc1",
+    "size_bytes": 807694368
+  },
+  "bundle_checksum_sha256": "5124beef2252b873c21ecbb9618044ba1d0514e9d7e294444dbfd9a61dfc74ed",
+  "capture_tool": {
+    "name": "aienos-evidence",
+    "version": "0.1.0"
+  },
   "config_identity": {
+    "architecture": "aarch64",
     "host": "spark-b87b",
     "kernel": "7.0.0-1019-nvidia",
-    "architecture": "aarch64",
-    "os_distribution": "Ubuntu 24.04.5 LTS",
-    "kernel_command_line": "BOOT_IMAGE=/boot/vmlinuz-7.0.0-1019-nvidia root=UUID=d27bfd26-ff30-400e-9eca-9cdf73de9406 ro init_on_alloc=0 iommu.passthrough=0 console=tty0 plymouth.ignore-serial-consoles plymouth.use-simpledrm earlycon=uart,mmio32,0x16A00000 console=tty0 console=ttyS0,921600 crashkernel=1G-:0M quiet splash initcall_blacklist=tegra234_cbb_init pci=pcie_bus_safe vt.handoff=7"
+    "kernel_command_line": "BOOT_IMAGE=/boot/vmlinuz-7.0.0-1019-nvidia root=UUID=d27bfd26-ff30-400e-9eca-9cdf73de9406 ro init_on_alloc=0 iommu.passthrough=0 console=tty0 plymouth.ignore-serial-consoles plymouth.use-simpledrm earlycon=uart,mmio32,0x16A00000 console=tty0 console=ttyS0,921600 crashkernel=1G-:0M quiet splash initcall_blacklist=tegra234_cbb_init pci=pcie_bus_safe vt.handoff=7",
+    "os_distribution": "Ubuntu 24.04.5 LTS"
   },
+  "generated_at_utc": "2026-09-24T00:28:37Z",
   "machine_capsule": {
-    "firmware": {
-      "uefi_present": true,
-      "platform_bits": "64"
-    },
-    "cpu": {
-      "models": [
-        "0xd85",
-        "0xd87"
-      ],
-      "cores": 20,
-      "architecture": "aarch64"
-    },
-    "accelerator": [
+    "accelerators": [
       {
-        "model": "NVIDIA GB10",
+        "class": "0x030000",
+        "driver": "nvidia",
         "driver_version": "580.173.02",
-        "pci_bus_id": "0000000F:01:00.0"
+        "pci_bus_id": "000f:01:00.0",
+        "vendor_device": "10de:2e12"
       }
     ],
-    "memory": {
-      "total_kb": 127598748,
-      "swap_kb": 0
-    },
-    "storage": {
-      "root_available_bytes": 1868129050624,
-      "block_devices": {
-        "blockdevices": [
-          {
-            "name": "loop0",
-            "type": "loop",
-            "size": "4K",
-            "model": null,
-            "mountpoints": [
-              "/snap/bare/5"
-            ]
-          },
-          {
-            "name": "loop1",
-            "type": "loop",
-            "size": "69M",
-            "model": null,
-            "mountpoints": [
-              "/snap/core22/2438"
-            ]
-          },
-          {
-            "name": "loop2",
-            "type": "loop",
-            "size": "69M",
-            "model": null,
-            "mountpoints": [
-              "/snap/core22/2956"
-            ]
-          },
-          {
-            "name": "loop3",
-            "type": "loop",
-            "size": "61.8M",
-            "model": null,
-            "mountpoints": [
-              "/snap/core24/2125"
-            ]
-          },
-          {
-            "name": "loop4",
-            "type": "loop",
-            "size": "61.9M",
-            "model": null,
-            "mountpoints": [
-              "/snap/core24/1644"
-            ]
-          },
-          {
-            "name": "loop6",
-            "type": "loop",
-            "size": "10.2M",
-            "model": null,
-            "mountpoints": [
-              "/snap/firmware-updater/168"
-            ]
-          },
-          {
-            "name": "loop7",
-            "type": "loop",
-            "size": "503.1M",
-            "model": null,
-            "mountpoints": [
-              "/snap/gnome-42-2204/264"
-            ]
-          },
-          {
-            "name": "loop8",
-            "type": "loop",
-            "size": "15.6M",
-            "model": null,
-            "mountpoints": [
-              "/snap/firmware-updater/227"
-            ]
-          },
-          {
-            "name": "loop9",
-            "type": "loop",
-            "size": "188.2M",
-            "model": null,
-            "mountpoints": [
-              "/snap/mesa-2404/1836"
-            ]
-          },
-          {
-            "name": "loop10",
-            "type": "loop",
-            "size": "552.9M",
-            "model": null,
-            "mountpoints": [
-              "/snap/gnome-46-2404/154"
-            ]
-          },
-          {
-            "name": "loop11",
-            "type": "loop",
-            "size": "91.7M",
-            "model": null,
-            "mountpoints": [
-              "/snap/gtk-common-themes/1535"
-            ]
-          },
-          {
-            "name": "loop12",
-            "type": "loop",
-            "size": "12.2M",
-            "model": null,
-            "mountpoints": [
-              "/snap/snap-store/1217"
-            ]
-          },
-          {
-            "name": "loop13",
-            "type": "loop",
-            "size": "249.8M",
-            "model": null,
-            "mountpoints": [
-              "/snap/firefox/8968"
-            ]
-          },
-          {
-            "name": "loop14",
-            "type": "loop",
-            "size": "43.4M",
-            "model": null,
-            "mountpoints": [
-              "/snap/snapd/27709"
-            ]
-          },
-          {
-            "name": "loop15",
-            "type": "loop",
-            "size": "43.5M",
-            "model": null,
-            "mountpoints": [
-              "/snap/snapd/27740"
-            ]
-          },
-          {
-            "name": "loop16",
-            "type": "loop",
-            "size": "552K",
-            "model": null,
-            "mountpoints": [
-              "/snap/snapd-desktop-integration/316"
-            ]
-          },
-          {
-            "name": "loop17",
-            "type": "loop",
-            "size": "804K",
-            "model": null,
-            "mountpoints": [
-              "/snap/snapd-desktop-integration/396"
-            ]
-          },
-          {
-            "name": "loop18",
-            "type": "loop",
-            "size": "249.7M",
-            "model": null,
-            "mountpoints": [
-              "/snap/firefox/8926"
-            ]
-          },
-          {
-            "name": "loop19",
-            "type": "loop",
-            "size": "214.7M",
-            "model": null,
-            "mountpoints": [
-              "/snap/thunderbird/1256"
-            ]
-          },
-          {
-            "name": "loop20",
-            "type": "loop",
-            "size": "215.2M",
-            "model": null,
-            "mountpoints": [
-              "/snap/thunderbird/1261"
-            ]
-          },
-          {
-            "name": "loop21",
-            "type": "loop",
-            "size": "73.7M",
-            "model": null,
-            "mountpoints": [
-              "/snap/snap-store/1420"
-            ]
-          },
-          {
-            "name": "loop22",
-            "type": "loop",
-            "size": "561.1M",
-            "model": null,
-            "mountpoints": [
-              "/snap/gnome-46-2404/169"
-            ]
-          },
-          {
-            "name": "nvme0n1",
-            "type": "disk",
-            "size": "3.7T",
-            "model": "SAMSUNG MZALC4T0HBL1-00B07",
-            "mountpoints": [
-              null
-            ],
-            "children": [
-              {
-                "name": "nvme0n1p1",
-                "type": "part",
-                "size": "298M",
-                "model": null,
-                "mountpoints": [
-                  "/boot/efi"
-                ]
-              },
-              {
-                "name": "nvme0n1p2",
-                "type": "part",
-                "size": "3.7T",
-                "model": null,
-                "mountpoints": [
-                  "/"
-                ]
-              }
-            ]
-          }
-        ]
+    "block_devices": [
+      {
+        "model": "SAMSUNG MZALC4T0HBL1-00B07",
+        "name": "nvme0n1",
+        "size_bytes": 4096805658624
+      }
+    ],
+    "cpu": {
+      "architecture": "aarch64",
+      "cores": 20,
+      "parts": {
+        "0xd85": 10,
+        "0xd87": 10
       }
-    }
-  },
-  "toolchains": {
-    "rustc": "rustc 1.98.1 (48a229cea 2026-09-01)",
-    "cargo": "cargo 1.98.1 (797e8a9bc 2026-08-05)",
-    "python": "3.12.3",
-    "cuda_compiler_release": "13.0"
-  },
-  "baseline_model": {
-    "path": "/home/drakestapleton/models/aien-mail/Llama-3.2-1B-Instruct-Q4_K_M.gguf",
-    "size_bytes": 807694368,
-    "sha256": "3f5a22426976ab26cfe84dba63c1d08391717abb1af893e10f1b2968d862dcc1"
-  },
-  "workspace_repositories": [
-    {
-      "name": "aienos-repo",
-      "commit": "f6350b548cccc53ec03825021112be75c2b30667",
-      "branch": "feat/aienos-m1-integration",
-      "dirty": true
-    },
-    {
-      "name": "aegis-runtime",
-      "commit": "e8eed5aac8612c1b846284c09d58e798e382c11b",
-      "branch": "fix/rust-simd-oracle",
-      "dirty": false
     },
-    {
-      "name": "aien-sovereign-core",
-      "commit": "c83eb5b2f96b3d0a36fcb5092fcf0d66af5dd0d0",
-      "branch": "docs/readme-restructure",
-      "dirty": true
+    "firmware": {
+      "platform_bits": "64",
+      "uefi_present": true
     },
-    {
-      "name": "spark-sentinel",
-      "commit": "f5a8546016cbb31982ace7fda91ace3ce7f335e6",
-      "branch": "main",
-      "dirty": false
+    "memory": {
+      "swap_kb": 0,
+      "total_kb": 127598748
     }
-  ],
+  },
+  "recovery_procedure": {
+    "native_boot_rollback_tested": false,
+    "status": "documented_only"
+  },
   "reference_workload": {
     "endpoint": "http://127.0.0.1:18094/v1",
+    "max_tokens": 256,
     "model": "unsloth/Llama-3.2-1B-Instruct",
-    "prompt": "Reply with one word: ready",
+    "prompt": "Explain in about two hundred words how a copy-on-write page table lets two processes share memory until one of them writes, and what the kernel does on that first write.",
     "samples": [
       {
+        "decode_tokens_per_second": 52.101,
         "index": 0,
-        "ttft_ms": 85.445,
-        "total_ms": 99.962,
-        "output_tokens": 2,
-        "output_tokens_per_second": 20.008
+        "output_tokens": 256,
+        "total_ms": 5020.417,
+        "ttft_ms": 126.062
       },
       {
+        "decode_tokens_per_second": 53.601,
         "index": 1,
-        "ttft_ms": 86.248,
-        "total_ms": 102.887,
-        "output_tokens": 2,
-        "output_tokens_per_second": 19.439
+        "output_tokens": 256,
+        "total_ms": 4892.718,
+        "ttft_ms": 135.307
       },
       {
+        "decode_tokens_per_second": 55.007,
         "index": 2,
-        "ttft_ms": 84.974,
-        "total_ms": 103.17,
-        "output_tokens": 2,
-        "output_tokens_per_second": 19.385
+        "output_tokens": 256,
+        "total_ms": 4756.065,
+        "ttft_ms": 120.265
+      },
+      {
+        "decode_tokens_per_second": 53.533,
+        "index": 3,
+        "output_tokens": 256,
+        "total_ms": 4881.566,
+        "ttft_ms": 118.176
+      },
+      {
+        "decode_tokens_per_second": 56.918,
+        "index": 4,
+        "output_tokens": 256,
+        "total_ms": 4596.281,
+        "ttft_ms": 116.121
       }
-    ]
+    ],
+    "temperature": 0,
+    "warmup_samples": 1
   },
-  "recovery_procedure": {
-    "status": "documented_only",
-    "native_boot_rollback_tested": false
+  "schema_version": "3.0.0",
+  "toolchains": {
+    "cargo": "cargo 1.98.1 (797e8a9bc 2026-08-05)",
+    "rustc": "rustc 1.98.1 (48a229cea 2026-09-01)"
   },
-  "bundle_checksum_sha256": "d642a2724e9b27ca480883d14a00e6c2ab80d7c605b75ced457f6cafbdff78f1"
+  "workspace_repositories": [
+    {
+      "branch": "feat/rust-evidence-tool",
+      "commit": "e01987306f44f6044d94f5129c1bbff24ef20820",
+      "dirty": false,
+      "name": "aienos"
+    },
+    {
+      "branch": null,
+      "commit": "640a0ebb7969d7f2c3dbfd61a8f6ebd5e1e27611",
+      "dirty": false,
+      "name": "aien-sovereign-core"
+    },
+    {
+      "branch": "fix/rust-simd-oracle",
+      "commit": "e8eed5aac8612c1b846284c09d58e798e382c11b",
+      "dirty": false,
+      "name": "aegis-runtime"
+    },
+    {
+      "branch": "main",
+      "commit": "f5a8546016cbb31982ace7fda91ace3ce7f335e6",
+      "dirty": false,
+      "name": "spark-sentinel"
+    }
+  ]
 }
diff --git a/scripts/capture_config_a.py b/scripts/capture_config_a.py
deleted file mode 100755
index 61a72cba..00000000
--- a/scripts/capture_config_a.py
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/usr/bin/env python3
-"""Read-only Config A hardware capture and local streaming inference probe."""
-
-import datetime
-import hashlib
-import json
-import os
-from pathlib import Path
-import platform
-import re
-import subprocess
-import time
-import urllib.request
-
-ROOT = Path(__file__).resolve().parents[1]
-MODEL = Path(os.environ.get("AIENOS_BASELINE_MODEL", "/home/drakestapleton/models/aien-mail/Llama-3.2-1B-Instruct-Q4_K_M.gguf"))
-ENDPOINT = os.environ.get("AIENOS_REFERENCE_ENDPOINT", "http://127.0.0.1:18094/v1")
-
-
-def command(*args):
-    try:
-        return subprocess.run(args, check=True, capture_output=True, text=True, timeout=15).stdout.strip()
-    except (OSError, subprocess.SubprocessError):
-        return None
-
-
-def file_hash(path):
-    digest = hashlib.sha256()
-    with path.open("rb") as source:
-        for block in iter(lambda: source.read(1024 * 1024), b""):
-            digest.update(block)
-    return digest.hexdigest()
-
-
-def memory():
-    result = {}
-    for line in Path("/proc/meminfo").read_text().splitlines():
-        key, _, value = line.partition(":")
-        if key in ("MemTotal", "SwapTotal"):
-            result[key] = int(value.strip().split()[0])
-    return result
-
-
-def gpu():
-    raw = command("nvidia-smi", "--query-gpu=name,driver_version,pci.bus_id", "--format=csv,noheader")
-    if not raw:
-        return None
-    return [dict(zip(("model", "driver_version", "pci_bus_id"),
-                     (part.strip() for part in row.split(",", 2)))) for row in raw.splitlines()]
-
-
-def repositories():
-    result = []
-    for name in ("aienos-repo", "aegis-runtime", "aien-sovereign-core", "spark-sentinel"):
-        path = ROOT.parent / name
-        if not (path / ".git").exists():
-            continue
-        status = command("git", "-C", str(path), "status", "--porcelain")
-        result.append({"name": name,
-                       "commit": command("git", "-C", str(path), "rev-parse", "HEAD"),
-                       "branch": command("git", "-C", str(path), "branch", "--show-current"),
-                       "dirty": None if status is None else bool(status)})
-    return result
-
-
-def request(url, payload=None):
-    body = None if payload is None else json.dumps(payload).encode()
-    return urllib.request.urlopen(urllib.request.Request(
-        url, data=body, headers={"Content-Type": "application/json"}), timeout=30)
-
-
-def workload():
-    try:
-        with request(ENDPOINT + "/models") as response:
-            model = json.load(response)["data"][0]["id"]
-    except (OSError, ValueError, KeyError, IndexError) as error:
-        return {"endpoint": ENDPOINT, "error": str(error), "samples": []}
-    prompt = "Reply with one word: ready"
-    samples = []
-    for index in range(3):
-        payload = {"model": model, "messages": [{"role": "user", "content": prompt}],
-                   "temperature": 0, "max_tokens": 32, "stream": True,
-                   "stream_options": {"include_usage": True}}
-        started = time.monotonic_ns()
-        first = None
-        usage = None
-        try:
-            with request(ENDPOINT + "/chat/completions", payload) as response:
-                for line in response:
-                    if not line.startswith(b"data: ") or line.strip() == b"data: [DONE]":
-                        continue
-                    chunk = json.loads(line[6:])
-                    usage = chunk.get("usage") or usage
-                    if first is None and any(c.get("delta", {}).get("content") for c in chunk.get("choices", [])):
-                        first = time.monotonic_ns()
-            finished = time.monotonic_ns()
-            tokens = usage.get("completion_tokens") if usage else None
-            samples.append({"index": index, "ttft_ms": None if first is None else round((first-started)/1e6, 3),
-                            "total_ms": round((finished-started)/1e6, 3), "output_tokens": tokens,
-                            "output_tokens_per_second": None if not tokens else round(tokens/((finished-started)/1e9), 3)})
-        except (OSError, ValueError) as error:
-            samples.append({"index": index, "error": str(error)})
-    return {"endpoint": ENDPOINT, "model": model, "prompt": prompt, "samples": samples}
-
-
-def main():
-    if not MODEL.is_file():
-        raise SystemExit(f"Baseline model does not exist: {MODEL}")
-    stat = os.statvfs("/")
-    nvcc = command("nvcc", "--version")
-    cpu = sorted({line.partition(":")[2].strip() for line in Path("/proc/cpuinfo").read_text().splitlines()
-                  if line.partition(":")[0].strip() in ("model name", "CPU part")})
-    fw_bits = Path("/sys/firmware/efi/fw_platform_size")
-    bundle = {
-        "schema_version": "2.0.0",
-        "generated_at_utc": datetime.datetime.now(datetime.timezone.utc).isoformat(),
-        "config_identity": {"host": platform.node(), "kernel": platform.release(),
-                            "architecture": platform.machine(),
-                            "os_distribution": platform.freedesktop_os_release().get("PRETTY_NAME"),
-                            "kernel_command_line": Path("/proc/cmdline").read_text().strip()},
-        "machine_capsule": {
-            "firmware": {"uefi_present": Path("/sys/firmware/efi").is_dir(),
-                         "platform_bits": fw_bits.read_text().strip() if fw_bits.exists() else None},
-            "cpu": {"models": cpu, "cores": os.cpu_count(), "architecture": platform.machine()},
-            "accelerator": gpu(),
-            "memory": {"total_kb": memory().get("MemTotal"), "swap_kb": memory().get("SwapTotal")},
-            "storage": {"root_available_bytes": stat.f_bavail * stat.f_frsize,
-                        "block_devices": json.loads(command("lsblk", "--json", "--output", "NAME,TYPE,SIZE,MODEL,MOUNTPOINTS") or "{}")}},
-        "toolchains": {"rustc": command("rustc", "--version"), "cargo": command("cargo", "--version"),
-                       "python": platform.python_version(),
-                       "cuda_compiler_release": re.search(r"release ([^,]+)", nvcc).group(1)
-                       if nvcc and re.search(r"release ([^,]+)", nvcc) else None},
-        "baseline_model": {"path": str(MODEL), "size_bytes": MODEL.stat().st_size, "sha256": file_hash(MODEL)},
-        "workspace_repositories": repositories(),
-        "reference_workload": workload(),
-        "recovery_procedure": {"status": "documented_only", "native_boot_rollback_tested": False},
-    }
-    canonical = json.dumps(bundle, indent=2, sort_keys=True)
-    bundle["bundle_checksum_sha256"] = hashlib.sha256(canonical.encode()).hexdigest()
-    output = ROOT / "evidence" / "config_a_reference_bundle.json"
-    output.parent.mkdir(exist_ok=True)
-    output.write_text(json.dumps(bundle, indent=2) + "\n")
-    print(f"Captured observed Config A data: {output}")
-    print(f"Workload samples: {len(bundle['reference_workload']['samples'])}")
-
-
-if __name__ == "__main__":
-    main()
diff --git a/scripts/freeze_reality.sh b/scripts/freeze_reality.sh
index ec80e384..552e26b4 100755
--- a/scripts/freeze_reality.sh
+++ b/scripts/freeze_reality.sh
@@ -1,5 +1,8 @@
 #!/usr/bin/env bash
 # Capture observed Config A data without changing host boot state.
+# Arguments pass through to `aienos-evidence capture` (see --help text there),
+# for example: --model PATH --repo aienos=PATH --repo aien-sovereign-core=PATH
 set -euo pipefail
 repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
-exec python3 "${repo_root}/scripts/capture_config_a.py" "$@"
+cd "${repo_root}"
+exec cargo run --quiet --release -p aienos-evidence -- capture "$@"
diff --git a/scripts/verify_all.sh b/scripts/verify_all.sh
index f155e73d..9c3d27c9 100755
--- a/scripts/verify_all.sh
+++ b/scripts/verify_all.sh
@@ -43,14 +43,14 @@ cargo build -p aienos-kernel --target aarch64-unknown-none --no-default-features
 echo ""
 echo "--- [AArch64 UEFI Image Builds] ---"
 cargo build --release -p aienos-boot --target aarch64-unknown-uefi --features firmware --bin aienos-boot
-python3 scripts/verify_uefi_image.py target/aarch64-unknown-uefi/release/aienos-boot.efi
+cargo run --quiet --release -p aienos-evidence -- verify-efi target/aarch64-unknown-uefi/release/aienos-boot.efi
 cargo build --release -p aienos-boot --target aarch64-unknown-uefi --features handoff --bin aienos-handoff
-python3 scripts/verify_uefi_image.py target/aarch64-unknown-uefi/release/aienos-handoff.efi
+cargo run --quiet --release -p aienos-evidence -- verify-efi target/aarch64-unknown-uefi/release/aienos-handoff.efi
 
 echo ""
 echo "============================================================"
 echo "HOST VERIFICATIONS PASSED."
-echo "Config A: observed capture and three local inference samples verified."
+echo "Config A: observed capture verified. M0 stays open until native-boot rollback is tested."
 echo "Kernel: aarch64-unknown-none library compiles. Native boot remains untested."
 echo "UEFI: diagnostic and GB10-discovering handoff images build; hardware boot remains untested."
 echo "============================================================"
diff --git a/scripts/verify_evidence.py b/scripts/verify_evidence.py
deleted file mode 100755
index 4b57a113..00000000
--- a/scripts/verify_evidence.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python3
-"""Validate observed Config A evidence, not merely its self-checksum."""
-
-import hashlib
-import json
-from pathlib import Path
-import re
-import sys
-
-
-def check(bundle):
-    errors = []
-    stored = bundle.pop("bundle_checksum_sha256", None)
-    actual = hashlib.sha256(json.dumps(bundle, indent=2, sort_keys=True).encode()).hexdigest()
-    if stored != actual:
-        errors.append("bundle checksum mismatch")
-    if bundle.get("schema_version") != "2.0.0":
-        errors.append("unsupported evidence schema")
-    identity = bundle.get("config_identity", {})
-    if not all(identity.get(k) for k in ("host", "kernel", "architecture", "os_distribution", "kernel_command_line")):
-        errors.append("incomplete host identity")
-    capsule = bundle.get("machine_capsule", {})
-    if not capsule.get("firmware", {}).get("uefi_present"):
-        errors.append("UEFI was not observed")
-    if not capsule.get("accelerator") or not all(
-            gpu.get("model") and gpu.get("driver_version") and gpu.get("pci_bus_id")
-            for gpu in capsule.get("accelerator") or []):
-        errors.append("GPU identity was not observed")
-    if not capsule.get("cpu", {}).get("cores") or not capsule.get("memory", {}).get("total_kb"):
-        errors.append("CPU or memory identity missing")
-    if not capsule.get("storage", {}).get("block_devices", {}).get("blockdevices"):
-        errors.append("block device inventory missing")
-    model = bundle.get("baseline_model", {})
-    if not re.fullmatch(r"[0-9a-f]{64}", model.get("sha256", "")) or not model.get("size_bytes"):
-        errors.append("baseline model digest or size missing")
-    if not bundle.get("workspace_repositories") or any(not item.get("commit") for item in bundle["workspace_repositories"]):
-        errors.append("workspace commit inventory missing")
-    samples = bundle.get("reference_workload", {}).get("samples", [])
-    if len(samples) < 3 or any(not sample.get("ttft_ms") or not sample.get("output_tokens")
-                               or not sample.get("output_tokens_per_second") for sample in samples):
-        errors.append("three complete measured inference samples required")
-    return errors
-
-
-def main():
-    path = Path(sys.argv[1])
-    try:
-        bundle = json.loads(path.read_text())
-    except (OSError, ValueError) as error:
-        raise SystemExit(f"Evidence unavailable: {error}") from error
-    errors = check(bundle)
-    if errors:
-        for error in errors:
-            print(f"FAIL: {error}")
-        raise SystemExit(1)
-    samples = bundle["reference_workload"]["samples"]
-    print(f"Config A capture verified for {bundle['config_identity']['host']}: {len(samples)} measured inference samples")
-    print("Native boot and recovery qualification remain separate gates.")
-
-
-if __name__ == "__main__":
-    main()
diff --git a/scripts/verify_evidence.sh b/scripts/verify_evidence.sh
index c3efee8e..ae046936 100755
--- a/scripts/verify_evidence.sh
+++ b/scripts/verify_evidence.sh
@@ -1,4 +1,5 @@
 #!/usr/bin/env bash
 set -euo pipefail
 repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
-exec python3 "${repo_root}/scripts/verify_evidence.py" "${1:-${repo_root}/evidence/config_a_reference_bundle.json}"
+cd "${repo_root}"
+exec cargo run --quiet --release -p aienos-evidence -- verify "${1:-evidence/config_a_reference_bundle.json}"
diff --git a/scripts/verify_uefi_image.py b/scripts/verify_uefi_image.py
deleted file mode 100644
index d1b84162..00000000
--- a/scripts/verify_uefi_image.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python3
-"""Check the built image has an AArch64 EFI application PE header."""
-
-from pathlib import Path
-import struct
-import sys
-
-
-def verify(path):
-    data = Path(path).read_bytes()
-    if len(data) < 0x100 or data[:2] != b"MZ":
-        raise ValueError("missing DOS image header")
-    pe_offset = struct.unpack_from("<I", data, 0x3C)[0]
-    if pe_offset + 4 + 20 + 70 > len(data) or data[pe_offset:pe_offset + 4] != b"PE\x00\x00":
-        raise ValueError("missing PE header")
-    machine = struct.unpack_from("<H", data, pe_offset + 4)[0]
-    optional_header = pe_offset + 4 + 20
-    magic = struct.unpack_from("<H", data, optional_header)[0]
-    subsystem = struct.unpack_from("<H", data, optional_header + 68)[0]
-    if (machine, magic, subsystem) != (0xAA64, 0x20B, 10):
-        raise ValueError(f"unexpected machine/PE/subsystem: {machine:#x}/{magic:#x}/{subsystem}")
-    print(f"AArch64 PE32+ EFI application verified: {path}")
-
-
-if __name__ == "__main__":
-    try:
-        verify(sys.argv[1])
-    except (IndexError, OSError, ValueError) as error:
-        raise SystemExit(f"UEFI image verification failed: {error}") from error