import type { Finding } from "../rules/types"; import type { DynamicFinding } from "../sdk/types"; export type FindingPlane = "static" | "dynamic"; export type UnifiedSeverity = "low" | "medium" | "high" | "critical"; export type UnifiedFindingInput = { plane: FindingPlane; sourceFindingId: string; ruleId: string; ruleFamily: string; category: string; severity: UnifiedSeverity; confidence: number; message: string; servicePath: string; locationKey?: string; timestamp: number; raw: Finding | DynamicFinding; }; export type CorrelationReason = "rule-family" | "location" | "service-path"; export type CorrelationSummary = { correlated: boolean; matchedPlanes: FindingPlane[]; reasons: CorrelationReason[]; relatedFindingIds: string[]; }; export type UnifiedObservation = { plane: FindingPlane; sourceFindingId: string; severity: UnifiedSeverity; confidence: number; message: string; timestamp: number; }; export type TriageFeedbackOutcome = "true-positive" | "false-positive" | "acceptable-risk"; export type TriageFeedbackEntry = { id: string; timestamp: number; findingId: string; outcome: TriageFeedbackOutcome; actor: string; note?: string; }; export type FeedbackSummary = { truePositiveCount: number; falsePositiveCount: number; acceptableRiskCount: number; lastUpdatedAt?: number; }; export type UnifiedFindingRecord = { id: string; fingerprint: string; dedupeKey: string; ruleId: string; ruleFamily: string; category: string; servicePath: string; locationKey?: string; severityBase: UnifiedSeverity; severityFinal: UnifiedSeverity; severityPromoted: boolean; confidenceMax: number; confidenceAdjusted: number; firstSeenAt: number; lastSeenAt: number; occurrenceCount: number; feedbackSummary: FeedbackSummary; feedbackHistory: TriageFeedbackEntry[]; observations: UnifiedObservation[]; correlation: CorrelationSummary; }; export type IngestionResult = { ingested: number; uniqueAdded: number; deduped: number; totalUnique: number; }; export type TriageQuery = { plane?: FindingPlane; minSeverity?: UnifiedSeverity; correlatedOnly?: boolean; promotedOnly?: boolean; servicePathPrefix?: string; lowConfidenceOnly?: boolean; disputedOnly?: boolean; highConfidenceConfirmedOnly?: boolean; }; export type CorrelationView = { id: string; servicePath: string; ruleFamily: string; planes: FindingPlane[]; reasons: CorrelationReason[]; findingIds: string[]; }; export type TriageSummary = { totalUniqueFindings: number; totalObservations: number; dedupeReduction: { removedDuplicates: number; reductionPercent: number; }; crossPlaneCorrelatedCount: number; severityPromotedCount: number; }; export type TriageView = { summary: TriageSummary; findings: UnifiedFindingRecord[]; correlations: CorrelationView[]; };