Repository navigation
Flag left-out packages, known-range conversions and version spelling - #3
Merged
Merged
Conversation
…lling Three shapes from real advisory edits were missed or described poorly. - sibling-package-unchanged: version ranges changed for one package but not for another in the same advisory that had the same version data. Needs review. - known-range-converted: last_known_affected_version_range replaced by a range's one new end. This was an added event plus a removed field that suggested data loss. The finding says whether the two name the same end, comparing strings only. - version-spelling-changed: a range value that changes only in leading zeros. validate also warns with version-leading-zero for npm packages and SEMVER ranges. Allow lists naming the old codes no longer cover these cases. The version is not bumped; the changelog entry is under Unreleased.
Merged
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.
Adds three checks for edit shapes found by running AdvisoryGuard on real advisory edits. There is no new command or option, no version bump and no release in this PR.
What changes
sibling-package-unchangedknown-range-convertedlast_known_affected_version_rangewas replaced by a range's one new end. It says whether the two name the same end, comparing strings onlyversion-spelling-changed2025.08.14to2025.8.14version-leading-zerovalidatefound a leading zero in a range event of annpmpackage or aSEMVERrange. The file is still valid OSV, so it still exits 0Behaviour changes to check
--allow range-event-added,field-removedno longer covers a known range replaced by an end. Useknown-range-converted.--allow range-event-changedno longer covers a change that is only in leading zeros. Useversion-spelling-changed.sibling-package-unchangedif it leaves out a package that had the same version data.Without an allow list, exit codes did not change on any real edit tested below.
How it was checked
Locally, on Windows with Node 24.16.0: typecheck, lint, build, 508 tests (447 existing plus 61 new),
verify:pack46 of 46,verify:schema, andnpm auditwith no vulnerabilities.One existing test changed. The real-data test in
test/real.test.tskeeps its original check, and now also requiressibling-package-unchangedexactly when another package shares the data.Deliberate breaks. The new code was broken in 23 ways in a throwaway copy, and the tests caught all 23.
Real edits:
An earlier sample of 10 public edits exposed a false alarm, which is fixed and has its own test: only a change to the ranges now counts, not a known-range note leaving on its own.
Limits
last_affectedtofixedconversion from one that changes status.field-removedwith its "dropped by accident" wording. That looks common, and this PR does not change it.