import type { SpecType, SpecScope } from './common/index.js';
/** A single recorded actual for a completed spec */
export interface ActualRecord {
    /** The spec this record belongs to */
    specId: string;
    /** Estimated dev hours from the original estimate */
    estimatedHours: number;
    /** Actual hours spent on implementation */
    actualHours: number;
    /** Deviation percentage: (actual - estimated) / estimated * 100 */
    deviationPct: number;
    /** Spec type at time of recording */
    specType: SpecType;
    /** Spec scope at time of recording */
    specScope: SpecScope;
    /** ISO timestamp when the actual was recorded */
    recordedAt: string;
    /** Optional free-form notes from the developer */
    notes?: string;
}
/** Per-scope accuracy summary */
export interface ScopeAccuracySummary {
    scope: SpecScope;
    count: number;
    avgDeviationPct: number;
    /** Suggested calibration multiplier (1 = no change) */
    suggestedMultiplier: number;
}
/** Per-type accuracy summary */
export interface TypeAccuracySummary {
    type: SpecType;
    count: number;
    avgDeviationPct: number;
}
/** A single data point for trend analysis */
export interface TrendPoint {
    specId: string;
    recordedAt: string;
    deviationPct: number;
}
/** Full estimation accuracy report */
export interface EstimationAccuracyReport {
    projectId: string;
    generatedAt: string;
    totalRecords: number;
    /** Per-spec breakdown */
    perSpec: ActualRecord[];
    /** Aggregate stats */
    aggregate: {
        avgDeviationPct: number;
        medianDeviationPct: number;
        /** Specs with |deviation| > 50% */
        outlierCount: number;
        outliers: {
            specId: string;
            deviationPct: number;
        }[];
    };
    /** Breakdown by scope */
    byScope: ScopeAccuracySummary[];
    /** Breakdown by type */
    byType: TypeAccuracySummary[];
    /** Trend over time (chronological) */
    trend: TrendPoint[];
}
/** Calibration factors stored per project */
export interface CalibrationFactors {
    projectId: string;
    updatedAt: string;
    /** Multiplier per scope (applied to SCOPE_MULTIPLIER constants) */
    scopeMultipliers: Partial<Record<SpecScope, number>>;
    /** Multiplier per type (applied to BASE_HOURS_BY_TYPE constants) */
    typeMultipliers: Partial<Record<SpecType, number>>;
    /** Minimum records required before a factor is considered reliable */
    sampleSize: Record<string, number>;
}
export interface PredictionBucket {
    key: string;
    sampleSize: number;
    /** Ratio: actualHours / estimatedHours */
    avgBias: number;
    /** Same as avgBias, named for clarity at call sites */
    correctionFactor: number;
    /** low < 3 samples | medium 3-9 | high >= 10 */
    confidence: 'low' | 'medium' | 'high';
}
export interface CorrectionResult {
    correctedHours: number;
    confidenceInterval: [number, number];
    /** Human-readable description of the calibration basis */
    calibrationBasis: string;
}
export interface QuarterTrend {
    quarter: string;
    sampleSize: number;
    avgBias: number;
}
export interface RecordActualInput {
    projectId?: string;
    projectPath?: string;
    specId: string;
    actualHours: number;
    notes?: string;
}
export interface AccuracyReportInput {
    projectId?: string;
    projectPath?: string;
    /** Filter by scope (optional) */
    scope?: SpecScope;
    /** Filter by type (optional) */
    type?: SpecType;
    /** Maximum number of records to include in perSpec (default: all) */
    limit?: number;
}
export interface CalibrateInput {
    projectId?: string;
    projectPath?: string;
    /** Minimum samples per dimension before applying calibration (default: 3) */
    minSamples?: number;
}
/** Result of enriching a base estimate with persisted calibration data (SPEC-506) */
export interface CalibrationEstimationEnrichment {
    calibratedHours: number;
    applied: boolean;
    calibrationNote: string | null;
}
//# sourceMappingURL=actuals.d.ts.map