Skip to content

chore(license): declare copyright and license on every file (REUSE) - #354

Merged
Minipada merged 1 commit into
jazzyfrom
feature/301-add-spdx-license-headers-to-all-source-f
Aug 17, 2026
Merged

chore(license): declare copyright and license on every file (REUSE)#354
Minipada merged 1 commit into
jazzyfrom
feature/301-add-spdx-license-headers-to-all-source-f

Conversation

@Minipada

@Minipada Minipada commented Aug 17, 2026

Copy link
Copy Markdown
Owner

What

MPL-2.0 is a file-level license — its Exhibit A is meant to travel with each file — but
nothing in the tree carried a notice, so the license attached only through LICENSE.md.

The repo now follows REUSE 3.3. uvx reuse lint reports
728/728 files with copyright and license information, and the fsfe/reuse-tool prek
hook keeps it that way.

An earlier revision of this PR hand-rolled a spdx_headers.py hook. That reimplemented a
spec that already has a maintained tool, and only ever looked at C++/Python/CMake/shell —
which is not what "every file" means. It's gone; this is the REUSE version.

Two mechanisms, one rule

Anything that can hold a comment carries the header — 405 files, in whatever syntax the
format uses (//, #, <!-- -->, /* */, --, ;, {# #}), above everything but a
shebang:

// SPDX-FileCopyrightText: 2022-2026 David Bensoussan
// SPDX-License-Identifier: MPL-2.0

The rest — images, meshes, fonts, JSON, byte-exact test fixtures, prose — is covered by path
in REUSE.toml.

There is deliberately no ** catch-all in REUSE.toml. The first draft had one, and the
negative test then passed on a headerless new file: a catch-all silently claims anything
that appears in the tree as ours. That's the opposite of a gate — and it's how a
CC-BY-NC-ND-4.0 asset got in unnoticed in the first place (below). Without it, an undeclared
file fails reuse lint.

What the provenance audit turned up

Writing the annotations meant establishing provenance, and the tree is not single-licensed:

Files License Holder
dc_lifecycle_manager (5 files), dc_common's two cmake files Apache-2.0 Intel, Samsung Research America, + DC
turtlebot3_waffle_qrcodes.xacro, worlds/waffle.model Apache-2.0 ROBOTIS, Nav2 contributors, + DC
dc_simulation/rviz/qrcodes.rviz Apache-2.0 Nav2 contributors, + DC
dc_description/urdf/realsense_d455.urdf.xacro Apache-2.0 Intel
dc_util's base64.{hpp,cpp} Zlib René Nyffenegger
Chair, MonitorAndKeyboard models CC-BY-4.0 Open Robotics
bag, cutout_wall, europallet, europallet_10 models CC-BY-3.0 Nathan Koenig (Gazebo Classic model DB)
warehouse model CC-BY-NC-ND-4.0 MOV.AI
mdBook theme / highlight.js / mermaid bundle / mdbook-admonish / Lineicons MPL-2.0 / BSD-3-Clause / MIT AND (Apache-2.0 OR MPL-2.0) / MIT / MIT respective upstreams

⚠️ dc_simulation/models/warehouse is MOV.AI's Fuel model, and Fuel lists it as
CC-BY-NC-ND-4.0
— non-commercial, no derivatives, inside an MPL-2.0 repo whose model.sdf
has been modified locally. This PR declares it honestly; replacing it is #357.

The aws_robomaker_* and drc_practice_* models are not third-party — #268 already
replaced them with local primitive-geometry placeholders.

package.xml follows the files: dc_lifecycle_manager, dc_common and dc_description
declare Apache-2.0 next to MPL-2.0; dc_simulation declares the four asset licenses it
ships.

How the derivation audit was run

"Looks like nav2" isn't evidence. navigation2/humble, turtlebot3/humble and
turtlebot3_simulations/humble were cloned; both sides normalised (comments stripped,
nav2_/dc_/turtlebot3_ prefixes removed so a rename can't hide a copy); then compared
two ways — difflib ratio against hand-picked counterparts, and a 3-line-shingle sweep of
every C++/Python/CMake/URDF/world/rviz file in the tree against every such file upstream, to
catch pairs nobody thought to guess. Both passes name the same files and nothing else:
lifecycle_manager*.{hpp,cpp} 0.87–1.00, dc_package.cmake / dc_common-extras.cmake 1.00,
the tb3 xacro 0.74, the rviz config 0.66. dc_lifecycle_manager's tests score 0.04–0.09,
and dc_measurements, dc_bridge, dc_util, dc_group, dc_triggers and dc_core don't
register at all — original work, still MPL-2.0.

One thing worth knowing for future bulk runs: reuse annotate replaced the RealSense
URDF's existing comment block
rather than prepending to it, deleting Intel's
"License: Apache 2.0" line. It was the only file in the tree with an upstream notice in a
format the tool recognised, and reviewing the diff caught it; that header is hand-written now,
sitting above the restored original.

Verification

  • uvx reuse lint — compliant, 728/728, 0 bad licenses, 0 invalid expressions.
  • prek run --all-files --skip build-doc — green, all 24 hooks including the new reuse one.
    LICENSES/ is added to the global exclude: because codespell "fixed" the upstream typos
    in the CC and BSD texts (MERCHANTIBILITY); license texts stay verbatim.
  • Across 416 changed files the diff deletes exactly one line — the exclude: in
    .pre-commit-config.yaml, replaced by a longer one. Everything else is an insertion.
  • python3 -m compileall over every tracked .py — passes.
  • colcon build --packages-select dc_util dc_core dc_common dc_lifecycle_manager dc_interfaces
    in the cached localhost/dc-workspace:latest image with this worktree bind-mounted — clean.
    dc_interfaces matters: the .msg/.srv files gained headers and the IDL generator parses
    them.
  • Negative test: a new .cpp with no header fails (no license identifier / no copyright notice) — which the catch-all draft did not.

Not run: build-doc (docs container, owned by doc.yaml in CI).

Closes #301

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y1UHyNzZp8VhB4ii3kDRhg

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.20%. Comparing base (e4a87b0) to head (e85a8b7).
⚠️ Report is 1 commits behind head on jazzy.

Additional details and impacted files
@@           Coverage Diff           @@
##            jazzy     #354   +/-   ##
=======================================
  Coverage   67.20%   67.20%           
=======================================
  Files          96       96           
  Lines        5981     5981           
=======================================
  Hits         4019     4019           
  Misses       1962     1962           
Flag Coverage Δ
cpp-jazzy 67.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Minipada
Minipada force-pushed the feature/301-add-spdx-license-headers-to-all-source-f branch 2 times, most recently from 55824dd to 50250ba Compare August 17, 2026 22:55
@Minipada Minipada changed the title chore(license): add SPDX headers to every source file chore(license): declare copyright and license on every file (REUSE) Aug 17, 2026
@Minipada

Copy link
Copy Markdown
Owner Author

Reopening to re-trigger PR checks: the force-push landed but GitHub created no runs for the new head.

@Minipada Minipada closed this Aug 17, 2026
@Minipada Minipada reopened this Aug 17, 2026
MPL-2.0 is a file-level license, but nothing in the tree carried a notice:
the license attached only through LICENSE.md. The repo now follows REUSE 3.3
-- `reuse lint` reports 728/728 files with copyright and license info, and the
fsfe/reuse-tool prek hook keeps it that way.

Files that can hold a comment carry an SPDX header; images, meshes, fonts,
JSON and prose are covered by path in REUSE.toml. No `**` catch-all there, on
purpose: an undeclared file must fail the hook rather than be silently claimed.

Writing the annotations meant establishing provenance, and the tree is not
single-licensed. dc_lifecycle_manager is a port of nav2_lifecycle_manager and
dc_common's cmake files are verbatim nav2_common copies (0.87-1.00 normalised
similarity) -- those seven are Apache-2.0 now, with Intel's and Samsung's
copyright alongside. The TurtleBot3 xacro and world, the nav2-derived rviz
config and Intel's RealSense URDF likewise. dc_util's base64 is zlib-licensed,
and the sim models carry CC-BY-3.0/4.0 -- except MOV.AI's warehouse mesh, which
Gazebo Fuel lists as CC-BY-NC-ND-4.0. That one is declared, not fixed: #357.

Closes #301

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y1UHyNzZp8VhB4ii3kDRhg
Signed-off-by: David Bensoussan <d.bensoussan@proton.me>
@Minipada
Minipada force-pushed the feature/301-add-spdx-license-headers-to-all-source-f branch from b7fca2e to e85a8b7 Compare August 17, 2026 23:46
@Minipada
Minipada merged commit 0e72e09 into jazzy Aug 17, 2026
5 checks passed
@Minipada
Minipada deleted the feature/301-add-spdx-license-headers-to-all-source-f branch September 2, 2026 12:45
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