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

closed derived 8f9420b1bcac42fc #239

Imported from GitHub aien-dev/aienux#239 (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 f096c93c804fdc842084f3d9a590d62a864c1c7c · Head aef0b63ce8d10458fd10be6e46ec4e458c326c2e

Apply it

git checkout -b patch-8f9420b1bcac42fc f096c93c804fdc842084f3d9a590d62a864c1c7c
curl -fsSL https://interplane.io/drakestapleton/aienux/patches/8f9420b1bcac42fc.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
239
aef0b63ce8d10458fd10be6e46ec4e458c326c2e
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":239,"url":"https://github.com/aien-dev/aienux/pull/239","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:02Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/native/kernel/CONTINUITY_RECOVERY_CONTRACT.md b/native/kernel/CONTINUITY_RECOVERY_CONTRACT.md
index 666eb533..ed9b596a 100644
--- a/native/kernel/CONTINUITY_RECOVERY_CONTRACT.md
+++ b/native/kernel/CONTINUITY_RECOVERY_CONTRACT.md
@@ -1,19 +1,25 @@
 # C kernel contract: continuity objects and Recovery Core
 
-Status: **IMPLEMENTED (host PASS), QEMU NOT_RUN, hardware NOT_RUN** for the continuity half (M4_CONTINUITY).
-**Recovery Core (M4_RECOVERY) is NOT implemented beyond the challenge, state digest and operator HMAC of cut 3**:
-no inspection, no repair, no operator provisioning action (cut 5). What has C code (all **host PASS**, QEMU n/a,
-nothing wired into the kernel): the codec (cuts 1-2: `svc/continuity_codec.c`, golden vectors, C/Rust decode
-agreement), boot **resolution** (cut 3: `svc/continuity_resolve.c`: P-3 lookup, INV-5 orphan/Conflict, INV-6 chain,
-INV-7 references, read-only check), the Recovery Core challenge, state digest and operator HMAC (same file), the
-sealed-Store binding `svc/continuity_resolve_sealed.c`, and, new in cut 4, **provision, commit and resume**
-(`svc/continuity_commit.c`: INV-4, INV-8 to INV-11, K-1, markers of section 3), run by
-`make -C native/kernel test`, `sanitize` and `continuity-mutants` against the REAL sealed Store in a file, with
-power cuts at every Store and anchor checkpoint and at every block boundary, for commit AND for provisioning.
-Not done: Recovery Core inspection and actions (cut 5); wiring into the kernel and any QEMU run (the first wiring cut
-needs the K-7 test-mode mechanism and a kernel stage that calls these functions). Every QEMU row (81-87, 88-91)
-stays `NOT_RUN` until a forge receipt covers it. Host rows 87a-87d, 87f, 87g are HOST PASS (see GATES.md).
-QEMU qualifies nothing physical; nothing here says anything about Machine 1.
+Status: **IMPLEMENTED (host PASS), QEMU NOT_RUN, hardware NOT_RUN** for the continuity half (M4_CONTINUITY) and for the
+host half of the Recovery Core (M4_RECOVERY, cut 5). **M4_RECOVERY is NOT_RUN: there is no kernel wiring, no QEMU
+receipt and no hardware run.** What has C code (all **host PASS**, QEMU n/a, nothing wired into the kernel): the codec
+(cuts 1-2: `svc/continuity_codec.c`, golden vectors, C/Rust decode agreement), boot **resolution** (cut 3:
+`svc/continuity_resolve.c`: P-3 lookup, INV-5 orphan/Conflict, INV-6 chain, INV-7 references, read-only check), the
+Recovery Core challenge, state digest and operator HMAC (same file), the sealed-Store binding
+`svc/continuity_resolve_sealed.c`, **provision, commit and resume** (cut 4: `svc/continuity_commit.c`: INV-4, INV-8 to
+INV-11, K-1, markers of section 3), and, new in cut 5, the **Recovery Core** (`svc/continuity_recovery.c`: read-only
+inspection INV-13, entry reasons and `applicable()` INV-14/INV-15, the operator-authorised repair of a malformed peer
+INV-16/INV-17 and operator provisioning INV-16/INV-18, the C-only sealed-refusal entry reason of K-3/K-4, and the
+`RECOVERY_CORE`, `RECOVERY_CHALLENGE`, `RECOVERY_ACTION`, `RECOVERY_REFUSED` marker text), run by
+`make -C native/kernel test`, `sanitize` and `continuity-mutants` against the REAL sealed Store in a file (cut 4 also with
+power cuts at every Store and anchor checkpoint and at every block boundary, for commit AND for provisioning).
+Not done: wiring into the kernel and any QEMU run (the first wiring cut needs the K-7 test-mode mechanism, the
+`RECOVERY_OPERATOR_KEY: TEST-ONLY` handling and a kernel stage that calls these functions); the `RECOVERY_RECORD:` marker;
+the full K-3/K-4 tests (cut 5 proves only that a corrupted newest AgentRoot is a sealed refusal with no action; the
+newest-root-graph-broken case with a CRC-valid root is not built separately); power cuts during a repair or a
+recovery-core provisioning (cut 4 cut the underlying provisioning, a repair is one unit write plus a flush). Every QEMU
+row (81-87, 88-91) stays `NOT_RUN` until a forge receipt covers it. Host rows 87a-87d, 87f, 87g and 91d-91k are HOST PASS
+(see GATES.md). QEMU qualifies nothing physical; nothing here says anything about Machine 1.
 
 Authority:
 
@@ -305,7 +311,7 @@ PROPOSED: the C kernel prints these exact strings (same field order, same
 Debug spellings such as `Degraded(Malformed)`), so the C gate scripts can use
 the Rust scripts' grep patterns and the rows can be IDENTICAL rather than
 DIFFERS.
-**CONTINUITY markers IMPLEMENTED, host PASS (cut 4):** `cr_marker_view` (`PROVISIONED`, `RESUMED`, `RESUMED_READONLY`, `REMEMBERED`, `COMMITTED`) and `cr_marker_outcome` (`UNPROVISIONED`, `CONFLICT`, `CORRUPT (why)`, `NO_ENTROPY`, `STOP (...)`) in `svc/continuity_commit.c` produce the strings above byte for byte (test compares with an independently printf-built line, incl. the 8-byte `memory=` and `e3b0c44298fc1c14` for no records). Only the Store-error spelling differs (9.2). The `CHECKPOINT:`, `RECOVERY_*` markers are not implemented (no wiring; cut 5).
+**CONTINUITY markers IMPLEMENTED, host PASS (cut 4):** `cr_marker_view` (`PROVISIONED`, `RESUMED`, `RESUMED_READONLY`, `REMEMBERED`, `COMMITTED`) and `cr_marker_outcome` (`UNPROVISIONED`, `CONFLICT`, `CORRUPT (why)`, `NO_ENTROPY`, `STOP (...)`) in `svc/continuity_commit.c` produce the strings above byte for byte (test compares with an independently printf-built line, incl. the 8-byte `memory=` and `e3b0c44298fc1c14` for no records). Only the Store-error spelling differs (9.2). The `CHECKPOINT:` marker is not implemented (no wiring). **Recovery markers IMPLEMENTED, host PASS (cut 5):** `rc_marker_entry` (`RECOVERY_CORE: ENTERED reason=<text>` / `NOT_NEEDED`), `rc_marker_challenge`, `rc_marker_done`, `rc_marker_refused` in `svc/continuity_recovery.c`, with the Rust Debug spellings (`Degraded(Malformed)`, `Unprovisioned`, `ContinuityCorrupt("why")`); the C-only reason spells `SealedRefusal(<rc>)`, a mount error `StoreMount(<rc>)` (Rust prints the Debug of its own error), and `RECOVERY_REFUSED (Continuity(<outcome>))` names the cut 4 outcome. `RECOVERY_OPERATOR_KEY: TEST-ONLY` and `RECOVERY_RECORD:` are not implemented (the key is a parameter of the actions; the record belongs to the wiring cut).
 
 ---
 
@@ -434,15 +440,14 @@ main design point of this contract.
   AgentRoot's first unit (crates/aienos-store-tool/src/main.rs:177-201,
   qemu_recovery_test.sh:168). In the sealed Store that byte is ciphertext, so
   the C mount is expected to refuse at the keyed proof (`SS_E_ENVELOPE`) before
-  continuity runs. UNVERIFIED (confidence medium: from store_sealed.h:61 and
-  store_boot.h:5-11, not tested). PROPOSED: the C Recovery Core adds an entry
+  continuity runs. That expectation was UNVERIFIED (from store_sealed.h:61 and
+  store_boot.h:5-11) and turned out partly wrong. **Cut 5, DECIDED by running it (host PASS, `test_continuity_recovery` t_91g/t_91j, 4096 and 512 byte blocks):** flipping byte 20 of the first unit of the newest AgentRoot envelope makes `ss_open` refuse with `SS_E_ROLLBACK` (-303, `SealedRollback`), not `SS_E_ENVELOPE`: the damaged generation fails its sealed check and the anchor already holds that generation, so the refusal reads as a rollback. The Store does not mount, so no record, challenge or mount fields exist; the entry reason is the C-only `SealedRefusal(-303)` and `rc_applicable()` is none. A valid operator response cannot be formed (no challenge); forged responses for both actions return `NotApplicable` and the image stays byte for byte unchanged. PROPOSED (now implemented as above): the C Recovery Core adds an entry
   reason for a sealed refusal (keyed / rollback proof) that admits no action,
   and the identity-loss rows stay DIFFERS with that observable stated.
 - **K-4 GraphBadNewer.** When the newest root is graph-broken, Rust mounts
   degraded on the older generation (recovery_core_tests.rs:178-219). In the
   sealed Store the anchor holds the newer generation, so `ss_open` is expected to
-  refuse with `SS_E_ROLLBACK` (store_sealed.h:57). UNVERIFIED (confidence
-  medium). Either way no action may be applicable (INV-15).
+  refuse with `SS_E_ROLLBACK` (store_sealed.h:57). **Cut 5: CONFIRMED for a flipped byte of the newest AgentRoot (see K-3: `SS_E_ROLLBACK`, reason `SealedRefusal(-303)`, no action applicable); UNVERIFIED for other forms of newest-root graph damage (a CRC-valid but graph-broken root with a fresh anchor), which have no C test.** Either way no action may be applicable (INV-15).
 - **K-5 Degraded mount through ss_open. DECIDED by running it (cut 3, host PASS).** The question was whether
   `ss_open` returns 0 on a `DegradedRecovery` mount with a malformed peer (needed for INV-11 and repair).
   **Answer: yes.** `test_continuity_resolve.c` `t_degraded` (:716, printed at :751) commits two generations
@@ -629,15 +634,15 @@ M4_RECOVERY:
 
 | id | mutation | must turn FAIL |
 |---|---|---|
-| MR-1 | inspection writes (for example repairs on inspect) | 88, 90, 91, 91d |
+| MR-1 | inspection writes (for example repairs on inspect): `RC_MUTANT_INSPECT_WRITES`, IMPLEMENTED, killed (cut 5) | 88, 90, 91, 91d |
 | MR-2 | challenge omits `state_digest`: `CR_MUTANT_CHALLENGE_NO_DIGEST`, IMPLEMENTED, killed (cut 3) | 89b, 91k |
 | MR-3 | challenge omits the action byte: `CR_MUTANT_CHALLENGE_NO_ACTION`, IMPLEMENTED, killed (cut 3) | 88c, 91k |
 | MR-4 | response compare checks only 16 bytes (`CR_MUTANT_COMPARE_16`, IMPLEMENTED, killed, cut 3), or is not constant time (not mutated: timing is not observable on the host) | 91n (bit flips in bytes 16-31) |
-| MR-5 | `applicable()` treats a degraded mount with no identity as Unprovisioned (the fe2c2bd bug) | 91g, 91 |
-| MR-6 | repair zeroes the active slot | 89, 89a |
-| MR-7 | repair offered without a resolved identity | 91h |
+| MR-5 | `applicable()` treats a degraded mount with no identity as Unprovisioned (the fe2c2bd bug): `RC_MUTANT_DEGRADED_IS_UNPROVISIONED`, IMPLEMENTED, killed (cut 5) | 91g, 91 |
+| MR-6 | repair zeroes the active slot: `RC_MUTANT_REPAIR_ACTIVE`, IMPLEMENTED, killed (cut 5) | 89, 89a |
+| MR-7 | repair offered without a resolved identity: `RC_MUTANT_REPAIR_NO_IDENTITY`, IMPLEMENTED, killed (cut 5) | 91h |
 | MR-8 | operator auth uses bare SHA-256 (`CR_MUTANT_BARE_SHA256`) or omits the domain (`CR_MUTANT_NO_DOMAIN`): both IMPLEMENTED, killed (cut 3) | 91o, 91p |
-| MR-9 | operator provisioning writes source Qualification | 91f |
+| MR-9 | operator provisioning writes source Qualification: `RC_MUTANT_PROVISION_QUALIFICATION`, IMPLEMENTED, killed (cut 5) | 91f |
 
 Known oracle gap (CODE, not covered by any Rust test): no power-cut campaign
 runs on **provisioning** itself; only commits are cut
