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#60 (code only)
Apply it
git checkout -b patch-2ec193dab767f857 11313787be71c0e56c016094279b6e6a9ff81b2a curl -fsSL https://interplane.io/drakestapleton/aienux/patches/2ec193dab767f857.patch | git am
Provenance
github-import 1
aien-dev/aienux
60
5025b15b044857a5c2c8b75bd531d0a9ec4ca2eb
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":60,"url":"https://github.com/aien-dev/aienux/pull/60","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:41Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000..6217f701 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,63 @@ +# Instructions for coding agents working on AIENOS + +Read `CONTRIBUTING.md`, `CONTEXT.md` (domain language) and `docs/MILESTONES.md` +(gate order and escalation triggers) before starting. They are binding. This +file adds what agents most often get wrong here. + +## Finish line for every pull request + +1. `bash scripts/verify_all.sh` passes. Paste the command and the tail of its + output (the PASS/FAIL lines) at the top of the PR description. +2. On an x86 runner some steps print `SKIPPED` (AArch64-only recovery tests, + KVM). Say which steps skipped; never describe a skipped step as passing. +3. The PR description ends with one line `SECURITY_IMPACT: <class>`, one of + NONE, BOUNDARY, ROOT_OF_TRUST, AUTHORITY, RECOVERY, PERSISTENT_FORMAT. + Anything in the kernel privilege path, capabilities, AEGIS, storage unlock, + crypto or recovery is not NONE. +4. One concern per PR, and keep it reviewable: aim for under 600 changed + lines. Split larger work into a series and say what comes next. + +## Hard rules + +- Rust only (small AArch64 assembly where hardware demands it). No Python, no + shell scripts that fetch from the network, no CUDA or CUDA-shaped APIs. +- No systemd anywhere: no units, no systemd-creds, no journald, no emulation + of them. AIENOS has its own init and supervision. +- No new crates in the kernel, boot or trusted-base crates unless the issue + asks for one. Elsewhere, justify each new dependency in the PR. +- The kernel must work with no AI model loaded. Models never run in the + kernel and never hold authority. +- Never claim hardware behavior. Only QEMU and host-test results can be + claimed; Machine 1 (DGX Spark) evidence is produced by maintainers. +- Do not edit existing files in `evidence/`, the recovery scripts + (`scripts/build_recovery_media.sh`, `scripts/build_standalone_recovery_initrd.sh`, + `scripts/qemu_verify_recovery_media.sh`), signing or key tooling, or + `.github/workflows/`, unless the issue explicitly asks for it. +- No secrets, keys, personal data or photos in the repository. +- Docs and comments: plain language, no em dashes or en dashes. + +## Kernel ordering (Milestone 3) + +ADR 0009 is accepted: the kernel moves from EL2 to EL1h before anything else in +M3. Until that change is on `main`, do not implement MMU page tables, exception +vector changes, interrupt or timer bring-up, task switching or EL0 entry, even +if an issue seems to ask. Host-testable logic (pure Rust with unit tests, no +system registers) is fine and preferred: build it so the EL1 kernel can adopt +it later. + +## ADRs + +Check `docs/adr/` **and open pull requests** for the next free ADR number +before writing one, update `docs/adr/README.md`, and start with +`Status: Proposed.` Only the operator accepts ADRs. + +## Useful commands + +```bash +rustup target add aarch64-unknown-uefi aarch64-unknown-none +cargo test --workspace +cargo clippy --workspace --all-targets -- -D warnings +cargo build -p aienos-kernel --target aarch64-unknown-none --no-default-features +bash scripts/qemu_boot_test.sh # UEFI boot in QEMU, needs qemu-system-aarch64 + AAVMF +bash scripts/verify_all.sh # everything +``` diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 00000000..fd4c9963 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,29 @@ +name: Copilot setup steps + +# Prepares the Copilot coding agent's environment with the same toolchain and +# emulator packages as scripts/verify_all.sh needs. Runs only for the agent or +# when started by hand. +on: workflow_dispatch + +jobs: + copilot-setup-steps: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-unknown-none, aarch64-unknown-uefi + components: clippy, rustfmt + + - name: Install QEMU, AAVMF firmware and swtpm + run: | + sudo apt-get update + sudo apt-get install -y qemu-system-arm qemu-efi-aarch64 swtpm swtpm-tools + + - name: Warm the cargo cache + run: cargo fetch --locked