import { R as Run, S as Span, a as TraceEvent, A as Artifact, B as BudgetLedgerEntry } from './schema-m0gsnbt3.js';
import { T as TraceStore } from './store-BcFXE6LG.js';

interface RunScore {
    success: number;
    goalProgress: number;
    repoGroundedness: number;
    driftPenalty: number;
    toolUseQuality: number;
    patchQuality: number;
    testReality: number;
    finalGate: number;
    reviewerBlockers: number;
    costUsd: number;
    wallSeconds: number;
    notes?: string[];
}
interface RunScoreWeights {
    success: number;
    goalProgress: number;
    repoGroundedness: number;
    driftPenalty: number;
    toolUseQuality: number;
    patchQuality: number;
    testReality: number;
    finalGate: number;
    reviewerBlockers: number;
    costUsd: number;
    wallSeconds: number;
}
declare const DEFAULT_RUN_SCORE_WEIGHTS: RunScoreWeights;
declare function aggregateRunScore(score: RunScore, weights?: Partial<RunScoreWeights>): number;
declare function clamp01(value: number): number;

interface RunTrace {
    run: Run;
    spans: Span[];
    events: TraceEvent[];
    artifacts: Artifact[];
    budget: BudgetLedgerEntry[];
}
interface RunCriticOptions {
    weights?: Partial<RunScoreWeights>;
    driftPatterns?: RegExp[];
}
declare class RunCritic {
    private readonly weights?;
    private readonly driftPatterns;
    constructor(options?: RunCriticOptions);
    score(store: TraceStore, runId: string): Promise<RunScore>;
    scoreTrace(trace: RunTrace): RunScore;
    rank(score: RunScore): number;
    private isDrift;
}

export { DEFAULT_RUN_SCORE_WEIGHTS as D, type RunScore as R, type RunTrace as a, type RunScoreWeights as b, RunCritic as c, type RunCriticOptions as d, aggregateRunScore as e, clamp01 as f };
