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
{{ message }}
Repository navigation
Bug: emit ecosystem-correct PURLs in SBOM exports #167
vg sbom export should not claim an ecosystem Vibgrate did not detect. If SPDX/CycloneDX helpers hard-code pkg:npm/... for non-npm packages, supply-chain evidence is wrong.
Separate from #151 (docs/example) and the outputs-contract docs issue.
What to do
Preserve ecosystem metadata through SBOM export
Emit ecosystem-correct PURLs for supported package managers
Use the same identity in CycloneDX and SPDX where both exist
If ecosystem cannot be identified safely, omit/NOASSERTION rather than guessing npm
Add fixtures for npm plus at least two non-npm ecosystems
Keep ordering and generated identifiers deterministic
Do not fabricate dependency relationships from a flat list unless the parser already exposes them.
Acceptance
npm packages still emit valid npm PURLs
Non-npm packages do not emit npm PURLs
Unknown ecosystems degrade honestly
Tests cover both formats (or document if only one ships)
Repeated export of a fixed artifact is byte-stable; DCO sign-off
Mentoring notes
Start from SBOM export / lockfile component helpers. fix: or feat: Conventional Commit as appropriate.
Component PURLs in toCycloneDx / toSpdx go through purlFor(dep.ecosystem, …) in src/reporting/commands/sbom.ts. The dependency graph does not. cycloneDxDependencyGraph maps every lockfile key with npmPurl, and spdxRelationships keys nodes as package@version with no ecosystem. A Cargo or PyPI graph can show pkg:cargo/… on components[].purl and pkg:npm/… on dependencies[].dependsOn.
purlPath's default branch also falls through to npm, so an unrecognized ProjectScan.type is claimed as npm.
Scope for a fix:
Carry ecosystem on graph refs. The lockfile key is only name@version today; that is the gap, not purlFor itself.
Use the same purl string in CycloneDX bom-ref / dependencies and SPDX externalRefs.
If the ecosystem is unknown, omit the purl. Do not invent pkg:npm. SPDX downloadLocation: NOASSERTION can stay.
Fixtures: npm plus two non-npm ecosystems. Repeated export of a fixed artifact stays byte-stable.
Leaving this open for an external contributor (help wanted).
Activity
vibgrate-team commentedon Oct 3, 2026
Component PURLs in
toCycloneDx/toSpdxgo throughpurlFor(dep.ecosystem, …)insrc/reporting/commands/sbom.ts. The dependency graph does not.cycloneDxDependencyGraphmaps every lockfile key withnpmPurl, andspdxRelationshipskeys nodes aspackage@versionwith no ecosystem. A Cargo or PyPI graph can showpkg:cargo/…oncomponents[].purlandpkg:npm/…ondependencies[].dependsOn.purlPath's default branch also falls through to npm, so an unrecognizedProjectScan.typeis claimed as npm.Scope for a fix:
name@versiontoday; that is the gap, notpurlForitself.bom-ref/dependenciesand SPDXexternalRefs.pkg:npm. SPDXdownloadLocation: NOASSERTIONcan stay.Leaving this open for an external contributor (
help wanted).