From 5396e6c3ccae68f61dc673f3e564a30471d58836 Mon Sep 17 00:00:00 2001 From: Admin Pupkin Date: Tue, 9 Jun 2026 16:27:09 +0300 Subject: [PATCH] docs: add NO OVERLAY-STYLE PATCHES policy to both AGENTS.md files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Red Bear is a full fork, not an overlay. Document explicitly: - What the policy is - What the forbidden anti-patterns are (apply-patches.sh symlinks, recipes/*/source/ symlinks, mixing local/recipes/ edits with recipes/ patches, etc.) - How to fork a Redox package correctly (copy to local/recipes/, edit there, delete the upstream recipe) - Why this matters (auditability, build determinism, no stolen upstream changes, CI reproducibility) - Historical context of why apply-patches.sh and local/patches/ still exist (transitional remnants, historical-only) Also update the 'How the build system works' diagram to clarify that the source/ symlink is for core Red Bear forks (kernel, base, relibc, bootloader, installer) — NOT for recipes. Recipes have a different model: either fork entirely in local/recipes/ or coexist in mainline. No symlinks, no overlay. Also add a row to the 'Common anti-patterns' table listing the four specific overlay-style mistakes (apply-patches.sh, recipes/ symlinks, local/recipes/ + recipes/ mix, etc.) so future agents see them flagged next to the existing 'don't edit source/' and 'don't add patches' rules. The user's 'IF YOU DID PATCHES, REDO ALL' was triggered by my adding mesa to apply-patches.sh. The 450k line deletion was the cost of the overlay approach breaking. This commit prevents recurrence. --- AGENTS.md | 106 ++++++++++++++++++++++++++++++++++++++++++++++-- local/AGENTS.md | 99 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 181 insertions(+), 24 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 42b33498cc..2591097c85 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,7 +28,7 @@ This means: | Rule | Explanation | |---|---| -| **Own your dependencies** | Every crate and library Red Bear uses must have its source accessible in `local/sources/` or `local/recipes/`. No depending on upstream crates that we cannot fix ourselves. | +| **Own your dependencies** | Every crate and library Red Bear uses must have its source accessible in `local/sources/` or `local/recipes/`. No dependiendo on upstream crates that we cannot fix ourselves. | | **No waiting for upstream** | If a dependency breaks, we fix it in our fork. We do not file issues and wait. | | **Frozen snapshots only** | Upstream Redox is a reference, not a live dependency. We baseline on frozen snapshots and never auto-pull. | | **Upstream gitlab URLs are temporary** | Any recipe pointing at `gitlab.redox-os.org` (91 currently) must eventually be forked to `local/sources/` or pinned to a frozen archive. Exceptions: unmodified upstream packages with pinned revisions. | @@ -37,10 +37,93 @@ This means: **Concretely:** - `local/recipes/drivers/redox-driver-sys/` is OUR fork. We fix compilation errors there. -- `local/sources/kernel/` is OUR kernel. We don't pull from `gitlab.redox-os.org/redox-os/kernel`. +- `local/sources/kernel/` is OUR kernel. We don't pull from `gitlab.redox-os.org/redox-oskernel`. - 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 + +**Hard policy. No exceptions. No "just this once." No "temporary until we fork."** + +The Red Bear build is a **full fork**, not an overlay on top of Redox. The +correct workflow for any change is: + +| Want to change | Where to do it (DIRECT EDIT) | +|---|---| +| Change a recipe's build config | Edit `local/recipes///recipe.toml` directly. If the recipe is in upstream `recipes///recipe.toml`, fork it: copy to `local/recipes///recipe.toml` and edit there. | +| Change a source file | Edit `local/sources//.rs` directly. | +| Add a new package | Create `local/recipes///recipe.toml` directly. | +| Change a build script | Edit `local/scripts/