import type { TraceProcessorService } from './traceProcessorService';
import type { SegmentSemantics } from './criticalPathSemantics';
export interface QuantifyTaskInput {
    utid: number;
    upid: number | null;
    startTs: number;
    endTs: number;
    durMs: number;
}
export interface QuantifySegmentInput {
    segmentKey: string;
    durMs: number;
}
export interface CounterfactualEstimate {
    longestSegmentKey: string | null;
    longestSegmentDurMs: number;
    upperBoundMs: number;
    note: string;
}
export interface FrameImpact {
    frameId: number | null;
    expectedDeadlineDurMs: number;
    jankType: string | null;
    presentType: string | null;
    layerName: string | null;
    appUpid: number | null;
    overlapMs: number;
}
export type HypothesisStrength = 'strong' | 'weak' | 'speculative';
export interface CriticalPathHypothesis {
    id: string;
    statement: string;
    strength: HypothesisStrength;
    /**
     * SQL that, when run on the same trace, will return rows iff the hypothesis
     * holds. Codex P1-8: only numeric IDs are interpolated; never string
     * literals from segment metadata.
     */
    verificationSql: string;
    notes: string[];
}
export interface CriticalPathQuantification {
    counterfactual: CounterfactualEstimate | null;
    frameImpacts: FrameImpact[];
    hypotheses: CriticalPathHypothesis[];
    warnings: string[];
}
declare function buildCounterfactual(task: QuantifyTaskInput, segments: QuantifySegmentInput[]): CounterfactualEstimate | null;
interface HypothesisInput {
    task: QuantifyTaskInput;
    segments: QuantifySegmentInput[];
    semantics: SegmentSemantics[];
}
/**
 * Generate up to 3 falsifiable hypotheses ranked by evidence strength.
 *
 * SQL rule (Codex P1-8): all interpolated values must be numeric IDs taken
 * from `task.upid`, `task.utid`, `binder.binder_txn_id`, `monitor.rowId`,
 * or `task.startTs / task.endTs` (already integers from probe). NEVER
 * interpolate user-controlled strings (process name, method name, etc.) into
 * verification SQL — they appear in the natural-language statement only.
 */
declare function buildHypotheses(input: HypothesisInput): CriticalPathHypothesis[];
export declare function quantifyCriticalPath(tp: TraceProcessorService, traceId: string, task: QuantifyTaskInput, segments: QuantifySegmentInput[], semantics: SegmentSemantics[]): Promise<CriticalPathQuantification>;
export declare const __INTERNAL__: {
    buildCounterfactual: typeof buildCounterfactual;
    buildHypotheses: typeof buildHypotheses;
};
export {};
//# sourceMappingURL=criticalPathQuantify.d.ts.map