aien-dev has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
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#261 (code only)
Apply it
git checkout -b patch-2a46bbc659901a24 9d41efc9d1bea31be0640ca70eeeec9d1d000fad curl -fsSL https://interplane.io/drakestapleton/aienux/patches/2a46bbc659901a24.patch | git am
Provenance
github-import 1
aien-dev/aienux
261
feae3c1203945d3c9c29b7580aa824672053c4bd
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":261,"url":"https://github.com/aien-dev/aienux/pull/261","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:04Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index 30f96af4..b72a93fc 100644 --- a/.crumb +++ b/.crumb @@ -27,33 +27,33 @@ "purpose": "Directory crates. Purpose not yet described by a human." }, { - "digest": "3947ba1fe343472af9f2afe65c10051bdda114a47e52ed281c9c496928613a69", - "last_commit": "640522a", + "digest": "8b848e5392b8d0fd71fe3fb6e5c8101f73369579446f76d994623d1da0374740", + "last_commit": "9d41efc", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, { "digest": "4c3af9c590d65bc53f1ff800c6c71a182d1198942af77723468fc3b1ec983d7d", - "last_commit": "640522a", + "last_commit": "9d41efc", "name": "native", "purpose": "Directory native. Purpose not yet described by a human." }, { "digest": "07ca1d2521f97f9ca307c0d11fd0793cb00558b2a429f581c9bd3c2b91e4f1cf", - "last_commit": "640522a", + "last_commit": "9d41efc", "name": "scripts", "purpose": "Directory scripts. Purpose not yet described by a human." } ], - "children_root": "sha256:71ab00ea4d4d7468795bbc75e618c4c1f85bc089a59a6f2d534ff3ec02e9edb0", - "compiled_at": "2026-10-05T02:27:48Z", + "children_root": "sha256:0f6bd8efc5885d6a70fb4aefbaa4d52d0c3be0aa2cb7c29226e33f1c875958a2", + "compiled_at": "2026-10-05T03:30:04Z", "compiler": "crumb-compile/1", - "digest": "sha256:b97fc8060559ff252ae45da063dfe5d19a499c0fbf5c3df259116c76777971e6", + "digest": "sha256:572d27997bf2f5a7138da1a99c5760968eb4f79246eb6a678c3df22b44ce0057", "evidence_files": 147, "evidence_root": "sha256:3f1c80574189eaded43ead3929d21a74c01f77dee31e7b2e2bd3858e67155dc7", "files": 2853, - "generated_at_commit": "640522a03b9f939d2d07ef0d0fdc08e35ecefc7e", - "source_tree": "sha256:01fd2bbb73681268d64b27e5cf332a4ffe7d93c072aed2f1bc494d7d7e3c6798" + "generated_at_commit": "9d41efc9d1bea31be0640ca70eeeec9d1d000fad", + "source_tree": "sha256:64bc674f6af5963292d2604131afb93a2ea5e7ce8e1638a357dd904a0809780c" }, "owner_lane": "", "provenance": { diff --git a/docs/.crumb b/docs/.crumb index d887570d..4da0a700 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -18,26 +18,26 @@ "children": [ { "digest": "c24b943fbbd6b536c29d731066917fc908de275c72f594d2d4a5a1c7d19f879c", - "last_commit": "640522a", + "last_commit": "9d41efc", "name": "adr", "purpose": "Directory docs/adr. Purpose not yet described by a human." }, { "digest": "e9e804e088a0b2316d035b957c09289bf9f6176eece959d43c40c6e66005fe5e", - "last_commit": "fbbfc9c", + "last_commit": "7e15a57", "name": "crumbs", "purpose": "Directory docs/crumbs. Purpose not yet described by a human." } ], "children_root": "sha256:25a2af14107c1c2ae96916dd5c4086195ebd4117975ea0ae458855ac21f46099", - "compiled_at": "2026-10-05T02:27:48Z", + "compiled_at": "2026-10-05T03:30:04Z", "compiler": "crumb-compile/1", - "digest": "sha256:3947ba1fe343472af9f2afe65c10051bdda114a47e52ed281c9c496928613a69", + "digest": "sha256:8b848e5392b8d0fd71fe3fb6e5c8101f73369579446f76d994623d1da0374740", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 57, - "generated_at_commit": "640522a03b9f939d2d07ef0d0fdc08e35ecefc7e", - "source_tree": "sha256:49ef00c2c9e4238564ac5645aac7a6e1c186eca16afc8564ea6e12bae757f750" + "generated_at_commit": "9d41efc9d1bea31be0640ca70eeeec9d1d000fad", + "source_tree": "sha256:accdb56dd1c6324e249c5ff59c9e50126a48497a094a54f8f9bb4f2c6496e1f7" }, "owner_lane": "", "provenance": { diff --git a/docs/TRUST-1-M5-GATE-MATRIX.md b/docs/TRUST-1-M5-GATE-MATRIX.md index 015942bf..079eff3a 100644 --- a/docs/TRUST-1-M5-GATE-MATRIX.md +++ b/docs/TRUST-1-M5-GATE-MATRIX.md @@ -3,7 +3,7 @@ Snapshot of every TRUST-1 gate (docs/TRUST-1-IMPLEMENTATION-PLAN.md) and every M5 requirement (aien-architecture CURRENT_EXECUTION_PLAN.md section D1, ADR 0017) against what is actually on `main`. Base commit for this snapshot: -`a3be1b0` (2026-10-01, after #180). Verdict vocabulary only: PASS, FAIL, +`a3be1b0` (2026-10-01, after #180); the 2026-10-05 refresh below re-checks it against 9d41efc. Verdict vocabulary only: PASS, FAIL, NOT_RUN, BLOCKED_HARDWARE, BLOCKED_OPERATOR, MISSING_IMPLEMENTATION. A gate is PASS only when every acceptance assertion in the plan is true; a gate with some items done and others open carries the verdict of its worst open item. @@ -11,6 +11,141 @@ QEMU, swTPM and host tests never count as Machine 1 hardware qualification. Overall: **TRUST-1 NOT QUALIFIED. M5 NOT QUALIFIED.** +## Refresh 2026-10-05 against aienos main 9d41efc (read this section first) + +Authority for this section: lane L4-TRUST of the overnight campaign, candidate CAND-0 +(`9d41efc9d1bea31be0640ca70eeeec9d1d000fad`, ALLEN native #260). It re-reads every row of the +tables below against current main. The tables further down are history: their +"Base commit" and "newest receipt" sentences are superseded by this section. +Overall is unchanged: **TRUST-1 NOT QUALIFIED. M5 NOT QUALIFIED.** No row became PASS in +this refresh and nothing here was run on Machine 1 by an agent. + +Tags: OBSERVED (read in a file or command output named here), INFERRED (follows from +observed facts, reasoning given), UNVERIFIED (not checked in this refresh). + +### Receipts used and how fresh they are + +| Receipt | Commit | Tier | Counts | Status for 9d41efc | +|---|---|---|---|---| +| `evidence/trust1_m5_qualification_3f9d07f50196b4ad741b03c353ed3c45c268a72f04c32f00a0ddfab5294a3eee.json` (in repo) | 44de11f, 2026-10-02 | host + QEMU | pass 19, fail 1, not_run 1, blocked 11, missing 5 | older, kept as history | +| `~/workspace/evidence-out/TRUST1-M5-20261003-130aa20/trust1_m5_qualification_c992277b5396191ba6fe74d6022b8c3bbbceb7588fe01def99c1d7a493317540.json` (NOT in repo; lane TR-02; started 2026-10-03T17:02:32Z) | 130aa20 | host + QEMU | pass 20, fail 1, not_run 0, blocked 11, missing 5 (37 rows) | newest TRUST-1/M5 receipt that exists; see staleness below | +| `evidence/ck_gates_1ecf5bcd303bf88422dd0542f14851c931f5d52276838fa182c812f3c73f3c1b.json` (in repo, from #260) | 640522a, 2026-10-05 | QEMU only | 20 gates: pass 15, fail 0, not_run 5 | binds 9d41efc, see "Binding" below | +| `evidence/allen_native_qemu_cfe9aecffb8b20e0c1ff51fad54c46c522ec7d6c56c6cba7661e4b8cda1ee25a.json` (in repo, from #260) | 640522a | QEMU only | 3 results PASS | binds 9d41efc, see ALLEN section | +| New receipt at 9d41efc | 9d41efc | host + QEMU | QUEUED, NOT_RUN at the time of writing | owed, see "Owed" | + +The one FAIL in both newest TRUST-1/M5 receipts is `t1_gate7_preflight`. It reads live +operator state and Secure Boot is off on the Spark (`secure_boot=0` in every Gate 2 +baseline `capture.env`; OBSERVED), so the pre-flight correctly refuses. It is a software +FAIL that reports operator state, not a code regression, and it stays FAIL until Secure Boot +is on again. + +Binding of the 640522a receipts to 9d41efc (OBSERVED, `git diff` in this worktree): +`197206c` (the PR head that added the receipts) has git tree `5b9615818287e1369dd87ce82c428c188f3db699`, identical +to the tree of 9d41efc. Between `640522a` (the commit the receipts name) and 9d41efc the +only non-evidence, non-crumb files that differ are `docs/adr/0018-allen-subject-state-object.md` +and `native/kernel/GATES.md`. So every C kernel, boot, Store, M5 and script byte the QEMU +runs used is the code of 9d41efc. + +Staleness test applied to the 130aa20 receipt (OBSERVED, `git diff --stat 130aa20 HEAD` with +crumb files excluded): no change at all in `native/crypto`, `native/m5`, `native/sig`, +`native/store`, `native/disk`, `native/net`, `crates/aienos-crypto`, +`crates/aienos-kernel/src/crypto`, `crates/aienos-kernel/src/store`, `crates/aienos-boot`, +`crates/aienos-store-tool`, nor in any `scripts/trust1_*`, `tpm_measurement_campaign.sh`, +`qemu_secureboot_signing_test.sh`, `qemu_security_suite.sh`, `qemu_store_512b_crash_test.sh`, +`build_standalone_recovery_initrd.sh` or `verify_recovery_tools.sh`. Changed since 130aa20: +`native/boot` (GOP console, model load), `native/kernel` (FPU, infer, screen, ALLEN) and +the `ck_gates.sh` gate list. So the host and Rust rows of the 130aa20 receipt are current +for 9d41efc; its three C-kernel QEMU rows (`ck_m1_boot_qemu`, `ck_store_kernel_qemu`, +`ck_argus1_revoke_qemu`) are STALE and are replaced by the same gates in the 640522a +`ck_gates` receipt (rows M1, M4_STORE, ARGUS1_REVOKE all PASS there). + +GitHub CI on 9d41efc (OBSERVED, `gh run list -R aien-dev/aienos -b main`): Native suites, +Crypto boundary, Crumb compiler, Push on main and "C kernel (CK) gates" (run 37257444148) +all concluded success (CK gates checked again at 03:29Z on 2026-10-05; it was still in +progress at 03:23Z). The CK run is a QEMU-only check. + +### TRUST-1 gates, classified + +Classes: DONE (every acceptance item has evidence at the stated tier), MISSING_IMPLEMENTATION, +software FAIL, BLOCKED_OPERATOR, BLOCKED_HARDWARE, STALE. A gate carries the class of its +worst open item. + +| Gate | Class now | Evidence and tier | Fresh for 9d41efc? | What is still owed | +|---|---|---|---|---| +| 0 Freeze baseline | BLOCKED_OPERATOR | Gate 0 addendum (2026-09-30, Secure Boot ON capture) keeps Gate 0 OPEN. New since: two cold boots compared identical, `boot2` vs `boot3` changed=0 of 35 (physical Machine 1, 130aa20, Secure Boot OFF; `evidence/trust1_gate2_baseline_2026-10-03/`); `fwupd-refresh.timer` observed paused (`boot0` vs `boot3`: enabled to disabled; `systemctl is-enabled` printed `disabled` at 2026-10-05T03:25Z) | Tools unchanged, evidence not stale. The addendum's operator facts are 5 days old (UNVERIFIED now) | Second independent place for the offline material (addendum: identity has one copy and no passphrase); cold-boot stability with Secure Boot ON (the plan's precondition is Secure Boot ON, the only repeat is OFF); a written approval for the firmware pause; service baseline (Forgejo loop, backup script) | +| 1 Recovery media | BLOCKED_OPERATOR | `t1_recovery_tools` PASS (host, 130aa20). The 2026-09-24 QEMU zero-disk receipt is amended to NOT_RUN by `gate1_zero_disk_recovery_receipt_addendum_v1.json`. Stick boot-and-return partial per #53/#59 (UNVERIFIED here) | Recovery scripts unchanged since 3156c33, not stale | Operator Steps 3 to 6: test file, stick rebuild (approval), attended Secure Boot ON boot with unlock round trip | +| 2 TPM measurement campaign | BLOCKED_OPERATOR (reboots are BLOCKED_HARDWARE) | Tooling self-test `t1_measurement_tools` PASS (host). Baseline of 4 physical boots 2026-10-03 (Secure Boot OFF). Experiments 1 to 5 not run, no Gate 2 per-experiment receipt exists | Not stale | The one-change experiments, the report, and the Secure Boot ON repeat. Attended steps: `docs/TRUST-1-OPERATOR-STEPS.md`, "Gate 2 attended run" | +| 3 Owner Root ceremony | BLOCKED_OPERATOR | `t1_key_ceremony` PASS (host, throwaway keys) | Not stale | Offline ceremony (Operator Step 8), two backups. Precondition Gates 0 and 1 | +| 4 Emulator security suite | MISSING_IMPLEMENTATION | Signed accepted, unsigned and tampered refused, QEMU: `qemu_secureboot_signing` PASS (130aa20, snakeoil TEST key). 100 of 100 boots plus tamper rejection, QEMU + swTPM, 2026-10-02 (log only, `~/workspace/test-queue-logs/C5-SOAK-005901.log`) | Signing test not stale. The soak is STALE against #243 (`qemu_security_suite.sh` changed after it ran: the tamper check now also needs the firmware banner). A 5-boot rerun is queued | Signed boot manifest, manifest accept and alter, A/B selection, failed-candidate fallback: no code (see next section). Build and emulator receipts for the gate are not produced. Firmware dbx revocation is not tested | +| 5 TPM policy simulation | BLOCKED_OPERATOR | `t1_gate5_policy_sim` PASS on swTPM (130aa20). Simulation only | Not stale | Preconditions Gates 2 to 4. PCR 7 and 11 in the simulation are placeholders. PCR 11 is all zero on the live Spark (OBSERVED in every baseline capture) | +| 6 Storage migration prep | BLOCKED_OPERATOR | none | n/a | Gates 0 to 5, own written steps | +| 7 Hardware validation | BLOCKED_OPERATOR and BLOCKED_HARDWARE; `t1_gate7_preflight` is a software FAIL (reads live state, Secure Boot off) | preflight script only | Not stale | Gates 0 to 6, approval receipt, Secure Boot ON | +| 8 Observation | BLOCKED_OPERATOR | none | n/a | Gate 7 | +| 9 Retire legacy policy | BLOCKED_OPERATOR | none | n/a | Gate 8 and approval | + +### M5 rows, classified + +| Requirement | Class now | Evidence and tier | Still owed | +|---|---|---|---| +| Owner-controlled key hierarchy | BLOCKED_OPERATOR | `m5_native_test` PASS (host; sources unchanged since 130aa20; CI Native suites success at 9d41efc) | Gate 3 ceremony and the real Owner Root | +| Sealed volume keys | MISSING_IMPLEMENTATION (the real TPM part is BLOCKED_HARDWARE) | swTPM policy model only. The kernel's production key source `ck_store_production_keys` is a refusing seam that returns `CK_SB_E_BLOCKED_OPERATOR` (`native/kernel/svc/store_boot.c`) | Product seal/unseal of K_vol; Gate 6 on real TPM | +| AES-256-GCM-SIV object envelopes | MISSING_IMPLEMENTATION for the production row; mechanism DONE on host and in QEMU with TEST keys | Host: `m5_store_encrypted_objects` PASS. QEMU: `M4_STORE` PASS (640522a `ck_gates`) | Real device, real keys | +| Anti-rollback anchors | MISSING_IMPLEMENTATION | Anchor in its own region, host and QEMU (`M4_STORE`); the kernel opens it at every boot | TPM NV anchor (Gate 6); rolling back Store and anchor regions together still mounts | +| Migration authorization | BLOCKED_OPERATOR | `m5_migration_sig_test_key` PASS (host, TEST keys) | Real owner signature from Gate 3 | +| Production/test identity separation | MISSING_IMPLEMENTATION for production | The hardware-staging build refuses TEST identity keys before any disk access (`store_boot.c`, CK_SB_E_TEST_KEYS); host tests for the mechanism; QEMU with TEST class only | A production boot path that enforces it | +| Deterministic recovery | MISSING_IMPLEMENTATION (Machine 1) | Newer than the older row text: the kernel-path Store crash campaign now exists and passed in QEMU, `M4_STORE_CRASH` PASS (640522a `ck_gates`, `scripts/qemu_ck_store_crash_test.sh`, 709 s). The older sentence "no crash campaign in the kernel path" is superseded. The C Recovery Core has a QEMU gate, `M4_RECOVERY` PASS with a TEST-only operator key (the prose in `native/kernel/GATES.md` rows 88 to 91p still says NOT_RUN: documentation lag, INFERRED from the receipt row and `qemu_ck_recovery_test.sh`) | A Machine 1 run | +| Owner-signed trust chain on Machine 1 | BLOCKED_OPERATOR | none | Gates 0 to 7 | +| Production Store on 512-byte geometry | MISSING_IMPLEMENTATION | C engine and driver host and QEMU; partition-aware layout `DISK_LAYOUT` PASS in QEMU (640522a `ck_gates`, 512 B and 4096 B) | Real-device run on the Machine 1 SSD; DISK_LAYOUT on hardware is NOT_RUN | + +### Signed boot manifests, A/B, rollback, recovery, production Store wiring: exactly what exists + +| Piece | Code that exists | What is missing | Gate that covers it | +|---|---|---|---| +| Signed boot manifest | None. The Rust loader has no manifest, the C stub "loads nothing and checks nothing" (`native/boot/efi_main.c`, `native/boot/README.md`, `docs/BOOT_HANDOFF_CONTRACT.md` section 1). Firmware Secure Boot signature checks on the single PE are tested | Manifest format, loader verification, owner signature chain. No spec fixes a manifest format (searched `docs/` and aien-architecture: only the plan's gate text names it) | `t1_gate4_manifest_ab` NOT_RUN (MISSING_IMPLEMENTATION); closest covered item: `qemu_secureboot_signing` (signature on the image, not a manifest) | +| A/B slot selection | None. Operator decision Q3 (ADR 0024) froze the Rust loader and says no slots will be added to it. The C path replaces slots with firmware one-time BootNext (`docs/BOOT_HANDOFF_CONTRACT.md` section 7) | Everything slot-related. Conflict to decide: Gate 9 acceptance text in `docs/TRUST-1-IMPLEMENTATION-PLAN.md` asks for "AIENOS A/B discipline", Q3 says no A/B in this loader | none (same row) | +| One-time boot and rollback to the default | Rust: BootNext one-time candidate with return to the default entry, QEMU script `scripts/qemu_native_rollback_test.sh` (ROADMAP records `M0_NATIVE_ROLLBACK_QEMU: PASS`; not rerun in this refresh, rerun queued). C: `CK_HARDWARE_STAGING` image plus `scripts/stage_one_time_boot_ck.sh --dry-run` (from #256) | C rollback rows 42 to 46 (`M0_ROLLBACK` in `ck_gates.sh`) report NOT_RUN: MISSING_IMPLEMENTATION. The spec exists, `docs/BOOT_HANDOFF_CONTRACT.md` section 7.1: rows 42, 45, 46 need script changes only, rows 43 and 44 also need two TEST-only kernel build flags (bad magic, hang) | `M0_ROLLBACK` NOT_RUN. Physical `M0_NATIVE_ROLLBACK_MACHINE1` BLOCKED | +| Recovery | Recovery media build and tools (`t1_recovery_tools` PASS host). Rust and C Recovery Core, TEST-only operator key, QEMU PASS for the C one (`M4_RECOVERY`) | Real operator key and attended stick boot with Secure Boot ON (Gate 1 steps) | `t1_recovery_tools`, `M4_RECOVERY`, Gate 1 attended | +| Production Store wiring | C kernel opens the sealed Store at boot, TEST keys, SMMU-confined NVMe DMA, partition-aware layout, crash campaign, ARGUS-1 revoke, ALLEN genesis and restore, all in QEMU (640522a `ck_gates`: M4_NVME, M4_STORE, M4_STORE_CRASH, M4_CONTINUITY, M4_ALLEN, DISK_LAYOUT, ARGUS1_REVOKE PASS) | Production K_vol source (BLOCKED_OPERATOR seam), real TPM seal, real device run, Gate 3 owner keys | `ck_store_kernel_qemu`, `ck_argus1_revoke_qemu`, `m5_store_kernel_binding` (MISSING_IMPLEMENTATION), `m5_production_store_512b` (MISSING_IMPLEMENTATION) | + +Decision on a software prerequisite: none was implemented in this refresh. The only +candidate with an existing spec is the C port of rollback rows 42 to 46 (section 7.1 above). +It spans a script change plus two new kernel TEST build flags and a labelled second mode, +and the document that specifies it still marks every part PROPOSED. It is better done as its +own cut with its own review than folded into a matrix refresh. Cut list for whoever takes it: +(1) row 42, 45, 46 by pointing `candidate.efi` at the normal C image and grepping +`report_kind: final`; (2) row 43 with a TEST-only bad-magic flag refused by +`CK_HARDWARE_STAGING` (the existing `CK_TEST_STALE_HANDOFF=2` flag passes an old magic, so +check whether it is enough before adding a new flag); (3) row 44 with a TEST-only hang flag. + +### ALLEN native continuity (not a TRUST-1 or M5 row; recorded because #260 touched the same kernel) + +Every claim in #260 maps to a check in `scripts/qemu_ck_allen_test.sh`: + +| #260 claim | Check | Evidence | +|---|---|---| +| Genesis is atomic inside the provisioning Store transaction | host `test_continuity_subject_provision`: power cut at 9 checkpoints and every block boundary gives unprovisioned or identity plus one genesis, 0 other, and the split-transaction mutant is caught; QEMU `FI.1` to `FI.9`: SIGKILL at all 9 Store checkpoints, then a cold boot finds old or new state, never identity without subject | Host rerun in this refresh (OBSERVED): `test_continuity_subject_provision: PASS (764 checks)`, mutant `CS_MUTANT_PROVISION_SPLIT_TXN caught (83 checks failed)`, logs in `~/workspace/overnight-1005/reports/L4-TRUST-evidence/host-allen-*-9d41efc.log`. QEMU: receipt `evidence/allen_native_m4_allen_f50447aa35e01c30deaf5508bc88e5fa3e011ae49d34fd2010f6eefe280a35bb.log` PASS lines FI.1 to FI.9 | +| Exactly-once provisioning | `G8`: provisioning a provisioned image is refused (`AlreadyProvisioned`), no genesis, image unchanged; `FI.1b` re-provision after an uncommitted attempt works | same log | +| Cold restore never mints | `G9` (two new QEMU processes, no `ALLEN: GENESIS` line, still 1 genesis and 2 subject objects, head object byte-identical); `G11c` identity without subject reports `ALLEN: ABSENT` on two boots and the host reader still finds 0 subject objects | same log | +| Cold restore is read-only | `G9` shows no new subject object and an identical head object. It does not compare a whole-image hash, because a restore legitimately advances the incarnation. The strict "image unchanged" check is applied to the refusal cases `G8`, `G11a`, `G11b`, `G12a`, `G12b`. So "read-only" holds for the subject, and is INFERRED, not asserted byte for byte, for the whole disk | same log | +| Foreign-state refusal | `G12a` another installation's chain beside ours and `G12b` on a subjectless identity: `ALLEN: CORRUPT (subject object belongs to another agent)`, nothing restored, nothing minted, image unchanged | same log | +| Corruption refusal | `G11a` forked chain (2 boots), `G11b` flipped envelope byte: refused, image unchanged | same log | +| No re-provisioning on restore | `G10` restore plan is only `AIENCONT v1 mode=6`; a second image restores its own subject, not the first image's | same log | +| QEMU mutants `subject_restore_mints` and `subject_accept_foreign` are KILLED | the script supports `--mutant`; `GATES.md` A16-A20 name which checks kill them | UNVERIFIED in recorded evidence: the receipt and the gate log contain no mutant run. Both runs are queued (below) | + +Receipt binding: both ALLEN receipts name `640522a`, whose code equals 9d41efc (see Binding above). Limits stated by #260 and +kept: QEMU only, no physical cold reboot or NVMe, native genesis exists only in the TEST +continuity image (the default image does not provision an identity; operator decision, not +changed here), ADR 0018 stays PROPOSED. + +### Owed after this refresh (queued through the shared heavy queue, NOT_RUN when this was written) + +- `trust1_m5_qualify.sh --with-qemu` on a pristine 9d41efc worktree (lane `L4-TRUST-qualify`): the missing receipt at current main. +- `qemu_ck_allen_test.sh` plain (`L4-TRUST-allen`) and the two mutants (`L4-TRUST-allen-mut1`, `-mut2`): ALLEN rerun at 9d41efc and the mutant evidence. +- `GATE4_SOAK_RUNS=5 qemu_security_suite.sh` (`L4-TRUST-gate4`): Gate 4 under the stricter tamper check. +- `qemu_native_rollback_test.sh` (`L4-TRUST-rollback`): current Rust BootNext rollback result. + +--- + ## TRUST-1 gates | Gate | Criterion (short) | Implementation on main | Evidence on main | Testable by agents now | Hardware needed | Operator needed | Verdict | Remaining blocker | diff --git a/docs/TRUST-1-OPERATOR-STEPS.md b/docs/TRUST-1-OPERATOR-STEPS.md index e94bc445..e61d1d16 100644 --- a/docs/TRUST-1-OPERATOR-STEPS.md +++ b/docs/TRUST-1-OPERATOR-STEPS.md @@ -294,6 +294,308 @@ live): manifest, the record) goes back to the Spark. The `private` folder stays on the ceremony machine and the two backups. +## Gate 2 attended run (written 2026-10-05, aienos main 9d41efc) + +Companion to `docs/TRUST-1-GATE2-EXPERIMENTS.md` (the why and the expected effects) and to +Steps 1, 2 and 7 above (the baseline, already done on 2026-10-03). This is the exact +runbook for the next three sittings: Experiment 1, Experiment 2 and Experiment 4, the three +that need no extra hardware. Experiments 3 (USB stick) and 5 (boot order) wait for their own +written steps and are not part of this run. + +**Where we are.** On 2026-10-03 four boots were captured with Secure Boot OFF +(`evidence/trust1_gate2_baseline_2026-10-03/`). Two cold boots were identical on all 35 +items [OBSERVED]. One warm restart (`sudo reboot`) differed in PCR1 and PCR10 [OBSERVED]. +A "PCR" is one numbered logbook slot in the TPM chip that records what started up. +Nothing has been decided about which slots a security policy may use, and this page does not +decide it. + +What this run does and does not change: it never changes firmware settings, Secure Boot, +keys or the TPM. It only restarts the machine, reads measurements, and (Experiment 2) turns +one Ubuntu timer on and off. Experiment 4 opens the firmware setup screen and leaves +without saving. The Spark stays in its current Secure Boot OFF state for the whole run. +Results therefore describe Secure Boot OFF only (see "What would decide the TPM policy"). + +### Before the first sitting (once, about 5 minutes) + +Type each command in a terminal window on the Spark, logged in as yourself. None of them +changes anything. + +1. Go to the repository copy and look at it. Do NOT run `git pull` here: this copy sits on a + work branch, and a pull would move it. + + ```bash + cd ~/workspace/aienos-recovery-gate + sha256sum scripts/tpm_measurement_campaign.sh + ``` + + *You should see:* `aac103774858f2d4ff1c302883f7784f3948d50b640faa20e2b2c870c3824529` + followed by the file name. That is the same script as on `main`. A different number: + stop and tell the orchestrator. + +2. Check the machine is in the state the baseline had: + + ```bash + mokutil --sb-state + systemctl is-enabled fwupd-refresh.timer + id -nG | tr ' ' '\n' | grep -x tss + command -v tpm2_pcrread tpm2_eventlog + ``` + + *You should see:* `SecureBoot disabled`, `disabled`, `tss`, then two tool paths. Anything + else (especially `SecureBoot enabled`): stop and tell the orchestrator; the campaign state + has changed. + +3. Make sure the evidence folder exists and show what is already in it: + + ```bash + mkdir -p ~/trust1-evidence + ls ~/trust1-evidence + ``` + + *You should see:* the four baseline folders (`boot0-before` to `boot3-after`) and some + files. The capture tool refuses to overwrite a folder, so every folder name below is new + (they start with `g2-`). + +**Evidence destination:** `~/trust1-evidence/` on the Spark, one folder per capture. When a +sitting ends, tell the orchestrator the folder names and paste the `compare` lines. The +orchestrator copies the folders into the repository under +`evidence/trust1_gate2_experiments_<date>/` in a pull request. You do not commit anything. + +**Stop rules for every sitting.** Stop, do not retry, do not improvise, and send the +orchestrator the last command and everything it printed, if any of these happens: + +- a command prints `FAIL`, `Error`, or something other than "What you should see"; +- Ubuntu does not start normally after a restart, or the encrypted private storage or the + vault does not unlock afterwards (a plain power-off, a 30 second wait and the power + button once is allowed; nothing else); +- any PCR other than 1 and 10 changes where the sitting says only those may move, + and in particular **any change in PCR 7**: three Ubuntu credentials are sealed to PCR 7 + alone (`evidence/trust1_gate0_addendum_v1.json`), so a moved PCR 7 means they may refuse + to unseal; +- a firmware update appears to have been installed; +- a rollback `compare` still shows a PCR different from the "before" capture. That is the + plan's UnexpectedState case: no PCR policy is chosen and the orchestrator writes it up. + +`compare` ends with `compared=35 changed=N`. It exits with code 3 whenever something +differs. That is normal and is not an error. + +### Sitting 1. Experiment 1: is the warm-restart value stable? + +Question: the warm restart changed PCR1 and PCR10 once. Is the warm value always the same? +This resolves the one [UNKNOWN] of the baseline. The one change to the machine: none. This +sitting restarts it warm twice and cold once. Four boots. + +1. Start from a cold boot so the reference is cold by construction. Save your work, then: + + ```bash + sudo poweroff + ``` + + Wait 30 seconds, press the power button, wait for Ubuntu to start and log in. + +2. Reference capture (a cold boot, nothing changed yet): + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/g2-exp1-before g2-exp1-before + ``` + + *You should see:* a short summary ending without `FAIL`. *Changes:* nothing on the + machine; it only writes the new folder. + +3. First warm restart. Do not touch the keyboard during startup: + + ```bash + sudo reboot + ``` + + After Ubuntu is back: + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/g2-exp1-warmA g2-exp1-warmA + ``` + +4. Second warm restart, same way: + + ```bash + sudo reboot + ``` + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/g2-exp1-warmB g2-exp1-warmB + ``` + +5. Back to a cold boot (this is the rollback). `sudo poweroff`, wait 30 seconds, power + button, then: + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/g2-exp1-rollback g2-exp1-rollback + ``` + +6. Compare (nothing here changes the machine): + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh compare ~/trust1-evidence/g2-exp1-warmA ~/trust1-evidence/g2-exp1-warmB + bash scripts/tpm_measurement_campaign.sh compare ~/trust1-evidence/g2-exp1-before ~/trust1-evidence/g2-exp1-warmA + bash scripts/tpm_measurement_campaign.sh compare ~/trust1-evidence/g2-exp1-before ~/trust1-evidence/g2-exp1-rollback + ``` + +*Expected observations (tags show how much is known):* + +- `before` vs `warmA`: PCR1, PCR10 and the event log differ, nothing else [OBSERVED once on + 2026-10-03, so a repeat is expected, not guaranteed]. +- `warmA` vs `warmB`: UNKNOWN, this is the question. Either answer is useful: `changed=0` + would mean the warm value is stable and PCR1 could get its own warm baseline; a difference + would mean PCR1 cannot be promised after a warm restart. +- `before` vs `rollback` (cold vs cold): all PCRs identical [OBSERVED on 2026-10-03, + `boot2` vs `boot3` changed=0]. The event log bytes may differ even when every PCR is the + same [OBSERVED once, `boot0` vs `boot3`]. + +*Stop conditions:* the common rules above; also any PCR other than 1 and 10 differing +between `before` and a warm capture. +*Rollback:* nothing was changed, so nothing to undo. Step 5 returns to a cold boot and its +`compare` against `g2-exp1-before` is the proof. + +### Sitting 2. Experiment 2: turn the firmware-update checker back on + +Question: does Ubuntu's background check for new firmware change any measurement? The one +change: `sudo systemctl enable --now fwupd-refresh.timer`, the undo of Step 2. *Changes:* +one Ubuntu setting; no firmware is touched. Three boots. Risk: if a firmware update were +actually installed during this window it would spoil the campaign; step 6 checks. + +1. Cold boot: `sudo poweroff`, wait 30 seconds, power button, log in. +2. Before capture: + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/g2-exp2-before g2-exp2-before + ``` + +3. The one change: + + ```bash + sudo systemctl enable --now fwupd-refresh.timer + ``` + + *You should see:* a line saying a link was created. + +4. Cold boot again: `sudo poweroff`, wait 30 seconds, power button, log in. Then: + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/g2-exp2-after g2-exp2-after + bash scripts/tpm_measurement_campaign.sh compare ~/trust1-evidence/g2-exp2-before ~/trust1-evidence/g2-exp2-after + ``` + +5. Undo and prove it: + + ```bash + sudo systemctl disable --now fwupd-refresh.timer + ``` + + Cold boot (`sudo poweroff`, 30 seconds, power button), log in, then: + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/g2-exp2-rollback g2-exp2-rollback + bash scripts/tpm_measurement_campaign.sh compare ~/trust1-evidence/g2-exp2-before ~/trust1-evidence/g2-exp2-rollback + ``` + +6. Firmware-update check, if the tool is installed (UNVERIFIED that it is): + + ```bash + command -v fwupdmgr && fwupdmgr get-history + ``` + + *You should see:* no update recorded for the last few days. A recorded update: stop and + tell the orchestrator. + +*Expected observations:* `before` vs `after`: only the `fwupd_refresh_timer` item flips from +disabled to enabled; every PCR identical [expected from the `boot0` vs `boot3` result, where +that timer was the only non-event-log difference and all PCRs matched; OBSERVED]. `before` vs +`rollback`: `changed=0` on every PCR. +*Stop conditions:* any PCR differs; a firmware update shows in step 6. +*Rollback:* step 5 (`disable --now`), plus the proving capture. + +### Sitting 3. Experiment 4: visit the firmware setup screen and leave without saving + +Question: does only entering the firmware setup screen change a measurement? The one +change: entering the setup screen at startup and exiting with "discard changes" or "exit +without saving". Three boots. **This is the only sitting where you touch the firmware +screen. Change nothing there. Do not open any Secure Boot, key or TPM menu.** + +1. Cold boot, log in, then before capture: + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/g2-exp4-before g2-exp4-before + ``` + +2. `sudo poweroff`, wait 30 seconds, press the power button, and press the setup key shown + on the startup screen (typically Delete or F2; UNVERIFIED for this machine, read what + the screen says). Look. Change NOTHING. Choose exit without saving. If you are unsure + whether you changed something, power the machine off, do not boot, and tell the + orchestrator. +3. After Ubuntu starts and you log in: + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/g2-exp4-after g2-exp4-after + bash scripts/tpm_measurement_campaign.sh compare ~/trust1-evidence/g2-exp4-before ~/trust1-evidence/g2-exp4-after + ``` + +4. Rollback proof (nothing was changed, so this only proves it): `sudo poweroff`, 30 + seconds, power button, log in, then: + + ```bash + cd ~/workspace/aienos-recovery-gate + bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/g2-exp4-rollback g2-exp4-rollback + bash scripts/tpm_measurement_campaign.sh compare ~/trust1-evidence/g2-exp4-before ~/trust1-evidence/g2-exp4-rollback + ``` + +*Expected observations:* UNKNOWN. Some firmware measures its configuration into PCR1 after a +setup visit, so PCR1 is the one to watch; no change is also a normal answer [guess, +confidence low, to be checked against the result]. `before` vs `rollback`: `changed=0` on +every PCR. +*Stop conditions:* the common rules; PCR 7 moves; the screen shows anything about +Secure Boot keys being modified. +*Rollback:* nothing was changed; Step 4 is the proof. If a setting was changed by mistake, +restore it by hand to what it was and tell the orchestrator before the next boot. + +### What would decide the TPM policy (and why this run does not) + +This run does not choose, and must not be read as choosing, any PCR for a policy. Missing +experiment evidence, in the order it is needed: + +1. **Secure Boot ON baseline.** Every capture so far is Secure Boot OFF. PCR 7 holds the + Secure Boot state, so its OFF value is not the value a Secure-Boot-ON policy would see. + The deciding experiment is at least three cold boots with Secure Boot ON and nothing else + changed (the plan's Gate 0 and Gate 2 precondition). Turning Secure Boot ON changes PCR 7 + and may stop three Ubuntu credentials from unsealing, so it is a firmware-policy change + that needs its own written approval, a tested fallback and the recovery stick first. It + is NOT part of this run and no agent may do it. +2. **Warm-restart stability** (Experiment 1 above) decides whether PCR1 may be in a policy + at all. +3. **One-variable experiments with Secure Boot ON** from the plan's Q15 list (kernel, init + image, boot order, db addition, owner certificate addition, loader version, loader + rehash, signer rotation, recovery boot, tampered image). A PCR becomes a candidate only if + it is identical across the cold boots, moves under a security-relevant change, and does + not move under harmless ones. This acceptance rule is PROPOSED here; the plan's own text + is "no PCR selected by convention" and gives no numeric line (see the + `docs/TRUST-1-GATE2-EXPERIMENTS.md` proposal). + +Facts that already bound the choice [OBSERVED in the baseline]: PCR 11 is all zero on this +machine, so the placeholder PCR 11 in the Gate 5 simulation has nothing to measure today; +PCR 0, 2, 3, 4, 5 and 7 were identical in all four boots; PCR 1 and PCR 10 moved on the one +warm restart. Which of these mean something for security is exactly what is not yet +explained. + +--- + ## Known hardware risk: do not boot the C kernel on a disk that holds data **Do not boot the C kernel on a disk holding data until CK gate `DISK_LAYOUT` @@ -323,6 +625,12 @@ Source: `~/handoffs/2026-10-01-review/track4-aienos-trust.md`, row R2. This entry is documentation only. It was not tested, and no hardware result is claimed. Host, QEMU and hardware status of the fix: all NOT_RUN. +Update 2026-10-05: the CK gate `DISK_LAYOUT` is now PASS in a QEMU-only receipt +(`evidence/ck_gates_1ecf5bcd303bf88422dd0542f14851c931f5d52276838fa182c812f3c73f3c1b.json`, +commit 640522a, code identical to 9d41efc), so the "NOT_RUN" wording above is out of date for +QEMU. Nothing changes for hardware: it is still NOT_RUN on a real disk, and no step in this +document boots the C kernel on Machine 1. + ## Later gates (no action from you yet) - **Gate 4** (agents): sign the loader with your Boot Signer in the emulator