BSI TR-03183-2: licences in the SBOM export as SPDX ids.
New compliance_core::spdx_license: the SPDX list (moved from sbom_docs), the licence-page URL table (moved from nuget_license, plus Eclipse/CC0/Boost pages and generic opensource.org/licenses/<id> / spdx.org/licenses/<id>), and the name matcher (moved from registry_license::spdx_of_name, extended). One table, used at export and by the POM/NuGet lookups at ingest.
Names are matched by family + version, ignoring case, punctuation, "The", "Version"/"v"; "or later"/"+" gives -or-later; GPL 2 with Classpath exception becomes GPL-2.0-only WITH Classpath-exception-2.0. A family without the version it needs ("GPL", "BSD License", "Eclipse Public License") or a dual licence ("CDDL + GPLv2 ...") stays a name. Valid ids (case-canonicalised), expressions and LicenseRef- stay as they are.
CycloneDX: known -> license.id, unknown -> license.name, expressions -> expression.
SPDX: licenseConcluded was the raw name (invalid SPDX); now an expression of listed ids, else NOASSERTION with the declared text in licenseComments. The concluded-vs-declared field choice is unchanged (out of scope).
Normalised at export, so SBOM rows stored before need no migration.
Not in this PR: COPYLEFT_LICENSES in the SBOM licence summary still matches stored strings exactly, so old rows named "GNU Lesser General Public License v2.1" are not flagged copyleft; feeding it the normaliser is a follow-up.
BSI TR-03183-2: licences in the SBOM export as SPDX ids.
- New `compliance_core::spdx_license`: the SPDX list (moved from `sbom_docs`), the licence-page URL table (moved from `nuget_license`, plus Eclipse/CC0/Boost pages and generic `opensource.org/licenses/<id>` / `spdx.org/licenses/<id>`), and the name matcher (moved from `registry_license::spdx_of_name`, extended). One table, used at export and by the POM/NuGet lookups at ingest.
- Names are matched by family + version, ignoring case, punctuation, "The", "Version"/"v"; "or later"/"+" gives `-or-later`; GPL 2 with Classpath exception becomes `GPL-2.0-only WITH Classpath-exception-2.0`. A family without the version it needs ("GPL", "BSD License", "Eclipse Public License") or a dual licence ("CDDL + GPLv2 ...") stays a name. Valid ids (case-canonicalised), expressions and `LicenseRef-` stay as they are.
- CycloneDX: known -> `license.id`, unknown -> `license.name`, expressions -> `expression`.
- SPDX: `licenseConcluded` was the raw name (invalid SPDX); now an expression of listed ids, else `NOASSERTION` with the declared text in `licenseComments`. The concluded-vs-declared field choice is unchanged (out of scope).
- Normalised at export, so SBOM rows stored before need no migration.
Not in this PR: `COPYLEFT_LICENSES` in the SBOM licence summary still matches stored strings exactly, so old rows named "GNU Lesser General Public License v2.1" are not flagged copyleft; feeding it the normaliser is a follow-up.
Tests: `spdx_license::tests::{known_licence_names_and_urls_become_spdx_ids, unknown_names_and_spdx_input_stay_as_written, spdx_expressions_are_recognised}`, `sbom_docs::tests::known_license_names_are_exported_as_spdx_ids`, doctest; existing `registry_license`/`nuget_license` licence tests and `vex_schemas` pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
BSI TR-03183-2 wants SPDX ids. Maven POMs, syft and older scans store
names ("The Apache Software License, Version 2.0") or only a licence URL;
the CycloneDX export wrote them as license.name, the SPDX export put the
raw name into licenseConcluded (invalid SPDX).
New compliance_core::spdx_license holds the SPDX list (moved from
sbom_docs), the licence-page URL table (moved from the agent's NuGet
lookup) and the name matcher (moved and extended from the agent's POM
lookup): case, punctuation, "The", "Version"/"v", "or later"/"+" and
GPL + Classpath exception; a family without a version or a dual licence
stays a name. Normalised at export, so rows stored before need no
migration; the POM and NuGet lookups use the same functions at ingest.
SPDX export: an expression of listed ids, else NOASSERTION with the
declared text in licenseComments.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
BSI TR-03183-2: licences in the SBOM export as SPDX ids.
compliance_core::spdx_license: the SPDX list (moved fromsbom_docs), the licence-page URL table (moved fromnuget_license, plus Eclipse/CC0/Boost pages and genericopensource.org/licenses/<id>/spdx.org/licenses/<id>), and the name matcher (moved fromregistry_license::spdx_of_name, extended). One table, used at export and by the POM/NuGet lookups at ingest.-or-later; GPL 2 with Classpath exception becomesGPL-2.0-only WITH Classpath-exception-2.0. A family without the version it needs ("GPL", "BSD License", "Eclipse Public License") or a dual licence ("CDDL + GPLv2 ...") stays a name. Valid ids (case-canonicalised), expressions andLicenseRef-stay as they are.license.id, unknown ->license.name, expressions ->expression.licenseConcludedwas the raw name (invalid SPDX); now an expression of listed ids, elseNOASSERTIONwith the declared text inlicenseComments. The concluded-vs-declared field choice is unchanged (out of scope).Not in this PR:
COPYLEFT_LICENSESin the SBOM licence summary still matches stored strings exactly, so old rows named "GNU Lesser General Public License v2.1" are not flagged copyleft; feeding it the normaliser is a follow-up.Tests:
spdx_license::tests::{known_licence_names_and_urls_become_spdx_ids, unknown_names_and_spdx_input_stay_as_written, spdx_expressions_are_recognised},sbom_docs::tests::known_license_names_are_exported_as_spdx_ids, doctest; existingregistry_license/nuget_licenselicence tests andvex_schemaspass.🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
BSI TR-03183-2 wants SPDX ids. Maven POMs, syft and older scans store names ("The Apache Software License, Version 2.0") or only a licence URL; the CycloneDX export wrote them as license.name, the SPDX export put the raw name into licenseConcluded (invalid SPDX). New compliance_core::spdx_license holds the SPDX list (moved from sbom_docs), the licence-page URL table (moved from the agent's NuGet lookup) and the name matcher (moved and extended from the agent's POM lookup): case, punctuation, "The", "Version"/"v", "or later"/"+" and GPL + Classpath exception; a family without a version or a dual licence stays a name. Normalised at export, so rows stored before need no migration; the POM and NuGet lookups use the same functions at ingest. SPDX export: an expression of listed ids, else NOASSERTION with the declared text in licenseComments. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p19d098bdbbtoe417d154d4