import type { VerificationStatus } from "./verification.js";
export type BugWorkflowStatus = "fix-applied" | "fix-proposed" | "investigation-only" | "rejected" | "cancelled" | "failed";
export interface BugWorkflowLimits {
    readonly maxModelCalls: number;
    readonly maxRetries: number;
    readonly contextBudgetBytes: number;
    readonly maxBytesPerFile: number;
    readonly maxFilesChanged: number;
    readonly maxChangedLines: number;
    readonly maxPatchBytes: number;
}
export declare const DEFAULT_BUG_WORKFLOW_LIMITS: BugWorkflowLimits;
interface BaseBugEvent {
    readonly schemaVersion: "1";
    readonly runId: string;
    readonly fingerprint: string;
    readonly seq: number;
    readonly ts: number;
}
export interface BugInvestigationStartedEvent extends BaseBugEvent {
    readonly type: "bug:started";
    readonly workflowId: "bug-investigation";
    readonly modelId: string;
    readonly applyEnabled: boolean;
    readonly limits: BugWorkflowLimits;
}
export interface FailureParsedEvent extends BaseBugEvent {
    readonly type: "bug:failure:parsed";
    readonly frameCount: number;
    readonly messageCount: number;
}
export interface BugContextSelectedEvent extends BaseBugEvent {
    readonly type: "bug:context:selected";
    readonly entryCount: number;
    readonly usedBytes: number;
    readonly budgetBytes: number;
    readonly droppedForBudget: number;
}
export interface BugModelCallStartedEvent extends BaseBugEvent {
    readonly type: "bug:model:call:started";
    readonly attempt: number;
    readonly contextBytes: number;
}
export interface BugModelCallCompletedEvent extends BaseBugEvent {
    readonly type: "bug:model:call:completed";
    readonly attempt: number;
    readonly finishReason: string;
    readonly promptTokens: number;
    readonly completionTokens: number;
    readonly latencyMs: number;
}
export interface RootCauseProposedEvent extends BaseBugEvent {
    readonly type: "bug:rootcause:proposed";
    readonly hasPatch: boolean;
    readonly confidence?: "low" | "medium" | "high" | undefined;
}
export interface BugPatchValidatedEvent extends BaseBugEvent {
    readonly type: "bug:patch:validated";
    readonly ok: boolean;
    readonly patchBytes: number;
    readonly filesChanged: number;
    readonly rejectionCode?: string | undefined;
}
export interface BugPatchAppliedEvent extends BaseBugEvent {
    readonly type: "bug:patch:applied";
    readonly changedFiles: number;
    readonly created: number;
    readonly deleted: number;
}
export interface BugVerificationResultEvent extends BaseBugEvent {
    readonly type: "bug:verification:result";
    readonly overallStatus: VerificationStatus;
    readonly stepCount: number;
    readonly passedCount: number;
    readonly durationMs: number;
}
export interface BugInvestigationCompletedEvent extends BaseBugEvent {
    readonly type: "bug:completed";
    readonly status: BugWorkflowStatus;
    readonly durationMs: number;
}
export interface BugInvestigationFailedEvent extends BaseBugEvent {
    readonly type: "bug:failed";
    readonly errorCode: string;
    readonly message: string;
}
export type BugInvestigationEvent = BugInvestigationStartedEvent | FailureParsedEvent | BugContextSelectedEvent | BugModelCallStartedEvent | BugModelCallCompletedEvent | RootCauseProposedEvent | BugPatchValidatedEvent | BugPatchAppliedEvent | BugVerificationResultEvent | BugInvestigationCompletedEvent | BugInvestigationFailedEvent;
export interface BugWorkflowEventSink {
    readonly emit: (event: BugInvestigationEvent) => void;
}
export {};
//# sourceMappingURL=bug-investigation-events.d.ts.map