/**
 * Kernel Runtime — contracts.
 *
 * RuntimeBackend is the narrow interface between the kernel execution service
 * and any concrete runtime system (Phantom/SubAgentRuntime today; a lighter
 * git-native executor in a future PR).
 *
 * Rule: KernelExecutionService.execute() depends on RuntimeBackend, not on
 * SubAgentRuntime or any Phantom class directly. Phantom becomes an internal
 * implementation detail of PhantomRuntimeBackend.
 */
import type { PreparedStep, ExecutedStep, InspectedStep, RuntimeExecuteInput } from './types.js';
export interface RuntimeBackend {
    /**
     * Set up preconditions for a step (e.g. create a worktree, load candidate
     * files). Called before executeStep. Backends that have no prepare phase
     * return a minimal PreparedStep with an empty candidateFiles list.
     */
    prepareStep(input: RuntimeExecuteInput): Promise<PreparedStep>;
    /**
     * Run the step — for Phantom this means AI-driven code generation, for a
     * lightweight backend it might mean applying a pre-written patch.
     */
    executeStep(input: RuntimeExecuteInput): Promise<ExecutedStep>;
    /**
     * Observe the post-execution state of the worktree (file hashes, HEAD ref).
     * Called after executeStep when the caller wants to verify before merge.
     */
    inspectStep(input: RuntimeExecuteInput): Promise<InspectedStep>;
    /**
     * Optional teardown. Remove the worktree, free resources. Called on success
     * after merge, or on error to avoid leaked worktrees.
     */
    cleanupStep?(input: RuntimeExecuteInput): Promise<void>;
}
