feat(validator): enforce license headers on tool Python files (check #8)#474
Merged
Conversation
Add a HARD check to skill-and-tool-validator requiring every non-trivial Python source file under tools/ to carry either the SPDX one-liner or the full ASF license preamble. Seed the header into the 6 security-tracker-stats-dashboard scripts that lacked it so the real-repo integration test stays green. Skill .md files are exempt: they already declare their license via the required `license:` frontmatter key (validated by the frontmatter check), so a separate SPDX comment would be redundant.
potiuk
approved these changes
Jun 11, 2026
potiuk
left a comment
Member
There was a problem hiding this comment.
Ough... How did we miss it :) ?
Member
Author
Correctness[advisory] _MIN_LICENSE_FILE_SIZE — docstring says "characters", code uses st_size (bytes). Equivalent for ASCII; a BOM/multi-byte stub could measure differently. Document as bytes. Conventions[advisory] Shares check-slot #8 with #481 (see cross-PR note) — whichever lands second renumbers. Securityno findings. |
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.
Summary
Adds check #8 to skill-and-tool-validator: a HARD check requiring every
non-trivial Python source file under
tools/to carry a license header,either the SPDX one-liner (
# SPDX-License-Identifier: Apache-2.0) or thefull Apache Software Foundation preamble.
Skill
.mdfiles are intentionally exempt. They already declare theirlicense through the required
license:frontmatter key, which thefrontmatter check (aspect 1) validates, so a separate SPDX comment would
be redundant.
License headers were only caught in code review, if at all. Making it a
HARD validator check moves the failure to validation time and keeps the
repo's ASF licensing compliant by default.
Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
prek run --all-filespassesuv run pytest/ruff check/mypypasses(
PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)(a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)