@@ -723,3 +728,23 @@ Where code and contract differ, the safer behaviour (refuse) was chosen. Host ev
 | marker text for a Store error | `STOP (<Debug of the Rust error>)` | `STOP (Store(<rc>))` with the C error number; `STOP (ReadOnly)`, `STOP (AlreadyProvisioned)`, `STOP (Limit("..."))`, `UNPROVISIONED`, `CONFLICT`, `CORRUPT (<why>)`, `NO_ENTROPY` match the Rust spelling | the QEMU rows for store-error cases will be DIFFERS |
 | crash campaign | 7 Store checkpoints (kill points) per commit; provisioning not cut | 9 (7 Store + 2 anchor) plus every block boundary, for commit AND provisioning; `after_inactive_superblock` gives the NEW state (Rust "either") | stronger; anchor points reopen at `SS_RB_PREPARED_ADVANCE` and show the new state, as 6.1 predicted |
 | agent id word order | four RNDR words stored little-endian, word 0 first | whatever `ck_rng_fill` writes (it is the C kernel's entropy interface, entropy.h:53) | UNVERIFIED on hardware: the byte order is the rng module's; the test checks the agent equals `ck_rng_fill` output, not the Rust word layout |
+
+### 9.3 Cut 5 (Recovery Core): C versus the Rust code, and what C does on purpose
+
+Where code and contract differ, the safer behaviour (refuse) was chosen. Host evidence:
+`tests/test_continuity_recovery.c` (real sealed Store in a file, 4096 and 512 byte blocks; one test per Rust
+recovery_core test row 91d-91k; rows 91l-91p are `test_continuity_resolve`, cut 3). Every inspection and every refused
+action is checked to leave the image byte for byte unchanged.
+
+| item | Rust | C (cut 5) | effect |
+|---|---|---|---|
+| entry reasons | `EntryReason` (recovery_core.rs:25-33) | same, plus C-only `RC_SEALED_REFUSAL` for a sealed mount refusal (`SS_E_*`, -301..-314); `ST_M_UNFORMATTED` is `StoreUnformatted`, any other `ST_M_*` is `StoreMount(rc)` | a sealed refusal admits no action (INV-15); the Store does not mount, so the record has no mount, challenge or catalog |
+| flipped byte of the newest AgentRoot (rows 91, 91g, 91j) | mounts degraded on the older generation (`Degraded(GraphBadNewer)`), or a mount error | `ss_open` refuses with `SS_E_ROLLBACK` (-303): entry reason `SealedRefusal(-303)`, no challenge, no action | identity-loss rows stay DIFFERS: the observable is a sealed refusal, not `Degraded(GraphBadNewer)` (K-3, K-4) |
+| catalog counts in the record | roots, manifests, other over the Store catalog | counts of verified application objects (sealed claims): roots, manifests, other; the Store's own envelope and transaction-record entries are not counted | `other` differs from Rust for the same history |
+| MR-5 killing test | 91g (a degraded mount whose valid root has no identity) | 91h (garbage in the inactive slot of a formatted store). In C row 91g never mounts (see above), so it cannot show a Degraded-without-identity mount | the mutant `RC_MUTANT_DEGRADED_IS_UNPROVISIONED` is killed by 91h; the 91g C test checks the refusal and that nothing is offered |
+| agent id in provisioning | the caller passes `agent_id` | the id is drawn from the kernel entropy interface inside `cr_provision` (cut 4: no fallback); `rc_provision_identity` takes the rng | the test checks the stored root (source Operator, Store uuid from the inspection, generation), not a pinned id |
+| provisioning without entropy | not reachable (caller supplies the id) | authorised, then `RC_CONTINUITY` with `CR_NO_ENTROPY`, nothing written (`RECOVERY_REFUSED (Continuity(NoEntropy))`) | C-only refusal, tested |
+| operator key | `TEST_ONLY_OPERATOR_KEY` in the boot crate | a parameter; this file holds no key and prints no `RECOVERY_OPERATOR_KEY: TEST-ONLY` | the key handling and its `CK_HARDWARE_STAGING` refusal belong to the wiring cut (section 4 PROPOSED) |
+| repair after a failed unit write | `RecoveryError::Io` | `RC_IO`; the repair writes the single inactive unit then flushes, no power cut test | UNVERIFIED for a cut during the repair write; the inactive slot is zero, malformed or half written either way and the active root is untouched |
+| inspection mount | `Store::open` borrows the device | `ss_open` into a caller-owned `ss_store`; it stays open after `rc_inspect` and an action reuses it for provisioning, with nothing written between the authorisation and the write | same ordering (inspect, applicable, verify, write) |
+| marker `RECOVERY_RECORD:` | printed on entry | not implemented | wiring cut |
diff --git a/native/kernel/GATES.md b/native/kernel/GATES.md
index 171822e5..6e76b9ed 100644
--- a/native/kernel/GATES.md
+++ b/native/kernel/GATES.md
@@ -370,36 +370,36 @@ QEMU PASS lines of `scripts/qemu_continuity_test.sh` (receipt `evidence/continui
 
 ## M4 recovery: scripts/qemu_recovery_test.sh -> CK `M4_RECOVERY`
 
-Contract: `native/kernel/CONTINUITY_RECOVERY_CONTRACT.md` (SPEC, NOT_RUN). Rows 88-91c are the QEMU PASS lines of
+Contract: `native/kernel/CONTINUITY_RECOVERY_CONTRACT.md` (host PASS for rows 91d-91k, QEMU NOT_RUN). Rows 88-91c are the QEMU PASS lines of
 `scripts/qemu_recovery_test.sh` (receipt `evidence/recovery_core_qemu_2026-09-25.md`), rows 91d-91k the host tests
 `cargo test -p aienos-kernel --lib recovery_core` (`crates/aienos-kernel/src/recovery_core_tests.rs`), rows
-91l-91p the operator-auth tests in `crates/aienos-kernel/src/recovery.rs`. No C Recovery Core exists, so every
-row is NOT_RUN. Operator key is TEST-ONLY in the oracle.
+91l-91p the operator-auth tests in `crates/aienos-kernel/src/recovery.rs`. The C Recovery Core (`svc/continuity_recovery.c`, cut 5) has host tests only (rows 91d-91k, and 91l-91p from cut 3), no kernel wiring and no QEMU run, so rows 88-91c and the M4_RECOVERY gate are NOT_RUN. Rows 91d-91k say HOST PASS, and the
+C-only rows are as stated. Operator key is TEST-ONLY in the oracle.
 
 | # | Rust check | CK gate | Status |
 | --- | --- | --- | --- |
-| 88 | inspection: `RECOVERY_OPERATOR_KEY: TEST-ONLY`, `RECOVERY_CORE: ENTERED reason=Degraded(Malformed)`, same agent in `RECOVERY_RECORD:`, image unchanged, repair challenge offered (script :94-103) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION: no Recovery Core (ADR 0006) in the C kernel) |
-| 88a | repair with zero response: `RECOVERY_REFUSED (Unauthorised)`, image unchanged (:105-117) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 88b | repair with wrong-key response: `RECOVERY_REFUSED (Unauthorised)`, image unchanged | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 88c | repair with a response to another challenge: `RECOVERY_REFUSED (Unauthorised)`, image unchanged | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 89 | authorised repair: `RECOVERY_ACTION: repair-degraded-peer DONE`, image changed (:119-125) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 89a | after repair a cold boot `CONTINUITY: RESUMED` writable, same agent and memory (:126-132) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 89b | replaying the repair response: `RECOVERY_REFUSED (NotApplicable)`, image unchanged (:133-138) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 90 | unprovisioned store: `ENTERED reason=Unprovisioned`, only the provision challenge, image unchanged (:141-149) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 90a | provisioning with a wrong key: `RECOVERY_REFUSED (Unauthorised)`, image unchanged (:150-155) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 90b | authorised provisioning: `RECOVERY_ACTION: provision-identity DONE agent=..`, a cold boot resumes that agent (:156-163) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 91 | corrupted agent root: `RECOVERY_CORE: ENTERED`, no `RECOVERY_CHALLENGE`, image unchanged (:166-174) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION; in the sealed C Store the flip is expected to be refused at the keyed proof instead, UNVERIFIED, contract K-3) |
-| 91a | mode 10 (repair) after identity loss with a forged response: refused, no action, image unchanged (:175-183) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 91b | mode 11 (provision) after identity loss with a forged response: refused, no action, image unchanged (:175-183) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 91c | normal boot after identity loss neither resumes nor mints, image unchanged (:184-189) | M4_RECOVERY | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 91d | host `inspection_never_writes_and_names_the_reason` (recovery_core_tests.rs:89) | M4_RECOVERY (host) | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 91e | host `degraded_repair_needs_the_operator_and_restores_a_writable_store` (:111) | M4_RECOVERY (host) | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 91f | host `provisioning_is_operator_only_and_only_on_an_unprovisioned_store` (:154) | M4_RECOVERY (host) | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 91g | host `identity_lost_in_the_newest_root_never_looks_unprovisioned` (:178) | M4_RECOVERY (host) | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 91h | host `malformed_peer_without_a_resolvable_identity_is_not_repaired` (:222) | M4_RECOVERY (host) | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 91i | host `orphaned_continuity_objects_are_corrupt_not_unprovisioned` (:236) | M4_RECOVERY (host) | HOST PASS for the resolve half (cut 3, `test_continuity_resolve` (`make -C native/kernel test`, real sealed Store in a file): orphan manifest, orphan agent state and orphan WAL are Corrupt `continuity objects without an agent root`; mutant MC-2 `CR_MUTANT_NO_ORPHAN_CHECK` killed); the Recovery Core entry reason is cut 5; gate NOT_RUN |
-| 91j | host `identity_loss_through_corruption_offers_no_action_that_mints` (:267) | M4_RECOVERY (host) | NOT_RUN (MISSING_IMPLEMENTATION) |
-| 91k | host `challenges_bind_state_and_action` (:300) | M4_RECOVERY (host) | HOST PASS for the primitive (cut 3, `test_continuity_resolve` (`make -C native/kernel test`, real sealed Store in a file): `cr_challenge` binds action, state digest, generation and uuid, a response for one action is refused on the other; mutants MR-2 and MR-3 killed); the system record that carries them is cut 5; gate NOT_RUN |
+| 88 | inspection: `RECOVERY_OPERATOR_KEY: TEST-ONLY`, `RECOVERY_CORE: ENTERED reason=Degraded(Malformed)`, same agent in `RECOVERY_RECORD:`, image unchanged, repair challenge offered (script :94-103) | M4_RECOVERY | NOT_RUN (host code and host tests exist since cut 5, rows 91d-91k; not wired into the kernel, no QEMU run) |
+| 88a | repair with zero response: `RECOVERY_REFUSED (Unauthorised)`, image unchanged (:105-117) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 88b | repair with wrong-key response: `RECOVERY_REFUSED (Unauthorised)`, image unchanged | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 88c | repair with a response to another challenge: `RECOVERY_REFUSED (Unauthorised)`, image unchanged | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 89 | authorised repair: `RECOVERY_ACTION: repair-degraded-peer DONE`, image changed (:119-125) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 89a | after repair a cold boot `CONTINUITY: RESUMED` writable, same agent and memory (:126-132) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 89b | replaying the repair response: `RECOVERY_REFUSED (NotApplicable)`, image unchanged (:133-138) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 90 | unprovisioned store: `ENTERED reason=Unprovisioned`, only the provision challenge, image unchanged (:141-149) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 90a | provisioning with a wrong key: `RECOVERY_REFUSED (Unauthorised)`, image unchanged (:150-155) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 90b | authorised provisioning: `RECOVERY_ACTION: provision-identity DONE agent=..`, a cold boot resumes that agent (:156-163) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 91 | corrupted agent root: `RECOVERY_CORE: ENTERED`, no `RECOVERY_CHALLENGE`, image unchanged (:166-174) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5; in the sealed C Store the flip is refused at mount with SS_E_ROLLBACK, host test, contract K-3) |
+| 91a | mode 10 (repair) after identity loss with a forged response: refused, no action, image unchanged (:175-183) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 91b | mode 11 (provision) after identity loss with a forged response: refused, no action, image unchanged (:175-183) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 91c | normal boot after identity loss neither resumes nor mints, image unchanged (:184-189) | M4_RECOVERY | NOT_RUN (not wired into the kernel, no QEMU run; host code exists since cut 5) |
+| 91d | host `inspection_never_writes_and_names_the_reason` (recovery_core_tests.rs:89) | M4_RECOVERY (host) | HOST PASS (cut 5, `test_continuity_recovery` (`make -C native/kernel test` and `sanitize`, real sealed Store in a file, 4096 and 512 byte blocks): blank, unprovisioned, healthy and degraded stores inspected, image byte for byte unchanged, reasons StoreUnformatted, Unprovisioned, none, Degraded(Malformed); mutant MR-1 `RC_MUTANT_INSPECT_WRITES` killed); gate NOT_RUN (no kernel wiring, no QEMU) |
+| 91e | host `degraded_repair_needs_the_operator_and_restores_a_writable_store` (:111) | M4_RECOVERY (host) | HOST PASS (cut 5, `test_continuity_recovery` (`make -C native/kernel test` and `sanitize`, real sealed Store in a file, 4096 and 512 byte blocks): zero, wrong-key, wrong-action and stale-state responses refused with the image unchanged, authorised repair zeroes only the inactive slot, same agent and memory, writable again, replay NotApplicable; mutant MR-6 `RC_MUTANT_REPAIR_ACTIVE` killed); gate NOT_RUN (no kernel wiring, no QEMU) |
+| 91f | host `provisioning_is_operator_only_and_only_on_an_unprovisioned_store` (:154) | M4_RECOVERY (host) | HOST PASS (cut 5, `test_continuity_recovery` (`make -C native/kernel test` and `sanitize`, real sealed Store in a file, 4096 and 512 byte blocks): wrong key or response refused, no-entropy refused with nothing written, authorised provisioning writes source Operator and a cold resume returns that agent, replay NotApplicable; mutant MR-9 `RC_MUTANT_PROVISION_QUALIFICATION` killed); gate NOT_RUN (no kernel wiring, no QEMU) |
+| 91g | host `identity_lost_in_the_newest_root_never_looks_unprovisioned` (:178) | M4_RECOVERY (host) | HOST PASS, DIFFERS (cut 5, `test_continuity_recovery`: a flipped byte of the newest AgentRoot is refused by the sealed mount with `SS_E_ROLLBACK`, entry reason `SealedRefusal(-303)`, no action applicable, forged and valid-form responses refused, image unchanged; Rust shows `Degraded(GraphBadNewer)`, contract K-3, K-4); the Degraded-without-identity half is row 91h; gate NOT_RUN (no kernel wiring, no QEMU) |
+| 91h | host `malformed_peer_without_a_resolvable_identity_is_not_repaired` (:222) | M4_RECOVERY (host) | HOST PASS (cut 5, `test_continuity_recovery` (`make -C native/kernel test` and `sanitize`, real sealed Store in a file, 4096 and 512 byte blocks): garbage in the inactive slot of an identity-less formatted store reads Degraded(Malformed), never Unprovisioned, no action offered; mutants MR-5 `RC_MUTANT_DEGRADED_IS_UNPROVISIONED` and MR-7 `RC_MUTANT_REPAIR_NO_IDENTITY` killed); gate NOT_RUN (no kernel wiring, no QEMU) |
+| 91i | host `orphaned_continuity_objects_are_corrupt_not_unprovisioned` (:236) | M4_RECOVERY (host) | HOST PASS for the resolve half (cut 3, `test_continuity_resolve` (`make -C native/kernel test`, real sealed Store in a file): orphan manifest, orphan agent state and orphan WAL are Corrupt `continuity objects without an agent root`; mutant MC-2 `CR_MUTANT_NO_ORPHAN_CHECK` killed); Recovery Core entry reason ContinuityCorrupt "continuity objects without an agent root", no action, image unchanged: cut 5, `test_continuity_recovery`, host PASS; gate NOT_RUN |
+| 91j | host `identity_loss_through_corruption_offers_no_action_that_mints` (:267) | M4_RECOVERY (host) | HOST PASS, DIFFERS (cut 5, `test_continuity_recovery`: a corrupted AgentRoot of a provisioned store is a sealed refusal, no challenge, forged responses refused for both actions, image unchanged; contract K-3); gate NOT_RUN (no kernel wiring, no QEMU) |
+| 91k | host `challenges_bind_state_and_action` (:300) | M4_RECOVERY (host) | HOST PASS for the primitive (cut 3, `test_continuity_resolve` (`make -C native/kernel test`, real sealed Store in a file): `cr_challenge` binds action, state digest, generation and uuid, a response for one action is refused on the other; mutants MR-2 and MR-3 killed); the system record that carries them, `rc_challenge`: different on-disk state, different action or a stale response change or refuse the authorisation: cut 5, `test_continuity_recovery`, host PASS; gate NOT_RUN |
 | 91l | host `hmac_primitive_rfc4231_case_2` (recovery.rs:238) | M4_RECOVERY (host) | NOT_RUN (MISSING_IMPLEMENTATION: no C operator-auth wrapper; the C HMAC primitive itself is `aienos_hmac_sha256` in native/crypto) |
 | 91m | host `operator_auth_known_answer_accepted` (recovery.rs:251) | M4_RECOVERY (host) | HOST PASS (cut 3, `test_continuity_resolve` (`make -C native/kernel test`, real sealed Store in a file): `cr_operator_response` reproduces the Rust known answer and the four Rust-emitted fixture lines byte for byte); gate NOT_RUN |
 | 91n | host `operator_auth_rejects_any_single_bit_flip` (recovery.rs:269) | M4_RECOVERY (host) | HOST PASS (cut 3, `test_continuity_resolve` (`make -C native/kernel test`, real sealed Store in a file): every single-bit flip of response, challenge and key is refused; mutant MR-4 `CR_MUTANT_COMPARE_16` killed); gate NOT_RUN |
diff --git a/native/kernel/Makefile b/native/kernel/Makefile
index 4cb70cd5..ede3f881 100644
--- a/native/kernel/Makefile
+++ b/native/kernel/Makefile
@@ -63,6 +63,9 @@
 #   make continuity-commit-mutants
 #                        TEST-only -D mutants of svc/continuity_commit.c (and MC-11 of the codec) must
 #                        each fail test_continuity_commit -> CK_CONTINUITY_COMMIT_MUTANTS: PASS
+#   make continuity-recovery-mutants
+#                        TEST-only -D mutants of svc/continuity_recovery.c (MR-1, MR-5, MR-6, MR-7, MR-9) must
+#                        each fail test_continuity_recovery -> CK_CONTINUITY_RECOVERY_MUTANTS: PASS
 #   make stage-test | stage-sanitize | stage-free   stage host tests (stage.mk)
 #   make print-kcflags   flags stage code must be built with
 #   make udp-echo        host UDP echo helper for scripts/qemu_ck_net_test.sh:
@@ -497,7 +500,7 @@ HOST_SRCS := $(KDIR)/core/fmt.c $(KDIR)/core/acpi.c $(KDIR)/core/smmu.c $(KDIR)/
 	$(KDIR)/mm/pt.c $(KDIR)/mm/heap.c $(KDIR)/core/sched.c $(KDIR)/core/ipc.c $(KDIR)/core/entropy.c \
 	$(KDIR)/core/handoff_check.c
 TESTS := test_fmt test_frames test_pt test_acpi test_heap test_smmu test_sched test_ipc test_artifact test_entropy test_handoff \
-	test_continuity_codec test_continuity_resolve test_continuity_commit
+	test_continuity_codec test_continuity_resolve test_continuity_commit test_continuity_recovery
 HCFLAGS := -std=gnu11 -O1 -g -Wall -Wextra -Werror -I$(KDIR)/core -I$(KDIR)/mm -I$(KDIR)/tests -I$(BOOT)
 SANFLAGS := -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer
 
@@ -577,7 +580,7 @@ $(OUT)/host-san/test_continuity_codec: $(KDIR)/tests/test_continuity_codec.c $(C
 	@mkdir -p $(dir $@)
 	$(HOSTCC) $(HCFLAGS) $(SANFLAGS) $(CC_HOST_INC) $(CC_FIXTURE_DEF) -o $@ $< $(CC_HOST_SRCS)
 
-continuity-mutants: $(OUT)/host/test_continuity_codec continuity-resolve-mutants continuity-commit-mutants
+continuity-mutants: $(OUT)/host/test_continuity_codec continuity-resolve-mutants continuity-commit-mutants continuity-recovery-mutants
 	@mkdir -p $(OUT)/host-mut; fail=0; \
 	$(OUT)/host/test_continuity_codec > $(OUT)/host-mut/base.log 2>&1 || { echo "unmutated test_continuity_codec fails"; fail=1; }; \
 	for m in $(CC_MUTANTS); do \
@@ -687,6 +690,46 @@ continuity-commit-mutants: $(OUT)/host/test_continuity_commit
 	done; \
 	if [ $$fail = 0 ]; then echo "CK_CONTINUITY_COMMIT_MUTANTS: PASS"; else echo "CK_CONTINUITY_COMMIT_MUTANTS: FAIL"; exit 1; fi
 
+# Continuity Recovery Core (C port cut 5): host test over the REAL sealed Store in a
+# file, TEST-only -D mutants, each of which must make the test print its FAIL verdict.
+# Mutant flags are refused under CK_HARDWARE_STAGING (svc/continuity_recovery.h).
+RC_HOST_SRCS := $(KDIR)/svc/continuity_recovery.c $(CM_HOST_SRCS)
+RC_HOST_DEPS := $(RC_HOST_SRCS) $(wildcard $(KDIR)/svc/continuity_*.h) $(KDIR)/core/entropy.h \
+	$(wildcard $(NATIVE)/store/*.h $(NATIVE)/m5/*.h $(NATIVE)/disk/*.h $(NATIVE)/crypto/*.h) $(KDIR)/tests/ck_test.h
+# MR-1 inspection writes, MR-5 degraded mount read as Unprovisioned, MR-6 repair zeroes the
+# active slot, MR-7 repair without a resolved identity, MR-9 operator provisioning writes
+# source Qualification. (MR-2, MR-3, MR-4, MR-8 are the cut 3 mutants.)
+RC_MUTANTS := RC_MUTANT_INSPECT_WRITES RC_MUTANT_DEGRADED_IS_UNPROVISIONED RC_MUTANT_REPAIR_ACTIVE \
+	RC_MUTANT_REPAIR_NO_IDENTITY RC_MUTANT_PROVISION_QUALIFICATION
+
+$(OUT)/host/test_continuity_recovery: $(KDIR)/tests/test_continuity_recovery.c $(RC_HOST_DEPS)
+	@mkdir -p $(dir $@)
+	$(HOSTCC) $(HCFLAGS) $(CM_HOST_INC) -o $@ $< $(RC_HOST_SRCS)
+
+$(OUT)/host-san/test_continuity_recovery: $(KDIR)/tests/test_continuity_recovery.c $(RC_HOST_DEPS)
+	@mkdir -p $(dir $@)
+	$(HOSTCC) $(HCFLAGS) $(SANFLAGS) $(CM_HOST_INC) -o $@ $< $(RC_HOST_SRCS)
+
+continuity-recovery-mutants: $(OUT)/host/test_continuity_recovery
+	@mkdir -p $(OUT)/host-mut; fail=0; \
+	$(OUT)/host/test_continuity_recovery > $(OUT)/host-mut/recovery_base.log 2>&1 || { echo "unmutated test_continuity_recovery fails"; fail=1; }; \
+	for m in $(RC_MUTANTS); do \
+	  b=$(OUT)/host-mut/test_continuity_recovery_$$m; \
+	  if ! $(HOSTCC) $(HCFLAGS) $(CM_HOST_INC) -D$$m -o $$b $(KDIR)/tests/test_continuity_recovery.c $(RC_HOST_SRCS); then \
+	    echo "mutant $$m: does not build (FAIL)"; fail=1; continue; fi; \
+	  if $$b > $$b.log 2>&1; then echo "mutant $$m: SURVIVED (FAIL)"; fail=1; \
+	  elif grep -q "^test_continuity_recovery: FAIL" $$b.log; then \
+	    echo "mutant $$m: killed ($$(grep -c '^  FAIL ' $$b.log) checks failed)"; \
+	  else echo "mutant $$m: no FAIL verdict (crashed?) (FAIL)"; fail=1; fi; \
+	done; \
+	for m in $(RC_MUTANTS); do \
+	  if $(HOSTCC) $(HCFLAGS) $(CM_HOST_INC) -DCK_HARDWARE_STAGING=1 -D$$m \
+	      -fsyntax-only $(KDIR)/svc/continuity_recovery.c 2>/dev/null; then \
+	    echo "mutant flag $$m accepted under CK_HARDWARE_STAGING (FAIL)"; fail=1; \
+	  else echo "mutant flag $$m refused under CK_HARDWARE_STAGING"; fi; \
+	done; \
+	if [ $$fail = 0 ]; then echo "CK_CONTINUITY_RECOVERY_MUTANTS: PASS"; else echo "CK_CONTINUITY_RECOVERY_MUTANTS: FAIL"; exit 1; fi
+
 ART_TOOL := $(OUT)/host/ck_artifact_tool
 $(ART_TOOL): $(KDIR)/tools/ck_artifact_tool.c $(ART_HOST_DEPS)
 	@mkdir -p $(dir $@)
diff --git a/native/kernel/svc/continuity_recovery.c b/native/kernel/svc/continuity_recovery.c
new file mode 100644
index 00000000..146dd8b2
--- /dev/null
+++ b/native/kernel/svc/continuity_recovery.c
@@ -0,0 +1,318 @@
+/* continuity_recovery.c -- see continuity_recovery.h. */
+#include <stdio.h>
+#include <string.h>
+
+#include "continuity_recovery.h"
+
+#define UNIT SV1_UNIT
+
+static int is_zero(const uint8_t *p, size_t n)
+{
+    uint8_t acc = 0;
+    for (size_t i = 0; i < n; i++) acc |= p[i];
+    return acc == 0;
+}
+
+/* Sealed mount refusals (store_sealed.h SS_E_*, -301..-314). */
+static int is_sealed_error(int rc) { return rc <= SS_E_ARG && rc >= SS_E_FORMAT_VERSION; }
+
+int rc_inspect(const struct rc_env *e, struct rc_record *rec)
+{
+    if (!e || !rec || !e->dev || !e->anchor || !e->keys || !e->ws || !e->store || !e->w || !e->view ||
+        !e->dev->read_unit)
+        return -1;
+    static uint8_t raw[2][UNIT]; /* single-threaded kernel scratch, like cr_work */
+    memset(rec, 0, sizeof *rec);
+    for (unsigned s = 0; s < 2; s++) {
+        memset(raw[s], 0, UNIT);
+        rec->slot[s] = RC_SLOT_READ_ERROR;
+        if (e->dev->read_unit(e->dev->ctx, s, raw[s]) != 0) {
+            memset(raw[s], 0, UNIT); /* recovery_core.rs:109-133: an unreadable unit hashes as zero */
+            continue;
+        }
+        if (is_zero(raw[s], UNIT)) {
+            rec->slot[s] = RC_SLOT_ZERO;
+            continue;
+        }
+        sv1_superblock sb;
+        if (sv1_superblock_decode(raw[s], UNIT, s, &sb) == 0) {
+            rec->slot[s] = RC_SLOT_SUPERBLOCK;
+            rec->slot_generation[s] = sb.generation;
+            if (!rec->have_uuid) {
+                rec->have_uuid = 1;
+                memcpy(rec->uuid, sb.store_uuid, 16);
+            }
+        } else {
+            rec->slot[s] = RC_SLOT_UNDECODABLE;
+        }
+    }
+    cr_state_digest(raw[0], raw[1], rec->state_digest);
+
+    /* Mount without writing (ss_open never writes). */
+    memset(e->store, 0, sizeof *e->store);
+    int rc = ss_open(e->store, e->dev, e->anchor, e->anchor_lba, e->keys, e->ws);
+    if (rc != 0) {
+        rec->mount_rc = rc;
+        rec->reason = rc == ST_M_UNFORMATTED ? RC_STORE_UNFORMATTED
+                      : is_sealed_error(rc)  ? RC_SEALED_REFUSAL
+                                             : RC_STORE_MOUNT;
+        return 0;
+    }
+    rec->have_mount = 1;
+    rec->mount_state = e->store->st.state;
+    rec->peer = e->store->st.peer;
+    rec->generation = ss_generation(e->store);
+
+    struct cr_source src;
+    cr_bind_sealed(&src, e->store);
+    uint32_t n = src.count(src.ctx);
+    rec->have_catalog = 1;
+    for (uint32_t i = 0; i < n; i++) {
+        uint16_t kind = 0, ver = 0;
+        if (src.entry(src.ctx, i, &kind, &ver) != 0) continue;
+        if (kind == CC_KIND_AGENT_ROOT)
+            rec->n_roots++;
+        else if (kind == CC_KIND_MANIFEST)
+            rec->n_manifests++;
+        else
+            rec->n_other++;
+    }
+
+    const char *why = NULL;
+    int srcrc = 0;
+    int o = cr_resolve(&src, e->w, e->view, &why, &srcrc);
+#ifdef RC_MUTANT_DEGRADED_IS_UNPROVISIONED
+    /* MR-5 (the fe2c2bd bug): continuity decides first, a degraded mount that resolves no identity
+     * reads as Unprovisioned. */
+    if (o == CR_UNPROVISIONED) {
+        rec->reason = RC_UNPROVISIONED;
+        rec->have_identity = 0;
+        return 0;
+    }
+#endif
+    if (rec->mount_state == ST_DEGRADED_RECOVERY) {
+        /* Degraded takes precedence (INV-14): what the valid (older) root says about
+         * continuity is not the whole story. */
+        rec->reason = RC_DEGRADED;
+    } else if (o == CR_RESOLVED) {
+        rec->reason = RC_REASON_NONE;
+    } else if (o == CR_UNPROVISIONED) {
+        rec->reason = RC_UNPROVISIONED;
+    } else if (o == CR_CONFLICT) {
+        rec->reason = RC_CONFLICT;
+    } else if (o == CR_CORRUPT && why) {
+        rec->reason = RC_CONTINUITY_CORRUPT;
+        rec->why = why;
+    } else {
+        rec->reason = RC_CONTINUITY_CORRUPT;
+        rec->why = "continuity unreadable";
+    }
+    if (o == CR_RESOLVED) {
+        rec->have_identity = 1;
+        memcpy(rec->agent_id, e->view->root.agent_id, 32);
+    }
+#ifdef RC_MUTANT_INSPECT_WRITES
+    /* MR-1: "repair on inspect". */
+    if (rec->reason == RC_DEGRADED && rec->peer == ST_PEER_MALFORMED && e->dev->write_unit) {
+        static const uint8_t zero[UNIT];
+        (void)e->dev->write_unit(e->dev->ctx, 1u - st_active_slot(&e->store->st), zero);
+    }
+#endif
+    return 0;
+}
+
+int rc_applicable(const struct rc_record *rec)
+{
+    if (!rec || !rec->have_mount) return 0;
+    switch (rec->reason) {
+    case RC_DEGRADED:
+#ifdef RC_MUTANT_REPAIR_NO_IDENTITY
+        if (rec->peer == ST_PEER_MALFORMED) return CR_ACTION_REPAIR_DEGRADED_PEER;
+#else
+        if (rec->peer == ST_PEER_MALFORMED && rec->have_identity) return CR_ACTION_REPAIR_DEGRADED_PEER;
+#endif
+        return 0;
+    case RC_UNPROVISIONED:
+#ifdef RC_MUTANT_DEGRADED_IS_UNPROVISIONED
+        return CR_ACTION_PROVISION_IDENTITY;
+#else
+        if (rec->mount_state == ST_VALID) return CR_ACTION_PROVISION_IDENTITY;
+        return 0;
+#endif
+    default:
+        return 0;
+    }
+}
+
+int rc_challenge(const struct rc_record *rec, uint8_t action, uint8_t out[32])
+{
+    if (!rec || !rec->have_uuid || !rec->have_mount) return 0;
+    cr_challenge(rec->uuid, rec->generation, action, rec->state_digest, out);
+    return 1;
+}
+
+const char *rc_outcome_name(int rc)
+{
+    switch (rc) {
+    case RC_OK: return "Ok";
+    case RC_NOT_APPLICABLE: return "NotApplicable";
+    case RC_UNAUTHORISED: return "Unauthorised";
+    case RC_IO: return "Io";
+    case RC_CONTINUITY: return "Continuity";
+    case RC_E_ARG: return "BadArgument";
+    default: return "?";
+    }
+}
+
+/* recovery_core.rs:219-235: applicable first, then the operator response. */
+static int authorise(const struct rc_record *rec, uint8_t action, const uint8_t key[32],
+                     const uint8_t response[32])
+{
+    if (rc_applicable(rec) != action) return RC_NOT_APPLICABLE;
+    uint8_t ch[32];
+    if (!rc_challenge(rec, action, ch)) return RC_NOT_APPLICABLE;
+    if (!cr_operator_verify(key, ch, response)) return RC_UNAUTHORISED;
+    return RC_OK;
+}
+
+static int env_ok(const struct rc_env *e) { return e && e->tw && e->dev && e->store; }
+
+int rc_repair_degraded_peer(const struct rc_env *e, const uint8_t operator_key[32],
+                            const uint8_t response[32], struct rc_record *after)
+{
+    if (!env_ok(e) || !operator_key || !response || !e->dev->write_unit || !e->dev->flush) return RC_E_ARG;
+    struct rc_record rec;
+    if (rc_inspect(e, &rec) != 0) return RC_E_ARG;
+    int a = authorise(&rec, CR_ACTION_REPAIR_DEGRADED_PEER, operator_key, response);
+    if (a != RC_OK) return a;
+    /* The valid root is the slot the engine mounted; the other one goes (INV-17). */
+    uint32_t active = st_active_slot(&e->store->st);
+#ifdef RC_MUTANT_REPAIR_ACTIVE
+    uint32_t victim = active; /* MR-6 */
+#else
+    uint32_t victim = 1u - active;
+#endif
+    if (active > 1u) return RC_IO;
+    static const uint8_t zero[UNIT];
+    if (e->dev->write_unit(e->dev->ctx, victim, zero) != 0) return RC_IO;
+    if (e->dev->flush(e->dev->ctx) != 0) return RC_IO;
+    if (after) (void)rc_inspect(e, after);
+    return RC_OK;
+}
+
+int rc_provision_identity(const struct rc_env *e, const uint8_t operator_key[32],
+                          const uint8_t response[32], struct ck_rng *rng, struct cr_view *out,
+                          int *cr_outcome, const char **why, int *store_rc)
+{
+    if (!env_ok(e) || !e->w || !operator_key || !response || !rng || !out) return RC_E_ARG;
+    struct rc_record rec;
+    if (rc_inspect(e, &rec) != 0) return RC_E_ARG;
+    int a = authorise(&rec, CR_ACTION_PROVISION_IDENTITY, operator_key, response);
+    if (a != RC_OK) return a;
+    if (!rec.have_uuid) return RC_NOT_APPLICABLE;
+    /* inspection left the Store open at exactly the state that was authorised */
+    struct cr_source src;
+    struct cr_sink snk;
+    struct cr_sealed_sink sk = {e->store, NULL, NULL};
+    cr_bind_sealed(&src, e->store);
+    cr_bind_sealed_sink(&snk, &sk);
+#ifdef RC_MUTANT_PROVISION_QUALIFICATION
+    uint8_t source = CC_SOURCE_QUALIFICATION; /* MR-9 */
+#else
+    uint8_t source = CC_SOURCE_OPERATOR; /* INV-18 */
+#endif
+    int o = cr_provision(&src, &snk, e->w, e->tw, rng, rec.uuid, source, out, why, store_rc);
+    if (cr_outcome) *cr_outcome = o;
+    return o == CR_RESOLVED ? RC_OK : RC_CONTINUITY;
+}
+
+/* ---- markers ---- */
+
+const char *rc_peer_name(int peer)
+{
+    switch (peer) {
+    case ST_PEER_ZERO: return "Zero";
+    case ST_PEER_VALID: return "Valid";
+    case ST_PEER_MALFORMED: return "Malformed";
+    case ST_PEER_GRAPH_BAD_NEWER: return "GraphBadNewer";
+    case ST_PEER_GRAPH_BAD_OLDER: return "GraphBadOlder";
+    default: return "?";
+    }
+}
+
+static size_t fin(char *out, size_t cap, int n)
+{
+    if (n < 0 || (size_t)n >= cap) {
+        if (cap) out[0] = 0;
+        return 0;
+    }
+    return (size_t)n;
+}
+
+size_t rc_reason_text(char *out, size_t cap, const struct rc_record *r)
+{
+    if (!out || !cap || !r) return 0;
+    switch (r->reason) {
+    case RC_STORE_UNFORMATTED: return fin(out, cap, snprintf(out, cap, "StoreUnformatted"));
+    case RC_STORE_MOUNT: return fin(out, cap, snprintf(out, cap, "StoreMount(%d)", r->mount_rc));
+    case RC_SEALED_REFUSAL: return fin(out, cap, snprintf(out, cap, "SealedRefusal(%d)", r->mount_rc));
+    case RC_UNPROVISIONED: return fin(out, cap, snprintf(out, cap, "Unprovisioned"));
+    case RC_CONFLICT: return fin(out, cap, snprintf(out, cap, "Conflict"));
+    case RC_CONTINUITY_CORRUPT:
+        return fin(out, cap, snprintf(out, cap, "ContinuityCorrupt(\"%s\")", r->why ? r->why : ""));
+    case RC_DEGRADED: return fin(out, cap, snprintf(out, cap, "Degraded(%s)", rc_peer_name(r->peer)));
+    default: return fin(out, cap, snprintf(out, cap, "None"));
+    }
+}
+
+size_t rc_marker_entry(char *out, size_t cap, const struct rc_record *r)
+{
+    if (!out || !cap || !r) return 0;
+    if (r->reason == RC_REASON_NONE) return fin(out, cap, snprintf(out, cap, "RECOVERY_CORE: NOT_NEEDED"));
+    char t[160];
+    if (!rc_reason_text(t, sizeof t, r)) return 0;
+    return fin(out, cap, snprintf(out, cap, "RECOVERY_CORE: ENTERED reason=%s", t));
+}
+
+static const char *action_name(uint8_t a)
+{
+    return a == CR_ACTION_REPAIR_DEGRADED_PEER ? "repair-degraded-peer"
+           : a == CR_ACTION_PROVISION_IDENTITY ? "provision-identity"
+                                               : "?";
+}
+
+static void hex(const uint8_t *p, size_t n, char *o)
+{
+    static const char H[] = "0123456789abcdef";
+    for (size_t i = 0; i < n; i++) {
+        o[2 * i] = H[p[i] >> 4];
+        o[2 * i + 1] = H[p[i] & 15];
+    }
+    o[2 * n] = 0;
+}
+
+size_t rc_marker_challenge(char *out, size_t cap, const struct rc_record *r, uint8_t action)
+{
+    uint8_t ch[32];
+    char h[65];
+    if (!out || !cap || !rc_challenge(r, action, ch)) return 0;
+    hex(ch, 32, h);
+    return fin(out, cap, snprintf(out, cap, "RECOVERY_CHALLENGE: action=%s challenge=%s", action_name(action), h));
+}
+
+size_t rc_marker_refused(char *out, size_t cap, int rc, int cr_outcome)
+{
+    if (!out || !cap) return 0;
+    if (rc == RC_CONTINUITY)
+        return fin(out, cap, snprintf(out, cap, "RECOVERY_REFUSED (Continuity(%s))", cr_outcome_name(cr_outcome)));
+    return fin(out, cap, snprintf(out, cap, "RECOVERY_REFUSED (%s)", rc_outcome_name(rc)));
+}
+
+size_t rc_marker_done(char *out, size_t cap, uint8_t action, const uint8_t *agent)
+{
+    char h[65];
+    if (!out || !cap) return 0;
+    if (!agent) return fin(out, cap, snprintf(out, cap, "RECOVERY_ACTION: %s DONE", action_name(action)));
+    hex(agent, 32, h);
+    return fin(out, cap, snprintf(out, cap, "RECOVERY_ACTION: %s DONE agent=%s", action_name(action), h));
+}
diff --git a/native/kernel/svc/continuity_recovery.h b/native/kernel/svc/continuity_recovery.h
new file mode 100644
index 00000000..7aa3bf67
--- /dev/null
+++ b/native/kernel/svc/continuity_recovery.h
@@ -0,0 +1,156 @@
+/* continuity_recovery.h -- C port, cut 5: the Recovery Core over the sealed
+ * Store: read-only inspection, entry reasons, the one action each state admits,
+ * and the operator-authorised actions (contract section 4, INV-13..INV-18,
+ * MR-1..MR-9, K-3/K-4 notes).
+ *
+ * Contract: native/kernel/CONTINUITY_RECOVERY_CONTRACT.md. Oracle: the Rust
+ * kernel crates/aienos-kernel/src/recovery_core.rs (`inspect` :107-187,
+ * `applicable` :79-90, `challenge` :94-104, `repair_degraded_peer` :244-257,
+ * `provision_identity` :262-273).
+ *
+ * No model, no network, no clock. Inspection NEVER writes (INV-13): it reads
+ * units 0 and 1 of the Store region and opens the sealed Store, which does not
+ * write. Every write is an explicit operator action; each one re-inspects, requires
+ * rc_applicable() == action (else RC_NOT_APPLICABLE), then a verifying operator
+ * response (else RC_UNAUTHORISED), and only then writes (INV-16).
+ *
+ * The operator key is a parameter. The TEST-only key of the Rust qualification
+ * (0x0f x 32) is the caller's business; this file contains no key.
+ *
+ * Status: host PASS over the real sealed Store in a file. Not wired into the
+ * kernel; no QEMU run (M4_RECOVERY stays NOT_RUN). */
+#ifndef CK_CONTINUITY_RECOVERY_H
+#define CK_CONTINUITY_RECOVERY_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "continuity_commit.h"
+#include "continuity_resolve_sealed.h"
+
+/* TEST-only mutants for the host mutation run (Makefile continuity-mutants).
+ * MR-1 inspection writes (repairs on inspect), MR-5 applicable() treats a
+ * degraded mount as Unprovisioned (the fe2c2bd bug), MR-6 repair zeroes the
+ * active slot, MR-7 repair offered without a resolved identity, MR-9 operator
+ * provisioning writes source Qualification. */
+#if defined(CK_HARDWARE_STAGING) &&                                                          \
+    (defined(RC_MUTANT_INSPECT_WRITES) || defined(RC_MUTANT_DEGRADED_IS_UNPROVISIONED) ||    \
+     defined(RC_MUTANT_REPAIR_ACTIVE) || defined(RC_MUTANT_REPAIR_NO_IDENTITY) ||            \
+     defined(RC_MUTANT_PROVISION_QUALIFICATION))
+#error "continuity recovery mutants are TEST-only and refused under CK_HARDWARE_STAGING"
+#endif
+
+/* What one superblock slot holds (SlotView, recovery_core.rs:17-22). */
+enum { RC_SLOT_ZERO = 0, RC_SLOT_SUPERBLOCK = 1, RC_SLOT_UNDECODABLE = 2, RC_SLOT_READ_ERROR = 3 };
+
+/* Why the Recovery Core was entered (EntryReason, recovery_core.rs:25-33).
+ * RC_REASON_NONE: a normal boot may proceed.
+ * RC_SEALED_REFUSAL is C only (contract K-3/K-4): the sealed mount (keyed proof,
+ * anti-rollback anchor, envelope or transaction record) refused before continuity
+ * could run. It admits no action (INV-15). */
+enum {
+    RC_REASON_NONE = 0,
+    RC_STORE_UNFORMATTED,
+    RC_STORE_MOUNT,      /* ST_M_* other than unformatted: record.mount_rc */
+    RC_SEALED_REFUSAL,   /* SS_E_*: record.mount_rc */
+    RC_UNPROVISIONED,
+    RC_CONFLICT,
+    RC_CONTINUITY_CORRUPT, /* record.why */
+    RC_DEGRADED,         /* record.peer (ST_PEER_*) */
+};
+
+/* The read-only raw system record (SystemRecord, recovery_core.rs:61-73). */
+struct rc_record {
+    int slot[2];              /* RC_SLOT_* */
+    uint64_t slot_generation[2]; /* valid when slot[i] == RC_SLOT_SUPERBLOCK */
+    uint8_t state_digest[32]; /* SHA-256 over both raw units: binds challenges */
+    int have_uuid;            /* from the first decodable slot */
+    uint8_t uuid[16];
+    int have_mount;           /* the sealed Store mounted */
+    int mount_state;          /* ST_VALID or ST_DEGRADED_RECOVERY */
+    int peer;                 /* ST_PEER_* */
+    uint64_t generation;
+    int reason;               /* RC_* */
+    int mount_rc;             /* RC_STORE_MOUNT / RC_SEALED_REFUSAL: the error */
+    const char *why;          /* RC_CONTINUITY_CORRUPT: static text */
+    int have_identity;        /* continuity resolved (a view exists) */
+    uint8_t agent_id[32];
+    int have_catalog;
+    uint32_t n_roots, n_manifests, n_other; /* verified application objects (claims) */
+};
+
+/* Caller-owned environment. The Store is opened into `store` and stays open
+ * after rc_inspect (an action reuses it for provisioning). `view` receives the
+ * resolved continuity. */
+struct rc_env {
+    const st_dev *dev;           /* Store region, 4096-byte units */
+    const ts_device *anchor;     /* anchor region device */
+    uint64_t anchor_lba;
+    const ss_keys *keys;
+    ss_workspace *ws;
+    ss_store *store;
+    struct cr_work *w;
+    struct cr_txwork *tw;
+    struct cr_view *view;
+};
+
+/* Inspect in place. Never writes (INV-13). Returns 0, or -1 for a NULL argument
+ * (record untouched). */
+int rc_inspect(const struct rc_env *e, struct rc_record *rec);
+
+/* The action this state admits: CR_ACTION_REPAIR_DEGRADED_PEER, CR_ACTION_PROVISION_IDENTITY
+ * or 0 (INV-15). Fails toward preservation:
+ *  - repair only a Malformed peer and only with a resolved identity (MR-7);
+ *  - provision only on a Valid mount that reads Unprovisioned (MR-5): a degraded
+ *    mount is never treated as unprovisioned;
+ *  - everything else (sealed refusals, conflicts, corrupt continuity, unformatted
+ *    stores, a CRC-valid newer root whose graph is broken) admits nothing. */
+int rc_applicable(const struct rc_record *rec);
+
+/* Challenge for `action` on exactly this state (cr_challenge over the record's
+ * uuid, generation, action and state digest). 1 on success, 0 when the record
+ * has no uuid or no mount (recovery_core.rs:94-104). */
+int rc_challenge(const struct rc_record *rec, uint8_t action, uint8_t out[32]);
+
+/* Action outcomes (RecoveryError, recovery_core.rs:199-207). */
+enum {
+    RC_OK = 0,
+    RC_NOT_APPLICABLE = 1,
+    RC_UNAUTHORISED = 2,
+    RC_IO = 3,
+    RC_CONTINUITY = 4, /* provisioning refused: *cr_outcome has the CR_* outcome */
+    RC_E_ARG = 5,
+};
+const char *rc_outcome_name(int rc);
+
+/* Zero the INACTIVE superblock slot (1 - active, never the active one: MR-6) of
+ * a degraded store after the operator's response verifies, flush, re-inspect
+ * into *after (optional). Nothing is written unless authorisation passes. */
+int rc_repair_degraded_peer(const struct rc_env *e, const uint8_t operator_key[32],
+                            const uint8_t response[32], struct rc_record *after);
+
+/* Provision the one identity on a Valid, unprovisioned store after the
+ * operator's response verifies. Writes source Operator (INV-18, MR-9), with the
+ * Store uuid taken from the inspection. Entropy comes from rng (no fallback:
+ * cut 4). On RC_CONTINUITY, *cr_outcome, *why and *store_rc (all optional) say why. */
+int rc_provision_identity(const struct rc_env *e, const uint8_t operator_key[32],
+                          const uint8_t response[32], struct ck_rng *rng, struct cr_view *out,
+                          int *cr_outcome, const char **why, int *store_rc);
+
+/* ---- serial markers (contract section 3; the Rust Debug spellings) ----
+ * Write the NUL-terminated line, without newline; return its length, 0 when cap
+ * is too small. */
+const char *rc_peer_name(int peer); /* "Zero", "Valid", "Malformed", "GraphBadNewer", "GraphBadOlder" */
+/* "Degraded(Malformed)", "Unprovisioned", "ContinuityCorrupt(\"why\")", "StoreMount(rc)",
+ * "SealedRefusal(rc)" (C only), ... */
+size_t rc_reason_text(char *out, size_t cap, const struct rc_record *rec);
+/* "RECOVERY_CORE: ENTERED reason=<text>" or "RECOVERY_CORE: NOT_NEEDED". */
+size_t rc_marker_entry(char *out, size_t cap, const struct rc_record *rec);
+/* "RECOVERY_CHALLENGE: action=<name> challenge=<64 hex>" (0 when no challenge). */
+size_t rc_marker_challenge(char *out, size_t cap, const struct rc_record *rec, uint8_t action);
+/* "RECOVERY_REFUSED (<NotApplicable|Unauthorised|Io|Continuity(<outcome>)>)". */
+size_t rc_marker_refused(char *out, size_t cap, int rc, int cr_outcome);
+/* "RECOVERY_ACTION: <name> DONE" (agent != NULL: " agent=<64 hex>"). */
+size_t rc_marker_done(char *out, size_t cap, uint8_t action, const uint8_t *agent);
+
+#endif /* CK_CONTINUITY_RECOVERY_H */
diff --git a/native/kernel/tests/test_continuity_recovery.c b/native/kernel/tests/test_continuity_recovery.c
new file mode 100644
index 00000000..4d561883
--- /dev/null
+++ b/native/kernel/tests/test_continuity_recovery.c
@@ -0,0 +1,597 @@
+/* test_continuity_recovery.c -- host tests of svc/continuity_recovery.c (C
+ * continuity port, cut 5: Recovery Core inspection, repair, operator
+ * provisioning; contract native/kernel/CONTINUITY_RECOVERY_CONTRACT.md section
+ * 6.2, aienos#222). Oracle: crates/aienos-kernel/src/recovery_core.rs and
+ * recovery_core_tests.rs.
+ *
+ * Storage: the REAL sealed Store (native/store, M5 envelopes, anchor) in a
+ * file, at 4096 and 512 byte blocks. Entropy: the real ck_rng over a mocked
+ * RNDR. Every inspection and every refused action must leave the image byte
+ * for byte unchanged (INV-13, INV-16).
+ *
+ * One test per Rust recovery_core test row: 91d inspection never writes, 91e
+ * repair needs the operator, 91f provisioning is operator only, 91g identity
+ * lost in the newest root never looks unprovisioned, 91h malformed peer
+ * without identity is not repaired, 91i orphans are Corrupt, 91j identity loss
+ * offers no minting action, 91k challenges bind state and action. Rows 91l-91p
+ * (operator auth primitive) are test_continuity_resolve (cut 3). The QEMU rows
+ * 88-91c are NOT_RUN.
+ * Mutants (make continuity-mutants) must each turn this test FAIL. */
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "ck_test.h"
+#include "continuity_recovery.h"
+#include "disk_file.h"
+
+#define CK_(c, ...)                                                            \
+    do {                                                                       \
+        ck_t_run++;                                                            \
+        if (!(c)) {                                                            \
+            ck_t_fail++;                                                       \
+            printf("  FAIL %s:%d: %s: ", __FILE__, __LINE__, #c);              \
+            printf(__VA_ARGS__);                                               \
+            printf("\n");                                                      \
+        }                                                                      \
+    } while (0)
+
+#define A_UNITS 4u
+#define S_UNITS 512u
+#define T_UNITS (A_UNITS + S_UNITS)
+#define IMG_BYTES ((size_t)T_UNITS * 4096u)
+
+static ss_workspace g_ws;
+static ss_store g_s;
+static disk_file g_f;
+static disk_dev g_d;
+static st_disk g_sd;
+static st_dev g_sdev;
+static ts_device g_tdev;
+static ss_keys g_k;
+static uint32_t g_bs;
+static char g_path[256];
+static struct cr_work g_w;
+static struct cr_txwork g_tw;
+static struct cr_view g_v, g_v2, g_out;
+static struct cr_source g_src;
+static struct cr_sink g_snk;
+static struct cr_sealed_sink g_sk;
+static struct rc_env E;
+static const uint8_t RUUID[16] = {0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a,
+                                  0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a};
+static uint8_t snap_img[IMG_BYTES], now_img[IMG_BYTES];
+static uint8_t OPKEY[32], BADKEY[32];
+
+static int g_open;
+static void dev_close(void)
+{
+    if (g_open) disk_file_close(&g_f);
+    g_open = 0;
+}
+static int dev_open(int create)
+{
+    dev_close();
+    uint32_t bpu = 4096u / g_bs;
+    if (create) unlink(g_path);
+    memset(&g_f, 0, sizeof g_f);
+    if (disk_file_open(&g_f, &g_d, g_path, g_bs, (uint64_t)(A_UNITS + S_UNITS) * bpu, create) != 0) return -1;
+    g_open = 1;
+    if (st_disk_bind(&g_sd, &g_d, (uint64_t)A_UNITS * bpu, S_UNITS, &g_sdev) != 0) return -2;
+    ss_ts_device(&g_d, &g_tdev);
+    return 0;
+}
+static void make_keys(void)
+{
+    uint8_t kvol[32];
+    memset(kvol, 0x77, 32);
+    m5_subkeys sk;
+    m5_derive_subkeys(kvol, M5_ID_TEST, 0, &sk);
+    memset(&g_k, 0, sizeof g_k);
+    g_k.identity_class = M5_ID_TEST;
+    g_k.key_generation = 1;
+    memcpy(g_k.k_root_auth, sk.k_root_auth, 32);
+    memcpy(g_k.k_domain, sk.k_artifact, 32);
+    m5_subkeys_wipe(&sk);
+}
+static void bind(void)
+{
+    g_sk.s = &g_s;
+    g_sk.hook = NULL;
+    g_sk.hook_arg = NULL;
+    cr_bind_sealed(&g_src, &g_s);
+    cr_bind_sealed_sink(&g_snk, &g_sk);
+}
+/* A formatted store, no identity. */
+static void fresh(void)
+{
+    CK_(dev_open(1) == 0, "rig create");
+    CK_(ss_format(&g_sdev, &g_tdev, 0, RUUID, &g_k, &g_ws) == 0, "format");
+    CK_(ss_open(&g_s, &g_sdev, &g_tdev, 0, &g_k, &g_ws) == 0, "open genesis");
+    bind();
+}
+static void env_open(void)
+{
+    CK_(dev_open(0) == 0, "reopen rig");
+    E.dev = &g_sdev;
+    E.anchor = &g_tdev;
+    E.anchor_lba = 0;
+    E.keys = &g_k;
+    E.ws = &g_ws;
+    E.store = &g_s;
+    E.w = &g_w;
+    E.tw = &g_tw;
+    E.view = &g_v2;
+}
+static int file_load(uint8_t *dst)
+{
+    dev_close();
+    FILE *f = fopen(g_path, "rb");
+    if (!f) return -1;
+    size_t n = fread(dst, 1, IMG_BYTES, f);
+    fclose(f);
+    return n == IMG_BYTES ? 0 : -2;
+}
+static void snapshot(void) { CK_(file_load(snap_img) == 0, "snapshot"); }
+static int unchanged(void) { return file_load(now_img) == 0 && memcmp(now_img, snap_img, IMG_BYTES) == 0; }
+/* Store-region unit u of the image now equals the snapshot. */
+static int unit_same(unsigned u)
+{
+    size_t o = (size_t)(A_UNITS + u) * 4096u;
+    return file_load(now_img) == 0 && memcmp(now_img + o, snap_img + o, 4096) == 0;
+}
+static int unit_zero(unsigned u)
+{
+    size_t o = (size_t)(A_UNITS + u) * 4096u;
+    if (file_load(now_img) != 0) return 0;
+    for (size_t i = 0; i < 4096; i++)
+        if (now_img[o + i]) return 0;
+    return 1;
+}
+static void fill_unit(unsigned u, uint8_t fillb)
+{
+    dev_close();
+    FILE *f = fopen(g_path, "r+b");
+    CK_(f != NULL, "open image");
+    static uint8_t junk[4096];
+    memset(junk, fillb, sizeof junk);
+    if (f) {
+        fseek(f, (long)((A_UNITS + u) * 4096u), SEEK_SET);
+        CK_(fwrite(junk, 1, sizeof junk, f) == sizeof junk, "write junk");
+        fclose(f);
+    }
+}
+static void flip_byte(uint64_t unit, unsigned off)
+{
+    dev_close();
+    FILE *f = fopen(g_path, "r+b");
+    CK_(f != NULL, "open image");
+    if (!f) return;
+    long pos = (long)((A_UNITS + unit) * 4096u + off);
+    uint8_t b = 0;
+    fseek(f, pos, SEEK_SET);
+    CK_(fread(&b, 1, 1, f) == 1, "read byte");
+    b ^= 0xff;
+    fseek(f, pos, SEEK_SET);
+    CK_(fwrite(&b, 1, 1, f) == 1, "write byte");
+    fclose(f);
+}
+
+/* ---- mocked RNDR ---- */
+struct mock {
+    int present;
+    uint64_t ctr;
+};
+static struct mock g_m;
+static struct ck_rng_ops g_ops;
+static struct ck_rng g_rng;
+static int m_present(void *c) { return ((struct mock *)c)->present; }
+static int m_read(void *c, uint64_t *out)
+{
+    struct mock *m = c;
+    uint64_t z = (m->ctr += 0x9e3779b97f4a7c15ull);
+    z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9ull;
+    z = (z ^ (z >> 27)) * 0x94d049bb133111ebull;
+    *out = z ^ (z >> 31);
+    return 1;
+}
+static void rng_init(uint64_t seed, int present)
+{
+    g_m.present = present;
+    g_m.ctr = seed;
+    g_ops.present = m_present;
+    g_ops.read = m_read;
+    g_ops.ctx = &g_m;
+    memset(&g_rng, 0, sizeof g_rng);
+    (void)ck_rng_probe(&g_rng, &g_ops);
+}
+
+static struct cc_record fact(const char *s)
+{
+    struct cc_record r;
+    memset(&r, 0, sizeof r);
+    r.status = CC_EPI_DIRECT_OBSERVATION;
+    r.len = (uint16_t)strlen(s);
+    r.statement = (const uint8_t *)s;
+    return r;
+}
+
+static uint8_t g_agent[32], g_mem[32];
+
+/* Provisioned (Qualification, as the Rust fixture) with one remembered fact. */
+static void remembered(void)
+{
+    fresh();
+    rng_init(5005, 1);
+    const char *why = NULL;
+    int rc = 0;
+    CK_(cr_provision(&g_src, &g_snk, &g_w, &g_tw, &g_rng, RUUID, CC_SOURCE_QUALIFICATION, &g_v, &why, &rc) == CR_RESOLVED,
+        "provision");
+    struct cc_record r1 = fact("keep this");
+    struct cr_update up = {NULL, &r1, 1};
+    static struct cr_view cur;
+    memcpy(&cur, &g_v, sizeof cur);
+    CK_(cr_commit(&g_src, &g_snk, &g_w, &g_tw, &cur, &up, 0, &g_v, &why, &rc) == CR_RESOLVED, "remember");
+    memcpy(g_agent, g_v.root.agent_id, 32);
+    memcpy(g_mem, g_v.memory, 32);
+}
+static void degrade(uint8_t fillb)
+{
+    uint32_t active = st_active_slot(&g_s.st);
+    fill_unit(1u - active, fillb);
+}
+static int raw_commit(uint16_t kind, const uint8_t *b, size_t n)
+{
+    ss_object so = {kind, 1, b, n};
+    return ss_transact(&g_s, &so, 1, NULL, NULL, NULL);
+}
+/* first Store unit of the first AgentRoot envelope */
+static uint64_t root_unit(void)
+{
+    for (uint32_t i = 0; i < g_s.nclaims; i++) {
+        if (g_ws.claims[i].c.obj.object_kind != CC_KIND_AGENT_ROOT) continue;
+        uint32_t n = 0;
+        const sv1_entry *cat = st_catalog(&g_s.st, &n);
+        for (uint32_t j = 0; j < n; j++)
+            if (memcmp(cat[j].object_id, g_ws.claims[i].sid, 32) == 0) return cat[j].first_unit;
+    }
+    CK_(0, "no agent root envelope found");
+    return 0;
+}
+
+static struct rc_record R, R2;
+static void inspect(struct rc_record *r)
+{
+    env_open();
+    CK_(rc_inspect(&E, r) == 0, "inspect");
+}
+static void respond(const struct rc_record *r, uint8_t action, const uint8_t key[32], uint8_t out[32])
+{
+    uint8_t ch[32];
+    CK_(rc_challenge(r, action, ch) == 1, "challenge available");
+    cr_operator_response(key, ch, out);
+}
+static int do_repair(const uint8_t resp[32], struct rc_record *after)
+{
+    env_open();
+    return rc_repair_degraded_peer(&E, OPKEY, resp, after);
+}
+static int do_prov(const uint8_t key[32], const uint8_t resp[32], int *cro, const char **why)
+{
+    env_open();
+    return rc_provision_identity(&E, key, resp, &g_rng, &g_out, cro, why, NULL);
+}
+
+/* ---- 91d: inspection never writes and names the reason (MR-1) ---- */
+static void t_91d(void)
+{
+    char t[200];
+    /* blank device */
+    CK_(dev_open(1) == 0, "blank");
+    snapshot();
+    inspect(&R);
+    CK_(unchanged(), "bs=%u inspect of a blank device wrote", g_bs);
+    CK_(R.reason == RC_STORE_UNFORMATTED && !R.have_mount && rc_applicable(&R) == 0, "blank: reason %d mount_rc %d", R.reason, R.mount_rc);
+    CK_(R.slot[0] == RC_SLOT_ZERO && R.slot[1] == RC_SLOT_ZERO && !R.have_uuid, "blank slots");
+    CK_(rc_challenge(&R, CR_ACTION_PROVISION_IDENTITY, (uint8_t[32]){0}) == 0, "no challenge without uuid and mount");
+    CK_(rc_marker_entry(t, sizeof t, &R) > 0 && strcmp(t, "RECOVERY_CORE: ENTERED reason=StoreUnformatted") == 0, "marker '%s'", t);
+
+    /* formatted, no identity */
+    fresh();
+    snapshot();
+    inspect(&R);
+    CK_(unchanged(), "inspect of an unprovisioned store wrote");
+    CK_(R.reason == RC_UNPROVISIONED && R.have_mount && R.mount_state == ST_VALID && !R.have_identity, "unprovisioned reason %d", R.reason);
+    CK_(R.slot[0] == RC_SLOT_SUPERBLOCK && R.slot[1] == RC_SLOT_ZERO && R.have_uuid && memcmp(R.uuid, RUUID, 16) == 0,
+        "slot views and uuid");
+    CK_(R.have_catalog && R.n_roots == 0 && R.n_manifests == 0 && R.n_other == 0, "catalog counts");
+
+    /* healthy */
+    remembered();
+    snapshot();
+    inspect(&R);
+    CK_(unchanged(), "inspect of a healthy store wrote");
+    CK_(R.reason == RC_REASON_NONE && R.have_identity && memcmp(R.agent_id, g_agent, 32) == 0, "healthy: reason %d", R.reason);
+    CK_(R.n_roots == 1 && R.n_manifests == 2 && rc_applicable(&R) == 0, "one root, two manifests, nothing applicable");
+    CK_(rc_marker_entry(t, sizeof t, &R) > 0 && strcmp(t, "RECOVERY_CORE: NOT_NEEDED") == 0, "marker '%s'", t);
+
+    /* degraded: malformed peer */
+    degrade(0xa5);
+    snapshot();
+    uint32_t active_before = 0;
+    inspect(&R);
+    CK_(unchanged(), "inspect of a degraded store wrote (MR-1)");
+    inspect(&R);
+    CK_(unchanged(), "second inspect wrote");
+    (void)active_before;
+    CK_(R.reason == RC_DEGRADED && R.peer == ST_PEER_MALFORMED && R.mount_state == ST_DEGRADED_RECOVERY, "degraded reason %d", R.reason);
+    CK_(R.have_identity && memcmp(R.agent_id, g_agent, 32) == 0, "record shows the same agent");
+    CK_(R.slot[0] != R.slot[1] && (R.slot[0] == RC_SLOT_UNDECODABLE || R.slot[1] == RC_SLOT_UNDECODABLE), "one undecodable slot");
+    CK_(rc_marker_entry(t, sizeof t, &R) > 0 && strcmp(t, "RECOVERY_CORE: ENTERED reason=Degraded(Malformed)") == 0, "marker '%s'", t);
+    CK_(rc_applicable(&R) == CR_ACTION_REPAIR_DEGRADED_PEER, "88: repair offered");
+    CK_(rc_marker_challenge(t, sizeof t, &R, CR_ACTION_REPAIR_DEGRADED_PEER) > 0 &&
+            strncmp(t, "RECOVERY_CHALLENGE: action=repair-degraded-peer challenge=", 58) == 0 && strlen(t) == 58 + 64,
+        "challenge marker '%s'", t);
+    CK_(unchanged(), "markers wrote nothing");
+    /* NULL arguments */
+    CK_(rc_inspect(NULL, &R) == -1 && rc_inspect(&E, NULL) == -1, "NULL args");
+}
+
+/* ---- 91e (88a-c, 89, 89a, 89b): repair needs the operator, restores a writable store (MR-6) ---- */
+static void t_91e(void)
+{
+    remembered();
+    degrade(0xa5);
+    inspect(&R);
+    CK_(rc_applicable(&R) == CR_ACTION_REPAIR_DEGRADED_PEER, "applicable");
+    uint8_t good[32], wrong_key[32], wrong_action[32], zero[32] = {0}, other_state[32];
+    respond(&R, CR_ACTION_REPAIR_DEGRADED_PEER, OPKEY, good);
+    respond(&R, CR_ACTION_REPAIR_DEGRADED_PEER, BADKEY, wrong_key);
+    respond(&R, CR_ACTION_PROVISION_IDENTITY, OPKEY, wrong_action);
+    /* a response to another state's challenge (88c) */
+    cr_operator_response(OPKEY, (uint8_t[32]){0x42}, other_state);
+    uint32_t active = st_active_slot(&g_s.st); /* g_s is the store inspect opened */
+    snapshot();
+    const uint8_t *bad[4] = {zero, wrong_key, wrong_action, other_state};
+    char t[100];
+    for (int i = 0; i < 4; i++) {
+        int rc = do_repair(bad[i], NULL);
+        CK_(rc == RC_UNAUTHORISED, "bad response %d: %s", i, rc_outcome_name(rc));
+        CK_(unchanged(), "refused repair %d wrote", i);
+    }
+    CK_(rc_marker_refused(t, sizeof t, RC_UNAUTHORISED, 0) > 0 && strcmp(t, "RECOVERY_REFUSED (Unauthorised)") == 0, "marker '%s'", t);
+    /* provisioning is not the applicable action */
+    {
+        int cro = -1;
+        int rc = do_prov(OPKEY, wrong_action, &cro, NULL);
+        CK_(rc == RC_NOT_APPLICABLE && unchanged(), "provision on a degraded store: %s", rc_outcome_name(rc));
+    }
+    /* 89: the authorised repair */
+    snapshot();
+    uint64_t gen = R.generation;
+    int rc = do_repair(good, &R2);
+    CK_(rc == RC_OK, "authorised repair: %s", rc_outcome_name(rc));
+    CK_(R2.reason == RC_REASON_NONE && R2.mount_state == ST_VALID && R2.peer == ST_PEER_ZERO, "healthy after repair (reason %d)", R2.reason);
+    CK_(unit_zero(1u - active), "the inactive slot is zero (MR-6)");
+    CK_(unit_same(active), "the ACTIVE slot is byte for byte untouched (MR-6)");
+    CK_(R2.generation == gen && R2.have_identity, "generation unchanged, identity kept");
+    CK_(rc_marker_done(t, sizeof t, CR_ACTION_REPAIR_DEGRADED_PEER, NULL) > 0 &&
+            strcmp(t, "RECOVERY_ACTION: repair-degraded-peer DONE") == 0, "marker '%s'", t);
+    /* 89a: same identity and memory, writable again */
+    env_open();
+    {
+        ss_store *s = &g_s;
+        CK_(ss_open(s, &g_sdev, &g_tdev, 0, &g_k, &g_ws) == 0 && s->st.state == ST_VALID, "reopen valid");
+        bind();
+        int committed = 0;
+        CK_(cr_resume(&g_src, &g_snk, &g_w, &g_tw, &g_v, &committed, NULL, NULL) == CR_RESOLVED && committed == 1, "resume writable");
+        CK_(memcmp(g_v.root.agent_id, g_agent, 32) == 0 && memcmp(g_v.memory, g_mem, 32) == 0 && g_v.cortex_count == 1,
+            "same agent, same memory");
+    }
+    /* 89b: replay of the old authorisation on the new state */
+    snapshot();
+    rc = do_repair(good, NULL);
+    CK_(rc == RC_NOT_APPLICABLE, "replay: %s", rc_outcome_name(rc));
+    CK_(unchanged(), "replay wrote");
+    CK_(rc_marker_refused(t, sizeof t, rc, 0) > 0 && strcmp(t, "RECOVERY_REFUSED (NotApplicable)") == 0, "marker '%s'", t);
+}
+
+/* ---- 91f (90, 90a, 90b): provisioning is operator only and only on an unprovisioned store (MR-9) ---- */
+static void t_91f(void)
+{
+    char t[200];
+    fresh();
+    inspect(&R);
+    CK_(rc_applicable(&R) == CR_ACTION_PROVISION_IDENTITY, "90: provision offered");
+    CK_(rc_marker_challenge(t, sizeof t, &R, CR_ACTION_PROVISION_IDENTITY) > 0, "challenge marker");
+    uint8_t good[32], wrong_action[32], seven[32];
+    memset(seven, 7, 32);
+    respond(&R, CR_ACTION_PROVISION_IDENTITY, OPKEY, good);
+    respond(&R, CR_ACTION_REPAIR_DEGRADED_PEER, OPKEY, wrong_action);
+    snapshot();
+    rng_init(6006, 1);
+    int cro = -1;
+    CK_(do_prov(OPKEY, seven, &cro, NULL) == RC_UNAUTHORISED && unchanged(), "90a: wrong response");
+    CK_(do_prov(BADKEY, good, &cro, NULL) == RC_UNAUTHORISED && unchanged(), "90a: wrong key");
+    CK_(do_prov(OPKEY, wrong_action, &cro, NULL) == RC_UNAUTHORISED && unchanged(), "response for the other action");
+    /* repair is not applicable here */
+    CK_(do_repair(wrong_action, NULL) == RC_NOT_APPLICABLE && unchanged(), "repair on an unprovisioned store");
+    /* no entropy: authorised, but nothing may be minted without it */
+    rng_init(6007, 0);
+    CK_(do_prov(OPKEY, good, &cro, NULL) == RC_CONTINUITY && cro == CR_NO_ENTROPY && unchanged(), "no entropy: outcome %d", cro);
+    CK_(rc_marker_refused(t, sizeof t, RC_CONTINUITY, cro) > 0 && strncmp(t, "RECOVERY_REFUSED (Continuity(", 29) == 0,
+        "marker '%s'", t);
+    /* 90b: authorised */
+    rng_init(6008, 1);
+    uint64_t gen = R.generation;
+    int rc = do_prov(OPKEY, good, &cro, NULL);
+    CK_(rc == RC_OK, "authorised provisioning: %s (cr %d)", rc_outcome_name(rc), cro);
+    CK_(g_out.root.source == CC_SOURCE_OPERATOR, "source is Operator, not Qualification (INV-18, MR-9): %u", g_out.root.source);
+    CK_(memcmp(g_out.root.store_uuid, RUUID, 16) == 0, "Store uuid from the inspection");
+    CK_(g_out.manifest.sequence == 1 && g_out.manifest.incarnation == 1 && g_out.state.written_at == 1, "genesis view");
+    CK_(g_out.root.provisioned_generation == gen + 1, "provisioned_generation");
+    CK_(rc_marker_done(t, sizeof t, CR_ACTION_PROVISION_IDENTITY, g_out.root.agent_id) > 0 &&
+            strncmp(t, "RECOVERY_ACTION: provision-identity DONE agent=", 47) == 0, "marker '%s'", t);
+    uint8_t agent[32];
+    memcpy(agent, g_out.root.agent_id, 32);
+    /* a cold resume returns that agent, and the stored root says Operator */
+    env_open();
+    CK_(ss_open(&g_s, &g_sdev, &g_tdev, 0, &g_k, &g_ws) == 0, "cold open");
+    bind();
+    CK_(cr_resolve(&g_src, &g_w, &g_v, NULL, NULL) == CR_RESOLVED && memcmp(g_v.root.agent_id, agent, 32) == 0, "cold resolve");
+    CK_(g_v.root.source == CC_SOURCE_OPERATOR, "stored source is Operator (MR-9)");
+    int committed = 0;
+    CK_(cr_resume(&g_src, &g_snk, &g_w, &g_tw, &g_v, &committed, NULL, NULL) == CR_RESOLVED && committed == 1 &&
+            memcmp(g_v.root.agent_id, agent, 32) == 0,
+        "cold resume returns that agent");
+    /* the same authorisation cannot provision again */
+    snapshot();
+    CK_(do_prov(OPKEY, good, &cro, NULL) == RC_NOT_APPLICABLE && unchanged(), "replay");
+}
+
+static const char *refusal_ok(const struct rc_record *r)
+{
+    /* never Unprovisioned, never repairable */
+    return (r->reason != RC_UNPROVISIONED && r->reason != RC_REASON_NONE && rc_applicable(r) == 0) ? NULL : "bad reason";
+}
+
+/* every action, with a response valid for the exact state if one can be formed, is refused and writes nothing */
+static void all_actions_refused(const struct rc_record *r, const char *what)
+{
+    uint8_t resp[32];
+    for (int a = 1; a <= 2; a++) {
+        if (rc_challenge(r, (uint8_t)a, resp)) cr_operator_response(OPKEY, resp, resp);
+        else memset(resp, 0x55, 32);
+        int rc = a == 1 ? do_repair(resp, NULL) : do_prov(OPKEY, resp, &(int){0}, NULL);
+        CK_(rc == RC_NOT_APPLICABLE, "%s: action %d: %s", what, a, rc_outcome_name(rc));
+        CK_(unchanged(), "%s: action %d wrote", what, a);
+    }
+}
+
+/* ---- 91g: identity lost in the newest root never looks unprovisioned (MR-5) ---- */
+static void t_91g(void)
+{
+    char t[100];
+    fresh();
+    rng_init(7007, 1);
+    const char *why = NULL;
+    int rc = 0;
+    CK_(cr_provision(&g_src, &g_snk, &g_w, &g_tw, &g_rng, RUUID, CC_SOURCE_QUALIFICATION, &g_v, &why, &rc) == CR_RESOLVED, "provision");
+    flip_byte(root_unit(), 20);
+    snapshot();
+    inspect(&R);
+    CK_(unchanged(), "inspect wrote");
+    CK_(refusal_ok(&R) == NULL, "reason %d", R.reason);
+    CK_(R.reason == RC_SEALED_REFUSAL || R.reason == RC_DEGRADED || R.reason == RC_STORE_MOUNT || R.reason == RC_CONTINUITY_CORRUPT,
+        "a refusal reason");
+    /* K-3 observed: the flipped ciphertext byte is refused by the sealed mount before continuity runs */
+    CK_(R.reason == RC_SEALED_REFUSAL, "K-3 expected a sealed refusal, got reason %d rc %d", R.reason, R.mount_rc);
+    CK_(rc_reason_text(t, sizeof t, &R) > 0 && strncmp(t, "SealedRefusal(", 14) == 0, "reason text '%s'", t);
+    if (g_bs == 4096) printf("K-3/K-4 answer: byte 20 of the newest AgentRoot envelope flipped: reason=%d (RC_SEALED_REFUSAL=%d) mount_rc=%d (%s), mounted=%d\n", R.reason, RC_SEALED_REFUSAL, R.mount_rc, ss_strerror(R.mount_rc), R.have_mount);
+    all_actions_refused(&R, "91g");
+}
+
+/* ---- 91h: a malformed peer with no resolvable identity is not repaired (MR-5, MR-7) ---- */
+static void t_91h(void)
+{
+    fresh();
+    degrade(0xa5);
+    snapshot();
+    inspect(&R);
+    CK_(unchanged(), "inspect wrote");
+    CK_(R.have_mount && R.mount_state == ST_DEGRADED_RECOVERY && R.peer == ST_PEER_MALFORMED, "degraded on a malformed peer");
+    CK_(R.reason == RC_DEGRADED, "reason is Degraded, never Unprovisioned (MR-5): %d", R.reason);
+    CK_(!R.have_identity && rc_applicable(&R) == 0, "no identity: nothing applicable (MR-5, MR-7): %d", rc_applicable(&R));
+    all_actions_refused(&R, "91h");
+}
+
+/* ---- 91i: orphaned continuity objects are Corrupt, not Unprovisioned ---- */
+static void t_91i(void)
+{
+    fresh();
+    struct cc_manifest m;
+    memset(&m, 0, sizeof m);
+    memset(m.root, 0x77, 32);
+    m.sequence = 1;
+    m.incarnation = 1;
+    memset(m.agent_state, 0x66, 32);
+    static uint8_t b[CC_MAX_OBJECT_BYTES];
+    size_t n = 0;
+    CK_(cc_manifest_encode(&m, b, sizeof b, &n, NULL) == CC_OK && raw_commit(CC_KIND_MANIFEST, b, n) == 0, "orphan manifest");
+    snapshot();
+    inspect(&R);
+    CK_(unchanged(), "inspect wrote");
+    CK_(R.reason == RC_CONTINUITY_CORRUPT && R.why && !strcmp(R.why, "continuity objects without an agent root"),
+        "reason %d why %s", R.reason, R.why ? R.why : "-");
+    CK_(rc_applicable(&R) == 0, "nothing applicable");
+    all_actions_refused(&R, "91i");
+}
+
+/* ---- 91j: identity loss through corruption offers no action that mints ---- */
+static void t_91j(void)
+{
+    remembered();
+    flip_byte(root_unit(), 20);
+    snapshot();
+    inspect(&R);
+    CK_(unchanged(), "inspect wrote");
+    CK_(R.reason == RC_SEALED_REFUSAL || R.reason == RC_STORE_MOUNT || R.reason == RC_CONTINUITY_CORRUPT || R.reason == RC_DEGRADED,
+        "refusal reason %d", R.reason);
+    CK_(rc_applicable(&R) == 0, "no action applicable");
+    /* 91: ENTERED, and no challenge is offered */
+    char t[200];
+    CK_(rc_marker_entry(t, sizeof t, &R) > 0 && strncmp(t, "RECOVERY_CORE: ENTERED reason=", 30) == 0, "marker '%s'", t);
+    CK_(rc_marker_challenge(t, sizeof t, &R, CR_ACTION_PROVISION_IDENTITY) == 0, "no challenge when no mount");
+    uint8_t forged[32];
+    memset(forged, 0x55, 32);
+    CK_(do_prov(OPKEY, forged, &(int){0}, NULL) != RC_OK, "provision refused");
+    CK_(do_repair(forged, NULL) != RC_OK, "repair refused");
+    CK_(unchanged(), "no action wrote after identity loss");
+    all_actions_refused(&R, "91j");
+}
+
+/* ---- 91k: challenges bind state and action (MR-2, MR-3 primitives are cut 3) ---- */
+static void t_91k(void)
+{
+    remembered();
+    degrade(0xa5);
+    inspect(&R);
+    uint8_t c1[32], c2[32], c3[32];
+    CK_(rc_challenge(&R, CR_ACTION_REPAIR_DEGRADED_PEER, c1) == 1, "c1");
+    degrade(0x5a); /* different on-disk state, same generation */
+    inspect(&R2);
+    CK_(rc_challenge(&R2, CR_ACTION_REPAIR_DEGRADED_PEER, c2) == 1, "c2");
+    CK_(memcmp(c1, c2, 32) != 0, "different on-disk state, different challenge");
+    CK_(memcmp(R.state_digest, R2.state_digest, 32) != 0, "digests differ");
+    CK_(rc_challenge(&R, CR_ACTION_PROVISION_IDENTITY, c3) == 1 && memcmp(c1, c3, 32) != 0, "different action, different challenge");
+    /* a response to the old state does not authorise a repair of the new one */
+    uint8_t old[32];
+    cr_operator_response(OPKEY, c1, old);
+    snapshot();
+    CK_(do_repair(old, NULL) == RC_UNAUTHORISED && unchanged(), "stale authorisation refused");
+}
+
+int main(void)
+{
+    make_keys();
+    memset(OPKEY, 0x0f, 32);
+    memset(BADKEY, 0x0e, 32);
+    snprintf(g_path, sizeof g_path, "/tmp/ck_rc_test_%d.img", (int)getpid());
+    static const uint32_t geos[2] = {4096u, 512u};
+    for (int g = 0; g < 2; g++) {
+        g_bs = geos[g];
+        t_91d();
+        t_91e();
+        t_91f();
+        t_91g();
+        t_91h();
+        t_91i();
+        t_91j();
+        t_91k();
+    }
+    dev_close();
+    unlink(g_path);
+    return ck_t_verdict("test_continuity_recovery");
+}