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 / .github / copilot-instructions.md
| 1 | # Instructions for coding agents working on AIENOS |
| 2 | |
| 3 | Read `docs/PLAN_AUTHORITY.md`, `ROADMAP.md`, `CONTRIBUTING.md`, `CONTEXT.md` (domain language), and the relevant accepted ADRs before starting. `ROADMAP.md` owns the current AIENOS gate order. Historical/reference planning documents do not override it. Whole-system sequencing is owned by `aien-dev/aien-architecture-mv/CURRENT_EXECUTION_PLAN.md`. This file adds what agents most often get wrong here. |
| 4 | |
| 5 | ## Finish line for every pull request |
| 6 | |
| 7 | 1. `bash scripts/verify_all.sh` passes. Paste the command and the tail of its |
| 8 | output (the PASS/FAIL lines) at the top of the PR description. |
| 9 | 2. On an x86 runner some steps print `SKIPPED` (AArch64-only recovery tests, |
| 10 | KVM). Say which steps skipped; never describe a skipped step as passing. |
| 11 | 3. The PR description ends with one line `SECURITY_IMPACT: <class>`, one of |
| 12 | NONE, BOUNDARY, ROOT_OF_TRUST, AUTHORITY, RECOVERY, PERSISTENT_FORMAT. |
| 13 | Anything in the kernel privilege path, capabilities, AEGIS, storage unlock, |
| 14 | crypto or recovery is not NONE. |
| 15 | 4. One concern per PR, and keep it reviewable: aim for under 600 changed |
| 16 | lines. Split larger work into a series and say what comes next. |
| 17 | |
| 18 | ## Hard rules |
| 19 | |
| 20 | - Rust only (small AArch64 assembly where hardware demands it). No Python, no |
| 21 | shell scripts that fetch from the network, no CUDA or CUDA-shaped APIs. |
| 22 | - No systemd anywhere: no units, no systemd-creds, no journald, no emulation |
| 23 | of them. AIENOS has its own init and supervision. |
| 24 | - No new crates in the kernel, boot or trusted-base crates unless the issue |
| 25 | asks for one. Elsewhere, justify each new dependency in the PR. |
| 26 | - The kernel must work with no AI model loaded. Models never run in the |
| 27 | kernel and never hold authority. |
| 28 | - Never claim hardware behavior. Only QEMU and host-test results can be |
| 29 | claimed; Machine 1 (DGX Spark) evidence is produced by maintainers. |
| 30 | - Do not edit existing files in `evidence/`, the recovery scripts |
| 31 | (`scripts/build_recovery_media.sh`, `scripts/build_standalone_recovery_initrd.sh`, |
| 32 | `scripts/qemu_verify_recovery_media.sh`), signing or key tooling, or |
| 33 | `.github/workflows/`, unless the issue explicitly asks for it. |
| 34 | - No secrets, keys, personal data or photos in the repository. |
| 35 | - Docs and comments: plain language, no em dashes or en dashes. |
| 36 | |
| 37 | ## Kernel ordering (Milestone 3) |
| 38 | |
| 39 | ADR 0009 is accepted: the kernel moves from EL2 to EL1h before anything else in |
| 40 | M3. Until that change is on `main`, do not implement MMU page tables, exception |
| 41 | vector changes, interrupt or timer bring-up, task switching or EL0 entry, even |
| 42 | if an issue seems to ask. Host-testable logic (pure Rust with unit tests, no |
| 43 | system registers) is fine and preferred: build it so the EL1 kernel can adopt |
| 44 | it later. |
| 45 | |
| 46 | ## ADRs |
| 47 | |
| 48 | Check `docs/adr/` **and open pull requests** for the next free ADR number |
| 49 | before writing one, update `docs/adr/README.md`, and start with |
| 50 | `Status: Proposed.` Only the operator accepts ADRs. |
| 51 | |
| 52 | ## Useful commands |
| 53 | |
| 54 | ```bash |
| 55 | rustup target add aarch64-unknown-uefi aarch64-unknown-none |
| 56 | cargo test --workspace |
| 57 | cargo clippy --workspace --all-targets -- -D warnings |
| 58 | cargo build -p aienos-kernel --target aarch64-unknown-none --no-default-features |
| 59 | bash scripts/qemu_boot_test.sh # UEFI boot in QEMU, needs qemu-system-aarch64 + AAVMF |
| 60 | bash scripts/verify_all.sh # everything |
| 61 | ``` |