Repository navigation
feat(import): Warn on an unrecognized license instead of refusing - #142
Merged
Merged
Conversation
omesser
force-pushed
the
feat/license-allowlist-130
branch
from
August 31, 2026 19:18
b6382a6 to
171333b
Compare
omesser
force-pushed
the
feat/license-allowlist-130
branch
from
August 31, 2026 19:20
171333b to
9e0d1c3
Compare
The check only asked whether a license was declared, so any string passed unread. It now compares the declared license against an allowlist of permissive ones and prints a warning when it does not match. It warns rather than refuses, and `--accept-license` is removed: the person running the import is the one who decides what to ship. Closes #130. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
omesser
force-pushed
the
feat/license-allowlist-130
branch
from
August 31, 2026 19:20
9e0d1c3 to
d2a1cb8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
scripts/import-pet.pyonly checked whether a pack declared a license at all.Any non-empty string passed, so a pet declaring
All Rights Reservedimportedas quietly as one declaring
CC0-1.0.petdex's submit flow now offers CC0 and CC-BY per pet, so the field will
usually be filled in, and what it says starts to matter.
What changed
KNOWN_LICENSES: MIT, CC0-1.0, CC0, CC-BY-4.0, Apache-2.0, BSD-3-Clause.the importer prints a warning to stderr and carries on. Nothing is refused.
--accept-licenseis removed, along with its three README mentions and thereference to it in
characters/cat/character.manifest.warning only exists in the terminal.
Comparison flattens case and spacing, then matches exactly.
cc by 4.0isrecognized;
MIT Licenseis not, and warns. The upside of being that literalis that
CC BY-NC 4.0andCC-BY-SA-4.0cannot be read asCC-BY-4.0. If thefalse warnings get annoying, dropping
THEandLICENSEas noise words is twolines.
New pure functions
normalize_license,license_warning, andlicense_header,all covered by
--self-test.emitcallslicense_headerinstead of buildingthe header inline, so the warning and the recorded header cannot disagree.
How to verify
python3 scripts/import-pet.py --self-test, then real imports of syntheticpetscodex pets:
pet.jsonlicenseCC0-1.0CC BY 4.0All Rights Reserved"", or" "cargo test(305 + 35),node --test tests/(22), andvalidateon all fiveshipped Characters.
Notes
This does not do what #130 asked for. The issue wanted an unrecognized license
refused unless
--accept-licensewas passed; the decision was to warn andcontinue, and to drop the flag. The allowlist itself is as the issue described.
Recorded in a comment there too.
One bug fixed on the way: a
licensekey holding""or" "was undeclaredto
mainand unrecognized to the new functions, which would have putLicense: , which the importer does not recognizein a manifest header. Blanknow counts as undeclared everywhere.
Closes #130