import type { RepositoryFoundryGenerationPlanV1 } from "@velum-labs/routekit-eval-setup";
import { Cause, Effect, FileSystem, Path } from "effect";
import { type EvalFoundryExecutionSummary, type EvalFoundryPlanInput } from "./workflow.js";
export declare const EVAL_FOUNDRY_AUTONOMOUS_DEFAULT_REPAIRS = 1;
export declare const EVAL_FOUNDRY_AUTONOMOUS_MAXIMUM_REPAIRS = 3;
export type EvalFoundrySupervisorFailureCategory = "critic-false-accept" | "transport" | "budget" | "repository-drift" | "quality" | "ambiguous";
export type EvalFoundrySupervisorRepair = "regenerate-valid-controls" | "restart-fresh-attempt";
export declare const EVAL_FOUNDRY_AUTONOMOUS_REPAIRS: {
readonly "critic-false-accept": "regenerate-valid-controls";
readonly transport: "restart-fresh-attempt";
};
export type EvalFoundrySupervisorFailure = {
readonly category: EvalFoundrySupervisorFailureCategory;
readonly detail: string;
readonly repair?: EvalFoundrySupervisorRepair;
};
export type EvalFoundrySupervisorAttempt = {
readonly sequence: number;
readonly caseId: string;
readonly planDigest: string;
readonly status: "succeeded" | "consumed";
readonly appliedRepair?: EvalFoundrySupervisorRepair;
readonly failure?: EvalFoundrySupervisorFailure;
};
export type EvalFoundrySupervisorSummary = {
readonly operation: "repository-foundry-generate-autonomous";
readonly repairsUsed: number;
readonly attempts: readonly EvalFoundrySupervisorAttempt[];
readonly result: EvalFoundryExecutionSummary;
};
declare const EvalFoundrySupervisorError_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
readonly _tag: "EvalFoundrySupervisorError";
} & Readonly;
export declare class EvalFoundrySupervisorError extends EvalFoundrySupervisorError_base<{
readonly category: EvalFoundrySupervisorFailureCategory;
readonly consumedDigest: string;
readonly detail: string;
readonly attempts: readonly EvalFoundrySupervisorAttempt[];
}> {
get message(): string;
}
declare const EvalFoundryCaseDigestPinError_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
readonly _tag: "EvalFoundryCaseDigestPinError";
} & Readonly;
export declare class EvalFoundryCaseDigestPinError extends EvalFoundryCaseDigestPinError_base<{
readonly caseId: string;
readonly pinnedDigest: string;
readonly attemptedDigest: string;
readonly detail: string;
}> {
get message(): string;
}
export type EvalFoundrySupervisorPorts = {
readonly plan: (input: EvalFoundryPlanInput) => Effect.Effect;
readonly execute: (plan: RepositoryFoundryGenerationPlanV1,
/** Invoke once only after scoped readiness, before generation can submit. */
commitExecution: Effect.Effect) => Effect.Effect;
readonly nextAttemptId?: () => string;
};
export declare function classifyEvalFoundrySupervisorFailure(cause: unknown): EvalFoundrySupervisorFailure;
export declare function evalFoundrySupervisorRepairPlanInput(input: {
readonly base: EvalFoundryPlanInput;
readonly repair: EvalFoundrySupervisorRepair;
readonly sequence: number;
readonly attemptId: string;
}): EvalFoundryPlanInput;
/**
* Pin the execute-start digest for a caseId. Refuse any alternate digest under
* the same caseId for the lifetime of the run (and against the durable ledger).
*/
export declare function assertCaseDigestPin(input: {
readonly caseId: string;
readonly planDigest: string;
readonly pinnedByCaseId: ReadonlyMap;
readonly ledgerDigests: readonly {
readonly planDigest: string;
readonly caseId: string;
}[];
}): void;
/** Read-only guard shared by direct and autonomous generation session entry. */
export declare const evalFoundryAssertPlanUnconsumed: (plan: {
readonly version: 1;
readonly budget: {
readonly wallTimeMs: number;
readonly perCallOutputTokens: number;
readonly requiredTotalInputTokens: number;
readonly requiredTotalOutputTokens: number;
readonly plannedModelCalls: number;
readonly maximumTransientRetries: number;
readonly maximumHillClimbAttempts: number;
readonly maximumSpecificationRevisions?: number | undefined;
readonly maximumOracleCoverageRevisions?: number | undefined;
readonly maximumFixtureRepairAttempts?: number | undefined;
};
readonly caseId: string;
readonly planDigest: string;
readonly seedId: string;
readonly referenceCommit: string;
readonly repository: {
readonly root: string;
readonly requestedRef: string;
readonly commit: string;
readonly tree: string;
};
readonly initialCommit: string;
readonly modelPlan: {
readonly version: 1;
readonly assignments: readonly {
readonly role: "specification-writer" | "hill-climb-planner" | "oracle-designer" | "repository-analyst" | "specification-critic-a" | "specification-critic-b" | "trajectory-designer" | "trajectory-critic" | "valid-solution-generator-a" | "valid-solution-generator-b" | "adversary" | "solution-critic-a" | "solution-critic-b" | "held-out-adversary" | "held-out-solution-critic-a" | "held-out-solution-critic-b" | "quality-reviewer" | "oracle-critic";
readonly model: string;
readonly reasoningEffort: "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
}[];
};
readonly qualification: {
readonly repetitionsPerBatch: number;
readonly batches: number;
readonly oracleRepetitions: number;
readonly oracleConcurrency?: number | undefined;
};
readonly requestedDimension?: string | undefined;
readonly excludedReferenceCommits?: readonly string[] | undefined;
readonly historyProvenance?: {
readonly method: "integrated-retained-history-v1";
readonly requestedRef: string;
readonly requestedTipCommit: string;
readonly requestedTipTree: string;
readonly integrationCommit: string;
readonly pathBlobs: readonly {
readonly path: string;
readonly blob: string;
}[];
} | undefined;
readonly validControlRegenerationSequence?: number | undefined;
readonly validControlReviewVersion?: 1 | 2 | undefined;
readonly dependencyContextVersion?: 1 | 2 | undefined;
readonly oracleCoverageWitnessVersion?: 1 | 2 | undefined;
readonly oracleCoverageWitnessRepairVersion?: 1 | undefined;
readonly oracleRepairFeedbackVersion?: 1 | undefined;
readonly reviewInputVersion?: 2 | undefined;
readonly specificationContractFactsVersion?: 1 | undefined;
}) => Effect.Effect;
export declare function evalFoundrySuperviseCommand(input: {
readonly planInput: EvalFoundryPlanInput;
readonly initialPlan: RepositoryFoundryGenerationPlanV1;
readonly maximumRepairs?: number;
readonly ports: EvalFoundrySupervisorPorts;
}): Effect.Effect;
export {};