Repository navigation
refactor: one severity table, a collector registry, and ruleId/confidence on findings - #9
Open
AjayBThorat-20 wants to merge 1 commit into
Conversation
…ence on findings - core/utils/severity.js is now the only severity table; issue.model.js re-exports it and console-formatter.js uses it, replacing copies that had drifted apart. - Findings carry ruleId, confidence (heuristics are never "high") and every merged advisory id. The finding id is now <ruleId>:<package>@<version>[:<advisoryId>], so two findings for one package no longer share an id. - analyze runs collectors from a registry (collectors/index.js) instead of a hardcoded list; "scan incomplete" messages come from each entry, and --json metadata gains a per-collector scanIncomplete map. Same findings and score as before on the same project. - Fix: merging only low-confidence findings no longer reports "medium". - Coverage is measured over all of src/ (c8 --all), not just files tests happen to load; the real figure is ~29%, so the floor is 25%, not 60%. - Add a weekly informational job scanning five popular OSS projects for likely false positives.
2 of 3 tasks
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.
What and why
Groundwork for everything after it:
core/utils/severity.jsreplaces four copies that had drifted apart (MEDIUM was blue in one, yellow in another).ruleId,confidenceand every merged advisory id. Heuristics (unused, typosquat) are neverhighconfidence. A finding's id is now<ruleId>:<package>@<version>[:<advisoryId>], so two findings for one package no longer share an id.analyzeruns checks fromcollectors/index.jsinstead of a hardcoded list; each entry owns its "scan incomplete" message, and--jsonmetadata gains a per-collectorscanIncompletemap. Same findings and score as before on the same project.src/(c8 --all) instead of only the files a test loads. The real figure was ~29%, so the CI floor is 25%, not a misleading 60%.Stacked on #8.
Merging the stack: use Create a merge commit, not squash (squashing makes every later PR show these commits again). After merging the PR below this one, click Delete branch on it; GitHub then retargets this PR to
mainand CI runs.How I tested it
npm run test:coverageon Node 24.21.0, cleannpm ci, network disabled: 99/99 pass, 28.67% linesnpm audit --audit-level=highcurrently fails on GHSA-mrwp-f3q8-3g9p (follow-redirects, published after this branch was made); the lockfile fix is in feat: rank vulnerabilities by exploit risk (CISA KEV + FIRST EPSS) #14🤖 Generated with Claude Code