diff --git a/AGENTS.md b/AGENTS.md index 2591097c85..579481abf4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,12 +41,40 @@ This means: - If a Cargo dependency breaks, we fork the dependency crate to `local/sources/` and pin our Cargo.toml to our fork. - The Linux kernel in `local/reference/` is read-only reference — never a dependency. -### NO OVERLAY-STYLE PATCHES — DIRECT EDITS ONLY +### NO OVERLAY-STYLE PATCHES — SCOPED POLICY (AMENDED 2026) -**Hard policy. No exceptions. No "just this once." No "temporary until we fork."** +**Hard policy for in-tree Red Bear components. Explicit allowance for +Red Bear forks of big external projects.** The blanket "no patches +anywhere" reading from commit `5396e6c3c` was too broad — it would have +forced every direct edit to mesa, wayland, qt, KF6, KWin, SDDM, llvm, +libdrm, redox-drm, libepoxy, and similar multi-million-line external +projects to live inside `recipes//source/`, where a `make clean` +or upstream sync would clobber it. That is not a full fork, that is a +liability. This section sets the two-rule model Red Bear OS actually +follows. -The Red Bear build is a **full fork**, not an overlay on top of Redox. The -correct workflow for any change is: +--- + +#### Rule 1 — In-tree Red Bear components: NO overlay, NO local fork of mainline + +These are Red Bear's own core components. They are small, fast-moving, +and tightly coupled to the rest of the system. **Direct edits go into +the mainline `recipes//recipe.toml` and `recipes//source/`.** +There is **no** Red Bear fork in `local/`, **no** symlink layer, +**no** patch file. + +| Component | Why in-tree, not a fork | +|---|---| +| `kernel` (`recipes/core/kernel`) | Red Bear's microkernel fork; ACPI, x2APIC, MSI/MSI-X, scheduling, branding — all live in `recipes/core/kernel/source/` directly | +| `relibc` (`recipes/core/relibc`) | Red Bear's C library fork; eventfd, signalfd, timerfd, waitid, SysV IPC, credential syscalls — all live in `recipes/core/relibc/source/` directly | +| `base` (drivers) (`recipes/core/base`) | Red Bear's userspace drivers fork; acpid, pcid, inputd, ps2d, xhcid migrations — all live in `recipes/core/base/source/` directly | +| `installer` (`recipes/core/installer`) | Red Bear's installer fork; ext4 + GRUB support — all lives in `recipes/core/installer/source/` directly | +| `bootloader` (`recipes/core/bootloader`) | Red Bear's UEFI bootloader fork; UEFI alloc fix, branding, GPT offset — all lives in `recipes/core/bootloader/source/` directly | + +For these components, the mainline recipe IS the Red Bear fork. We own +it. There is no upstream to sync with — it is our code, full stop. +The same rule applies to Red Bear-initiated new packages in +`local/recipes///`. | Want to change | Where to do it (DIRECT EDIT) | |---|---| @@ -56,7 +84,7 @@ correct workflow for any change is: | Change a build script | Edit `local/scripts/