Repository navigation
fix(assurance): fail the merged-document link check when the merge has no identity of its own - #517
Conversation
…s no identity of its own The sbominterop check compared the merged CycloneDX serialNumber against the source namespaces and nothing else, so a merged document with an empty or absent serialNumber passed: an empty string is never one of the sources'. serialNumber is optional in CycloneDX and the official validator accepts its absence, which left ADR-0042's "a merge mints its own identity" rule with no check that could catch a codec regression. The merge rule is now judged once, on a format-neutral view of the document: an identity must be present, must not be a source's, and every source must be linked. The merged SPDX export is checked the same way (documentNamespace, externalDocumentRefs), which the issue left as an open question; the real two-source export already satisfies it. Closes #497 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N759HBy1BtYMen4U53bGHJ
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bomly Diff SummaryCompared Overview
Dependency Changes✅ No dependency changes. Vulnerabilities✅ No vulnerability changes. License Changes✅ No license changes. Project Posture✅ No project posture changes ( Policy Findings✅ No policy differences were identified. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4f99090d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…he run The SPDX and CycloneDX link checks ran in one loop that returned on the first failure, so a failing SPDX document kept the CycloneDX verdict out of the manifest. The manifest is the evidence for the catalog's per-format claim, which matters most on a failure. Both checks now run and are recorded; the run then fails with every failing format's detail. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N759HBy1BtYMen4U53bGHJ
Requested by Ahmed · project thread
Closes #497
Before: the SBOM interoperability check compared the merged CycloneDX
serialNumberagainst the two source namespaces and nothing else. A merged document with an empty or absentserialNumberpassed as "merged document links 2 source(s)", because an empty string is never one of the sources'.serialNumberis optional in CycloneDX and the official validator accepts its absence, so a codec regression that stopped minting a merge identity would have stayed green. The merged SPDX export was not checked for identity or links at all.After: a merged document fails the check when it has no identity of its own (
merged document has no serialNumber of its own), when it adopted a source's identity, or when it does not link every source. The same rule now runs on the merged SPDX export too, readingdocumentNamespaceandexternalDocumentRefs[].spdxDocument. The run manifest records one check per format.This closes the gap the issue reports and answers its open question: the SPDX side had the same gap, and the merged SPDX export Bomly writes today already carries its own namespace and both source links, so the new check passes on real output.
How: both formats are decoded with plain JSON into one format-neutral view (identity slot, identity, linked set) and judged by a single
judgeMergedDocument, with presence checked before adoption so the failure detail names the actual gap.spdxNamespacenow also rejects a whitespace-only source namespace. Tests cover both formats and every verdict; the fuzz target runs both decoders and gains seeds for the empty-identity shapes. The catalog'sprovesline for the check now says what it checks.Verified locally with
go test ./...,go vet,make guardcheck, ten seconds ofFuzzEvaluateMergedLinks, and the new check run against a real two-source merge produced by the built binary.golangci-lintcould not run here (the installed binary predates Go 1.27), so CI's lint job is the first run of it.Generated by Claude Code