Skip to content

fix: normalize confidence case across config filtering and semantic output#73

Open
Ty-Robb wants to merge 1 commit intosinewaveai:mainfrom
Ty-Robb:fix/70-confidence-normalization
Open

fix: normalize confidence case across config filtering and semantic output#73
Ty-Robb wants to merge 1 commit intosinewaveai:mainfrom
Ty-Robb:fix/70-confidence-normalization

Conversation

@Ty-Robb
Copy link
Copy Markdown

@Ty-Robb Ty-Robb commented Apr 16, 2026

Summary

Normalize confidence casing so threshold filtering behaves consistently across engines, including semantic findings.

Problem

Semantic integration can emit lowercase confidence (for example medium) while threshold checks use uppercase levels (LOW|MEDIUM|HIGH). This can cause findings to be filtered incorrectly.

Changes

  • src/config.js
    • Normalize both finding confidence and configured confidence_threshold to uppercase in meetsConfidenceThreshold.
  • src/semantic-integration.js
    • Normalize emitted semantic finding confidence to uppercase (MEDIUM default).
  • tests/config.test.js
    • Added regression tests for lowercase/mixed-case confidence and thresholds.
    • Added regression test proving lowercase semantic-style confidence is preserved correctly at MEDIUM threshold.

Verification

  • npx vitest run tests/config.test.js (pass)
  • npx vitest run tests/scan-security.test.js tests/semantic-analysis.test.js (pass)

Fixes #70

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.

[Bug]: Confidence threshold filtering inconsistent due to case mismatch (semantic findings)

1 participant