Add cross-service alert correlation system FRE-4500

- Unified alert types (AlertSource, AlertCategory, CorrelationStatus, EntityType)
- NormalizedAlert and CorrelationGroup Prisma models
- AlertNormalizer for all 4 services (DarkWatch, SpamShield, VoicePrint, CallAnalysis)
- CorrelationEngine with temporal + entity-based correlation detection
- CorrelationService orchestrator with dashboard API
- Correlation API routes (/api/v1/correlation/*)
- Service emitters wired to DarkWatch, SpamShield, VoicePrint
- pnpm workspace config for monorepo
This commit is contained in:
Senior Engineer
2026-05-02 01:10:44 -04:00
committed by Michael Freno
parent 685fb57e53
commit 03276dde2d
35 changed files with 8072 additions and 31 deletions

View File

@@ -9,8 +9,9 @@
"lint": "eslint src/"
},
"dependencies": {
"@shieldai/db": "0.1.0",
"@shieldai/types": "0.1.0",
"@shieldai/db": "workspace:*",
"@shieldai/types": "workspace:*",
"@shieldai/correlation": "workspace:*",
"node-cache": "^5.1.2"
},
"exports": {

View File

@@ -2,6 +2,7 @@ import prisma from "@shieldai/db";
import { AudioPreprocessor, AudioFeatures } from "../preprocessor/AudioPreprocessor";
import { EmbeddingService, EmbeddingOutput } from "../embedding/EmbeddingService";
import { VoiceEnrollmentService } from "../enrollment/VoiceEnrollmentService";
import { emitVoicePrintAlert } from "@shieldai/correlation";
import {
AnalyzeAudioInput,
AnalysisJobStatus,
@@ -78,6 +79,19 @@ export class AnalysisService {
},
});
if (result.verdict === DetectionVerdict.SYNTHETIC || result.verdict === DetectionVerdict.UNCERTAIN) {
emitVoicePrintAlert(
userId,
job.id,
result.verdict,
result.syntheticScore,
result.confidence,
result.matchedEnrollmentId || undefined,
result.matchedSimilarity || undefined,
input.analysisType || undefined
).catch((err) => console.error(`[Correlation] VoicePrint emit failed:`, err));
}
return {
jobId: job.id,
syntheticScore: result.syntheticScore,