/** * False-positive metadata produced by supreme-max for a finding. */ export interface RawFalsePositiveAnalysis { is_likely_fp: boolean; confidence: number; reason: string | null; explanation: string; } /** * A single raw finding entry produced by supreme-max in the scan report. */ export interface RawFinding { scanner: string; file: string; line: number | null; severity: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW' | 'UNDEFINED'; confidence: 'HIGH' | 'MEDIUM' | 'LOW' | string; issue: string; cwe: string | null; code: string | null; fp_analysis: RawFalsePositiveAnalysis; } /** * Summary metrics generated by supreme-max for the full scan. */ export interface RawScanSummary { total_issues: number; files_scanned: number; lines_scanned: number; security_score: number; risk_level: string; } /** * Severity counters generated by supreme-max. */ export interface RawSeverityBreakdown { CRITICAL?: number; HIGH?: number; MEDIUM?: number; LOW?: number; UNDEFINED?: number; [severity: string]: number | undefined; } /** * Raw top-level JSON report created by supreme-max. */ export interface RawScanReport { timestamp: string; supreme2l_version: string; scan_summary: RawScanSummary; severity_breakdown: RawSeverityBreakdown; findings: RawFinding[]; } /** * A normalized code-based finding enriched with snippet and VS Code link. */ export interface CodeFinding extends RawFinding { type: 'code_finding'; snippet: string | null; vscode_link: string; } /** * A normalized dependency/advisory finding extracted from issue text. */ export interface CveFinding extends RawFinding { type: 'cve_finding'; cve_ids: string[]; ghsa_ids: string[]; advisory_links: string[]; } /** * Grouped parser output for code findings and CVE findings. */ export interface ParsedFindings { code_findings: CodeFinding[]; cve_findings: CveFinding[]; } /** * A code finding enriched with Qwen false-positive verification metadata. */ export interface VerifiedFinding extends CodeFinding { qwen_verified: boolean; fp_analysis: RawFalsePositiveAnalysis; } /** * Verification split for report generation and downstream processing. */ export interface VerificationResult { confirmed: VerifiedFinding[]; filtered: VerifiedFinding[]; } /** * Final S-Edition report payload used to generate the standalone HTML report. */ export interface ScanReport { meta: { project_path: string; timestamp: string; supreme2l_version: string; s_edition_version: string; duration_seconds: number; raw_json_filename: string; verification_limited: boolean; total_findings_scanned: number; }; summary: { total_scanned: number; confirmed: number; false_positives_filtered: number; unverified: number; dependency_cves: number; by_severity: Record; }; confirmed_findings: VerifiedFinding[]; dependency_cves: CveFinding[]; filtered_fp: VerifiedFinding[]; } export interface KnowledgeGraphNode { id: string; type: string; name: string; path?: string; layer?: string; summary?: string; functions?: string[]; imports?: string[]; } export interface KnowledgeGraphEdge { from: string; to: string; type: string; } export interface KnowledgeGraph { nodes: KnowledgeGraphNode[]; edges: KnowledgeGraphEdge[]; } export interface SecurityMetadata { handles_auth: boolean; handles_user_input: boolean; makes_external_calls: boolean; accesses_database: boolean; has_crypto: boolean; trust_boundary: 'public' | 'internal' | 'privileged'; } export interface EnrichedNode extends KnowledgeGraphNode { security: SecurityMetadata; } export interface EnrichedKnowledgeGraph { nodes: EnrichedNode[]; edges: KnowledgeGraphEdge[]; } export interface ArchVulnerability { id: string; category: | 'broken_trust_boundary' | 'missing_auth_on_path' | 'sensitive_data_exposure' | 'single_point_of_failure' | 'privilege_escalation_path'; severity: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW'; affected_nodes: string[]; description: string; recommendation: string; } export interface ArchScanReport { meta: { project_path: string; timestamp: string; s_edition_version: string; duration_seconds: number; graph_stats: { total_nodes: number; total_edges: number; used_fallback: boolean; }; }; vulnerabilities: ArchVulnerability[]; graph: EnrichedKnowledgeGraph; }