Skip to content

fix(assurance): fail the merged-document link check when the merge has no identity of its own - #517

Merged
bomly-guy merged 2 commits into
mainfrom
claude/project-thread-aix9n0
Oct 19, 2026
Merged

bomly-guy merged 2 commits into
mainfrom
claude/project-thread-aix9n0

Conversation

@bomly-guy

Copy link
Copy Markdown
Collaborator

Requested by Ahmed · project thread

Closes #497

Before: the SBOM interoperability check compared the merged CycloneDX serialNumber against the two source namespaces and nothing else. A merged document with an empty or absent serialNumber passed as "merged document links 2 source(s)", because an empty string is never one of the sources'. serialNumber is 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, reading documentNamespace and externalDocumentRefs[].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. spdxNamespace now 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's proves line for the check now says what it checks.

Verified locally with go test ./..., go vet, make guardcheck, ten seconds of FuzzEvaluateMergedLinks, and the new check run against a real two-source merge produced by the built binary. golangci-lint could 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

…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
@bomly-guy bomly-guy self-assigned this Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: bomly-dev/bomly-cli/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77453d69-d6dc-4e32-9ce0-25d2ad43d661
📥 Commits

Reviewing files that changed from the base of the PR and between 9949fd2 and 30a2643.

📒 Files selected for processing: 3
  • docs/assurance/catalog.json
  • internal/assurance/sbominterop/main.go
  • internal/assurance/sbominterop/main_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Bomly Diff Summary

Compared 9949fd22b0357ac0c37cd662e0ea0448a1b2e87f to 30a2643fcbfc46adf989f6000e6a0ed6416ae07c.

Overview

Status Manifests Dependencies Findings Duration
✅ Pass +0 / ~0 / -0 0 added / 0 version changed / 0 detail changes / 0 removed 0 introduced / 0 persisted / 0 resolved 1m 36s

Dependency Changes

✅ No dependency changes.

Vulnerabilities

✅ No vulnerability changes.

License Changes

✅ No license changes.

Project Posture

✅ No project posture changes (--matchers +scorecard was not selected).

Policy Findings

✅ No policy differences were identified.

@bomly-guy
bomly-guy marked this pull request as ready for review October 19, 2026 04:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T05:07:46.502851Z 30a2643 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/assurance/sbominterop/main.go Resolved
…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
@bomly-guy
bomly-guy merged commit 47fc77b into main Oct 19, 2026
19 checks passed
@bomly-guy
bomly-guy deleted the claude/project-thread-aix9n0 branch October 19, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sbominterop: merged-document link check passes when the merged CycloneDX has no serialNumber

2 participants