Skip to content

Commit af5fa44

Browse files
committed
chore(licence): apply + enforce MPL-2.0 / CC-BY-SA-4.0 SPDX invariant
Owner-directed (satisfies LICENCE-POLICY.adoc A2's "manual, per-file, by the owner" gate). Makes the licence split a formal, enforced invariant. - Applied SPDX headers per file: MPL-2.0 to all code/config/scripts/state (25 src+tests .rs, Cargo.toml, .gitignore); CC-BY-SA-4.0 to prose. Fixed prose drift: CHANGELOG/CONTRIBUTING/SECURITY MPL-2.0 -> CC-BY-SA-4.0, and docs/*.adoc CC-BY-4.0 -> CC-BY-SA-4.0 (the check caught the missing -SA). - New scripts/check-spdx.sh enforces the invariant; wired into `just check` (new `license-check` recipe) and .github/workflows/rust-ci.yml. - New .machine_readable/licensing-policy.toml declares the rule + the excluded set machine-readably. Third-party protection: nothing not ours is relicensed. Cargo.lock (generated, enumerates third-party deps), LICENSE (the MPL text itself), and tests/fixtures/ (Agda test-input data) are excluded. There is no vendored third-party source in-tree; if any is added, the checker FAILS until it is listed as excluded with its original SPDX preserved — that failure is the guard against silent relicensing. `bash scripts/check-spdx.sh` OK; fmt/clippy/test green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019GiSiEfgZCte35dyykgBHs
1 parent 5b7aff4 commit af5fa44

38 files changed

Lines changed: 209 additions & 16 deletions

.github/workflows/rust-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ jobs:
4949
cargo --version
5050
rustup component add clippy rustfmt
5151
52+
- name: SPDX licence invariant
53+
run: bash scripts/check-spdx.sh
54+
5255
- name: cargo fmt --check
5356
run: cargo fmt --all -- --check
5457

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
14
# Rust build artefacts
25
target/
36

.machine_readable/6a2/STATE.a2ml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,13 @@ milestones = [
3434
]
3535

3636
[blockers-and-issues]
37-
# No active blockers. v0.1 lint set + DAG schema (arghda-spec.adoc) are complete.
38-
# Known compliance gap (owner-manual only, per LICENCE-POLICY A2 — never an
39-
# agent sweep): src/*.rs lack per-file `// SPDX-License-Identifier: MPL-2.0`
40-
# headers. The repo is declared MPL-2.0 (Cargo.toml, LICENSE); applying the
41-
# per-file headers is owner-driven manual work.
37+
# No active blockers. v0.1 lint set + DAG schema (arghda-spec.adoc) are
38+
# complete. The SPDX licence invariant is applied and enforced
39+
# (scripts/check-spdx.sh; .machine_readable/licensing-policy.toml).
4240

4341
[critical-next-actions]
4442
actions = [
45-
"Owner-manual: apply MPL-2.0 SPDX headers to src/*.rs (no agent bulk sweep — LICENCE-POLICY A2)",
43+
"Formalise template-applicability rules (capability-gated RSR profile: carry a template module iff the repo declares the capability it serves) — estate-wide, candidate for hyperpolymath/standards",
4644
"Extend content-hash invalidation to cover transitive imports (needs include-root tracking)",
4745
"Serve /.well-known/groove for PanLL discovery (Groove protocol)",
4846
"Scaffold arghda-studio (AffineScript visual layer consuming the dag JSON)",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
#
4+
# Licence invariant for arghda-core — machine-readable declaration of the rule
5+
# enforced by scripts/check-spdx.sh (run in `just check` + Rust CI). The split
6+
# itself comes from hyperpolymath/standards LICENCE-POLICY.adoc Rule 1.
7+
8+
[invariant]
9+
enforced = true
10+
checker = "scripts/check-spdx.sh"
11+
wired-into = ["Justfile (just check / just license-check)", ".github/workflows/rust-ci.yml"]
12+
13+
[licences]
14+
# By content type, not by directory.
15+
code = "MPL-2.0" # *.rs, *.toml, *.a2ml, *.yml, *.sh, Justfile, .gitignore, .well-known/*
16+
prose = "CC-BY-SA-4.0" # *.adoc, *.md narrative
17+
# Canonical texts: MPL-2.0 -> ./LICENSE ; CC-BY-SA-4.0 -> standards/LICENSES/CC-BY-SA-4.0.txt
18+
19+
[excluded]
20+
# NOT ours, generated, or test-input data. These never carry the repo's
21+
# licence choices; the checker skips them.
22+
paths = [
23+
"Cargo.lock", # generated by cargo; enumerates third-party dependencies
24+
"LICENSE", # the MPL-2.0 licence text itself
25+
"target/", # cargo build output (gitignored)
26+
"tests/fixtures/", # Agda test-input data (some deliberately malformed)
27+
]
28+
29+
[third-party]
30+
# arghda-core vendors NO third-party source in-tree: every dependency is
31+
# fetched by cargo (declared in Cargo.toml, pinned in Cargo.lock) and is never
32+
# relicensed. If third-party source is ever vendored in-tree, add its path to
33+
# [excluded] above and preserve its ORIGINAL SPDX header verbatim. The checker
34+
# fails on any unrecognised in-tree file until it is excluded — that failure is
35+
# the intended guard against silently relicensing others' code.
36+
vendored-in-tree = []

CHANGELOG.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- SPDX-License-Identifier: MPL-2.0 -->
1+
<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
22
# Changelog
33

44
All notable changes to arghda-core are documented here. The format follows
@@ -16,8 +16,15 @@ All notable changes to arghda-core are documented here. The format follows
1616
docs carry `CC-BY-SA-4.0`; code/config/state stay `MPL-2.0` (per the estate
1717
licence policy). Refreshed `.machine_readable/6a2/STATE.a2ml` + `META.a2ml`
1818
and the `0-AI-MANIFEST.a2ml` read-order; removed local `dist-newstyle/`
19-
build cruft. (Per-file SPDX headers on `src/*.rs` remain owner-manual by
20-
policy — never an agent bulk sweep.)
19+
build cruft.
20+
- Formal SPDX licence invariant (owner-directed): every tracked file carries
21+
the correct header — `MPL-2.0` for code/config/scripts/state, `CC-BY-SA-4.0`
22+
for prose — applied per file (incl. all `src/*.rs`) and enforced by
23+
`scripts/check-spdx.sh`, wired into `just check` and Rust CI. Third-party,
24+
generated (`Cargo.lock`), and test-data (`tests/fixtures/`) files are
25+
explicitly excluded and never relicensed; `docs/*.adoc` normalised from
26+
`CC-BY-4.0` to `CC-BY-SA-4.0`. Declared in
27+
`.machine_readable/licensing-policy.toml`.
2128

2229
### Added
2330

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- SPDX-License-Identifier: MPL-2.0 -->
1+
<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
22
# Contributing to arghda-core
33

44
arghda-core is the Rust engine for the arghda proof-workspace tool.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
14
[package]
25
name = "arghda-core"
36
version = "0.1.0"

Justfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ fmt-check:
3232
lint:
3333
cargo clippy --all-targets -- -D warnings
3434

35+
# SPDX licence invariant: MPL-2.0 for code/config/scripts, CC-BY-SA-4.0 for
36+
# prose; third-party / generated / test data excluded (CI gate).
37+
license-check:
38+
bash scripts/check-spdx.sh
39+
3540
# The full CI gate, exactly what .github/workflows/rust-ci.yml runs.
36-
check: fmt-check lint build test
41+
check: fmt-check lint license-check build test
3742

3843
# Alias for CI.
3944
ci: check

README.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,10 @@ link:EXPLAINME.adoc[`EXPLAINME.adoc`] as the orientation pointer.
137137

138138
Code, configuration and scripts are `MPL-2.0` (see link:LICENSE[LICENSE]);
139139
prose documentation is `CC-BY-SA-4.0`, per the
140-
https://github.com/hyperpolymath/standards[hyperpolymath licence policy].
141-
SPDX headers are owner-managed and applied manually per file.
140+
https://github.com/hyperpolymath/standards[hyperpolymath licence policy] (Rule
141+
1). This split is a **formal invariant**: every tracked file carries the
142+
appropriate SPDX header, checked by `scripts/check-spdx.sh` in `just check` and
143+
in CI. Third-party, generated, and test-data files are explicitly excluded
144+
(link:.machine_readable/licensing-policy.toml[`licensing-policy.toml`]) and are
145+
never relicensed — vendoring third-party source in-tree fails the check until
146+
it is listed as excluded with its original SPDX preserved.

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- SPDX-License-Identifier: MPL-2.0 -->
1+
<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
22
# Security Policy
33

44
## Supported versions

0 commit comments

Comments
 (0)