/**
 * Nexus Prime — Bounded Simulation Sandbox
 *
 * Provides rehearsal-before-commit for risky or multi-branch runs.
 * A simulation creates an isolated worktree, dry-runs the planned
 * mutations, and produces a SimulationProof without touching the
 * real working tree.
 *
 * Governance rules:
 *  - Only activates for runs with complexity 'mutate' or multi-worker topology
 *  - Respects the Machine Efficiency Governor: paused under elevated/critical pressure
 *  - Time-bounded: auto-aborts after the configured timeout
 *  - Worktree-bounded: respects the governor's per-workspace limit
 */
import type { ProofVerdict } from './proofs/types.js';
export type SimulationComplexity = 'read' | 'orchestrate' | 'mutate';
export interface SimulationRequest {
    /** Unique ID for this simulation. Auto-generated if omitted. */
    simulationId?: string;
    /** The run ID this simulation rehearses. */
    runId: string;
    /** Human-readable description of what is being simulated. */
    description: string;
    /** Complexity class — only 'mutate' and multi-worker topologies require simulation. */
    complexity: SimulationComplexity;
    /** Planned file mutations to rehearse. */
    plannedMutations: Array<{
        path: string;
        action: 'create' | 'modify' | 'delete';
        reason: string;
    }>;
    /** Number of workers in the planned topology. */
    workerCount: number;
    /** Timeout in milliseconds. Defaults to 30 000. */
    timeoutMs?: number;
}
export interface SimulationProof {
    simulationId: string;
    runId: string;
    startedAt: number;
    completedAt: number;
    durationMs: number;
    verdict: ProofVerdict;
    checks: SimulationCheck[];
    skipped: boolean;
    skipReason: string | null;
    /** Files that would conflict if applied to the real tree. */
    conflicts: string[];
    /** Mutations that passed the dry-run. */
    verified: string[];
}
export interface SimulationCheck {
    name: string;
    passed: boolean;
    detail: string;
}
export type SimulationState = 'idle' | 'running' | 'completed' | 'aborted' | 'skipped';
export interface SimulationRecord {
    simulationId: string;
    runId: string;
    state: SimulationState;
    proof: SimulationProof | null;
    createdAt: number;
}
export declare class SimulationSandbox {
    private active;
    private history;
    /**
     * Determine whether a simulation is required for the given request.
     * Only mutate-complexity or multi-worker (>=3) runs trigger simulation.
     */
    requiresSimulation(request: Pick<SimulationRequest, 'complexity' | 'workerCount'>): boolean;
    /**
     * Run a bounded simulation for the given request.
     * Returns a SimulationProof — even if the simulation was skipped.
     */
    simulate(request: SimulationRequest): Promise<SimulationProof>;
    /** Get the current simulation state. */
    getActiveSimulations(): SimulationRecord[];
    /** Get recent simulation history. */
    getHistory(limit?: number): SimulationRecord[];
    private runBoundedSimulation;
    private buildProof;
    private buildSkippedProof;
}
export declare function getSharedSimulationSandbox(): SimulationSandbox;
