Skip to content

refactor: one severity table, a collector registry, and ruleId/confidence on findings - #9

Open
AjayBThorat-20 wants to merge 1 commit into
refactor/remove-dead-codefrom
refactor/finding-model-and-collector-registry
Open

AjayBThorat-20 wants to merge 1 commit into
refactor/remove-dead-codefrom
refactor/finding-model-and-collector-registry

Conversation

@AjayBThorat-20

@AjayBThorat-20 AjayBThorat-20 commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

What and why

Groundwork for everything after it:

  • One severity table. core/utils/severity.js replaces four copies that had drifted apart (MEDIUM was blue in one, yellow in another).
  • Findings carry ruleId, confidence and every merged advisory id. Heuristics (unused, typosquat) are never high confidence. A finding's id is now <ruleId>:<package>@<version>[:<advisoryId>], so two findings for one package no longer share an id.
  • Collector registry. analyze runs checks from collectors/index.js instead of a hardcoded list; each entry owns its "scan incomplete" message, and --json metadata gains a per-collector scanIncomplete map. Same findings and score as before on the same project.
  • Merging only low-confidence findings no longer reports "medium".
  • Honest coverage: measured over all of 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%.
  • A weekly informational job scans five popular open-source projects for likely false positives.

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 main and CI runs.

How I tested it

🤖 Generated with Claude Code

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant