Skip to content

Separate the code license from the data license - #261

Open
skearnes wants to merge 2 commits into
mainfrom
license-split
Open

Separate the code license from the data license#261
skearnes wants to merge 2 commits into
mainfrom
license-split

Conversation

@skearnes

@skearnes skearnes commented Jul 26, 2026

Copy link
Copy Markdown
Member

This repository holds two different kinds of thing under a single LICENSE, and only one of them is described correctly today.

The datasets under data/ are CC-BY-SA-4.0. That is what CITATION.cff and the Hugging Face dataset card declare, it is what a data consumer needs to know, and it does not change here. The code under scripts/ and .github/ has no license of its own, which leaves it implicitly under the same CC license — a poor fit, since Creative Commons recommends against applying CC licenses to software, and the project's other code repositories (including ord-schema) are Apache-2.0. This states the intent that already exists rather than changing direction.

What this does

LICENSE stays CC-BY-SA-4.0 and is untouched, so GitHub's sidebar keeps advertising the data license — the right headline for a data repository. LICENSE-CODE adds Apache-2.0 for the code, and a new README section states the split in a table. addlicense runs in pre-commit and stamps per-file headers, so a script copied out of the repository carries its license with it rather than depending on a reader finding the right root file.

LICENSE/LICENSE-CODE is the convention Microsoft uses across its docs and data repositories, where the same split applies (content under CC, code samples under a permissive license). The alternative of a directory-scoped scripts/LICENSE was considered and rejected because the code is not only in scripts/.github/ is code too, and per-directory copies drift.

Scope

This changes no code: the diff is 333 insertions and no deletions. Every modification to an existing file is the 14-line Apache header and nothing else.

A follow-up PR adds Python tooling (uv, ruff, ty, pytest) on top of this branch.

🤖 Generated with Claude Code

Greptile Summary

Adds a distinct Apache-2.0 license for repository code while retaining CC-BY-SA-4.0 for datasets and metadata.

  • Documents the license split in the README.
  • Adds Apache license headers to Python scripts and GitHub workflows.
  • Adds a scoped pre-commit hook that applies headers only to designated code files.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
.pre-commit-config.yaml Restricts addlicense to Python scripts, GitHub YAML workflows, and the pre-commit configuration, resolving the prior risk of stamping CC-licensed metadata.
README.md Documents the CC-BY-SA-4.0 data and metadata license alongside the Apache-2.0 code license.
LICENSE-CODE Adds the standard Apache License 2.0 text for repository code.
scripts/convert_to_parquet.py Adds an Apache-2.0 file header without changing executable behavior.
scripts/download_from_huggingface.py Adds an Apache-2.0 file header without changing executable behavior.
scripts/upload_to_huggingface.py Adds an Apache-2.0 file header without changing executable behavior.
.github/workflows/huggingface_mirror.yml Adds an Apache-2.0 file header without changing workflow behavior.
.github/workflows/submission.yml Adds an Apache-2.0 file header without changing workflow behavior.
.github/workflows/validation.yml Adds an Apache-2.0 file header without changing workflow behavior.

Reviews (3): Last reviewed commit: "Scope the addlicense hook to code files" | Re-trigger Greptile

Comment thread .pre-commit-config.yaml
skearnes added a commit that referenced this pull request Jul 26, 2026
The hook ran unfiltered, so which files got an Apache header depended on
addlicense's internal list of recognized extensions rather than on any stated
intent. That list happens to exclude .md and .cff today, which is why README.md
and CITATION.cff are unstamped -- but those files are CC-BY-SA-4.0 metadata
describing the datasets, and "the tool does not recognize the extension" is not
a guarantee worth resting a licensing boundary on.

An allowlist states the boundary directly: code gets the code license, and
anything else has to be added deliberately.

Reported by Greptile on #261.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
skearnes added a commit that referenced this pull request Jul 26, 2026
The hook ran unfiltered, so which files got an Apache header depended on
addlicense's internal list of recognized extensions rather than on any stated
intent. That list happens to exclude .md and .cff today, which is why README.md
and CITATION.cff are unstamped -- but those files are CC-BY-SA-4.0 metadata
describing the datasets, and "the tool does not recognize the extension" is not
a guarantee worth resting a licensing boundary on.

An allowlist states the boundary directly: code gets the code license, and
anything else has to be added deliberately.

Reported by Greptile on #261.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@skearnes

Copy link
Copy Markdown
Member Author

Thanks — the specific claim does not reproduce, but it pointed at a real weakness, so I fixed the underlying issue.

addlicense does not stamp README.md or CITATION.cff: neither .md nor .cff is in its list of recognized extensions, so both files pass through untouched. I confirmed this by running the hook against the tree and diffing (CITATION.cff: UNCHANGED, README.md: UNCHANGED), which is also visible in this PR's diff — README.md changes only by the added License section, and CITATION.cff is not modified at all.

The weakness is that this safety was incidental. Which files received the code license depended on addlicense's internal extension list rather than on anything this repository states, and "the tool does not recognize the extension" is a poor thing to rest a licensing boundary on — particularly in a PR whose entire purpose is to establish that boundary. If addlicense gains Markdown support, or someone adds a .yaml file describing the datasets, the hook would silently stamp Apache onto CC-BY-SA-4.0 content.

Fixed in 4f29424 with an explicit allowlist:

files: ^(scripts/.*\.py|\.github/.*\.ya?ml|\.pre-commit-config\.yaml)$

Now code gets the code license and anything else has to be added deliberately. Verified by staging a probe .cff file carrying license: CC-BY-SA-4.0 and confirming the hook leaves it byte-identical.

Analysis performed with Claude Code (Claude Opus 5).

@skearnes
skearnes requested review from bdeadman and connorcoley July 26, 2026 03:51
skearnes and others added 2 commits July 26, 2026 00:14
The repository holds two different kinds of thing under one LICENSE. The
datasets under data/ are CC-BY-SA-4.0, which is what CITATION.cff and the
Hugging Face dataset card declare and what a data consumer needs. The code
under scripts/ and .github/ had no license of its own, which left it implicitly
under the same CC license -- a poor fit, since Creative Commons recommends
against applying CC licenses to software, and the project's other code
repositories are Apache-2.0.

LICENSE stays CC-BY-SA-4.0 so GitHub keeps advertising the data license, which
is the right headline for a data repository. LICENSE-CODE adds Apache-2.0 for
the code, following the convention Microsoft uses for its docs and data
repositories, and addlicense stamps per-file headers so a script copied out of
the repository carries its license with it.

This changes no code: the diff is 333 insertions and no deletions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The hook ran unfiltered, so which files got an Apache header depended on
addlicense's internal list of recognized extensions rather than on any stated
intent. That list happens to exclude .md and .cff today, which is why README.md
and CITATION.cff are unstamped -- but those files are CC-BY-SA-4.0 metadata
describing the datasets, and "the tool does not recognize the extension" is not
a guarantee worth resting a licensing boundary on.

An allowlist states the boundary directly: code gets the code license, and
anything else has to be added deliberately.

Reported by Greptile on #261.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants