import type { GoldenPatch, GoldenTrajectory, GoldenCustomMetrics, ExecutorSelection, RawEvalSchema } from "./types.js"; /** * Extract the executor name from a `defaults.executor` selection, which may be * either a bare name string or an `{ name, config }` object. */ export declare function resolveExecutorName(sel: ExecutorSelection | undefined): string | undefined; /** * Extract the executor-specific `config` from a `defaults.executor` selection. * Returns `undefined` for the bare-name form (no config). */ export declare function resolveExecutorConfig(sel: ExecutorSelection | undefined): unknown; /** * Validate the structural shape of a `defaults.executor` selection: either a * string name, or an object with a required string `name` and optional `config`. * The `config` payload itself is opaque here — the selected executor validates * it via its `validateConfig` hook. Throws with an actionable message. * * Only emptiness/non-string shapes are rejected here — an unregistered name is * already caught by the executor-not-found gate at plan time, so it doesn't * need a special case of its own. */ export declare function validateExecutorSelection(value: unknown, label?: string): void; /** Reject unknown fields; allow `filePath` only for provider-generated schemas. */ export declare function validateEvalSpecTopLevelFields(spec: Record, options?: { allowFilePath?: boolean; }): void; /** * Load and validate an eval.yaml file. * * All errors thrown during parsing/validation are wrapped to include * the source file path, so callers always know which file failed. */ export declare function loadEvalSpec(filePath: string): Promise; /** * Normalize the agent-environment key. `agent_environment` is the preferred * name; `environment` is a **deprecated alias** kept for backward compatibility. * Both map to the internal `environment` field, so downstream code only ever * sees `environment`. Errors if both keys are present (they name the same * block). Returns `true` when the deprecated `environment` key was used, so the * caller can emit a single deprecation warning per spec. * * Exported so the eval-provider path can normalize provider-returned objects the * same way YAML parsing does — otherwise a provider setting `agent_environment` * would be silently ignored (planning reads only the internal `environment`). */ export declare function applyAgentEnvironmentAlias(obj: Record, context: string): boolean; /** * Validate a `grading_environment` block: an object with an optional `files` * array of `{ src, dest }` entries. Path-shape and src-existence checks run * later in the shared validator; this is the structural guard at parse time. */ export declare function validateGradingEnvironment(value: unknown, context: string): void; /** * Emit the one-time deprecation warning for the legacy `environment` alias. * Shared by `parseRawEvalSpec` (single parse) and the param-expansion layer * (which aggregates it to one warning across matrix combinations). */ export declare function emitAgentEnvironmentDeprecation(): void; /** * Parse a raw YAML string into a validated RawEvalSchema. * * Extracted so that both `loadEvalSpec` (file-based) and param expansion * (string-based after interpolation) share the same validation logic. * * When the deprecated `environment` alias is used, the deprecation warning is * emitted here by default. Callers that parse the same eval repeatedly (param * expansion parses once per matrix combination) pass * `onDeprecatedAgentEnvironment` to suppress the per-parse emit and instead * aggregate a single warning for the whole load. */ export declare function parseRawEvalSpec(raw: string, options?: { onDeprecatedAgentEnvironment?: () => void; }): RawEvalSchema; /** * Upper bound on a golden patch's size (inline text or file contents). Bounds * the memory a single patch can consume before it reaches `git apply` and the * graders, so an oversized (or hostile) patch can't exhaust the process. */ export declare const MAX_GOLDEN_PATCH_BYTES = 5000000; /** * Assert a value is a well-formed {@link GoldenPatch}: an object with exactly * one of `inline` or `path`, each a non-empty string within * {@link MAX_GOLDEN_PATCH_BYTES}. */ export declare function assertGoldenPatchShape(patch: unknown, label?: string): asserts patch is GoldenPatch; /** * Max size (bytes) of a golden trajectory's inline JSON or file, bounding the * memory one ATIF document can consume before it is parsed. */ export declare const MAX_GOLDEN_TRAJECTORY_BYTES = 20000000; /** * Assert a value is a well-formed {@link GoldenTrajectory}: an object with * exactly one of `inline` (a non-null object within * {@link MAX_GOLDEN_TRAJECTORY_BYTES}) or `path` (a non-empty string). Full ATIF * validation happens later, at oracle time. */ export declare function assertGoldenTrajectoryShape(trajectory: unknown, label?: string): asserts trajectory is GoldenTrajectory; /** * Max size (bytes) of a golden custom-metrics inline JSON or file. Metrics * documents are small, so the bound is tight. */ export declare const MAX_GOLDEN_CUSTOM_METRICS_BYTES = 1000000; /** * Assert a value is a well-formed {@link GoldenCustomMetrics}: an object with * exactly one of `inline` (a non-null, non-array object within * {@link MAX_GOLDEN_CUSTOM_METRICS_BYTES}) or `path` (a non-empty string). The * metrics JSON is read later, at oracle time. */ export declare function assertGoldenCustomMetricsShape(metrics: unknown, label?: string): asserts metrics is GoldenCustomMetrics; //# sourceMappingURL=loader.d.ts.map