feat(cyclonedx): emit CycloneDX 1.7 with license acknowledgement and evidence - #1331
Merged
Conversation
Bump the CycloneDX renderer from spec 1.3 to 1.7 and populate licenses[].acknowledgement (declared vs concluded), the distinction Provenant already expresses in SPDX. A parser-declared license expression is `declared`; a license concluded from source/file detection is `concluded`, mapped from the same package fields the SPDX writer uses. Only the CycloneDX renderer changes: JSON specVersion, $schema, and the XML bom namespace move to 1.7, and every licenses[] entry carries an acknowledgement. SPDX and the native ScanCode-compatible JSON are unchanged. Component license evidence (evidence.licenses / evidence.occurrences) is split to a documented follow-up: a clean component-level file->license mapping is more than a moderate change in a renderer that does not otherwise consume output.files. - Switch the external validator to CycloneDX SchemaVersion.V1_7 (the pinned cyclonedx-python-lib already exposes it) and CYCLONEDX_SPEC_VERSION to 1.7. - Regenerate CycloneDX goldens and the four examples/sbom; all validate clean against the official 1.7 JSON schema + XSD, and SPDX still validates. - Document the bump + acknowledgement as an amendment to ADR 0012. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Greptile SummaryUpdates CycloneDX output to version 1.7.
Confidence Score: 5/5The PR appears safe to merge. No blocking failures remain. Important Files Changed
Reviews (2): Last reviewed commit: "feat(cyclonedx): add component license e..." | Re-trigger Greptile |
Populate CycloneDX component.evidence from the file-content license detections of the files each component owns (file->package ownership via file.for_packages): the distinct observed SPDX expressions as evidence.licenses and the file+line of each detection as evidence.occurrences. Only detected packages own scanned files, so promoted resolved dependencies carry no evidence. This completes the second license feature of the CycloneDX 1.7 work alongside licenses[].acknowledgement, rather than deferring it. SPDX and the native ScanCode-compatible JSON remain unchanged. - Add a dedicated cyclonedx-evidence golden (JSON + XML) and wire it into the external 1.7 schema/XSD validator; add unit coverage for the file->package evidence mapping. - Regenerate the four examples/sbom (now carrying evidence) stamped for the release that first ships this output; all validate clean against the official CycloneDX 1.7 schema + XSD, and SPDX still validates. - Fold the evidence contract into the ADR 0012 amendment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
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
licenses[].acknowledgement(declaredvsconcluded) — the declared-vs-concluded distinction Provenant already expresses in SPDX (PackageLicenseDeclared/PackageLicenseConcluded), mapped from the same package fields. A parser-declared expression isdeclared; a license concluded from source/file detection isconcluded.component.evidence— the file-content license detections of the files each component owns becomeevidence.licenses(distinct observed SPDX expressions) +evidence.occurrences(file + line), using thefile.for_packagesownership assembly already computes. Only detected packages own scanned files, so promoted resolved dependencies carry no evidence.specVersion/$schemaand the XMLbomnamespace move to 1.7. SPDX and the native ScanCode-compatible JSON are byte-unchanged.Issues
Scope and exclusions
specVersion+$schema, XML namespace),licenses[].acknowledgement,component.evidence(licenses + occurrences), validator switch toSchemaVersion.V1_7, regenerated CycloneDX goldens + a dedicated evidence golden + the fourexamples/sbom, ADR 0012 amendment.How to verify
scripts/requirements-output-format-validators.txt, then runpython scripts/validate_output_format_fixtures.py(with the venvbinonPATHsopyspdxtoolsresolves). All CycloneDX goldens — including the newcyclonedx-evidence-expected.{json,xml}— validate against the official 1.7 JSON schema + XSD, and SPDX tag-value still validates. The fourexamples/sbom/*/sbom.cdx.json(now carryingevidence) also validate against 1.7 and theirsbom.spdxagainst pyspdxtools.Intentional differences from Python
Follow-up work
Expected-output fixture changes
testdata/output-formats/cyclonedx-expected.{json,xml},cyclonedx-dependencies-expected.{json,xml},cyclonedx-expected-without-packages.json; newcyclonedx-evidence-expected.{json,xml}; regeneratedexamples/sbom/*/sbom.cdx.json(andsbom.spdxre-stamped, version/timestamp-only).$schema,specVersion: 1.7/ the 1.7 XML namespace,acknowledgementon each license, and (for components that own detected files)evidence; all validate clean against the official CycloneDX 1.7 schema + XSD. Theexamples/sbomsbom.spdxfiles differ only in theCreator/Createdversion+timestamp lines, confirming SPDX output is substantively unchanged. Examples are stamped for the upcoming release (the version that first ships this output), per the generator's convention.Before / after — component license
🤖 Generated with Claude Code