aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / evidence / recovery_core_qemu_2026-09-25.md
| 1 | # Recovery Core over Store v1 and continuity: QEMU qualification (2026-09-25) |
| 2 | |
| 3 | Code commit `e5b44d8ff5692f74fe191ab07f48fd21511ff82f` (clean tree), branch |
| 4 | `feat/recovery-core` (main `39e246a` + the operator-auth HMAC fix). |
| 5 | Design: ADR 0006 (Recovery Core), ADR 0007 (provisioning once), ADR 0016 |
| 6 | (continuity, Proposed). QEMU only, 4096-byte LBA, native NVMe driver. |
| 7 | |
| 8 | Reproduce: `./scripts/qemu_recovery_test.sh` |
| 9 | |
| 10 | **Operator credential: TEST-ONLY.** The operator key is a public constant in |
| 11 | this tree and every boot prints `RECOVERY_OPERATOR_KEY: TEST-ONLY`. How the |
| 12 | real operator key is derived (Argon2id passphrase, FIDO/hardware key, ...) is |
| 13 | not decided (ADR 0006 / M5, operator decision). The verification primitive is |
| 14 | real: `HMAC-SHA256(key, "AIENOS-RECOVERY-OPERATOR-AUTH-v1\0" || challenge)` |
| 15 | compared in constant time. |
| 16 | |
| 17 | ## What is proven |
| 18 | |
| 19 | | Claim | Step | |
| 20 | |---|---| |
| 21 | | Entry and inspection are deterministic and read-only: the raw system record (both superblock slots, mount state, peer condition, catalog counts, agent) is printed and the image is byte-identical after the boot | 1, 2, 3 | |
| 22 | | A challenge binds Store UUID, generation, action and a digest of both raw superblock units; zero, wrong-key and wrong-challenge responses are refused with no write | 1, 2 | |
| 23 | | An authorised repair of a malformed peer restores a writable store; a cold boot resumes the same agent with the same memory; replaying the authorisation on the repaired store does nothing | 1 | |
| 24 | | Operator provisioning on a healthy, unprovisioned store creates exactly one identity, which a cold boot resumes | 2 | |
| 25 | | After identity loss (corrupted agent root) no action is offered, both actions are refused, and a normal boot neither resumes nor mints | 3 | |
| 26 | |
| 27 | ## Finding fixed during qualification |
| 28 | |
| 29 | The first run (commit `fe2c2bd`) failed step 3: corrupting the agent root of a |
| 30 | store provisioned at generation 2 made the Store mount `DegradedRecovery` on |
| 31 | generation 1 (genesis, no identity), continuity reported `Unprovisioned`, and |
| 32 | the Recovery Core offered `provision-identity`. A valid operator response |
| 33 | would have minted a replacement identity after identity loss. Fixed in |
| 34 | `e5b44d8` (fail toward preservation): a degraded mount is never |
| 35 | unprovisioned; repair only a malformed peer while the valid root still |
| 36 | resolves the identity; never discard a CRC-valid newer root in-band; |
| 37 | continuity objects without an agent root are `Corrupt`. The host regression |
| 38 | test uses a response that is genuinely valid for the state and fails on the |
| 39 | previous code. |
| 40 | |
| 41 | ## Result |
| 42 | |
| 43 | ```text |
| 44 | === 1. Degraded store: operator-authorised repair === |
| 45 | PASS inspection enters the Recovery Core (Degraded(Malformed)), shows the same agent, writes nothing |
| 46 | PASS repair with zero response refused, nothing written |
| 47 | PASS repair with wrong_key response refused, nothing written |
| 48 | PASS repair with wrong_action response refused, nothing written |
| 49 | PASS authorised repair done |
| 50 | PASS after repair a cold boot resumes writable with the same agent and memory |
| 51 | PASS replaying the repair authorisation on the healthy store does nothing |
| 52 | === 2. Unprovisioned store: operator-authorised provisioning === |
| 53 | PASS unprovisioned store enters the Recovery Core and offers only provisioning |
| 54 | PASS provisioning with a wrong key refused, nothing written |
| 55 | PASS operator provisioning created one identity and a cold boot resumes it |
| 56 | === 3. Identity loss: nothing may mint === |
| 57 | PASS corrupted agent root: Recovery Core entered, no action offered, nothing written (Degraded(GraphBadNewer)) |
| 58 | PASS mode 10 after identity loss refused, nothing written |
| 59 | PASS mode 11 after identity loss refused, nothing written |
| 60 | PASS a normal boot after identity loss does not resume or mint (2c0752ceed5e81cd... is not replaced) |
| 61 | |
| 62 | === Summary (commit e5b44d8ff5692f74fe191ab07f48fd21511ff82f) === |
| 63 | RECOVERY_CORE_QEMU: PASS |
| 64 | RECOVERY_CORE_OPERATOR_CREDENTIAL: TEST-ONLY (real scheme undecided, ADR 0006 / M5) |
| 65 | ``` |
| 66 | |
| 67 | Host tests: `cargo test -p aienos-kernel --lib recovery_core` (8) and |
| 68 | `recovery` (operator-auth HMAC, RFC 4231 primitive vector, known answer, |
| 69 | bit-flip and legacy-construction rejection). |
| 70 | |
| 71 | ## Not claimed |
| 72 | |
| 73 | - A real operator credential, Machine 1 behaviour, TRUST-1, M5 encryption. |
| 74 | - Rolling back to an older root when the newer one is graph-broken: refused |
| 75 | in-band on purpose; it discards committed state and is an out-of-band |
| 76 | operator decision. |
| 77 | - A/B boot-slot rollback and crash records on hardware (ADR 0006 items |
| 78 | outside the Store). |