Skip to content

feat: Replace numeric scoring with severity counts#3

Merged
Pringled merged 4 commits intomainfrom
improve-scoring
Mar 2, 2026
Merged

feat: Replace numeric scoring with severity counts#3
Pringled merged 4 commits intomainfrom
improve-scoring

Conversation

@Pringled
Copy link
Owner

@Pringled Pringled commented Mar 1, 2026

No description provided.

Pringled added 4 commits March 1, 2026 16:01
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.
@Pringled Pringled merged commit 9cbddc5 into main Mar 2, 2026
2 checks passed
@Pringled Pringled deleted the improve-scoring branch March 2, 2026 09:29
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