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 / 0011-machine-1-hardware-test-rig.md
| 1 | # ADR 0011: Machine 1 Hardware Test Rig (Power, Capture, Input) |
| 2 | |
| 3 | Status: proposed, 2026-09-24. Requires operator approval of the parts list |
| 4 | before maintainers wire anything. It does not change the boot architecture. |
| 5 | Governing: [MILESTONES.md gate M2C](../MILESTONES.md), |
| 6 | [HARDWARE_TEST_RIG.md](../HARDWARE_TEST_RIG.md), |
| 7 | [NATIVE_BOOT_ONE_TIME.md](../NATIVE_BOOT_ONE_TIME.md), |
| 8 | issue [#25](https://github.com/aien-dev/aienux/issues/25). |
| 9 | |
| 10 | ## Context |
| 11 | |
| 12 | Every Spark boot needs a person at the machine: power and reset by hand, |
| 13 | screen evidence by photograph, and firmware interaction by keyboard. Gate M2C |
| 14 | requires power/reset control, HDMI capture and USB input emulation before |
| 15 | hardware testing can run unattended or at any cadence. A Raspberry Pi is |
| 16 | already cabled to the Spark and can host all three functions. |
| 17 | |
| 18 | ## Decision |
| 19 | |
| 20 | Build the Machine 1 test rig as three **independent** functions on the |
| 21 | existing Raspberry Pi controller, with the parts list and wiring in |
| 22 | [HARDWARE_TEST_RIG.md](../HARDWARE_TEST_RIG.md): |
| 23 | |
| 24 | 1. **Power and reset control**: reed relays across the front-panel power and |
| 25 | reset pins, a fail-on mains relay for hard power cut, and a `PWR_OK` sense |
| 26 | line for power state. |
| 27 | 2. **Display and console capture**: a UVC HDMI capture dongle with |
| 28 | loop-through on the Spark's display output, and the Pi GPIO UART for the |
| 29 | Spark console once SPCR-based UART discovery |
| 30 | ([#22](https://github.com/aien-dev/aienux/issues/22)) exists. |
| 31 | 3. **Deterministic input and boot selection**: the Pi USB OTG port as an HID |
| 32 | boot-protocol keyboard gadget, driven by scripted, capture-verified |
| 33 | keystroke sequences. |
| 34 | |
| 35 | All three functions are serialized through |
| 36 | `aien-proof hold --resource machine-1`, whose implementation and ledger live |
| 37 | in the [aien-sovereign-core](https://github.com/aien-spark/aien-sovereign-core) |
| 38 | repository. This repository holds the design, the operating contract and the |
| 39 | versioned boot sequences. |
| 40 | |
| 41 | ## Invariants |
| 42 | |
| 43 | 1. **Independence.** Each function fails without breaking the other two. A |
| 44 | failed capture never blocks power control; a dead keyboard gadget never |
| 45 | traps the machine. |
| 46 | 2. **Fail-on power.** The mains relay passes power at rest, so a dead or hung |
| 47 | controller cannot hold the machine dark. The operator can always cut power |
| 48 | by hand. |
| 49 | 3. **Momentary-only buttons.** Button relays close only for bounded intervals, |
| 50 | enforced in software and by the relay hardware. |
| 51 | 4. **Read-only capture.** Capture observes; it never alters the machine. |
| 52 | 5. **Serialized control.** Every rig function runs only inside an |
| 53 | `aien-proof hold --resource machine-1`; the hold output is the ledger |
| 54 | event. Deterministic sequences are versioned in this repository so a boot |
| 55 | maps to one exact commit, same rule as the staged image. |
| 56 | 6. **No trust change.** The rig drives boots; it does not change what boots. |
| 57 | Secure Boot stays on and native AIENOS boots stay paused until the |
| 58 | owner-controlled boot chain exists. The rig adds no credentials, network |
| 59 | services or privileged host state to the trusted base. |
| 60 | 7. **Off the critical path at rest.** With every relay at rest the Spark |
| 61 | behaves exactly as it does unwired. |
| 62 | |
| 63 | ## Consequences |
| 64 | |
| 65 | - Screen evidence for boots stops depending on an operator photograph; the |
| 66 | post-exit drawing gap in the M2 evidence becomes a capture artifact named |
| 67 | in the ledger payload. |
| 68 | - Recovery-media testing |
| 69 | ([#17](https://github.com/aien-dev/aienux/issues/17)) and the TRUST-1 |
| 70 | 100-boot campaign can run without a person at the machine. |
| 71 | - The HID gadget becomes the hardware test target for the native xHCI/HID |
| 72 | keyboard driver ([#24](https://github.com/aien-dev/aienux/issues/24)). |
| 73 | - `aien-proof` gains rig commands under the existing `machine-1` resource |
| 74 | lock; that work lands in aien-sovereign-core, not here. |
| 75 | - The rig is removed piece by piece only if a native path replaces it (for |
| 76 | example native network control after M6); the capture and input functions |
| 77 | are expected to stay through the M8 demonstration. |