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

branch main Branches Tags History

aienux / evidence / recovery_core_qemu_2026-09-25.md

78 lines · 4443 bytes Raw Blame History Rendered
1# Recovery Core over Store v1 and continuity: QEMU qualification (2026-09-25)
2
3Code commit `e5b44d8ff5692f74fe191ab07f48fd21511ff82f` (clean tree), branch
4`feat/recovery-core` (main `39e246a` + the operator-auth HMAC fix).
5Design: ADR 0006 (Recovery Core), ADR 0007 (provisioning once), ADR 0016
6(continuity, Proposed). QEMU only, 4096-byte LBA, native NVMe driver.
7
8Reproduce: `./scripts/qemu_recovery_test.sh`
9
10**Operator credential: TEST-ONLY.** The operator key is a public constant in
11this tree and every boot prints `RECOVERY_OPERATOR_KEY: TEST-ONLY`. How the
12real operator key is derived (Argon2id passphrase, FIDO/hardware key, ...) is
13not decided (ADR 0006 / M5, operator decision). The verification primitive is
14real: `HMAC-SHA256(key, "AIENOS-RECOVERY-OPERATOR-AUTH-v1\0" || challenge)`
15compared 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
29The first run (commit `fe2c2bd`) failed step 3: corrupting the agent root of a
30store provisioned at generation 2 made the Store mount `DegradedRecovery` on
31generation 1 (genesis, no identity), continuity reported `Unprovisioned`, and
32the Recovery Core offered `provision-identity`. A valid operator response
33would have minted a replacement identity after identity loss. Fixed in
34`e5b44d8` (fail toward preservation): a degraded mount is never
35unprovisioned; repair only a malformed peer while the valid root still
36resolves the identity; never discard a CRC-valid newer root in-band;
37continuity objects without an agent root are `Corrupt`. The host regression
38test uses a response that is genuinely valid for the state and fails on the
39previous code.
40
41## Result
42
43```text
44=== 1. Degraded store: operator-authorised repair ===
45PASS inspection enters the Recovery Core (Degraded(Malformed)), shows the same agent, writes nothing
46PASS repair with zero response refused, nothing written
47PASS repair with wrong_key response refused, nothing written
48PASS repair with wrong_action response refused, nothing written
49PASS authorised repair done
50PASS after repair a cold boot resumes writable with the same agent and memory
51PASS replaying the repair authorisation on the healthy store does nothing
52=== 2. Unprovisioned store: operator-authorised provisioning ===
53PASS unprovisioned store enters the Recovery Core and offers only provisioning
54PASS provisioning with a wrong key refused, nothing written
55PASS operator provisioning created one identity and a cold boot resumes it
56=== 3. Identity loss: nothing may mint ===
57PASS corrupted agent root: Recovery Core entered, no action offered, nothing written (Degraded(GraphBadNewer))
58PASS mode 10 after identity loss refused, nothing written
59PASS mode 11 after identity loss refused, nothing written
60PASS a normal boot after identity loss does not resume or mint (2c0752ceed5e81cd... is not replaced)
61
62=== Summary (commit e5b44d8ff5692f74fe191ab07f48fd21511ff82f) ===
63RECOVERY_CORE_QEMU: PASS
64RECOVERY_CORE_OPERATOR_CREDENTIAL: TEST-ONLY (real scheme undecided, ADR 0006 / M5)
65```
66
67Host tests: `cargo test -p aienos-kernel --lib recovery_core` (8) and
68`recovery` (operator-auth HMAC, RFC 4231 primitive vector, known answer,
69bit-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).