Skip to content

fix(testaudit): validate statistical detector configuration - #15

Merged
FreakyAdy merged 4 commits into
masterfrom
fix/statistical-detector-validation
Oct 17, 2026
Merged

FreakyAdy merged 4 commits into
masterfrom
fix/statistical-detector-validation

Conversation

@FreakyAdy

@FreakyAdy FreakyAdy commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

StatisticalDetector accepted threshold settings without validating their range or ordering. Invalid configurations could make the pass/fail anomaly rules ambiguous, and min_cohort_size=0 allowed an empty cohort to reach division by zero.

This change validates that both thresholds are between 0 and 1, that the universal-fail threshold is strictly lower than the universal-pass threshold, and that the minimum cohort size is a positive integer. Regression tests cover out-of-range values, overlapping thresholds, NaN thresholds, and invalid cohort sizes.

Validation

  • Ruff check and format: passed
  • mypy: passed
  • Unit-test matrix: passed
  • Linux/Docker integration tests: passed
  • Coverage gate: passed

@FreakyAdy
FreakyAdy merged commit 43776b7 into master Oct 17, 2026
14 checks passed
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