import type { RiskLevel, AuditCategory } from './common.js';
export interface ResilienceAnalysis {
    failureScenarios: FailureScenario[];
    concurrencyAnalysis: ConcurrencyAnalysis;
    scalabilityAssessment: string;
    overallRisk: RiskLevel;
}
export interface FailureScenario {
    scenario: string;
    probability: 'low' | 'medium' | 'high';
    impact: 'low' | 'medium' | 'high' | 'critical';
    currentHandling: string;
    requiredHandling: string;
    dataConsistency: string;
    userExperience: string;
}
export interface ConcurrencyAnalysis {
    hotPaths: string[];
    raceConditions: string[];
    sharedState: string[];
    recommendations: string[];
}
export interface DriftReport {
    specId: string;
    checkType: 'on-demand' | 'ci' | 'pre-commit' | 'scheduled';
    driftScore: number;
    drifts: DriftItem[];
    lastChecked: string;
    isCompliant: boolean;
}
export interface DriftItem {
    file: string;
    specCriterion: string;
    expected: string;
    actual: string;
    severity: 'low' | 'medium' | 'high' | 'critical';
    autoFixable: boolean;
    suggestedFix?: string;
}
export interface QualityProfile {
    enabledCategories: AuditCategory[];
    customRules: QualityRule[];
    principles: string[];
    strictness: 'relaxed' | 'standard' | 'strict';
}
export interface QualityRule {
    id: string;
    description: string;
    category: AuditCategory;
    severity: 'info' | 'warning' | 'error' | 'critical';
    source: string;
    pattern?: string;
}
export interface AuditFinding {
    file: string;
    line?: number;
    category: AuditCategory;
    severity: 'info' | 'warning' | 'error' | 'critical';
    rule: string;
    message: string;
    suggestion: string;
    reference?: string;
}
export interface AuditSummary {
    byCategory: Record<string, {
        count: number;
        severity: string;
    }>;
    topIssues: string[];
    strengths: string[];
    score: number;
}
export interface AuditResult {
    filesAnalyzed: number;
    findings: AuditFinding[];
    summary: AuditSummary;
    score: number;
    qualityScore?: QualityScore;
}
/** Scoring weight per category (must sum to 1.0). */
export type QualityScoringCategory = 'solid' | 'clean-code' | 'architecture' | 'security' | 'performance' | 'dry' | 'error-handling';
export interface QualityCategoryScore {
    category: QualityScoringCategory;
    score: number;
    weight: number;
    issueCount: number;
    worstSeverity: 'info' | 'warning' | 'error' | 'critical' | 'none';
    suggestions: string[];
}
export interface CustomRuleResult {
    rule: string;
    source: string;
    passed: boolean;
    detail: string;
}
export interface QualityScore {
    overall: number;
    categories: QualityCategoryScore[];
    customRules: CustomRuleResult[];
    generatedAt: string;
}
export interface TechDebtItem {
    file: string;
    type: 'anti-pattern' | 'code-smell' | 'outdated-dep' | 'missing-tests' | 'complexity';
    description: string;
    severity: 'low' | 'medium' | 'high';
    effort: 'trivial' | 'small' | 'medium' | 'large';
    suggestion: string;
}
export interface VisualValidation {
    screenshots: VisualScreenshot[];
    designComparison?: VisualComparison;
    visualScore: number;
    issues: VisualIssue[];
}
export interface VisualScreenshot {
    name: string;
    path: string;
    source: 'puppeteer' | 'playwright' | 'manual' | 'figma' | 'pencil';
    viewport: string;
}
export interface VisualComparison {
    designSource: 'figma' | 'pencil' | 'screenshot-reference';
    matchPercentage: number;
    differences: string[];
}
export interface VisualIssue {
    severity: 'critical' | 'warning' | 'info';
    element: string;
    issue: string;
    screenshot?: string;
}
export interface DetectDriftInput {
    specId: string;
    projectId: string;
    mode?: 'full' | 'quick';
    outputFormat?: 'report' | 'ci-json' | 'github-annotations';
    threshold?: number;
}
export interface AuditInput {
    path: string;
    projectId: string;
    categories?: AuditCategory[];
    specId?: string;
}
export interface ValidateResult {
    matches: string[];
    missing: string[];
    extra: string[];
    fieldsImplemented: number;
    fieldsTotal: number;
    score: number;
    qualityIssues: AuditFinding[];
    visualValidation?: VisualValidation;
}
export interface CodeState {
    affectedFiles: string[];
    unexpectedFiles: string[];
    fileContents: Map<string, string>;
}
export interface FunctionInfo {
    name: string;
    startLine: number;
    length: number;
}
/** A single pattern entry — correct, deprecated, or common mistake. */
export interface FrameworkPattern {
    /** Human-readable description of the pattern. */
    pattern: string;
    /** Optional code example illustrating the pattern. */
    example?: string;
    /** Framework version since which this pattern applies (for correctPatterns). */
    since?: string;
    /** The replacement for deprecated/mistake patterns. */
    replacedBy?: string;
    /** Severity when the pattern is problematic (deprecated / mistake). */
    severity?: 'error' | 'warning';
}
/** Full registry entry for one framework. */
export interface RegistryEntry {
    /** Unique machine-friendly ID, e.g. "nextjs". */
    framework: string;
    /** Human-readable name, e.g. "Next.js". */
    displayName: string;
    /** Reference version range, e.g. "14.x". */
    frameworkVersion: string;
    /** ISO date of last manual update. */
    lastUpdated: string;
    /** Language/platform ecosystem, e.g. "typescript", "python". */
    ecosystem: string;
    /** Patterns that are correct and recommended in this version. */
    correctPatterns: FrameworkPattern[];
    /** Patterns that are outdated / removed. */
    deprecatedPatterns: FrameworkPattern[];
    /** Common LLM hallucinations or misuses. */
    commonMistakes: FrameworkPattern[];
    /** true when added by the user via update_registry, not shipped with Planu. */
    customEntry: boolean;
}
/** A single accuracy problem detected in a spec. */
export interface SpecAccuracyIssue {
    /** Category of the problem. */
    type: 'invalid-api' | 'deprecated-pattern' | 'unknown-framework';
    /** The framework this issue belongs to. */
    framework: string;
    /** The exact text snippet that triggered the issue. */
    reference: string;
    /** Human-readable correction hint. */
    suggestion?: string;
    /** How critical the issue is. */
    severity: 'error' | 'warning' | 'info';
}
/** Full accuracy report returned by check_spec_accuracy. */
export interface SpecAccuracyReport {
    /** Confidence score 0-100 (100 = all references validated). */
    score: number;
    /** All detected issues. */
    issues: SpecAccuracyIssue[];
    /** Framework IDs auto-detected in the spec text. */
    frameworksDetected: string[];
    /** Framework names mentioned in the spec that are not in the registry. */
    frameworksNotInRegistry: string[];
    /** Total number of API/pattern references examined. */
    totalReferencesChecked: number;
    /** How many of those references were found in the registry. */
    validatedReferences: number;
    /** Framework IDs whose registry entry is older than 180 days. */
    staleRegistryEntries: string[];
}
export type ConfigFindingSeverity = 'info' | 'warn' | 'critical';
export interface ConfigFinding {
    area: string;
    severity: ConfigFindingSeverity;
    message: string;
    suggestion: string;
    docsRef: string;
}
export interface ConfigAuditResult {
    score: number;
    grade: 'A' | 'B' | 'C' | 'D' | 'F';
    findings: ConfigFinding[];
    quickWins: ConfigFinding[];
    summary: string;
}
export interface AuditClaudeConfigInput {
    projectPath: string;
    includeGlobal?: boolean;
}
export interface SettingsJson {
    permissions?: {
        allow?: string[];
        deny?: string[];
    };
    autoMemoryEnabled?: boolean;
    [key: string]: unknown;
}
//# sourceMappingURL=analysis.d.ts.map