Skip to content

feat: support --ratchet with per-subfolder baselines in multi-folder mode#876

Open
Ayush7614 wants to merge 1 commit into
OWASP:mainfrom
Ayush7614:feat/multi-folder-ratchet
Open

feat: support --ratchet with per-subfolder baselines in multi-folder mode#876
Ayush7614 wants to merge 1 commit into
OWASP:mainfrom
Ayush7614:feat/multi-folder-ratchet

Conversation

@Ayush7614

@Ayush7614 Ayush7614 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Wire per-subfolder --ratchet / baseline filtering into multi-folder mode (as agreed on feat: support --ratchet / baseline filtering in multi-folder mode #868): each scanned folder gets its own .cve-lite/baseline.json via existing readBaseline/writeBaseline.
  • First --ratchet run saves missing baselines; subsequent runs gate per folder and fail if any folder has findings above its baseline.
  • Non-ratchet scans with an existing baseline auto-suppress known findings (and derive maintenance from the filtered set). --check-overrides stays out of the ratchet path, matching single-folder.
  • Docs: multi-folder note in ratcheting.md; add --ratchet to CLI reference.

Fixes #868

Test plan

  • npm test -- tests/multi-folder-scan.test.ts tests/multi-folder-printer.test.ts (36 passed)
  • Manual: monorepo without root lockfile → cve-lite . --ratchet creates packages/*/.cve-lite/baseline.json and exits 0
  • Second --ratchet with same findings exits 0; introducing a new finding in one folder exits 1
  • cve-lite packages/api --ratchet uses the same path as multi-folder for that folder's baseline

…mode

Each scanned folder gets its own .cve-lite/baseline.json so a folder
behaves the same alone or in a multi-folder run. --ratchet saves or
gates per folder; existing baselines auto-filter non-ratchet scans.
@Ayush7614
Ayush7614 requested a review from sonukapoor as a code owner July 23, 2026 15:52
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.

feat: support --ratchet / baseline filtering in multi-folder mode

1 participant