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
Context
- Target file:
src/lib/anomalyDetector.ts
Description
anomalyDetectorflags unusual payment patterns but uses a hard-coded Z-score threshold. Contributors should expose asensitivityLeveloption ("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
sensitivityLevel: "low" | "medium" | "high"option is accepted (default"medium")sensitivityLevelis included in every anomaly report object for auditabilityContext
src/lib/anomalyDetector.ts