/** * Discover-and-filter pipeline — consolidates the duplicated discovery + * tag-filtering logic that was repeated in the CLI's --suite and --tag * branches into a single, testable function in core. * * Two entry points: * • `discoverAndLoadEvals` — discover + load only; no filtering * • `discoverAndFilterEvals` — discover + load + stimulus-level filtering * (retained for backward compatibility) */ import type { ProjectContext } from "../config/context.js"; import type { RawEvalSchema, RawStimulus } from "../eval/types.js"; import type { ParamValue } from "../params/types.js"; import { type Duration } from "../utils/duration.js"; import type { SuiteFilterInput } from "../eval/suite-filter.js"; import { type ReasoningEffort } from "../graders/llm/types.js"; /** An eval spec that was discovered and loaded successfully. */ export interface DiscoveredEvalSpec { filePath: string; spec: RawEvalSchema; } /** Result of `discoverAndLoadEvals`. */ export interface DiscoverEvalsResult { evals: DiscoveredEvalSpec[]; scannedCount: number; errors: Array<{ path: string; reason: string; }>; } export interface MatchedEval { filePath: string; spec: RawEvalSchema; stimuli: RawStimulus[]; skippedStimuli: string[]; totalStimuli: number; } export interface DiscoverAndFilterResult { matched: MatchedEval[]; scannedCount: number; errors: Array<{ path: string; reason: string; }>; } export interface DiscoverAndFilterOptions { /** Stimulus tag filter. Accepts a {@link SuiteFilter} or the legacy * include-only tag map. */ filter?: SuiteFilterInput; /** Eval file paths or glob patterns from suite config (resolved relative to project root). */ suiteEvals?: string[]; fallbackDir?: string; /** Suite-level params from .vally.yaml (lowest precedence). */ suiteParams?: Record; /** CLI-level params (highest precedence, scalars only). */ cliParams?: Record; } /** * Discover eval.yaml files and load their specs. * * This is a pure discovery function — it does NOT apply any tag filtering. * Filtering is the runner's concern (see `runMatchedEval` in orchestrate.ts). */ export declare function discoverAndLoadEvals(projectCtx: ProjectContext, options?: { fallbackDir?: string; suiteParams?: Record; cliParams?: Record; }): Promise; /** * Discover eval files, load them, and filter by tags at both eval and * stimulus level. Returns only evals with at least one matching stimulus. * Evals without eval-level tags are still checked because their stimuli may * carry tags that match the filter. * * When `options.suiteEvals` is provided, suite eval paths/globs are resolved * directly instead of using standard directory-based discovery. */ export declare function discoverAndFilterEvals(projectCtx: ProjectContext, options: DiscoverAndFilterOptions): Promise; /** Resolve judge model: CLI flag → eval config → env var */ export declare function resolveJudgeModel(cliOverride?: string, evalConfig?: string, envVar?: string): string | undefined; /** Resolve the judge reasoning effort: CLI flag → eval config → env var. */ export declare function resolveJudgeReasoningEffort(cliOverride?: ReasoningEffort, evalConfig?: ReasoningEffort, envVar?: string): ReasoningEffort | undefined; /** * Resolve the agent (executor) reasoning effort: CLI flag → eval config → env * var. Mirrors {@link resolveJudgeReasoningEffort} but targets the agent under * test rather than the judge model. */ export declare function resolveReasoningEffort(cliOverride?: ReasoningEffort, evalConfig?: ReasoningEffort, envVar?: string): ReasoningEffort | undefined; /** Resolve trial count: CLI flag → eval config → default 1 */ export declare function resolveTrialCount(cliOverride?: number, evalConfig?: number): number; /** * Resolve the eval-level default timeout (a `Duration` string such as * `"5m"`) into milliseconds. Returns `undefined` when no default is * configured, leaving the downstream runner to apply its built-in * default. * * `null` is treated the same as `undefined` ("not set"), matching the * `!= null` convention every other timeout field uses (the validator, * MCP-server, program-grader, and run-command-grader checks). A raw * YAML `timeout: null` therefore means "no override", not an error. * * The CLI `--timeout` override is a separate, higher-precedence value * applied at execution time (`ctx.timeout ?? planDefaultTimeout`); this * helper only converts the per-eval fallback. * * @throws If `evalConfig` is a non-parseable duration. Callers that * bypass validation (`--skip-validate`) must handle this; the eval * validator otherwise rejects invalid `defaults.timeout` up front. */ export declare function resolveTimeout(evalConfig?: Duration | null): number | undefined; //# sourceMappingURL=discover-filter.d.ts.map