/**
 * grading-service.ts
 *
 * Responsible for resolving forecasts into graded outcomes.
 * Called by resolve-forecasts worker and can be invoked on-demand.
 *
 * BENCHMARK RULE: Uses the "best_valid_number" grading policy from
 * benchmark-grading.ts. All grades are W/L/P using the most advantageous
 * valid number between the original forecast and closing market.
 *
 * See benchmark-grading.ts for full policy documentation.
 */
import { type BenchmarkGrade, type BenchmarkSource } from './benchmark-grading';
export interface GradingResult {
    forecastId: string;
    eventId: string;
    league: string;
    forecastType?: 'spread' | 'total';
    predictedWinner: string;
    actualWinner: string;
    /** Benchmark grade: W, L, or P (Push). Uses best_valid_number policy. */
    grade: BenchmarkGrade;
    homeScore: number;
    awayScore: number;
    actualSpread: number;
    actualTotal: number;
    predictedSpread: number | null;
    predictedTotal: number | null;
    accuracyPct: number;
    accuracyBucket: string;
    /** Original model projected spread for the forecast side. */
    originalForecast: number | null;
    /** Benchmark spread used for grading (most advantageous valid number). */
    benchmarkForecast: number | null;
    /** Closing market spread for the forecast side. */
    closingMarket: number | null;
    /** Which source was selected as benchmark ('original', 'closing', 'equal', etc). */
    benchmarkSource: BenchmarkSource;
    /** Grading policy used. */
    gradingPolicy: string;
}
export declare function gradeTotalFromForecastData(forecast: any, homeScore: number, awayScore: number): GradingResult | null;
export declare function gradeForcast(forecast: any): Promise<GradingResult | null>;
export declare function upsertAccuracyV2FromRow(row: any): Promise<void>;
/**
 * Persist a grading result to rm_forecast_accuracy_v2.
 * v1 is legacy-only and should not receive live writes.
 */
export declare function persistGradingResult(result: GradingResult, forecastType?: 'spread' | 'total'): Promise<void>;
/**
 * Settle associated archive entry if one exists.
 * Push is settled as 'push' in the archive.
 */
export declare function settleArchive(forecastId: string, grade: BenchmarkGrade, actualWinner: string, homeScore: number, awayScore: number): Promise<void>;
/**
 * Batch-resolve all unresolved forecasts.
 * Returns count of resolved forecasts.
 */
export declare function resolveAllPending(): Promise<number>;
//# sourceMappingURL=grading-service.d.ts.map