feat: Replace numeric scoring with severity counts#3
Merged
Conversation
Drop the Financial/Mutation/SecretExposure 0-10 scoring system entirely.
Scores were based on arbitrary weights and created false precision.
Replace with:
- models.Summary: objective counts (critical/high/moderate/low/uncertain,
findings_total, scanners_total, scanners_skipped)
- scan.Summarise(): computes Summary from []ScanResult
- --fail-on now takes low|moderate|high|critical (default: high)
- CI fails if any finding is at or above the threshold severity
- UNCERTAIN findings never trigger CI failure
- JSON output: {"summary": {...}, "scan_results": [...]}
- Delete internal/scoring/ package (~550 LOC removed)
- Rename FindingsTotal → ConfirmedTotal (models, scan, json, markdown, all tests): field name now matches semantics — only confirmed severity findings are counted; UNCERTAIN is always excluded. JSON key changes from 'findings_total' to 'confirmed_total'. - Add direct Summarise() unit tests in scan_test.go covering: empty input, mixed severities, uncertain-not-in-confirmed-total, all-uncertain, skipped scanners counted separately, no-findings-all-run. - Update README: replace old score-panel screenshot with new severity-count summary panel; remove 'Risk Scores' section; add JSON output contract showing confirmed_total; fix --ci/--fail-on examples to use severity strings (low|moderate|high|critical); add TODO comment for future config-file support for --fail-on threshold. - Update local/demo.sh: add commented-out --json, --markdown, and --ci examples showing the current flag surface.
Collapse 4 near-identical CI threshold tests into one table-driven test and 6 individual Summarise tests into one table-driven test. Same coverage, ~60 fewer lines.
…extract glob helper
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.
No description provided.