/**
 * Framework Security Model Types
 *
 * Interfaces for encoding framework-specific security guarantees.
 * Each framework model declares safe patterns (suppress findings)
 * and unsafe patterns (boost findings).
 */

export interface FrameworkSecurityModel {
  /** Which framework this model covers */
  framework: string
  /** Patterns that are safe by design — suppress findings */
  safePatterns: FrameworkSafePattern[]
  /** Patterns that are unsafe despite framework — boost findings */
  unsafePatterns: FrameworkUnsafePattern[]
}

export interface FrameworkSafePattern {
  /** Rule identifier */
  id: string
  /** What vulnerability categories this suppresses */
  suppressesCategory: string[]
  /** Detect the safe pattern on a line */
  detect: (lineContent: string, filePath: string, fileContent: string) => boolean
  /** Human-readable explanation for scoring/AI */
  reason: string
}

export interface FrameworkUnsafePattern {
  /** Rule identifier */
  id: string
  /** What vulnerability categories this boosts */
  boostsCategory: string[]
  /** Detect the unsafe pattern on a line */
  detect: (lineContent: string, filePath: string, fileContent: string) => boolean
  /** Human-readable explanation */
  reason: string
}

/** Per-file framework analysis result */
export interface FileFrameworkAnalysis {
  /** Which safe patterns matched lines in this file */
  safeLines: Map<number, FrameworkSafePattern[]>
  /** Which unsafe patterns matched lines in this file */
  unsafeLines: Map<number, FrameworkUnsafePattern[]>
}
