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 / docs / adr / 0012-self-construction-capability-growth-and-generations.md
| 1 | # ADR 0012: Self-Construction, Capability Growth, and Reversible System Generations |
| 2 | |
| 3 | Status: Accepted by the operator, 2026-09-24. Amended 2026-09-24 (operator): voice-first interaction; audio output, voice synthesis and a text interface join the survival kit (rules 2 and 15). |
| 4 | Governing: [ADR 0002](0002-incumbent-os-as-migration-environment.md), [ADR 0006](0006-deterministic-recovery-core-and-offline-operator-authority.md), [ADR 0007](0007-continuous-existence-provisioning-once.md), [ADR 0009](0009-el2-bootstrap-to-el1h-kernel-transition.md). |
| 5 | Roadmap: inserts SEED-0A before M3 and SEED-0B after the M3 isolation work ([`ROADMAP.md`](../../ROADMAP.md)). |
| 6 | |
| 7 | ## Context |
| 8 | |
| 9 | The roadmap builds AIENOS the conventional way: a general-purpose kernel, |
| 10 | then storage, identity, networking, inference, and the agent. Two things |
| 11 | changed that. |
| 12 | |
| 13 | 1. **The engineer is now an AI.** Kernel and driver work on this repository is |
| 14 | increasingly proposed by AI agents. On 2026-09-24 an agent produced a |
| 15 | 1,234-line USB keyboard driver (#58) against a ~600-line limit, and another |
| 16 | agent wrote an unobserved root cause into an evidence file (#56). The |
| 17 | deterministic gates (`scripts/verify_all.sh`, the repository rules) caught |
| 18 | both. The pattern is: the engineer proposes, a separate deterministic |
| 19 | mechanism decides. |
| 20 | 2. **Continuity is already settled.** ADR 0007 makes AIEN provisioned once; |
| 21 | power-on is reconstruction, not creation. What remains open is how the |
| 22 | *machine around* AIEN comes to exist and change over time. |
| 23 | |
| 24 | The operator settled this through three design-interview rounds on |
| 25 | 2026-09-24. This ADR records the result. |
| 26 | |
| 27 | ## Decision |
| 28 | |
| 29 | AIEN is not distributed as a finished, universal, general-purpose operating |
| 30 | system. The trusted base supplies mechanisms; each machine grows the |
| 31 | capabilities it and its owner need, and every accepted change is a numbered, |
| 32 | reversible Generation admitted by deterministic gates. |
| 33 | |
| 34 | ### The three pieces |
| 35 | |
| 36 | ```text |
| 37 | AIEN SEED Continuity and recovery root. Tiny, boring, deterministic. |
| 38 | Establishes owner trust, identifies the machine, locates and |
| 39 | verifies the accepted Generation, recovers, rolls back. |
| 40 | Contains no model and needs none. |
| 41 | |
| 42 | AIEN FORGE The self-construction machinery: the engineering agent, |
| 43 | reproducible builds, Worlds, tests, proofs, benchmarks. |
| 44 | |
| 45 | AIEN GENERATION The current accepted expression of one machine: |
| 46 | capabilities + policies + interface + state. |
| 47 | ``` |
| 48 | |
| 49 | The Seed and Forge machinery may have versioned releases. A person's complete |
| 50 | AIEN is never a universal release; each machine evolves through its own |
| 51 | Generations. |
| 52 | |
| 53 | ### Rules |
| 54 | |
| 55 | 1. **Prove locally, design generally.** Machine 1 (the Spark) is the proving |
| 56 | ground. Nothing fundamental is Spark-specific unless it sits behind a |
| 57 | machine/BSP boundary. |
| 58 | 2. **Survival kit, then growth.** Every AIEN has what it needs to exist, |
| 59 | recover, and talk with its person: Seed/recovery, identity, |
| 60 | console/display, keyboard/input, storage, networking, time, the Forge |
| 61 | build/test machinery, audio output, voice synthesis, and a text interface. |
| 62 | Everything else is grown when required. |
| 63 | 3. **The agent is an untrusted proposer.** The model may write, adapt, |
| 64 | diagnose, and optimize. Candidate code never authorizes itself; every |
| 65 | candidate passes deterministic admission gates. |
| 66 | 4. **Admission is not permission.** A verified, reversible capability (for |
| 67 | example a camera driver) may be admitted automatically. Using it for |
| 68 | privacy, external communication, destructive storage changes, security |
| 69 | roots, encryption, credentials, identity, or other irreversible effects |
| 70 | still requires owner policy through AEGIS. The owner approves durable |
| 71 | policies rather than individual interruptions. |
| 72 | 5. **No native admission without enforcement.** Generated native components |
| 73 | run on the physical machine only after enforceable memory, DMA (SMMU), and |
| 74 | capability isolation exist (M3). Before that, a candidate can prove only |
| 75 | that it passed every test I know how to run. |
| 76 | 6. **Generations.** Every accepted system state is an immutable, numbered |
| 77 | Generation recording: parent, source provenance, build provenance, code |
| 78 | hashes, tests, proof receipts, capability grants, hardware target, |
| 79 | benchmark evidence, and rollback target. Activation is inactive-slot plus |
| 80 | canary promotion. Failure never destroys the previous accepted Generation. |
| 81 | Recovery never requires a model. |
| 82 | 7. **Two records per capability.** |
| 83 | |
| 84 | ```text |
| 85 | Capability Artifact what was built: source and provenance, supported |
| 86 | hardware constraints, tests, known proofs and failures |
| 87 | Capability Admission this MachineId, this firmware/hardware state, the |
| 88 | local verification receipt, the granted resource |
| 89 | envelope, the Generation it entered |
| 90 | ``` |
| 91 | |
| 92 | 8. **Knowledge is shareable; trust is not transferable.** Artifacts move |
| 93 | freely between the owner's machines and, later, through a public |
| 94 | content-addressed commons between people. A proof on machine A is evidence, |
| 95 | not authority, for machine B: every receiving machine rebuilds or |
| 96 | reproduces where practical, checks hardware/firmware prerequisites, reruns |
| 97 | the deterministic tests, runs its own constrained canary, and issues its |
| 98 | own admission. Exact hardware/firmware matches may shorten validation. |
| 99 | Source is preferred; prebuilt binaries are caches that must trace back to |
| 100 | source and build provenance. |
| 101 | 9. **Outside code enters as source.** Externally sourced code enters as |
| 102 | auditable source with provenance. Runtime dependence on arbitrary Internet |
| 103 | code is forbidden. |
| 104 | 10. **Rollback first, repair second.** When a live capability violates its |
| 105 | health contract, AIEN quarantines it and restores the most recent |
| 106 | known-good Generation without waiting for the owner, preserves the |
| 107 | evidence, diagnoses in an isolated World, and promotes a repair only |
| 108 | through the normal proof pipeline and canary. Repeated failed repairs stop |
| 109 | and are reported; there is no endless self-modification loop. For |
| 110 | security-sensitive anomalies: revoke access first, investigate second. |
| 111 | 11. **Honest failure, then compatibility, then optional escalation.** When AIEN |
| 112 | cannot build a capability it says so plainly and why. If the owner allows |
| 113 | it, a sealed incumbent-OS island may provide the capability temporarily |
| 114 | (e.g. `camera.native unavailable`, `camera.compat.win available`). With |
| 115 | explicit permission only, AIEN may publish a sanitized failure package to |
| 116 | the commons. Compatibility fills gaps; it never becomes a hidden permanent |
| 117 | dependency and stays visible as debt Forge keeps working to remove. |
| 118 | 12. **Incumbent OS as scaffolding.** Per ADR 0002, an `aien-bootstrap` path may |
| 119 | start inside Windows, macOS, or Linux as the normal entry for new machines: |
| 120 | inspect the machine, build the Machine Capsule, allocate AIEN storage, run |
| 121 | Forge, import data, and prepare the first native Generation. The Seed must |
| 122 | boot independently and survive deletion of the incumbent OS. Machine 1 has |
| 123 | already crossed into native execution and does not regress to this path. |
| 124 | 13. **Owner-priority resource budget.** Forge runs any time but yields to the |
| 125 | person immediately, under an explicit compute budget: small while the |
| 126 | owner is active, larger while idle, temporarily raised (with visible |
| 127 | status) for an urgent request. Values are learned per owner and machine, |
| 128 | not hard-coded. Natural statements ("use everything overnight", "not while |
| 129 | I'm gaming") compile into explicit resource policy. |
| 130 | 14. **Execution state is bounded; provenance is permanent.** |
| 131 | |
| 132 | ```text |
| 133 | PERMANENT Generation manifests, provenance, hashes, |
| 134 | proof receipts, security events, |
| 135 | migration/identity history, |
| 136 | owner-important records |
| 137 | PINNED UNTIL OWNER RELEASES preserved Generations, major migration and |
| 138 | recovery checkpoints |
| 139 | FULLY RESTORABLE WINDOW current Generation + the most recent |
| 140 | known-good Generations (e.g. 3-5) |
| 141 | RECLAIMABLE superseded binaries, duplicate build outputs, |
| 142 | test environments, caches, model |
| 143 | reconstruction state, abandoned candidates |
| 144 | ``` |
| 145 | |
| 146 | Storage is content-addressed: shared objects are stored once and collected |
| 147 | only when nothing retained references them. Security rollback history and |
| 148 | identity continuity records are never collected for age. |
| 149 | |
| 150 | 15. **Voice-first interaction.** AIEN is conversational by default, visual |
| 151 | when useful, and textual when precise. Voice output is part of the |
| 152 | survival kit (rule 2). Microphone input is a permission-controlled |
| 153 | capability (rule 4): push-to-talk, a wake phrase, temporary listening |
| 154 | windows, room/device policy, a visible listening state, and barge-in |
| 155 | (interrupting AIEN mid-sentence). Voice identity is durable logical state |
| 156 | (ADR 0007 Class A); the TTS model, audio driver and buffers are replaceable |
| 157 | physical state. Voice is local-first and sovereign where practical: no |
| 158 | cloud speech service is required to speak, listen, or recover. Recovery |
| 159 | and the Seed never depend on voice or on a model; the text console |
| 160 | remains the fallback. |
| 161 | |
| 162 | Capability order: `audio.output`, `speech.synthesis`, `voice.expression`; |
| 163 | then `audio.input`, `speech.recognition`, barge-in, speaker |
| 164 | identification, ambient interaction. |
| 165 | |
| 166 | ### Roadmap |
| 167 | |
| 168 | ```text |
| 169 | M0 / M1 / M2 |
| 170 | -> SEED-0A Self-construction lab (now) |
| 171 | -> M3 Kernel isolation: the enforcement substrate |
| 172 | -> SEED-0B Native capability admission |
| 173 | -> M4+ |
| 174 | ``` |
| 175 | |
| 176 | **SEED-0A** can run now: the agent observes the machine, writes or adapts |
| 177 | code, builds reproducibly, runs the deterministic checks, tests in QEMU, |
| 178 | benchmarks, produces a proof receipt, and creates an *inactive* candidate |
| 179 | Generation. It does not claim the candidate is safe to run unrestricted on |
| 180 | hardware. Experiment #1 is `input.keyboard.usb` (#58). The Machine 1 hardware |
| 181 | test rig (ADR 0011) is the physical admission lab that later closes the loop: |
| 182 | candidate, proof, QEMU canary, Machine 1 lock, staged one-time boot, HDMI and |
| 183 | UART capture, automated verdict, automatic rollback. |
| 184 | |
| 185 | **SEED-0B** follows the M3 isolation pieces (MMU, SMMU/DMA isolation, |
| 186 | exception boundaries, interrupt ownership, capability handles, task isolation, |
| 187 | resource accounting): generated code is admitted into a constrained world on |
| 188 | the physical machine, canaried, and promoted or destroyed. |
| 189 | |
| 190 | ## Consequences |
| 191 | |
| 192 | - M3 is built as the enforcement substrate for generated code, not only as a |
| 193 | conventional kernel milestone. Its acceptance should include "a candidate |
| 194 | component can be confined to named pages, DMA windows, and devices". |
| 195 | - Every later milestone delivers mechanisms plus the capabilities of the |
| 196 | survival kit, not a universal feature set. |
| 197 | - Evidence rules tighten for agents: a candidate's proof states what was |
| 198 | tested (QEMU, host, hardware) and never implies hardware behavior it did not |
| 199 | observe. |
| 200 | - The hardware test rig (ADR 0011) becomes a priority, since it turns the |
| 201 | physical step from an operator task into an automated gate. |
| 202 | - Capability records, Generation manifests, and the retention tiers become |
| 203 | persistent formats; their concrete schemas need their own ADRs before M4 |
| 204 | storage work fixes them. |
| 205 | - The owner is not the system administrator: AIEN is highly autonomous about |
| 206 | engineering, conservative about authority, and nearly invisible about |
| 207 | maintenance. |