From 9be7502678f8d46e76524e609a9a6f7b0358e8bd Mon Sep 17 00:00:00 2001 From: Thore Cimbal Date: Fri, 21 Aug 2026 12:00:00 +0000 Subject: [PATCH] fix: a new immutable source is an addition, not a change pruefe_sperrliste read --name-only, so it could not tell a modified source from a newly added one and flagged both. That made a framework upgrade impossible by construction: an upgrade must place a new baseline under docs/sources/upstream/, and the lock rejected exactly that. Upstream's check_locked.py draws the same line and asserts it ('adding a new source is not an edit'). Modification and deletion stay locked. --- scripts/pruefe_sperrliste.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/pruefe_sperrliste.py b/scripts/pruefe_sperrliste.py index df2c4bc..395f6f8 100644 --- a/scripts/pruefe_sperrliste.py +++ b/scripts/pruefe_sperrliste.py @@ -119,7 +119,19 @@ def main() -> int: return 1 try: - geaendert = [z for z in git(root, "diff", "--name-only", bereich).splitlines() if z] + # --name-status statt --name-only: eine unveraenderliche Quelle darf + # nicht geaendert werden, aber eine NEUE anzulegen ist keine Aenderung. + # Ohne diese Unterscheidung ist ein Framework-Upgrade unmoeglich - es + # legt zwingend eine neue Baseline unter docs/sources/upstream/ an. + # Upstream check_locked.py trennt genauso ("adding a new source is not + # an edit"). + geaendert = [] + for zeile in git(root, "diff", "--name-status", "--no-renames", + bereich).splitlines(): + if not zeile.strip(): + continue + teile = zeile.split("\t") + geaendert.append((teile[0][0], teile[-1])) except GitFehler as fehler: print(f"pruefe_sperrliste: Bereich {bereich} nicht auswertbar - {fehler}") print("Ungeprueft ist nicht bestanden.") @@ -130,10 +142,12 @@ def main() -> int: befunde: list[str] = [] - for pfad in geaendert: - # 1. Unveraenderliche Quellen + for status, pfad in geaendert: + # 1. Unveraenderliche Quellen - Aenderung und Loeschung, nicht Zugang if any(pfad.startswith(p) for p in GESPERRT_VOLL): - befunde.append(f"{pfad}: unveraenderlich (AGENTS.md: read-only for agents)") + if status != "A": + befunde.append( + f"{pfad}: unveraenderlich (AGENTS.md: read-only for agents)") continue # 2. Angenommene ADRs