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 / docs / adr / 0016-continuity-objects-over-store-v1.md

102 lines · 6472 bytes Raw Blame History Source

ADR 0016: Continuity objects over System Store v1

Status: Proposed. Implemented as a QEMU qualification only. The object encodings below are a durable data format, so they are not frozen until the operator approves (escalation trigger: irreversible data formats). Until then every object carries format version 0 and every store holding them is disposable test media.

Related: ADR 0003 (minimal object store), ADR 0006 (Recovery Core), ADR 0007 (provisioning once), ADR 0015 (System Store v1 format), docs/CONTINUOUS_EXISTENCE_AMENDMENT.md (Class A state, commit-before-observation).

Context

System Store v1 (ADR 0015) gives AIENOS a crash-safe, generation-numbered, content-addressed object store over the native NVMe driver, qualified in QEMU at 4096- and 512-byte LBA (#134, #136). It stores opaque objects; it does not know what AIEN is. ADR 0007 requires that a normal boot locate, verify and resume one durable LogicalAgentId, and never mint a replacement. M4 is not done when storage works; it is done when a cold restart returns the same identity and the same committed memory.

Decision

Continuity state is a small set of Store v1 objects with canonical, fixed-layout little-endian encodings (no serde, no JSON, no_std), defined in aienos_kernel::continuity. Every Store transaction that changes Class A state also writes a new ContinuityManifest, so each Store generation has exactly one continuity view.

Object kinds (Store v1 kind; Store version is 1 because Store v1 rejects version 0; each object's own 16-byte header carries format_version = 0 while this ADR is Proposed, and decoders reject any other value):

kindnamewrittencontent
16AgentRootonce, at provisioningmagic, LogicalAgentId (32 B), genesis_store_uuid (16 B) it was provisioned into, root LogicalBranchId, provisioning generation, provisioning source (operator / test)
17ContinuityManifestevery Class A commitmagic, AgentRoot ObjectId, previous_manifest_id (zero for the first or migration boundary), migration_parent_id (zero normally; points to MigrationManifest on the first manifest of a migrated store), sequence (previous + 1), incarnation (boot counter), ObjectIds of: agent-state checkpoint, Cortex checkpoint, Cortex WAL segments (bounded list), admission receipts (bounded list)
18AgentStateCheckpointwhen branch state changescanonical branch table: branch id, parent, agent id, depth, fork counter
19CortexCheckpointwhen Cortex compactscanonical committed records
20CortexWalSegmenton each committed Cortex updateappend-only records since the checkpoint
23MigrationManifestonce, on store migrationmagic, AgentRoot ObjectId, genesis_store_uuid, origin_store_uuid, target_store_uuid, origin SecurityManifest and ContinuityManifest IDs, origin sequence/incarnation/epoch, origin rollback-anchor digest, migration sequence, offline owner authorization signature

Boot resolution (deterministic, no model, no network):

  1. Open the Store (ADR 0015). A DegradedRecovery mount is read-only: resume is allowed for inspection, but no new incarnation is committed; report CONTINUITY: DEGRADED.
  2. Count AgentRoot objects in the catalog.
    • 0 and provisioning was explicitly requested for this boot: create one LogicalAgentId from the boot entropy source, commit AgentRoot and the first manifest in one transaction, report CONTINUITY: PROVISIONED.
    • 0 otherwise: stop with CONTINUITY: UNPROVISIONED (Recovery Core). Never mint.
    • more than 1: stop with CONTINUITY: CONFLICT (Recovery Core).
    • exactly 1: continue.
  3. The current manifest is the unique catalog manifest that no other manifest names as previous, whose chain reaches either the genesis first manifest (previous_manifest_id = 0, migration_parent_id = 0) or a validated migration boundary (previous_manifest_id = 0, migration_parent_id = MigrationManifest ID) with strictly consecutive sequence numbers and the same AgentRoot id. Anything else (fork, gap, dangling reference, foreign root, undecodable object) stops with CONTINUITY: CORRUPT (Recovery Core), never with a new identity.
  4. Resume: verify every object the manifest names decodes; commit a new manifest with incarnation + 1 (commit-before-observation: the new incarnation is durable before AIEN acts on it); report CONTINUITY: RESUMED agent=<id> incarnation=<n> sequence=<s>.

Provisioning is only reachable from an explicit request (QEMU control block today; an operator-authenticated Recovery Core action on hardware later, ADR 0006). The normal boot path contains no code that writes an AgentRoot.

Qualification (QEMU)

CONTINUITY_QEMU: PASS requires, over the real NVMe path at 4096-byte LBA:

Consequences