Skip to content

feat(migrate): cited licenses of the Archive (T07) - #25

Merged
oesteban merged 4 commits into
masterfrom
feat/migrate-licenses
Dec 6, 2026
Merged

oesteban merged 4 commits into
masterfrom
feat/migrate-licenses

Conversation

@oesteban

@oesteban oesteban commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Summary

PR 5c1 of the migration to TemplateFlow 2.0 covers the licenses. Every template, atlas and file subset of the Archive gets an SPDX license, cited from its upstream distribution. A new transform, T07, then writes these licenses into each template.

migrate/config/2.0.0.yaml
└── licenses
    ├── texts    8 texts tfmanager does not bundle, verbatim under migrate/config/licenses/,
    │            each with its URL and sha256 (checked when the config loads)
    └── table   68 entries: 30 templates, 35 atlases, 3 file subsets
                basis: upstream 55, derived 5 (distributor's terms, source's noted),
                templateflow 8 (no upstream statement: TemplateFlow's value stands)

Each entry carries its license, basis, URL, a verbatim quote, the evidence files saved on 2026-12-05 (kept outside the repository), the retrieval date and the reason. A script checked every quote against its saved evidence, and all 68 matched.

 plan_content
   T05 references, config edits
   T01-T03 tables, label check
   T06 template_description.json
+  T07 plan_licenses (migrate/licensing.py)
+    template_description.json: License from the template's entry
+    LICENSE: "SPDX-License-Identifier: <License>", blank line, then
+      keep:  its own text, after the entry's replace edits (MNI152Lin, MNIPediatricAsym)
+      write: the license's text (Fischer344, MNI152NLin6Asym, NKI, OASIS30ANTs, WHS, fsLR, fsaverage)
+    JSON sidecars that state a License: their atlas or files entry (none: M203, value kept)
+    rows of an existing atlases table: their atlas's entry (a missing license column is added)
+    file subsets: one inheritable sidecar per directory and suffix (per file if it would reach others)
+    docs/licenses/<id>.txt for each license the sidecars or atlases.tsv use beyond the template's
+      (no text: M211, blocking)
   T10, T08, T09, flip trial
   T11 CHANGES
+    "Licenses: License X (was 'Y'); LICENSE ...; License of N JSON sidecars;
+     License of N atlases in tpl-X_atlases.tsv; docs/licenses/ ..."

Other changes:

  • The config schema gains licenses.texts and licenses.table. The loader checks:
    • SPDX ids are canonical;
    • each needed text exists, with its sha256;
    • license_file appears only on template entries, count only on files entries;
    • replace appears only with keep;
    • entities are known, and ids and entries are unique.
  • The config digest now covers the tables and license texts it cites.
  • CHANGES wraps no longer break at hyphens.
  • migrate/config/licenses/*.txt ships as package data.

Evidence

Migrated Archive (pinned v2 skeleton, test_archive):

  • Before: TF502 41, TF504 6, TF505 24; flips: none.
  • After: TF508 6 (MNI152Lin's six desc-SPM12 sidecars, GPL-2.0-or-later); TF502, TF504 and TF505 are gone. Flips: MNI152NLin6Sym, MNI305, MNIColin27 and onavg. Blocked plans: none. T07 writes 85 files.
  • Planning the migrated Archive again writes nothing (test_archive_idempotent).

New tests (test_migrate_licensing.py):

  • write and keep, including replace edits;
  • the no-entry case (M203);
  • sidecars, with M203 and M211;
  • file subsets, with inheritance and the per-file fallback;
  • the CHANGES item;
  • an existing atlases table: its rows, the generated description and the texts follow the entry (4dc965e, after Codex's review; no Archive template has such a table, and in feat(migrate): atlases tables from cited rows (T04), authors, new sidecars #26 T04 writes the table with these licenses before T07);
  • 14 config errors;
  • the bundled texts against their sha256.

Local CI on 048fa19 (GitHub CI runs as well, since this PR is based on master):

== test (3.13)   All checks passed!   366 passed
== test (3.15)   All checks passed!   366 passed
== build (3.13)  twine check PASSED (sdist, wheel)
installed sdist and wheel: load_config() -> 8 texts, 68 entries

Decisions to look at again (all approved on 2026-12-05):

  • TemplateFlow's assertion for PNC, dhcpAsym, dhcpSym, NMT31Sym (with CHARM and SARM) and DiFuMo (both templates).
  • Restricted terms, recorded as found:
    • D99: no redistribution without the authors' consent;
    • MNI152NLin6Asym: FSL licence, non-commercial;
    • SUIT and its atlases: CC-BY-NC-3.0;
    • Brainnetome: non-commercial, share-alike.
  • GPL: MNI152Lin does not flip until the FIL answers.

Merge Danger

Door: two-way

The config and the code only plan migrations. Nothing changes in the Archive until each template's WP5 PR applies its plan.

Blast Radius: migration plans

tfmgr validate, tfmgr add and the client are untouched. The four templates that now flip will get a 2.0.0 CHANGES entry and versions in their WP5 PRs.

oesteban and others added 2 commits December 5, 2026 11:58
The config's licenses.table gives the license of each of the 30 templates,
each of their 35 atlases and three subsets of files (MNI152Lin's SPM12
images, fsaverage's HCP Pipelines spheres and vertex areas), citing the
upstream statement: URL, a verbatim quote and the evidence saved on
2026-12-05, or basis templateflow where there is none. Texts tfmanager
does not bundle are under migrate/config/licenses/, cited with URL and
sha256, checked when the config loads.

T07 (migrate.licensing) sets the SPDX License of template_description.json,
writes LICENSE with its SPDX-License-Identifier line (keeping its text,
with the entry's corrections, or writing the license's text), makes the
License of JSON sidecars follow their atlas or files, declares the
subsets' licenses in sidecars and writes docs/licenses/<id>.txt for the
other licenses in use. M203 (no entry: the value stays) and M211 (no text,
blocking) are new; CHANGES entries get a licenses item.

On the Archive, TF502, TF504 and TF505 go away, and MNI152NLin6Sym,
MNI305, MNIColin27 and onavg become strict-clean (they flip). MNI152Lin
keeps TF508 (GPL on its SPM12 images) until the FIL answers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-06T08:32:12.022836Z 1c25869 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c258696c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tfmanager/migrate/licensing.py Resolved
oesteban and others added 2 commits December 6, 2026 09:52
T07 read the license column of an existing atlases table to choose the
license texts, but kept its values, so T08 generated the atlas
descriptions with the former license. Each row whose atlas has an entry
in licenses.table now takes that entry's license (a table without a
license column gets one), before docs/licenses and T08; the CHANGES item
counts the rows. No Archive template has an atlases table yet, and in
5c2 T04 writes the table with these licenses before T07.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
So that the item below it, added by the PR stacked on this one, merges
without a conflict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oesteban
oesteban merged commit 9cd3656 into master Dec 6, 2026
6 checks passed
@oesteban
oesteban deleted the feat/migrate-licenses branch December 6, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant