You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(governance): tolerate verbatim header-less LICENSE in consistency check
check-licence-consistency.sh required an SPDX-License-Identifier header
inside the LICENSE file and failed without one. But the estate template
ships LICENSE as plain, unmodified MPL-2.0 text with no header (SPDX
identifiers belong in source files, not in the canonical upstream licence
text), so the `licence-consistency` governance job went red on every PR
in repos using the template — hypatia, hermeneia and gitbot-fleet all
carry a header-less verbatim MPL-2.0 LICENSE.
Establish the licence identity from EITHER the SPDX header (when present)
OR the body-text classification (for a verbatim, header-less file). The
manifest cross-check now runs against that identity, so manifest mismatch
is still caught with or without a header. When a header IS present the
body-vs-header drift checks are unchanged (SPDX=MPL-2.0 + body=PMPL still
fails). Only a header-less file whose body matches no known template is
now reported as an error.
This is a script-logic change only — no LICENSE text or SPDX header is
edited (owner licence guardrail honoured).
Verified against hypatia/standards/hermeneia/gitbot-fleet (all pass) plus
five negative fixtures (PMPL-under-MPL-header drift, unidentifiable body,
manifest mismatch with and without header, missing LICENSE) — all still
fail loudly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wGTeLwiBGJ5rETC3QT4Pm
| sed -E 's/^[[:space:]]*SPDX-License-Identifier:[[:space:]]*//' \
62
110
| head -c 80 | tr -d '[:space:]')
63
111
64
-
if [ -z"$spdx_header" ];then
65
-
emit ERROR "LICENSE file has no 'SPDX-License-Identifier:' header on its first few lines."
66
-
emit ERROR "Add an SPDX header so downstream scanners (REUSE, cargo-license, etc.) can identify the licence."
67
-
failed=1
68
-
else
112
+
effective_lic=""
113
+
if [ -n"$spdx_header" ];then
69
114
emit OK "SPDX header: $spdx_header"
115
+
effective_lic="$spdx_header"
116
+
elif [ "$body_class"!="UNKNOWN" ];then
117
+
# No SPDX header, but the body is a recognised verbatim licence. This is the
118
+
# estate template's canonical shape (plain MPL-2.0 text, no header) and is
119
+
# internally consistent — accept it and use the body classification as the
120
+
# licence identity for the manifest cross-check below.
121
+
emit OK "LICENSE has no SPDX header, but its body is verbatim $body_class text — accepted as a canonical licence file."
122
+
effective_lic="$body_class"
123
+
else
124
+
emit ERROR "LICENSE file has no 'SPDX-License-Identifier:' header and its body matches no known licence template."
125
+
emit ERROR "Add an SPDX header, or use a recognised verbatim licence text, so downstream scanners (REUSE, cargo-license, etc.) can identify the licence."
0 commit comments