import { ResolveIOAIManagerRecoveryCheckpoint, ResolveIOAIManagerRecoveryActionPacket, ResolveIOAIManagerRecoveryActionDispatchRecord, ResolveIOAIManagerRecoveryExecutionDirective, ResolveIOAIManagerRecoveryEvidenceProbe, ResolveIOAIManagerRecoveryPlan } from './ai-runner-manager-policy';
export type ResolveIOAICoderV6Lane = 'intake' | 'plan' | 'build' | 'qa' | 'repair' | 'review' | 'publish';
export type ResolveIOAICoderV6StepType = 'intake' | 'journey_contract' | 'journey_validation' | 'plan' | 'task' | 'workflow_build' | 'workflow_qa' | 'build' | 'qa' | 'repair' | 'review' | 'test_deploy' | 'live_deploy' | 'publish' | 'cleanup';
export type ResolveIOAICoderV6Outcome = 'pass' | 'needs_repair' | 'retry_same_step' | 'park_manual' | 'budget_stop' | 'infra_retry' | 'ready_to_publish' | 'published';
export type ResolveIOAICoderV6RunKind = 'initial_builder' | 'terminal_helper';
export interface ResolveIOAICoderV6Budget {
    maxPromptTokensPerNonInitialStep: number;
    maxTotalPromptTokens: number;
    maxLoopsPerRun: number;
    maxRepeatedNoProgress: number;
    maxRuntimeMinutesPerLane: number;
    softBudgetUsd: number;
    hardBudgetUsd: number;
    totalPromptTokenEstimate: number;
    totalInputTokens: number;
    totalCachedInputTokens: number;
    totalOutputTokens: number;
    totalRuntimeMs: number;
    loopCount: number;
}
export interface ResolveIOAICoderV6LaneMemory {
    lane: ResolveIOAICoderV6Lane;
    model: string;
    threadKey: string;
    scopeSummary: string;
    activeStep: ResolveIOAICoderV6StepType;
    activeBlocker: string;
    activeQaRow?: {
        index?: number;
        workflow?: string;
        route?: string;
        assertion?: string;
        status?: string;
    };
    changedFiles: string[];
    artifactPaths: string[];
    latestPromptVersion?: string;
    latestPromptTokenEstimate?: number;
    updatedAt: string;
}
export interface ResolveIOAICoderV6WorkflowQaRow {
    index?: number;
    workflowId?: string;
    workflowStepId?: string;
    workflowStepIds?: string[];
    stepId?: string;
    route?: string;
    action?: string;
    assertion?: string;
    expectedState?: string;
    expectedOutput?: string;
    proofKind?: string;
    coverageTags?: string[];
    acceptanceGate?: 'aiqa_business_assertion';
    requiredArtifacts?: string[];
    stateTransition?: {
        before?: string;
        action?: string;
        after?: string;
        assertion?: string;
    };
    status?: string;
    artifactPaths?: string[];
}
export interface ResolveIOAICoderV6WorkflowMemory {
    journeyContractPath: string;
    primaryWorkflowId: string;
    activeWorkflowStep: string;
    workflowQaRows: ResolveIOAICoderV6WorkflowQaRow[];
    completedWorkflowSteps: string[];
    blockedWorkflowStep: string;
    businessProofArtifacts: string[];
    updatedAt: string;
}
export interface ResolveIOAICoderJourneyContractValidationIssue {
    code: string;
    path: string;
    message: string;
    severity: 'error' | 'warning';
}
export interface ResolveIOAICoderJourneyContractValidationResult {
    valid: boolean;
    contract: Record<string, any> | null;
    issues: ResolveIOAICoderJourneyContractValidationIssue[];
    workflowQaRows: ResolveIOAICoderV6WorkflowQaRow[];
    primaryWorkflowId: string;
}
export type ResolveIOAICoderWorkflowProofReadinessStatus = 'ready' | 'missing_journey_contract' | 'journey_invalid' | 'route_only' | 'workflow_qa_missing' | 'workflow_qa_incomplete' | 'business_proof_missing' | 'business_proof_weak' | 'sample_data_missing' | 'release_blocked' | 'stale_workflow_proof' | 'blocked';
export interface ResolveIOAICoderWorkflowProofReadinessInput {
    journeyContract?: any;
    journeyContractMarkdown?: string;
    workflowQaRows?: ResolveIOAICoderV6WorkflowQaRow[];
    businessAssertions?: Array<Record<string, any>>;
    routeProbes?: Array<Record<string, any>>;
    artifactPaths?: string[];
    scorecardPassed?: boolean;
    deployStatus?: string;
    publishStatus?: string;
    sampleDataStatus?: string;
    previousWorkflowProofFingerprint?: string;
    previousArtifactFingerprint?: string;
    previousWorkflowProofFingerprints?: string[];
    previousArtifactFingerprints?: string[];
    now?: Date | string;
}
export type ResolveIOAICoderWorkflowProofFreshness = 'fresh' | 'same_as_previous' | 'stale_artifact' | 'missing' | 'unknown';
export interface ResolveIOAICoderWorkflowProofReadiness {
    ready: boolean;
    status: ResolveIOAICoderWorkflowProofReadinessStatus;
    reason: string;
    blockers: string[];
    journeyContractValid: boolean;
    primaryWorkflowId: string;
    passedWorkflowRows: string[];
    missingWorkflowRows: string[];
    failedWorkflowRows: string[];
    passedBusinessAssertions: string[];
    routeOnly: boolean;
    scorecardOnly: boolean;
    sampleDataReady: boolean;
    releaseBlockers: string[];
    artifactPaths: string[];
    workflowProofFingerprint: string;
    artifactFingerprint: string;
    proofFreshness: ResolveIOAICoderWorkflowProofFreshness;
    nextAction: string;
    evaluatedAt: string;
}
export type ResolveIOAICoderV6ContinuationAction = 'continue' | 'retry_same_step' | 'switch_to_repair' | 'park' | 'budget_stop' | 'infra_retry' | 'ready_to_publish';
export type ResolveIOAICoderNextActionCostRisk = 'free_or_deterministic' | 'small_model_or_qa' | 'expensive_model' | 'release_or_customer_send' | 'manual_blocked';
export type ResolveIOAICoderWorkflowReadinessStatus = 'journey_contract_required' | 'journey_contract_repair_required' | 'workflow_build_ready' | 'workflow_qa_required' | 'workflow_business_proof_ready' | 'release_repair_required' | 'infra_repair_only' | 'compile_repair_only' | 'collect_new_evidence' | 'budget_stopped' | 'parked';
export type ResolveIOAICoderWorkflowReadinessGate = 'journey_contract' | 'build' | 'workflow_qa' | 'release' | 'infra' | 'compile' | 'evidence' | 'manual';
export type ResolveIOAICoderWorkflowProofCheckpointStatus = 'waiting_for_journey_contract' | 'waiting_for_workflow_proof' | 'waiting_for_new_evidence' | 'waiting_for_release_gate' | 'waiting_for_infra_or_compile' | 'ready_to_continue';
export interface ResolveIOAICoderWorkflowProofCheckpoint {
    required: boolean;
    status: ResolveIOAICoderWorkflowProofCheckpointStatus;
    readinessStatus: ResolveIOAICoderWorkflowReadinessStatus;
    nextGate: ResolveIOAICoderWorkflowReadinessGate;
    startingFailureClass: string;
    startingBlockerFingerprint: string;
    startingEvidenceHash: string;
    workflowProofFingerprint: string;
    artifactFingerprint: string;
    requiredEvidence: string[];
    requiredResetEvidence: string[];
    successRequiresWorkflowBusinessProof: boolean;
    blocksProductRepairUntilJourneyContract: boolean;
    blocksPublishUntilWorkflowProof: boolean;
    blocksPublishUntilReleaseGate: boolean;
    blocksWowUiUntilWorkflowProof: boolean;
    nextAction: string;
}
export interface ResolveIOAICoderWorkflowReadiness {
    status: ResolveIOAICoderWorkflowReadinessStatus;
    nextGate: ResolveIOAICoderWorkflowReadinessGate;
    nextLane: ResolveIOAICoderV6Lane;
    nextStep: ResolveIOAICoderV6StepType;
    nextCommand: string;
    journeyContractReady: boolean;
    workflowQaRowsReady: boolean;
    businessProofReady: boolean;
    routeOnlyBlocked: boolean;
    releaseBlocked: boolean;
    infraOnly: boolean;
    compileOnly: boolean;
    sameFailureParked: boolean;
    canRunProductRepair: boolean;
    canRunWorkflowQa: boolean;
    canPublish: boolean;
    canPolishWowUi: boolean;
    requiresHumanDecision: boolean;
    reason: string;
    blockers: string[];
    primaryWorkflowId: string;
    activeWorkflowStep: string;
    businessProofArtifacts: string[];
    workflowProofCheckpoint: ResolveIOAICoderWorkflowProofCheckpoint;
}
export interface ResolveIOAICoderNextActionContract {
    contractId: string;
    action: ResolveIOAICoderV6ContinuationAction;
    label: string;
    primaryCommand: string;
    lane: ResolveIOAICoderV6Lane;
    stepType: ResolveIOAICoderV6StepType;
    safeToAutoRun: boolean;
    requiresHumanApproval: boolean;
    canRunWithoutCodexMonitor: boolean;
    codexFallbackRequired: boolean;
    codexFallbackReason: string;
    costRisk: ResolveIOAICoderNextActionCostRisk;
    workflowFirstSatisfied: boolean;
    decisionBasis: {
        journeyContractReady: boolean;
        workflowProofReady: boolean;
        sampleDataReady: boolean;
        releaseBlocked: boolean;
        routeOnlyBlocked: boolean;
        infraOnly: boolean;
        compileOnly: boolean;
        sameFailureParked: boolean;
        canPublish: boolean;
        canPolishWowUi: boolean;
        workflowReadinessStatus: string;
        workflowProofCheckpointStatus: string;
        failureClass: string;
        evidenceHash: string;
        hotfixCommitRequired: boolean;
        liveHotfixBlockedUntilCommit: boolean;
    };
    preconditions: string[];
    expectedStateTransition: string;
    successEvidence: string[];
    requiredHotfixCommitProof: string[];
    stopConditions: string[];
    forbiddenActions: string[];
    nextCommands: string[];
    blockers: string[];
    ownerFiles?: string[];
    createdAt: string;
}
export interface ResolveIOAICoderV6SupervisorState {
    version: 'v6';
    runKind: ResolveIOAICoderV6RunKind;
    status: 'active' | 'parked' | 'complete';
    currentGoal: string;
    approvedScope: string;
    branchName: string;
    activeLane: ResolveIOAICoderV6Lane;
    activeStep: ResolveIOAICoderV6StepType;
    activeBlocker: string;
    lastGoodCheckpoint: string;
    lastGoodCommit?: string;
    testDeployStatus?: string;
    liveDeployStatus?: string;
    processLease?: {
        runId?: string;
        token?: string;
        generation?: number;
        workspace?: string;
        lane?: string;
    };
    artifactLinks: string[];
    updatedAt: string;
}
export interface ResolveIOAICoderV6StepRecord {
    stepType: ResolveIOAICoderV6StepType;
    outcome: ResolveIOAICoderV6Outcome;
    lane: ResolveIOAICoderV6Lane;
    model?: string;
    threadKey?: string;
    promptVersion?: string;
    promptTokenEstimate?: number;
    inputTokens?: number;
    cachedInputTokens?: number;
    outputTokens?: number;
    runtimeMs?: number;
    summary: string;
    blocker?: string;
    blockerFingerprint?: string;
    failureClass?: string;
    evidenceHash?: string;
    changedFiles?: string[];
    artifactPaths?: string[];
    nextAction?: ResolveIOAICoderV6ContinuationAction;
    recordedAt: string;
}
export interface ResolveIOAICoderV6RunnerIncident {
    incidentClass: string;
    summary: string;
    stepType?: ResolveIOAICoderV6StepType;
    lane?: ResolveIOAICoderV6Lane;
    blockerFingerprint?: string;
    artifactPaths?: string[];
    recordedAt: string;
}
export interface ResolveIOAICoderV6StateBundle {
    aiCoderRunnerVersion: 'v6';
    aiCoderV6SupervisorState: ResolveIOAICoderV6SupervisorState;
    aiCoderV6LaneMemory: Record<ResolveIOAICoderV6Lane, ResolveIOAICoderV6LaneMemory>;
    aiCoderV6WorkflowMemory: ResolveIOAICoderV6WorkflowMemory;
    aiCoderV6StepHistory: ResolveIOAICoderV6StepRecord[];
    aiCoderV6Budget: ResolveIOAICoderV6Budget;
    aiCoderV6RunnerIncidents: ResolveIOAICoderV6RunnerIncident[];
    aiCoderV6RecoveryPlan?: ResolveIOAIManagerRecoveryPlan;
    aiCoderV6RecoveryCheckpoint?: ResolveIOAIManagerRecoveryCheckpoint;
    aiCoderV6RecoveryEvidenceProbe?: ResolveIOAIManagerRecoveryEvidenceProbe;
    aiCoderV6RecoveryAction?: ResolveIOAIManagerRecoveryActionPacket;
    aiCoderV6RecoveryDispatchHistory?: ResolveIOAIManagerRecoveryActionDispatchRecord[];
    aiCoderV6RecoveryDirective?: ResolveIOAIManagerRecoveryExecutionDirective;
    aiCoderV6WorkflowReadiness?: ResolveIOAICoderWorkflowReadiness;
}
export interface ResolveIOAICoderV6InitializeInput {
    runKind: ResolveIOAICoderV6RunKind;
    jobId: string;
    appId?: string;
    conversationId?: string;
    title?: string;
    description?: string;
    approvedScopeRequirements?: string[];
    branchName?: string;
    journeyContractPath?: string;
    defaultModel?: string;
    laneThreadKeys?: Partial<Record<ResolveIOAICoderV6Lane, string>>;
    processLease?: ResolveIOAICoderV6SupervisorState['processLease'];
    now?: Date | string;
    existing?: Partial<ResolveIOAICoderV6StateBundle>;
}
export interface ResolveIOAICoderV6StepInput {
    stepType: ResolveIOAICoderV6StepType;
    outcome: ResolveIOAICoderV6Outcome;
    lane: ResolveIOAICoderV6Lane;
    model?: string;
    threadKey?: string;
    promptVersion?: string;
    promptTokenEstimate?: number;
    inputTokens?: number;
    cachedInputTokens?: number;
    outputTokens?: number;
    runtimeMs?: number;
    summary?: string;
    blocker?: string;
    failureClass?: string;
    evidenceHash?: string;
    primaryWorkflowId?: string;
    activeWorkflowStep?: string;
    workflowQaRows?: ResolveIOAICoderV6WorkflowQaRow[];
    completedWorkflowSteps?: string[];
    blockedWorkflowStep?: string;
    businessProofArtifacts?: string[];
    changedFiles?: string[];
    artifactPaths?: string[];
    activeQaRow?: ResolveIOAICoderV6LaneMemory['activeQaRow'];
    nextAction?: ResolveIOAICoderV6ContinuationAction;
    now?: Date | string;
}
export interface ResolveIOAICoderV6ContinuationDecision {
    action: ResolveIOAICoderV6ContinuationAction;
    reason: string;
    nextLane: ResolveIOAICoderV6Lane;
    nextStep: ResolveIOAICoderV6StepType;
    repeatedNoProgressCount: number;
    budgetExceeded: boolean;
    workflowReadiness: ResolveIOAICoderWorkflowReadiness;
    workflowProofCheckpoint: ResolveIOAICoderWorkflowProofCheckpoint;
    nextActionContract: ResolveIOAICoderNextActionContract;
    recoveryPlan: ResolveIOAIManagerRecoveryPlan;
    recoveryCheckpoint: ResolveIOAIManagerRecoveryCheckpoint;
    recoveryEvidenceProbe: ResolveIOAIManagerRecoveryEvidenceProbe;
    recoveryAction: ResolveIOAIManagerRecoveryActionPacket;
}
export declare function extractResolveIOAICoderJourneyContractFromMarkdown(content: string | null | undefined): Record<string, any> | null;
export declare function buildResolveIOAICoderWorkflowQaRowsFromJourneyContract(input: any): ResolveIOAICoderV6WorkflowQaRow[];
export declare function validateResolveIOAICoderJourneyContract(input: any, options?: {
    pathLabel?: string;
    requireMarkdownEnvelope?: boolean;
}): ResolveIOAICoderJourneyContractValidationResult;
export declare function collectResolveIOAICoderJourneyContractIssues(input: any, options?: {
    pathLabel?: string;
    requireMarkdownEnvelope?: boolean;
}): string[];
export declare function evaluateResolveIOAICoderWorkflowProofReadiness(input?: ResolveIOAICoderWorkflowProofReadinessInput): ResolveIOAICoderWorkflowProofReadiness;
export declare function fingerprintResolveIOAICoderV6Blocker(value: any): string;
export declare function buildResolveIOAICoderWorkflowProofCheckpoint(input: {
    status: ResolveIOAICoderWorkflowReadinessStatus;
    nextGate: ResolveIOAICoderWorkflowReadinessGate;
    nextAction?: any;
    last?: Partial<ResolveIOAICoderV6StepRecord>;
    journeyContractReady?: boolean;
    businessProofReady?: boolean;
    routeOnlyBlocked?: boolean;
    releaseBlocked?: boolean;
    infraOnly?: boolean;
    compileOnly?: boolean;
    sameFailureParked?: boolean;
    primaryWorkflowId?: any;
    activeWorkflowStep?: any;
    workflowQaRows?: any;
    businessProofArtifacts?: any;
    completedWorkflowSteps?: any;
}): ResolveIOAICoderWorkflowProofCheckpoint;
export declare function buildResolveIOAICoderV6WorkflowReadiness(bundle: ResolveIOAICoderV6StateBundle, context?: {
    action?: ResolveIOAICoderV6ContinuationAction;
    reason?: string;
    nextLane?: ResolveIOAICoderV6Lane;
    nextStep?: ResolveIOAICoderV6StepType;
    budgetExceeded?: boolean;
    repeatedNoProgressCount?: number;
}): ResolveIOAICoderWorkflowReadiness;
export declare function buildResolveIOAICoderNextActionContract(input: {
    bundle: ResolveIOAICoderV6StateBundle;
    action: ResolveIOAICoderV6ContinuationAction;
    reason: string;
    nextLane: ResolveIOAICoderV6Lane;
    nextStep: ResolveIOAICoderV6StepType;
    budgetExceeded?: boolean;
    workflowReadiness: ResolveIOAICoderWorkflowReadiness;
    workflowProofCheckpoint: ResolveIOAICoderWorkflowProofCheckpoint;
    now?: Date | string;
}): ResolveIOAICoderNextActionContract;
export declare function buildResolveIOAICoderV6Budget(existing?: Partial<ResolveIOAICoderV6Budget>): ResolveIOAICoderV6Budget;
export declare function initializeResolveIOAICoderV6State(input: ResolveIOAICoderV6InitializeInput): ResolveIOAICoderV6StateBundle;
export declare function recordResolveIOAICoderV6Step(bundle: ResolveIOAICoderV6StateBundle, step: ResolveIOAICoderV6StepInput): ResolveIOAICoderV6StateBundle;
export declare function decideResolveIOAICoderV6Continuation(bundle: ResolveIOAICoderV6StateBundle): ResolveIOAICoderV6ContinuationDecision;
export declare function buildResolveIOAICoderV6DiagnoseFirstPrompt(lines: {
    goal?: string;
    approvedScope?: string[];
    activeLane?: ResolveIOAICoderV6Lane;
    activeStep?: ResolveIOAICoderV6StepType;
    activeBlocker?: string;
    laneSummary?: string;
    currentQaRow?: ResolveIOAICoderV6LaneMemory['activeQaRow'];
    journeyContractPath?: string;
    activeWorkflowStep?: string;
    artifactPaths?: string[];
    changedFiles?: string[];
}): string[];
export declare function buildResolveIOAICoderV6Incident(input: {
    incidentClass: string;
    summary: string;
    stepType?: ResolveIOAICoderV6StepType;
    lane?: ResolveIOAICoderV6Lane;
    blocker?: string;
    artifactPaths?: string[];
    now?: Date | string;
}): ResolveIOAICoderV6RunnerIncident;
