/**
 * Audit system type contracts.
 * All audit modules build against these interfaces.
 */
import type { ComplianceDetailScore } from "./compliance/types.js";
export type Severity = "critical" | "warning" | "info";
export type FixTier = "SAFE" | "GUARDED" | "FORBIDDEN";
export type ComplianceCoverage = "full" | "partial";
export interface ComplianceRef {
    framework: string;
    controlId: string;
    version: string;
    description: string;
    coverage: ComplianceCoverage;
    level?: "L1" | "L2";
}
export interface AuditCheck {
    id: string;
    category: string;
    name: string;
    severity: Severity;
    passed: boolean;
    currentValue: string;
    expectedValue: string;
    fixCommand?: string;
    explain?: string;
    complianceRefs?: ComplianceRef[];
    tags?: string[];
    vpsIrrelevant?: boolean;
    safeToAutoFix?: FixTier;
}
export interface AuditCategory {
    name: string;
    checks: AuditCheck[];
    score: number;
    maxScore: number;
    connectionError?: boolean;
}
export interface AuditResult {
    serverName: string;
    serverIp: string;
    platform: "coolify" | "dokploy" | "bare";
    timestamp: string;
    auditVersion: string;
    categories: AuditCategory[];
    overallScore: number;
    quickWins: QuickWin[];
    skippedCategories?: string[];
    complianceDetail?: ComplianceDetailScore[];
    vpsType?: string;
    vpsAdjustedCount?: number;
    warnings?: string[];
}
export interface QuickWin {
    commands: string[];
    currentScore: number;
    projectedScore: number;
    description: string;
}
export interface AuditHistoryEntry {
    serverIp: string;
    serverName: string;
    timestamp: string;
    overallScore: number;
    categoryScores: Record<string, number>;
    auditVersion?: string;
}
export interface FixExecutionLogEntry {
    checkId: string;
    command: string;
    stdout: string;
    stderr: string;
    durationMs: number;
    success: boolean;
}
export interface FixHistoryEntry {
    fixId: string;
    serverIp: string;
    serverName: string;
    timestamp: string;
    checks: string[];
    scoreBefore: number;
    scoreAfter: number | null;
    status: "applied" | "rolled-back" | "failed";
    backupPath?: string;
    executionLog?: FixExecutionLogEntry[];
    source?: "fix" | "doctor" | "plugin";
    pluginName?: string;
}
/** Check parser function signature — each category module exports this */
export type CheckParser = (sectionOutput: string, platform: string) => AuditCheck[];
/** Snapshot file envelope stored on disk */
export interface SnapshotFile {
    schemaVersion: number;
    name?: string;
    savedAt: string;
    audit: AuditResult;
}
/** Entry returned by listSnapshots */
export interface SnapshotListEntry {
    filename: string;
    savedAt: string;
    name?: string;
    overallScore: number;
    corrupt?: boolean;
}
export interface SnapshotIndexEntry {
    filename: string;
    savedAt: string;
    name?: string;
    overallScore: number;
    checkCount: number;
    serverIp: string;
}
export interface SnapshotIndex {
    version: 1;
    entries: SnapshotIndexEntry[];
}
export interface RegressionBaseline {
    version: 1;
    serverIp: string;
    lastUpdated: string;
    bestScore: number;
    passedChecks: string[];
}
export interface RegressionResult {
    regressions: string[];
    newPasses: string[];
    baselineScore: number;
    currentScore: number;
}
export interface RegressionLine {
    severity: "warning" | "info";
    text: string;
}
export interface TrendCauseLine {
    category: string;
    scoreBefore: number;
    scoreAfter: number;
    delta: number;
}
export interface TrendEntry {
    timestamp: string;
    score: number;
    delta: number | null;
    causeList: TrendCauseLine[];
}
export interface TrendResult {
    serverIp: string;
    serverName: string;
    entries: TrendEntry[];
}
export type CheckDiffStatus = "improved" | "regressed" | "unchanged" | "added" | "removed";
export interface CheckDiffEntry {
    id: string;
    name: string;
    category: string;
    severity: Severity;
    status: CheckDiffStatus;
    /** null when check did not exist in this snapshot */
    before: boolean | null;
    after: boolean | null;
}
export interface AuditDiffResult {
    beforeLabel: string;
    afterLabel: string;
    scoreBefore: number;
    scoreAfter: number;
    scoreDelta: number;
    improvements: CheckDiffEntry[];
    regressions: CheckDiffEntry[];
    unchanged: CheckDiffEntry[];
    added: CheckDiffEntry[];
    removed: CheckDiffEntry[];
}
export interface CategoryDiffEntry {
    category: string;
    scoreBefore: number;
    scoreAfter: number;
    delta: number;
    passedBefore: number;
    passedAfter: number;
    totalBefore: number;
    totalAfter: number;
}
export interface AuditCompareSummary {
    beforeLabel: string;
    afterLabel: string;
    scoreBefore: number;
    scoreAfter: number;
    scoreDelta: number;
    categories: CategoryDiffEntry[];
    weakestCategory: {
        label: string;
        category: string;
        score: number;
    } | null;
}
//# sourceMappingURL=types.d.ts.map