You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adjacent SBOM ecosystems often struggle with BOM-of-BOM / multi-BOM upload semantics (duplicate components, dropped namespaces, unstable order). If vg sbom can accept or merge more than one input document, merges must stay deterministic and emit clear, actionable warnings when identities collide — never silent drops.
What to do
Define/confirm merge precedence (first-wins vs severity vs explicit flag) and stable component ordering.
When duplicate PURLs/versions collide, emit a machine-readable warning/finding rather than omitting quietly.
Add a small fixture with two overlapping SBOMs and assert stable output + warning presence.
Acceptance
Multi-input merge is deterministic across runs
Collisions are visible (warning/finding), not silent
Tests + DCO; local-first (no registry auth required for the fixture)
Current behaviour, so this can be scoped: vg sbom doesn't accept SBOMs as input.vg sbom export reads one scan artifact (--in, default .vibgrate/scan_result.json) and writes one CycloneDX or SPDX document. Merging external SBOMs would be a new command or flag, not a fix to existing behaviour.
The merge that does exist is collectLockfileGraph in src/reporting/commands/sbom.ts, which folds each scanned project's lockfile into one component list:
Components are keyed name@version in a Map. A later lockfile silently replaces an earlier entry, and the merged components don't record which project they came from.
edges, rootDependsOn and ecosystem are taken from the root project's lockfile (or the first one found) and applied to every merged component. A sub-project lockfile from a different ecosystem gets the root's purl type. That part overlaps Bug: emit ecosystem-correct PURLs in SBOM exports #167.
Proposed spec for the existing merge:
Identity is (ecosystem, name, version), not name@version.
Precedence: direct manifest rows first (as flattenDependencies already does), then lockfile components in sorted project-path order, first wins.
Same identity from two projects is not an error. Keep one component and record every contributing project in sorted order, rather than warning.
Warn only when something is dropped or guessed. That means a component whose ecosystem can't be determined, or a collision that loses information. Use the same pattern as vibgrate:purlWarning / SPDX annotations plus stderr.
Fixture: two sub-projects whose lockfiles share one name@version and split another package across versions. Assert byte-identical output across two runs and the expected properties/annotations.
If accepting external SBOMs is still wanted after that, propose it as a separate command with its own precedence rules, so this issue stays about the merge that ships today.
Activity
vibgrate-team commentedon Oct 5, 2026
Current behaviour, so this can be scoped:
vg sbomdoesn't accept SBOMs as input.vg sbom exportreads one scan artifact (--in, default.vibgrate/scan_result.json) and writes one CycloneDX or SPDX document. Merging external SBOMs would be a new command or flag, not a fix to existing behaviour.The merge that does exist is
collectLockfileGraphinsrc/reporting/commands/sbom.ts, which folds each scanned project's lockfile into one component list:name@versionin aMap. A later lockfile silently replaces an earlier entry, and the merged components don't record which project they came from.edges,rootDependsOnandecosystemare taken from the root project's lockfile (or the first one found) and applied to every merged component. A sub-project lockfile from a different ecosystem gets the root's purl type. That part overlaps Bug: emit ecosystem-correct PURLs in SBOM exports #167.Proposed spec for the existing merge:
name@version.flattenDependenciesalready does), then lockfile components in sorted project-path order, first wins.vibgrate:purlWarning/ SPDX annotations plus stderr.name@versionand split another package across versions. Assert byte-identical output across two runs and the expected properties/annotations.If accepting external SBOMs is still wanted after that, propose it as a separate command with its own precedence rules, so this issue stays about the merge that ships today.