fix: include source path on unparseable license findings - #337
Closed
vibgrate-team wants to merge 1 commit into
Closed
vibgrate-team wants to merge 1 commit into
vibgrate-team wants to merge 1 commit into
Conversation
When a local license declaration cannot be parsed as SPDX, vg scan now emits vibgrate/license-unparseable with the repo-relative path in JSON and SARIF instead of dropping the file. Registry licenses without a local file stay on the dependency row. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
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 scannow keeps a stable, repo-relative path on license findings in machine-readable JSON and SARIF when a local declaration cannot be parsed as SPDX.For each project directory the scan already knows, it reads a
package.jsonlicense/licensesfield (when that file is present) and the fixed namesLICENSE,LICENCE,COPYING, andNOTICE(plus.md/.txt) in that directory. A declaration that does not resolve to a known SPDX id is reported asvibgrate/license-unparseableinstead of being dropped:locationanddetails.pathto the path (LICENSE,packages/foo/package.json)physicalLocation.artifactLocation.uriandproperties.pathThe license body is not copied into the artifact. Findings are sorted by path. Registry license strings have no local file, so they stay on the dependency row (
license.raw,license.spdxId: null) and are not given a path. Standard license titles (Apache, MIT, GPL, BSD, ISC, MPL, Unlicense) and anSPDX-License-Identifierthat parses are not flagged. A failed SPDX tag does not fall through to a later title.Related issues
Fixes #213
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
Verification:
pnpm test— 460 files, 4904 tests passedpnpm lint— exit 0 (existing unused-var warnings only, none in this change)pnpm typecheck— exit 0src/core-open/licenses/evidence.test.tsasserts the pathLICENSEappears in scan JSON (location,details.path) and SARIF (artifactLocation.uri,properties.path), that the file body is not emitted, and that two collections of the same tree are byte-identical