Skip to content

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

Description

@Ty-Robb

Summary

Confidence normalization appears inconsistent across engines.

Semantic integration emits lowercase confidence (e.g., medium), while config threshold logic expects uppercase keys (LOW, MEDIUM, HIGH). This can cause confidence-threshold filtering to mis-handle semantic findings.

Affected Files

  • src/semantic-integration.js
  • src/config.js

Reproduction

  1. Produce a semantic finding with confidence: "medium".
  2. Set .scannerrc confidence threshold to MEDIUM.
  3. Observe filtering can treat semantic confidence as unknown/lowest.

Expected

  • Confidence values are normalized before threshold checks.
  • Threshold behavior is consistent for AST/regex/semantic findings.

Suggested Fix

  • Normalize confidence to uppercase at ingestion boundary.
  • Add tests for mixed-case values (medium, Medium, MEDIUM).

Acceptance Criteria

  • Semantic findings respect configured confidence thresholds identically to other engines.
  • Unit tests cover normalization and threshold behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions