Skip to content

feat(cli): add apply-metadata --license-only#21

Merged
jcschaff merged 1 commit into
mainfrom
feat/license-only
Jul 3, 2026
Merged

feat(cli): add apply-metadata --license-only#21
jcschaff merged 1 commit into
mainfrom
feat/license-only

Conversation

@jcschaff

@jcschaff jcschaff commented Jul 3, 2026

Copy link
Copy Markdown
Member

What

Adds apply-metadata --license-only — the license-side sibling of --creators-only. It swaps just a record's license, preserving title/description/creators/version/date/related_identifiers.

Why

virtualcell/vcell is MIT-licensed but its 492 archived records carry the wrong license (445 cc-by-4.0 + 46 other-open, 1 already MIT). A full apply-metadata can't fix this safely — it would overwrite vcell's curated per-version titles (Virtual Cell 8.0, etc.). --license-only changes nothing but the license.

Idempotency subtlety

Zenodo stores MIT as the deposit id mit-license, while .zenodo.json (and every tool-managed repo) writes the SPDX id mit. _license_equal normalizes that asymmetry (and the string vs {'id': ...} shapes), so already-correct records are skipped and re-runs converge. Verified against vcell: a dry-run reports 491 to update, 1 already correct.

Tests / checks

ruff + mypy --strict clean; 39 unit tests pass (added license-equality cases). Dry-run exercised live against the vcell concept.

Paired with virtualcell/vcell#1717 (fixes the repo .zenodo.json source). Once this merges, the 491 mislicensed records get normalized with:
zenodo-maint --repo virtualcell/vcell --concept 7796386 --zenodo-json .zenodo.json apply-metadata --license-only --execute

🤖 Generated with Claude Code

https://claude.ai/code/session_01BZx7w9BexQc9wWU5JoHYaF

The license-side sibling of --creators-only: swap just a record's license,
preserving its title/description/creators/version/date/related_identifiers. This
is what's needed to correct a mis-declared license across a whole concept without
clobbering curated per-version titles (a full apply-metadata would overwrite
them).

License equality normalizes the string vs {'id': ...} shapes and Zenodo's
`mit` (SPDX, what .zenodo.json writes) vs `mit-license` (the deposit id Zenodo
stores) asymmetry, so already-correct records are skipped and re-runs converge.

Motivated by virtualcell/vcell, whose 492 records carry cc-by-4.0 (445) and
other-open (46) despite the software being MIT.

- cli: --license-only handling in cmd_apply_metadata + _license_equal/_license_norm
- tests: license equality (string/dict forms, mit vs mit-license)
- README + SKILL: document the flag

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BZx7w9BexQc9wWU5JoHYaF
@jcschaff jcschaff merged commit 203055b into main Jul 3, 2026
1 check passed
@jcschaff jcschaff deleted the feat/license-only branch July 3, 2026 12:19
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