From 067331190a8cd6ff3e485a6b255cea06ecf0a7a2 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Fri, 17 Jul 2026 23:48:59 +0100 Subject: [PATCH] fix(licence-check): recognise AGPL-3.0 in the body classifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit check-licence-consistency.sh classified MPL-2.0, PMPL-1.0, GPL-3.0, Apache-2.0, MIT and BSD-3-Clause verbatim texts, but had no AGPL-3.0 template. A repo with a full-text GNU AFFERO GPL LICENSE (and no SPDX header line) therefore classified as UNKNOWN and failed the check. This forced the estate's deliberate AGPL exceptions (the co-developed-with-son games) into an SPDX-stub LICENSE to pass — which GitHub then reads as NOASSERTION/"Other" rather than AGPL. It also actively rejected airborne-submarine-squadron once its wrongly-clobbered MPL LICENSE was restored to its intended AGPL (asq PR #57): the check passed the wrong state and failed the right one. Add has_agpl (matches "GNU AFFERO GENERAL PUBLIC LICENSE"), classified before plain GPL-3.0 so the Affero title wins. A full-text AGPL LICENSE is now accepted as a canonical licence file, so AGPL repos can use GitHub-detectable full text like the MPL repos already do. Verified: modified script exits 0 against airborne-submarine-squadron (full-text AGPL) and still exits 0 against nextgen-typing (MPL) — no regression. Co-Authored-By: Claude Opus 4.8 --- scripts/check-licence-consistency.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/check-licence-consistency.sh b/scripts/check-licence-consistency.sh index 4c19ecc0..207fbdd3 100755 --- a/scripts/check-licence-consistency.sh +++ b/scripts/check-licence-consistency.sh @@ -71,6 +71,7 @@ has_mpl2_text=$(count_in 'Mozilla Public License Version 2\.0|Mozilla Public Lic has_pmpl_text=$(count_in_i 'PMPL-1\.0-or-later|Palimpsest License \(PMPL') has_apache=$(count_in 'Apache License.*Version 2\.0') has_mit=$(count_in 'MIT License') +has_agpl=$(count_in 'GNU AFFERO GENERAL PUBLIC LICENSE') has_gpl3=$(count_in 'GNU GENERAL PUBLIC LICENSE.*Version 3') has_bsd3=$(count_in 'BSD.*3-Clause') has_proprietary=$(count_in_i 'All Rights Reserved') @@ -89,6 +90,13 @@ elif [ "$has_apache" -gt 0 ]; then body_class="Apache-2.0" elif [ "$has_mit" -gt 0 ]; then body_class="MIT" +elif [ "$has_agpl" -gt 0 ]; then + # AGPL before plain GPL-3.0: the AGPL body carries "GNU AFFERO GENERAL PUBLIC + # LICENSE". These are deliberate co-developed-project exceptions to the estate + # MPL-2.0 policy (e.g. the games airborne-submarine-squadron, the-nash-equilibrium) + # and must be recognised so their full-text LICENSE files (which GitHub then + # detects as AGPL, unlike an SPDX-stub) pass this check. + body_class="AGPL-3.0" elif [ "$has_gpl3" -gt 0 ]; then body_class="GPL-3.0" elif [ "$has_bsd3" -gt 0 ]; then