aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / docs / EVIDENCE_RECEIPT_ADAPTER.md
| 1 | # Evidence Receipt Adapter Specification for `aienos` |
| 2 | |
| 3 | Scope: how `aienos` test setups emit machine readable qualification results |
| 4 | that `aien-proof` turns into sealed evidence receipts. This document is an |
| 5 | input contract only. Every JSON block marked EXAMPLE is a shape example, not |
| 6 | evidence. No gate has passed unless `aien-proof gate status` says PASS over |
| 7 | real stored receipts. |
| 8 | |
| 9 | You never need to edit `aien-proof` or depend on its Rust internals. You need |
| 10 | only: |
| 11 | |
| 12 | 1. a built `aien-proof` binary on PATH (or `cargo run -p aien-proof --`), |
| 13 | 2. a shared receipt store (the proof board dir, `AIEN_PROOF_DIR`), |
| 14 | 3. an assertion file your test setup writes, |
| 15 | 4. one `aien-proof receipt import` (alias: `aien-proof qualify`) call per run, |
| 16 | 5. for Machine 1 runs, a `hold` lease around the run. |
| 17 | |
| 18 | ## 1. Assertion file contract |
| 19 | |
| 20 | Your setup writes one JSON file per run. Prose is never parsed. The file |
| 21 | must match this shape exactly (unknown fields are refused): |
| 22 | |
| 23 | ```json |
| 24 | { |
| 25 | "assertions": [ |
| 26 | { |
| 27 | "id": "artifact_signature_valid", |
| 28 | "expected": "valid", |
| 29 | "observed": "valid", |
| 30 | "result": "pass", |
| 31 | "source": "scripts/qemu_seed0b.sh", |
| 32 | "note": "" |
| 33 | } |
| 34 | ], |
| 35 | "result": "PASS" |
| 36 | } |
| 37 | ``` |
| 38 | |
| 39 | Rules: |
| 40 | |
| 41 | - `id` is stable across runs (`secure_boot_unchanged`, `boot_order_unchanged`, |
| 42 | `artifact_signature_valid`, `granted_subset_requested`, |
| 43 | `w_x_never_simultaneous`, `unauthorized_write_denied`, |
| 44 | `all_task_frames_reclaimed`, `store_previous_or_new_only`, |
| 45 | `root_graph_valid`, `machine_returned_to_linux`). |
| 46 | - `result` per assertion is `pass` or `fail` (or boolean true/false). |
| 47 | - Top level `result` is optional. When absent it is derived (all pass gives |
| 48 | PASS, else FAIL). A claimed PASS with any failing assertion is refused. |
| 49 | A failing run can never be upgraded to PASS at import. |
| 50 | - At least one assertion is required for a PASS receipt. |
| 51 | - Assertion `source` is part of the canonical receipt identity. For hardware |
| 52 | topology and ownership claims, use one stable provenance category as the |
| 53 | source: `linux_observed`, `uefi_observed`, `native_aienos_observed`, |
| 54 | `qemu_synthetic`, `derived`, or `unknown`. Put collector/tool identity and |
| 55 | detail in `note` and bind its output as an artifact. A Linux-observed |
| 56 | topology assertion cannot satisfy a gate that source-pins |
| 57 | `native_aienos_observed`. |
| 58 | |
| 59 | ## 2. Import command contract |
| 60 | |
| 61 | EXAMPLE (SEED-0B QEMU run): |
| 62 | |
| 63 | ```sh |
| 64 | aien-proof receipt import \ |
| 65 | --repo https://github.com/aien-dev/aienux \ |
| 66 | --commit 3fa4c8e2b1d04f7a9c6e5b8d2a1f4c7e9b0d3f21 \ |
| 67 | --gate seed-0b-qemu \ |
| 68 | --tier QEMU \ |
| 69 | --procedure "scripts/qemu_seed0b.sh" \ |
| 70 | --machine qemu-virt-aarch64 \ |
| 71 | --toolchain "$(rustc -vV)" \ |
| 72 | --assert /tmp/seed0b-assert.json \ |
| 73 | --artifact blake3:<hex-of-boot-image> \ |
| 74 | --output-file /tmp/seed0b-output.log \ |
| 75 | --dep <m3-receipt-id> \ |
| 76 | --dep <recovery-media-receipt-id> |
| 77 | ``` |
| 78 | |
| 79 | Field notes: |
| 80 | |
| 81 | - `--commit` is the exact 40 digit lowercase git SHA (64 digits accepted). |
| 82 | - `--tier` is one of `HOST_TEST QEMU QEMU_SECURITY MACHINE1_READ_ONLY |
| 83 | MACHINE1_ATTENDED MACHINE1_MUTATING TEST_ONLY_TRUST PRODUCTION`. |
| 84 | The environment label always equals the tier, so a QEMU run can never be |
| 85 | filed as physical qualification. |
| 86 | - `--artifact` digests are `<algo>:<hex>` with algo `blake3`, `sha256`, or |
| 87 | `sha512` (repeatable). |
| 88 | - `--output-file` is hashed to the receipt output digest. Prefer it over |
| 89 | `--output-digest`. |
| 90 | - `--dep` lists prerequisite receipt IDs (repeatable). Missing deps stay |
| 91 | missing: verification reports INCOMPLETE, never PASS. |
| 92 | - `--dirty` marks uncommitted source changes. Gates that require clean |
| 93 | sources block dirty receipts. |
| 94 | - On success the command prints the receipt ID (the BLAKE3 of the canonical |
| 95 | encoding) and stores `<store>/receipts/<id>.json`. |
| 96 | |
| 97 | ## 3. Machine 1 runs: the `hold` lease |
| 98 | |
| 99 | Every `MACHINE1_*` receipt must bind an exclusive hold from the existing |
| 100 | coordination machinery. No second lock exists. Wrap the run: |
| 101 | |
| 102 | ```sh |
| 103 | HOLD=$(aien-proof hold --resource machine-1 --job seed-0b-machine1 -- \ |
| 104 | scripts/seed0b_machine1.sh 2>/dev/null | tail -n 1) |
| 105 | ``` |
| 106 | |
| 107 | `hold` always runs (no fingerprint, stamp, or reuse), holds every |
| 108 | `--resource` key plus the holder record for the whole run, seals an `audit` |
| 109 | event into the Crumb ledger with the full output as payload, and stores |
| 110 | `holds/<key>.json`. The audit event hash printed on stdout is the hold ID. |
| 111 | Resource names are lowercase letters, digits, and dashes only. `run |
| 112 | --resource` takes the same keys, so test-board runs and holds exclude each |
| 113 | other on one machine. |
| 114 | |
| 115 | Then import with: |
| 116 | |
| 117 | ```sh |
| 118 | --tier MACHINE1_ATTENDED \ |
| 119 | --machine machine-1 \ |
| 120 | --procedure "scripts/seed0b_machine1.sh" \ |
| 121 | --declared-mutation REMOVABLE_MEDIA_ONLY \ |
| 122 | --lease-hold "$HOLD" \ |
| 123 | --lease-resource machine-1 \ |
| 124 | --output-file <hold-log-or-collector-output> |
| 125 | ``` |
| 126 | |
| 127 | Rules: |
| 128 | |
| 129 | - `--procedure` must equal the held command line exactly. |
| 130 | - `--machine` must equal the leased resource. |
| 131 | - `--output-file` (or digest) must equal the held run output digest. |
| 132 | - `--declared-mutation` is required for hardware tiers. Allowed classes: |
| 133 | `NONE VOLATILE_ONLY REMOVABLE_MEDIA_ONLY ONE_TIME_BOOT_SELECTION |
| 134 | BOUNDED_TEST_REGION_WRITE BOOT_CONFIGURATION_CHANGE TRUST_ROOT_CHANGE |
| 135 | TPM_POLICY_CHANGE DESTRUCTIVE_STORAGE`. |
| 136 | - A read-only run (`MACHINE1_READ_ONLY`) cannot claim more than |
| 137 | `REMOVABLE_MEDIA_ONLY`. Observed mutation beyond declared mutation fails. |
| 138 | - A Machine 1 receipt without a matching exclusive hold verifies as |
| 139 | INCOMPLETE, never PASS. |
| 140 | |
| 141 | ## 4. EXAMPLE input contracts per gate input |
| 142 | |
| 143 | All values below are placeholders. Replace them with measured values. |
| 144 | |
| 145 | ### 4.1 SEED-0B QEMU (owner: SEED-0B completion lane) |
| 146 | |
| 147 | EXAMPLE assertion file: |
| 148 | |
| 149 | ```json |
| 150 | { |
| 151 | "assertions": [ |
| 152 | {"id": "artifact_identity", "expected": "<image-digest>", "observed": "<image-digest>", "result": "pass", "source": "scripts/qemu_seed0b.sh"}, |
| 153 | {"id": "artifact_signature_valid", "expected": "valid", "observed": "valid", "result": "pass", "source": "scripts/qemu_seed0b.sh"}, |
| 154 | {"id": "granted_subset_requested", "expected": "subset", "observed": "subset", "result": "pass", "source": "admission-check"}, |
| 155 | {"id": "authorized_op_permitted", "expected": "permit", "observed": "permit", "result": "pass", "source": "admission-check"}, |
| 156 | {"id": "unauthorized_write_denied", "expected": "deny", "observed": "deny", "result": "pass", "source": "admission-check"}, |
| 157 | {"id": "all_task_frames_reclaimed", "expected": "0 live", "observed": "0 live", "result": "pass", "source": "cleanup-check"}, |
| 158 | {"id": "machine_returned_to_linux", "expected": "linux", "observed": "linux", "result": "pass", "source": "cleanup-check"} |
| 159 | ] |
| 160 | } |
| 161 | ``` |
| 162 | |
| 163 | Import with `--gate seed-0b-qemu --tier QEMU`, plus `--dep` on the M3 |
| 164 | receipt and the recovery media receipt IDs. The hostile input matrix is a |
| 165 | separate import with `--gate seed-0b-hostile-matrix --tier QEMU`. |
| 166 | |
| 167 | ### 4.2 M0 rollback QEMU and Machine 1 are different facts (owner: M0 rollback lane) |
| 168 | |
| 169 | EXAMPLE assertion file: |
| 170 | |
| 171 | ```json |
| 172 | { |
| 173 | "assertions": [ |
| 174 | {"id": "rollback_harness_version_recorded", "expected": "version in procedure identity", "observed": "exact harness version", "result": "pass", "source": "rollback_harness"}, |
| 175 | {"id": "qemu_aavmf_environment_recorded", "expected": "QEMU and AAVMF identities", "observed": "exact QEMU/AAVMF versions and firmware digests", "result": "pass", "source": "qemu_environment_collector"}, |
| 176 | {"id": "rollback_normal_pass", "expected": "pass", "observed": "pass", "result": "pass", "source": "aavmf_serial_output"}, |
| 177 | {"id": "rollback_fault_pass", "expected": "pass", "observed": "pass", "result": "pass", "source": "aavmf_serial_output"}, |
| 178 | {"id": "rollback_timeout_pass", "expected": "pass", "observed": "pass", "result": "pass", "source": "aavmf_serial_output"}, |
| 179 | {"id": "rollback_rejected_pass", "expected": "pass", "observed": "pass", "result": "pass", "source": "aavmf_serial_output"}, |
| 180 | {"id": "rollback_absent_pass", "expected": "pass", "observed": "pass", "result": "pass", "source": "aavmf_serial_output"}, |
| 181 | {"id": "rollback_repeat_boot_pass", "expected": "pass", "observed": "pass", "result": "pass", "source": "aavmf_serial_output"}, |
| 182 | {"id": "bootnext_consumed", "expected": "unset in AAVMF NVRAM after one-time boot", "observed": "unset", "result": "pass", "source": "aavmf_variables"}, |
| 183 | {"id": "default_boot_unchanged", "expected": "default entry selected after candidate", "observed": "default entry selected", "result": "pass", "source": "aavmf_variables"}, |
| 184 | {"id": "m0_native_rollback_qemu_pass", "expected": "all required branches pass", "observed": "all required branches pass", "result": "pass", "source": "rollback_harness_summary"} |
| 185 | ] |
| 186 | } |
| 187 | ``` |
| 188 | |
| 189 | Import the QEMU run under `--gate m0-native-rollback-qemu --tier QEMU`. |
| 190 | Bind the exact `aienos` commit, harness version in `--procedure`, QEMU/AAVMF |
| 191 | identity in `--machine` and input artifact digests, and complete captured |
| 192 | output with `--output-file`. If the run also includes a pure state machine |
| 193 | mock, emit its observations with source `rollback_state_machine_mock`; firmware |
| 194 | variable observations must use source `aavmf_variables`. A mock result alone |
| 195 | cannot satisfy `bootnext_consumed`. |
| 196 | |
| 197 | Do not import a Machine 1 rollback receipt until the owner trust chain permits |
| 198 | the attended run. That future receipt must prove Secure Boot stayed on, |
| 199 | permanent BootOrder stayed unchanged, BootNext was consumed, Linux/default boot |
| 200 | returned, root and ESP UUIDs stayed unchanged, expected mounts are healthy, and |
| 201 | the exact candidate digest and source commit were recorded. It must use |
| 202 | `MACHINE1_ATTENDED`, declare `ONE_TIME_BOOT_SELECTION`, and reference the |
| 203 | existing `aien-proof hold --resource machine-1 -- ...` event. QEMU rollback |
| 204 | evidence never satisfies this receipt. |
| 205 | |
| 206 | ### 4.3 System Store v1 crash consistency (owner: System Store lane) |
| 207 | |
| 208 | EXAMPLE assertion file: |
| 209 | |
| 210 | ```json |
| 211 | { |
| 212 | "assertions": [ |
| 213 | {"id": "store_previous_or_new_only", "expected": "no torn writes", "observed": "no torn writes", "result": "pass", "source": "crash-qualify.sh"}, |
| 214 | {"id": "store_graph_valid", "expected": "valid", "observed": "valid", "result": "pass", "source": "crash-qualify.sh"}, |
| 215 | {"id": "store_nospace_zero_writes", "expected": "zero writes", "observed": "zero writes", "result": "pass", "source": "crash-qualify.sh"}, |
| 216 | {"id": "store_io_error_not_fallback", "expected": "no silent fallback", "observed": "no silent fallback", "result": "pass", "source": "crash-qualify.sh"}, |
| 217 | {"id": "w_x_never_simultaneous", "expected": "never", "observed": "never", "result": "pass", "source": "crash-qualify.sh"} |
| 218 | ] |
| 219 | } |
| 220 | ``` |
| 221 | |
| 222 | Import with `--gate store-v1-crash --tier QEMU` (or the tier the lane |
| 223 | declares), with `--dep` on the ADR 0015 acceptance receipt once it exists. |
| 224 | |
| 225 | The checked-in `P3_STORE_QEMU` manifest consumes separate Store format, |
| 226 | crash-consistency, and QEMU block-device receipts. Crash consistency must link |
| 227 | to the exact format qualification receipt. The block-device receipt must link |
| 228 | to both the exact format and crash-consistency receipts. Required structured |
| 229 | assertions are `store_previous_or_new_only`, `store_graph_valid`, |
| 230 | `store_nospace_zero_writes`, and `store_io_error_not_fallback`. This adapter |
| 231 | records observations; it does not define Store v1 semantics. |
| 232 | |
| 233 | `P3_STORE_MACHINE1` additionally requires an exact bounded-region receipt, |
| 234 | exact-region provisioning authority, and an attended Machine 1 execution |
| 235 | receipt. The execution receipt must be `MACHINE1_MUTATING`, bind the existing |
| 236 | `machine-1` hold, depend on the target and provisioning receipts, and declare |
| 237 | and observe only `BOUNDED_TEST_REGION_WRITE`. A read-only Machine 1 receipt |
| 238 | cannot prove persistent writes. |
| 239 | Store v1 format tests, mount validation, and the QEMU block-device suite |
| 240 | follow the same shape with their own `--gate` kinds. Muse never defines |
| 241 | Store v1 wire or recovery behavior; the Store lane emits structured |
| 242 | observations and Muse verifies, chains, and evaluates them. |
| 243 | |
| 244 | ### 4.4 Admission Receipts (owner: SEED-0B admission lane) |
| 245 | |
| 246 | Claude's Admission Receipt v0 stays where it is. It is the |
| 247 | subsystem-specific proof of artifact verification, admission, and execution. |
| 248 | It is not moved into `aien-proof`. An EvidenceReceipt references or digests |
| 249 | it without conflating the two layers: |
| 250 | |
| 251 | - pass the admission receipt digest as an `--artifact` input digest, and/or |
| 252 | - record its location or identifier in `--external-ref`. |
| 253 | |
| 254 | The EvidenceReceipt then proves the qualification procedure ran and its |
| 255 | required assertions and dependencies hold; the Admission Receipt proves what |
| 256 | the admission subsystem checked. Either layer can fail independently. |
| 257 | |
| 258 | ### 4.5 Provenance tags for characterization evidence |
| 259 | |
| 260 | Characterization observations (for example GB10 topology facts) must carry |
| 261 | their provenance in the assertion `source` field using this vocabulary: |
| 262 | |
| 263 | - `linux-observed` |
| 264 | - `uefi-observed` |
| 265 | - `native-aienos-observed` |
| 266 | - `qemu-synthetic` |
| 267 | - `derived` |
| 268 | - `unknown` |
| 269 | |
| 270 | EXAMPLE source value: `gb10-topology:linux-observed`. Gate manifests pin the |
| 271 | required origin per assertion with `assertion_sources`, so Linux-observed |
| 272 | topology can never satisfy a native-AIENOS hardware-ownership claim and a |
| 273 | pure state-machine mock can never prove firmware variable behavior. When a |
| 274 | manifest is silent about origin, any recorded source is accepted, but the |
| 275 | source string is still part of the canonical receipt identity. |
| 276 | |
| 277 | ## 5. Verification commands (read only) |
| 278 | |
| 279 | ```sh |
| 280 | aien-proof receipt verify <receipt-file> |
| 281 | aien-proof verify-chain <receipt-file> |
| 282 | aien-proof gate status SEED-0B |
| 283 | aien-proof gate explain P3_DEVELOPMENT_QEMU_ENTRY |
| 284 | aien-proof gate explain P3_MACHINE1_WRITE_ENTRY |
| 285 | aien-proof gate explain STORE_V1_FORMAT_PR_MERGE |
| 286 | ``` |
| 287 | |
| 288 | `gate explain` reports each checked-in manifest prerequisite. Missing ordinary |
| 289 | proof is `INCOMPLETE`. A known procedural blocker can declare `BLOCKED` and |
| 290 | name it explicitly. Example current physical state: |
| 291 | |
| 292 | ```text |
| 293 | P3_DEVELOPMENT_QEMU_ENTRY: INCOMPLETE |
| 294 | INCOMPLETE M0_NATIVE_ROLLBACK_QEMU ... |
| 295 | INCOMPLETE SEED0B_QEMU ... |
| 296 | INCOMPLETE ADR0015 ... |
| 297 | INCOMPLETE STRICT_MAIN ... |
| 298 | |
| 299 | P3_MACHINE1_WRITE_ENTRY: BLOCKED |
| 300 | BLOCKED P3_DEVELOPMENT_QEMU_ENTRY ... |
| 301 | BLOCKED OWNER_SECURE_BOOT_TRUST_CHAIN MISSING: HARDWARE_QUALIFICATION_BLOCKED_BY_TRUST_CHAIN |
| 302 | BLOCKED M0_NATIVE_ROLLBACK_MACHINE1 MISSING: HARDWARE_QUALIFICATION_BLOCKED_BY_TRUST_CHAIN |
| 303 | INCOMPLETE BOUNDED_MACHINE1_STORE_REGION ... |
| 304 | ``` |
| 305 | |
| 306 | `STORE_V1_FORMAT_PR_MERGE` is intentionally narrower. It requires ADR 0015, |
| 307 | pure Store v1 format/golden-vector assertions, and strict main. It can pass |
| 308 | without full SEED-0B completion. It does not authorize P3 QEMU qualification |
| 309 | or any Machine 1 mutation. `P3_DEVELOPMENT_QEMU_ENTRY` requires all four of |
| 310 | M0_NATIVE_ROLLBACK_QEMU, SEED0B_QEMU, ADR 0015, and strict main to pass. |
| 311 | |
| 312 | The tier ordering is explicit: `TEST_ONLY_TRUST`, `HOST_TEST`, `QEMU`, |
| 313 | `QEMU_SECURITY`, `MACHINE1_READ_ONLY`, `MACHINE1_ATTENDED`, |
| 314 | `MACHINE1_MUTATING`, `PRODUCTION`. Test-only trust satisfies only itself. |
| 315 | Physical requirements reject all QEMU tiers. The read-only Machine 1 tier |
| 316 | cannot satisfy attended mutation requirements, and `PRODUCTION` cannot rely on |
| 317 | test-only trust ancestry. |
| 318 | |
| 319 | Materialize the checked in example manifests with: |
| 320 | |
| 321 | ```sh |
| 322 | aien-proof gate examples --out <store>/gates |
| 323 | ``` |
| 324 | |
| 325 | ## 6. What the evidence lane will not do |
| 326 | |
| 327 | - Change store, boot, artifact, admission, Secure Boot, TPM, trust root, |
| 328 | native boot, or SEED-0B execution behavior. |
| 329 | - Infer completion from issue status or prose. If your run lacks a required |
| 330 | input, the receipt schema or verification reports the gap instead. |
| 331 | - Upgrade failing runs, satisfy physical requirements with QEMU receipts, |
| 332 | or close gates on BLOCKED runs. |
| 333 | - Move Claude's Admission Receipt format into `aien-proof`. An Admission |
| 334 | Receipt proves artifact admission/execution inside its subsystem. An |
| 335 | EvidenceReceipt proves a cross-repository qualification run and may bind an |
| 336 | Admission Receipt by digest/reference. |