Skip to content

anomalyDetector: Add configurable sensitivityLevel option (low/medium/high) #697

Description

@Kingsman-99

Description

anomalyDetector flags unusual payment patterns but uses a hard-coded Z-score threshold. Contributors should expose a sensitivityLevel option ("low" | "medium" | "high") that maps to Z-score thresholds (3.0, 2.0, 1.5 respectively), allowing operators to tune false-positive rates for their user base.

Acceptance Criteria

  • A sensitivityLevel: "low" | "medium" | "high" option is accepted (default "medium")
  • Each level maps to the correct Z-score threshold (low→3.0, medium→2.0, high→1.5)
  • The current sensitivityLevel is included in every anomaly report object for auditability
  • Existing tests continue to pass

Context

  • Target file: src/lib/anomalyDetector.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions