Repository navigation
feat(sbom): mark dev and optional dependencies in CycloneDX and SPDX - #472
Merged
Merged
Conversation
The scan already stores the manifest section on each direct row. Export now writes it as CycloneDX component scope and, when a graph is present, as SPDX DEV_DEPENDENCY_OF or OPTIONAL_DEPENDENCY_OF. vibgrate:scope stays direct or transitive. Fixes #418 Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
Export keeps vibgrate:scope as direct or transitive, and writes the manifest section as CycloneDX component scope (excluded or optional) and as SPDX DEV_DEPENDENCY_OF or OPTIONAL_DEPENDENCY_OF. Production, peer, and lockfile-only rows omit component scope. The document id includes the mark. Fixes #418 Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
vibgrate-team
marked this pull request as ready for review
October 19, 2026 05:17
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
vg sbom exportkeepsvibgrate:scope/ SPDXscope=asdirectortransitive, and now reads the scanned manifest section when it writes dependency kind.devDependenciesrow sets CycloneDX componentscopetoexcludedand writes SPDXDEV_DEPENDENCY_OFfrom that package toSPDXRef-DOCUMENT. It stays out of the CycloneDX rootdependsOnlist. Child edges stayDEPENDS_ON.optionalDependenciesrow sets componentscopetooptionaland writesOPTIONAL_DEPENDENCY_OFin that same direction. That relationship replaces a rootDEPENDS_ONwhen the lockfile already lists the package.scope. Peer edges stayDEPENDS_ON.requiredis never written.BUILD_DEPENDENCY_OF,TEST_DEPENDENCY_OF, andRUNTIME_DEPENDENCY_OFstay omitted.dependencies. Optional wins over a production listing. Production outranks development. Peer alone is unmarked. The same inputs produce the same mark whichever row is listed first.dependenciesand SPDX still omitsDEPENDS_ON. A scanned development or optional dependency still producesDEV_DEPENDENCY_OForOPTIONAL_DEPENDENCY_OF, including under--no-transitive.serialNumber/documentNamespace.The contract, the worked
scope-fixtureexample, and the gap list are updated indocs/sbom-dependency-scope.md,DOCS.md, andREADME.md.Related issues
Fixes #418
Checklist
pnpm testpassespnpm lintis cleanpnpm typecheckis cleangraph.json/ report output (content-hashed IDs, stable sorts; no time, randomness, or filesystem-order dependence)git commit -s, DCO)Notes for reviewers
excludedclassifies a development dependency; it does not remove the component. An omitted componentscopeis what the spec reads asrequired, so production, peer, and lockfile-only rows stay distinct from a writtenoptionalorexcluded. A child of a development package is not itself markedexcludedorDEV_DEPENDENCY_OF. Lockfile flags (dev,optional,devOptional, and the equivalents in other ecosystems) are still not read.