Skip to content

Commit 8611c33

Browse files
Kabuki94claude
andcommitted
add AI.md as system-layer agent entry point; whitelist in gitignore
AI.md at repo root provides a concise, agent-readable entry point covering the build/system layer: what mios.git owns, global env cascade, build pipeline, merge-at-build semantics, and the Six Architectural Laws. Agents load this file first, then /usr/share/mios/ai/system.md for full context. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 95f56b1 commit 8611c33

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
!/.github/
2626
!/.github/**
2727
!/AGENTS.md
28+
!/AI.md
2829
!/ARCHITECTURE.md
2930
!/CONTRIBUTING.md
3031
!/Containerfile

AI.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# MiOS — System Layer AI Entry Point
2+
3+
> Agent loading order: this file → `/usr/share/mios/ai/system.md` (full prompt) → `/etc/mios/ai/system-prompt.md` (host override) → `~/.config/mios/system-prompt.md` (user overlay)
4+
5+
MiOS is an immutable bootc-native Fedora workstation OS delivered as an OCI image. The repo root (`mios.git`) **is** the system root `/` — no separate workspace.
6+
7+
## What mios.git owns (build + system layer)
8+
9+
| Path | Purpose |
10+
|---|---|
11+
| `/Containerfile` | OCI image definition (bootc, `FROM quay.io/fedora/fedora-bootc:42`) |
12+
| `/Justfile` | Build entry (`just build`, `just push`, `just clean`) |
13+
| `/automation/` | 48 shell scripts for system configuration |
14+
| `/usr/lib/systemd/` | 38 systemd units + 4 Quadlet container definitions |
15+
| `/usr/lib/dracut.conf.d/` + `/usr/lib/karg.d/` | 14 kernel argument files |
16+
| `/usr/share/mios/PACKAGES.md` | Package manifest (parsed by `automation/80-install-packages.sh`) |
17+
| `/usr/share/mios/profile.toml` | Vendor-default profile (lowest precedence) |
18+
| `/usr/share/mios/env.defaults` | Global `MIOS_*` env variable defaults |
19+
20+
## Global env surface
21+
22+
All `MIOS_*` variables resolve via five-layer cascade (highest wins):
23+
24+
```
25+
$MIOS_VAR env → ~/.config/mios/env → /etc/mios/install.env → /etc/mios/env.overrides → /usr/share/mios/env.defaults
26+
```
27+
28+
Key vars: `MIOS_AI_MODEL`, `MIOS_AI_EMBED_MODEL`, `MIOS_AI_BASE_URL`, `MIOS_BASE_IMAGE`, `MIOS_VERSION`
29+
30+
## Build pipeline
31+
32+
```
33+
just build # Containerfile → OCI image
34+
just push # push to ghcr.io/mios-dev/mios:latest
35+
just clean # prune local image cache
36+
```
37+
38+
Local dev: `./mios-build-local.ps1` (Windows) · `./automation/build.sh` (Linux)
39+
40+
## Merge-at-build semantics
41+
42+
At `just build`, `mios-bootstrap.git` is fetched and merged onto this repo via `automation/00-bootstrap-merge.sh`. Bootstrap values (user profile, AI files, flatpak lists) override the vendor defaults in this repo. The merged result is baked into the OCI image.
43+
44+
## Six Architectural Laws
45+
46+
1. **USR-OVER-ETC** — defaults in `/usr/share/`; overrides in `/etc/`; never reverse
47+
2. **NO-MKDIR-IN-VAR** — runtime dirs declared in `tmpfiles.d`, not `mkdir` in scripts
48+
3. **BOUND-IMAGES** — all container images pinned; never `:latest` in Quadlets
49+
4. **BOOTC-CONTAINER-LINT**`RUN bootc container lint` is always the final Containerfile instruction
50+
5. **UNIFIED-AI-REDIRECTS** — all `MIOS_AI_*` vars point to `http://localhost:8080/v1`; no vendor endpoints in committed files
51+
6. **UNPRIVILEGED-QUADLETS** — all Quadlet containers run rootless unless security policy demands root
52+
53+
## Full agent context
54+
55+
Load `/usr/share/mios/ai/system.md` for the complete prompt covering all 48 automation scripts, 38 systemd units, 4 Quadlets, 14 karg files, user creation, profile resolution, and day-2 operations.

0 commit comments

Comments
 (0)