Skip to content

feat(spec-validator): enforce SPDX-License-Identifier header on spec files - #514

Merged
potiuk merged 1 commit into
apache:mainfrom
justinmclean:spec-validator-spdx
Jun 13, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
justinmclean:spec-validator-spdx

Conversation

@justinmclean

Copy link
Copy Markdown
Member

Summary

Adds check to the spec-validator: every .md file that carries YAML frontmatter must include '<!-- SPDX-License-Identifier: Apache-2.0' before the opening --- delimiter. Files without frontmatter (README, overview) are skipped silently — no change to their handling.

Adds validate_spdx_header() in init.py, plumbs it into validate_file(), updates the module docstring, and adds TestValidateSpdxHeader (7 tests) in the test suite. All 64 tests pass.

Also fixes run-workspace-check.sh: on Apple Silicon Macs where git is an x86_64 binary (Rosetta), pre-commit hooks spawn x86_64 Python that cannot load arm64-compiled extensions (mypy, cffi). The script now probes for this condition at runtime and falls back to arch -arm64 python3 for the mypy and pytest checks.

Type of change

  • Skill change (.claude/skills/<name>/) — eval fixtures updated below
  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml)
  • Groovy reference impl
  • Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
  • Documentation (docs/, README.md, CONTRIBUTING.md)
  • Project template (projects/_template/)
  • CI / dev loop (prek, workflows, validators)
  • Other:

Test plan

  • prek run --all-files passes
  • For Python packages touched: uv run pytest / ruff check / mypy passes
  • For Groovy bridges touched: command-line invocation tested end-to-end
  • For skill changes: eval suite passes for the affected skill
    (PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)
  • For skill behaviour changes: a new or updated eval fixture is included in this PR
    (a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)
  • Other:

…files

Adds check apache#8 to the spec-validator: every .md file that carries YAML
frontmatter must include '<\!-- SPDX-License-Identifier: Apache-2.0' before
the opening --- delimiter. Files without frontmatter (README, overview) are
skipped silently — no change to their handling.

Adds validate_spdx_header() in __init__.py, plumbs it into validate_file(),
updates the module docstring, and adds TestValidateSpdxHeader (7 tests) in
the test suite. All 64 tests pass.

Also fixes run-workspace-check.sh: on Apple Silicon Macs where git is an
x86_64 binary (Rosetta), pre-commit hooks spawn x86_64 Python that cannot
load arm64-compiled extensions (mypy, cffi). The script now probes for this
condition at runtime and falls back to arch -arm64 python3 for the mypy and
pytest checks.

Generated-by: Claude (Sonnet 4.6)
@potiuk
potiuk merged commit f4d0e6e into apache:main Jun 13, 2026
26 checks passed
@potiuk potiuk added the substrate:framework-dev Tool substrate: build / validate / eval the framework itself label Sep 25, 2026
@potiuk potiuk added family:ci .github workflows, prek, validators family:tools tools/* labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:ci .github workflows, prek, validators family:tools tools/* substrate:framework-dev Tool substrate: build / validate / eval the framework itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants