@alis-build/harness-eval 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -8
- package/dist/adapters/claude-code/index.d.ts +2 -2
- package/dist/adapters/claude-code/index.js +2 -1
- package/dist/adapters/codex/index.d.ts +68 -0
- package/dist/adapters/codex/index.js +3 -0
- package/dist/{claude-code-DZ4Vkgp6.js → claude-code-C_7hxC8z.js} +3 -245
- package/dist/claude-code-C_7hxC8z.js.map +1 -0
- package/dist/cli/bin.js +131 -151
- package/dist/cli/bin.js.map +1 -1
- package/dist/codex-0cHO2te9.js +496 -0
- package/dist/codex-0cHO2te9.js.map +1 -0
- package/dist/config/loader.d.ts +2 -2
- package/dist/config/loader.js +2 -2
- package/dist/{index-V22PrR0p.d.ts → index-DnvP1UBl.d.ts} +2 -2
- package/dist/index.d.ts +132 -6
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/loader-B1WmGGzf.d.ts +107 -0
- package/dist/{loader-DcI0KfRX.js → loader-DnQ6Jt0i.js} +472 -209
- package/dist/loader-DnQ6Jt0i.js.map +1 -0
- package/dist/{projections-BcX7w-f6.js → reporter-Biy-5-9M.js} +1335 -758
- package/dist/reporter-Biy-5-9M.js.map +1 -0
- package/dist/runner/suite.d.ts +1 -1
- package/dist/runner/suite.js +1 -1
- package/dist/{suite-DPJMIEbu.d.ts → suite-BEShV0by.d.ts} +2 -2
- package/dist/{suite-Dlzl-HI0.js → suite-BcP64nlb.js} +16 -2
- package/dist/{suite-Dlzl-HI0.js.map → suite-BcP64nlb.js.map} +1 -1
- package/dist/{types-CD3TwOtZ.d.ts → types-0QkNVyp9.d.ts} +2 -2
- package/dist/types-Bac8_Ixb.js +246 -0
- package/dist/types-Bac8_Ixb.js.map +1 -0
- package/dist/types-Bu8uOZZN.d.ts +77 -0
- package/dist/{types-B9H4IZtA.d.ts → types-C0gBkl0-.d.ts} +3 -2
- package/package.json +6 -2
- package/dist/claude-code-DZ4Vkgp6.js.map +0 -1
- package/dist/loader-C9yQHUPC.d.ts +0 -50
- package/dist/loader-DcI0KfRX.js.map +0 -1
- package/dist/projections-BcX7w-f6.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { A as Usage, B as isUserMessage, C as SystemInitEvent, D as TextBlock, E as SystemUnknownEvent, F as isSystemInit, I as isSystemRetry, L as isTextBlock, M as UserMessageEvent, N as isAssistantMessage, O as ToolResultBlock, P as isResult, R as isToolResultBlock, S as SystemCompactBoundaryEvent, T as SystemRetryEvent, _ as ContentBlock, a as HarnessAdapter, b as StopReason, c as AssistantTurn, d as ToolCall, f as TrajectoryView, g as AssistantMessageEvent, h as AssistantMessage, i as BaseAdapterConfig, j as UserMessage, k as ToolUseBlock, l as RetryRecord, m as namespaceOf, n as AdapterError, o as ParseErrorRecord, p as UsageSummary, r as AdapterResult, s as SuiteConfig, t as AdapterDiagnostics, u as SessionMeta, v as McpServerStatus, w as SystemPluginInstallEvent, x as StreamEvent, y as ResultEvent, z as isToolUseBlock } from "./types-
|
|
2
|
-
import { n as index_d_exports, o as ClaudeCodeOptions } from "./index-
|
|
3
|
-
import {
|
|
4
|
-
import { i as
|
|
5
|
-
import { t as
|
|
1
|
+
import { A as Usage, B as isUserMessage, C as SystemInitEvent, D as TextBlock, E as SystemUnknownEvent, F as isSystemInit, I as isSystemRetry, L as isTextBlock, M as UserMessageEvent, N as isAssistantMessage, O as ToolResultBlock, P as isResult, R as isToolResultBlock, S as SystemCompactBoundaryEvent, T as SystemRetryEvent, _ as ContentBlock, a as HarnessAdapter, b as StopReason, c as AssistantTurn, d as ToolCall, f as TrajectoryView, g as AssistantMessageEvent, h as AssistantMessage, i as BaseAdapterConfig, j as UserMessage, k as ToolUseBlock, l as RetryRecord, m as namespaceOf, n as AdapterError, o as ParseErrorRecord, p as UsageSummary, r as AdapterResult, s as SuiteConfig, t as AdapterDiagnostics, u as SessionMeta, v as McpServerStatus, w as SystemPluginInstallEvent, x as StreamEvent, y as ResultEvent, z as isToolUseBlock } from "./types-C0gBkl0-.js";
|
|
2
|
+
import { n as index_d_exports, o as ClaudeCodeOptions } from "./index-DnvP1UBl.js";
|
|
3
|
+
import { i as CodexOptions } from "./types-Bu8uOZZN.js";
|
|
4
|
+
import { A as ObjectPredicate, C as TrajectoryPairInstanceJson, D as Cardinality, E as AssertionResult, M as ThresholdedAssertion, N as ToolPattern, O as CompoundPredicate, S as TrajectoryInstancesJson, T as Assertion, _ as ProtojsonToolCall, a as ProgressEvent, b as ReferenceTrajectoryConfig, c as RunSuiteOptions, d as TestSuite, f as EvalDatasetRow, g as InstancesJsonlRow, h as InstanceData, i as ProgressCallback, j as Predicate, k as LeafPredicate, l as SuiteReport, m as HarnessMetrics, n as CellReport, o as RepetitionError, p as EvaluationInstanceJson, r as MatrixCell, s as RepetitionResult, t as AssertionStat, u as TestCase, v as ProtojsonTrajectory, w as TrajectorySingleToolUseInstanceJson, x as TrajectoryInstanceMetricKey, y as ReferenceToolNameMode } from "./types-0QkNVyp9.js";
|
|
5
|
+
import { a as loadSuiteDocument, c as GradingConfig, d as ConfigError, n as parseSuite, o as SuiteDocument, s as PipelineConfig, t as loadSuite } from "./loader-B1WmGGzf.js";
|
|
6
|
+
import { t as runSuite } from "./suite-BEShV0by.js";
|
|
6
7
|
import { Readable } from "node:stream";
|
|
7
8
|
|
|
8
9
|
//#region src/grader/types.d.ts
|
|
@@ -56,6 +57,12 @@ interface SuiteGradingReport {
|
|
|
56
57
|
sourceReport: string;
|
|
57
58
|
/** Grading YAML path when `--config` was used. */
|
|
58
59
|
gradingConfigPath?: string;
|
|
60
|
+
/** Judge that produced outcome grades. */
|
|
61
|
+
judge?: {
|
|
62
|
+
id: string;
|
|
63
|
+
model?: string;
|
|
64
|
+
adapter?: string;
|
|
65
|
+
};
|
|
59
66
|
results: RepGradingResult[];
|
|
60
67
|
summary: GradingSummary;
|
|
61
68
|
}
|
|
@@ -79,8 +86,12 @@ interface GradeReportOptions {
|
|
|
79
86
|
env?: Record<string, string>;
|
|
80
87
|
/** Working directory for the judge subprocess. */
|
|
81
88
|
cwd?: string;
|
|
89
|
+
/** Grading adapter id. Default: `claude-code`. */
|
|
90
|
+
judgeAdapter?: "claude-code" | "codex";
|
|
82
91
|
/** Claude Code options for the judge (nested in grading YAML under `claudeCode`). */
|
|
83
92
|
claudeCode?: Record<string, unknown>;
|
|
93
|
+
/** Codex CLI options for the judge (nested in grading YAML under `codex`). */
|
|
94
|
+
codex?: Record<string, unknown>;
|
|
84
95
|
/** Path to grading YAML when `--config` was used. */
|
|
85
96
|
gradingConfigPath?: string;
|
|
86
97
|
/** Inject a custom grader (for tests). */
|
|
@@ -170,6 +181,8 @@ interface JudgeInfo {
|
|
|
170
181
|
id: string;
|
|
171
182
|
model?: string;
|
|
172
183
|
version?: string;
|
|
184
|
+
/** Grading adapter id when known (e.g. `codex`, `claude-code`). */
|
|
185
|
+
adapter?: string;
|
|
173
186
|
}
|
|
174
187
|
/** Outcome grades for one repetition (built-in or external judge). */
|
|
175
188
|
interface OutcomeGrades {
|
|
@@ -451,6 +464,106 @@ declare function aggregateCell(testCase: TestCase, cell: MatrixCell, repetitions
|
|
|
451
464
|
type LimitedRunner = <T>(fn: () => Promise<T>) => Promise<T>;
|
|
452
465
|
declare function createLimit(max: number): LimitedRunner;
|
|
453
466
|
//#endregion
|
|
467
|
+
//#region src/cli/commands/envelope.d.ts
|
|
468
|
+
/** Supported `--projection` values for envelope output. */
|
|
469
|
+
type EnvelopeProjection = "envelope" | "trajectory" | "instances";
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region src/pipeline/resolve-inputs.d.ts
|
|
472
|
+
type PipelineStepName = "run" | "grade" | "envelope";
|
|
473
|
+
/** CLI overrides for pipeline artifact paths (take precedence over YAML). */
|
|
474
|
+
interface PipelineCliOverrides {
|
|
475
|
+
run?: {
|
|
476
|
+
output?: string;
|
|
477
|
+
maxConcurrent?: number;
|
|
478
|
+
};
|
|
479
|
+
grade?: {
|
|
480
|
+
input?: string;
|
|
481
|
+
output?: string;
|
|
482
|
+
maxConcurrent?: number;
|
|
483
|
+
};
|
|
484
|
+
envelope?: {
|
|
485
|
+
report?: string;
|
|
486
|
+
grading?: string;
|
|
487
|
+
output?: string;
|
|
488
|
+
projection?: EnvelopeProjection;
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
/** Resolved paths for the harness run step. */
|
|
492
|
+
interface ResolvedPipelineRun {
|
|
493
|
+
output: string;
|
|
494
|
+
maxConcurrent?: number;
|
|
495
|
+
}
|
|
496
|
+
/** Resolved input (suite report) and output (grading JSON) for the grade step. */
|
|
497
|
+
interface ResolvedPipelineGrade {
|
|
498
|
+
input: string;
|
|
499
|
+
output: string;
|
|
500
|
+
maxConcurrent?: number;
|
|
501
|
+
}
|
|
502
|
+
/** Resolved artifact paths for the envelope export step. */
|
|
503
|
+
interface ResolvedPipelineEnvelope {
|
|
504
|
+
report: string;
|
|
505
|
+
grading?: string;
|
|
506
|
+
output: string;
|
|
507
|
+
projection: EnvelopeProjection;
|
|
508
|
+
includeRawStreamEvents: boolean;
|
|
509
|
+
noTranscript: boolean;
|
|
510
|
+
}
|
|
511
|
+
/** Fully resolved pipeline inputs for one or more enabled steps. */
|
|
512
|
+
interface ResolvedPipeline {
|
|
513
|
+
suitePath: string;
|
|
514
|
+
run?: ResolvedPipelineRun;
|
|
515
|
+
grade?: ResolvedPipelineGrade;
|
|
516
|
+
envelope?: ResolvedPipelineEnvelope;
|
|
517
|
+
}
|
|
518
|
+
/** Inputs for {@link resolvePipelineInputs}. */
|
|
519
|
+
interface ResolvePipelineInputsOptions {
|
|
520
|
+
suitePath: string;
|
|
521
|
+
suiteDir: string;
|
|
522
|
+
pipeline: PipelineConfig;
|
|
523
|
+
steps: PipelineStepName[];
|
|
524
|
+
executed?: {
|
|
525
|
+
run?: {
|
|
526
|
+
output: string;
|
|
527
|
+
};
|
|
528
|
+
grade?: {
|
|
529
|
+
input: string;
|
|
530
|
+
output: string;
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
overrides?: PipelineCliOverrides;
|
|
534
|
+
}
|
|
535
|
+
/** Resolve absolute paths for enabled pipeline steps. */
|
|
536
|
+
declare function resolvePipelineInputs(options: ResolvePipelineInputsOptions): Promise<ResolvedPipeline>;
|
|
537
|
+
/**
|
|
538
|
+
* Resolve a grading artifact path from a unified suite's `pipeline:` block.
|
|
539
|
+
*
|
|
540
|
+
* Used by `harness-eval envelope --suite` when `--grading` is omitted (spec C-7).
|
|
541
|
+
* Checks `pipeline.envelope.grading` then default `pipeline.grade.output` on disk.
|
|
542
|
+
*/
|
|
543
|
+
declare function resolveGradingArtifactFromSuite(suitePath: string): Promise<string | undefined>;
|
|
544
|
+
//#endregion
|
|
545
|
+
//#region src/pipeline/run-pipeline.d.ts
|
|
546
|
+
/** Options for {@link runPipeline} (CLI flags and progress callbacks). */
|
|
547
|
+
interface RunPipelineOptions {
|
|
548
|
+
/** Comma-separated subset of configured steps (e.g. `run,grade`). */
|
|
549
|
+
steps?: string;
|
|
550
|
+
maxConcurrent?: number;
|
|
551
|
+
overrides?: PipelineCliOverrides;
|
|
552
|
+
onRunProgress?: ProgressCallback;
|
|
553
|
+
onGradeProgress?: GradeReportOptions["onProgress"];
|
|
554
|
+
/** Framework version stamped on envelope export. */
|
|
555
|
+
frameworkVersion?: string;
|
|
556
|
+
}
|
|
557
|
+
/** Outcome of a pipeline run including per-step exit semantics. */
|
|
558
|
+
interface RunPipelineResult {
|
|
559
|
+
/** 0 pass, 1 eval/grade/envelope failure, 2 load error (thrown before return). */
|
|
560
|
+
exitCode: number;
|
|
561
|
+
stepsRun: PipelineStepName[];
|
|
562
|
+
runReport?: SuiteReport;
|
|
563
|
+
}
|
|
564
|
+
/** Execute configured pipeline steps in order; stop on first failure. */
|
|
565
|
+
declare function runPipeline(doc: SuiteDocument, options?: RunPipelineOptions): Promise<RunPipelineResult>;
|
|
566
|
+
//#endregion
|
|
454
567
|
//#region src/otel/types.d.ts
|
|
455
568
|
/**
|
|
456
569
|
* Minimal OTLP JSON types for trace export.
|
|
@@ -601,6 +714,19 @@ interface ClaudeGraderOptions {
|
|
|
601
714
|
/** Factory returning a {@link GraderFn} bound to subprocess options. */
|
|
602
715
|
declare function createClaudeGrader(options?: ClaudeGraderOptions): GraderFn;
|
|
603
716
|
//#endregion
|
|
717
|
+
//#region src/grader/codex-grader.d.ts
|
|
718
|
+
/** Options for {@link createCodexGrader} / {@link runCodexGrader}. */
|
|
719
|
+
interface CodexGraderOptions {
|
|
720
|
+
binary?: string;
|
|
721
|
+
model?: string;
|
|
722
|
+
timeoutMs?: number;
|
|
723
|
+
env?: Record<string, string>;
|
|
724
|
+
cwd?: string;
|
|
725
|
+
codex?: CodexOptions;
|
|
726
|
+
}
|
|
727
|
+
/** Factory returning a {@link GraderFn} bound to subprocess options. */
|
|
728
|
+
declare function createCodexGrader(options?: CodexGraderOptions): GraderFn;
|
|
729
|
+
//#endregion
|
|
604
730
|
//#region src/grader/format-console.d.ts
|
|
605
731
|
/**
|
|
606
732
|
* Format a {@link SuiteGradingReport} for terminal output.
|
|
@@ -839,5 +965,5 @@ declare function toolParameterKvMatch(predicted: ToolCallInput, reference: ToolC
|
|
|
839
965
|
*/
|
|
840
966
|
declare function computeToolCallMetrics(predicted: ToolCallInput[], reference: ToolCallInput[], options?: ToolCallMetricOptions): ToolCallMetrics;
|
|
841
967
|
//#endregion
|
|
842
|
-
export { type AdapterDiagnostics, AdapterError, type AdapterResult, type AdapterRunFn, Assertion, AssertionResult, AssertionStat, AssistantMessage, AssistantMessageEvent, AssistantTurn, type BaseAdapterConfig, BuildEvalRunEnvelopeOptions, Cardinality, CellReport, CompoundPredicate, ConfigError, ContentBlock, DEFAULT_ADAPTER_ID, DEFAULT_REPETITIONS, DEFAULT_THRESHOLD, EVAL_RUN_SCHEMA_VERSION, type EmitOtelOptions, EvalArtifacts, EvalAssertionStat, EvalCellResult, EvalDatasetRow, EvalProvenance, EvalRepetition, EvalRunEnvelope, EvalRunSummary, EvaluationInstanceJson, type ExportTraceServiceRequest, ExternalScore, type GradeReportOptions, type HarnessAdapter, HarnessInfo, HarnessMetrics, InstanceData, InstancesJsonlRow, JudgeInfo, LeafPredicate, type LimitedRunner, MatrixCell, McpServerStatus, ObjectPredicate, OutcomeGrades, type ParseErrorRecord, type ParseResult, Predicate, ProgressCallback, ProgressEvent, ProtojsonToolCall, ProtojsonTrajectory, ReferenceToolNameMode, ReferenceTrajectoryConfig, type RepGradingResult, RepetitionError, RepetitionResult, type ReporterOptions, ResultEvent, RetryRecord, RunSuiteOptions, SessionMeta, StopReason, StreamEvent, type SuiteConfig, type SuiteGradingReport, SuiteReference, SuiteReport, SystemCompactBoundaryEvent, SystemInitEvent, SystemPluginInstallEvent, SystemRetryEvent, SystemUnknownEvent, TRAJECTORY_SCHEMA_VERSION, TestCase, TestSuite, TextBlock, ThresholdedAssertion, ToolCall, type ToolCallMetricOptions, ToolPattern, ToolResultBlock, ToolUseBlock, TrajectoryBuilder, type TrajectoryInput, TrajectoryInstanceMetricKey, TrajectoryInstancesJson, TrajectoryPairInstanceJson, TrajectorySingleToolUseInstanceJson, TrajectoryView, Usage, UsageSummary, UserMessage, UserMessageEvent, aggregateCell, buildEvalRunEnvelope, buildEvalRunEnvelopeFromFiles, buildTrajectory, index_d_exports as claudeCode, computeToolCallMetrics, computeTrajectoryMetrics, createClaudeGrader, createLimit, emitOtel, enrichRepetitionWithProtojson, evaluate, evaluateAll, formatGradingConsole, formatReport, getAdapter, getDefaultAdapter, getRepetitions, gradeReport, gradingReportPassed, isAssistantMessage, isResult, isSystemInit, isSystemRetry, isTextBlock, isToolResultBlock, isToolUseBlock, isUserMessage, listAdapters, loadSuite, mergeConfig, namespaceOf, parseStreamJson, parseSuite, registerAdapter, resolveGradeOptions, runRepetition, runSuite, toEvaluationInstance, toHarnessMetrics, toInstancesJsonl, toTrajectory, toTrajectoryInstances, toolCallValid, toolNameMatch, toolParameterKeyMatch, toolParameterKvMatch, trajectoryAnyOrderMatch, trajectoryExactMatch, trajectoryInOrderMatch, trajectoryPrecision, trajectoryRecall, trajectorySingleToolUse, trajectoryToOtlp, trajectoryToTranscript };
|
|
968
|
+
export { type AdapterDiagnostics, AdapterError, type AdapterResult, type AdapterRunFn, Assertion, AssertionResult, AssertionStat, AssistantMessage, AssistantMessageEvent, AssistantTurn, type BaseAdapterConfig, BuildEvalRunEnvelopeOptions, Cardinality, CellReport, CompoundPredicate, ConfigError, ContentBlock, DEFAULT_ADAPTER_ID, DEFAULT_REPETITIONS, DEFAULT_THRESHOLD, EVAL_RUN_SCHEMA_VERSION, type EmitOtelOptions, EvalArtifacts, EvalAssertionStat, EvalCellResult, EvalDatasetRow, EvalProvenance, EvalRepetition, EvalRunEnvelope, EvalRunSummary, EvaluationInstanceJson, type ExportTraceServiceRequest, ExternalScore, type GradeReportOptions, type HarnessAdapter, HarnessInfo, HarnessMetrics, InstanceData, InstancesJsonlRow, JudgeInfo, LeafPredicate, type LimitedRunner, MatrixCell, McpServerStatus, ObjectPredicate, OutcomeGrades, type ParseErrorRecord, type ParseResult, type PipelineConfig, Predicate, ProgressCallback, ProgressEvent, ProtojsonToolCall, ProtojsonTrajectory, ReferenceToolNameMode, ReferenceTrajectoryConfig, type RepGradingResult, RepetitionError, RepetitionResult, type ReporterOptions, ResultEvent, RetryRecord, RunSuiteOptions, SessionMeta, StopReason, StreamEvent, type SuiteConfig, type SuiteDocument, type SuiteGradingReport, SuiteReference, SuiteReport, SystemCompactBoundaryEvent, SystemInitEvent, SystemPluginInstallEvent, SystemRetryEvent, SystemUnknownEvent, TRAJECTORY_SCHEMA_VERSION, TestCase, TestSuite, TextBlock, ThresholdedAssertion, ToolCall, type ToolCallMetricOptions, ToolPattern, ToolResultBlock, ToolUseBlock, TrajectoryBuilder, type TrajectoryInput, TrajectoryInstanceMetricKey, TrajectoryInstancesJson, TrajectoryPairInstanceJson, TrajectorySingleToolUseInstanceJson, TrajectoryView, Usage, UsageSummary, UserMessage, UserMessageEvent, aggregateCell, buildEvalRunEnvelope, buildEvalRunEnvelopeFromFiles, buildTrajectory, index_d_exports as claudeCode, computeToolCallMetrics, computeTrajectoryMetrics, createClaudeGrader, createCodexGrader, createLimit, emitOtel, enrichRepetitionWithProtojson, evaluate, evaluateAll, formatGradingConsole, formatReport, getAdapter, getDefaultAdapter, getRepetitions, gradeReport, gradingReportPassed, isAssistantMessage, isResult, isSystemInit, isSystemRetry, isTextBlock, isToolResultBlock, isToolUseBlock, isUserMessage, listAdapters, loadSuite, loadSuiteDocument, mergeConfig, namespaceOf, parseStreamJson, parseSuite, registerAdapter, resolveGradeOptions, resolveGradingArtifactFromSuite, resolvePipelineInputs, runPipeline, runRepetition, runSuite, toEvaluationInstance, toHarnessMetrics, toInstancesJsonl, toTrajectory, toTrajectoryInstances, toolCallValid, toolNameMatch, toolParameterKeyMatch, toolParameterKvMatch, trajectoryAnyOrderMatch, trajectoryExactMatch, trajectoryInOrderMatch, trajectoryPrecision, trajectoryRecall, trajectorySingleToolUse, trajectoryToOtlp, trajectoryToTranscript };
|
|
843
969
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { o as
|
|
1
|
+
import { a as isAssistantMessage, c as isSystemRetry, d as isToolUseBlock, f as isUserMessage, i as namespaceOf, l as isTextBlock, n as TrajectoryBuilder, o as isResult, r as buildTrajectory, s as isSystemInit, t as AdapterError, u as isToolResultBlock } from "./types-Bac8_Ixb.js";
|
|
2
|
+
import { A as serializeToolInput, B as TRAJECTORY_SCHEMA_VERSION, C as trajectoryExactMatch, D as trajectorySingleToolUse, E as trajectoryRecall, I as trajectoryToTranscript, L as createCodexGrader, M as gradingReportPassed, N as resolveGradeOptions, O as toEvaluationInstance, P as gradeReport, R as createClaudeGrader, S as trajectoryAnyOrderMatch, T as trajectoryPrecision, _ as buildEvalRunEnvelopeFromFiles, b as computeTrajectoryMetrics, d as resolveGradingArtifactFromSuite, f as resolvePipelineInputs, g as buildEvalRunEnvelope, h as toTrajectory, i as runPipeline, j as formatGradingConsole, k as toTrajectoryInstances, m as toInstancesJsonl, n as emitOtel, r as trajectoryToOtlp, t as formatReport, v as enrichRepetitionWithProtojson, w as trajectoryInOrderMatch, x as parseToolInput, y as toHarnessMetrics, z as EVAL_RUN_SCHEMA_VERSION } from "./reporter-Biy-5-9M.js";
|
|
3
|
+
import { a as parseStreamJson, n as claude_code_exports } from "./claude-code-C_7hxC8z.js";
|
|
4
|
+
import { a as aggregateCell, c as runRepetition, d as getDefaultAdapter, f as listAdapters, h as evaluateAll, i as DEFAULT_THRESHOLD, l as DEFAULT_ADAPTER_ID, m as evaluate, n as createLimit, o as getRepetitions, p as registerAdapter, r as DEFAULT_REPETITIONS, s as mergeConfig, t as runSuite, u as getAdapter } from "./suite-BcP64nlb.js";
|
|
5
|
+
import { l as ConfigError, n as parseSuite, o as loadSuiteDocument, t as loadSuite } from "./loader-DnQ6Jt0i.js";
|
|
5
6
|
//#region src/metrics/tool-calls.ts
|
|
6
7
|
/**
|
|
7
8
|
* Tool-call-level metrics operating on prediction/reference tool-call pairs.
|
|
@@ -119,6 +120,6 @@ function computeToolCallMetrics(predicted, reference, options = {}) {
|
|
|
119
120
|
};
|
|
120
121
|
}
|
|
121
122
|
//#endregion
|
|
122
|
-
export { AdapterError, ConfigError, DEFAULT_ADAPTER_ID, DEFAULT_REPETITIONS, DEFAULT_THRESHOLD, EVAL_RUN_SCHEMA_VERSION, TRAJECTORY_SCHEMA_VERSION, TrajectoryBuilder, aggregateCell, buildEvalRunEnvelope, buildEvalRunEnvelopeFromFiles, buildTrajectory, claude_code_exports as claudeCode, computeToolCallMetrics, computeTrajectoryMetrics, createClaudeGrader, createLimit, emitOtel, enrichRepetitionWithProtojson, evaluate, evaluateAll, formatGradingConsole, formatReport, getAdapter, getDefaultAdapter, getRepetitions, gradeReport, gradingReportPassed, isAssistantMessage, isResult, isSystemInit, isSystemRetry, isTextBlock, isToolResultBlock, isToolUseBlock, isUserMessage, listAdapters, loadSuite, mergeConfig, namespaceOf, parseStreamJson, parseSuite, registerAdapter, resolveGradeOptions, runRepetition, runSuite, toEvaluationInstance, toHarnessMetrics, toInstancesJsonl, toTrajectory, toTrajectoryInstances, toolCallValid, toolNameMatch, toolParameterKeyMatch, toolParameterKvMatch, trajectoryAnyOrderMatch, trajectoryExactMatch, trajectoryInOrderMatch, trajectoryPrecision, trajectoryRecall, trajectorySingleToolUse, trajectoryToOtlp, trajectoryToTranscript };
|
|
123
|
+
export { AdapterError, ConfigError, DEFAULT_ADAPTER_ID, DEFAULT_REPETITIONS, DEFAULT_THRESHOLD, EVAL_RUN_SCHEMA_VERSION, TRAJECTORY_SCHEMA_VERSION, TrajectoryBuilder, aggregateCell, buildEvalRunEnvelope, buildEvalRunEnvelopeFromFiles, buildTrajectory, claude_code_exports as claudeCode, computeToolCallMetrics, computeTrajectoryMetrics, createClaudeGrader, createCodexGrader, createLimit, emitOtel, enrichRepetitionWithProtojson, evaluate, evaluateAll, formatGradingConsole, formatReport, getAdapter, getDefaultAdapter, getRepetitions, gradeReport, gradingReportPassed, isAssistantMessage, isResult, isSystemInit, isSystemRetry, isTextBlock, isToolResultBlock, isToolUseBlock, isUserMessage, listAdapters, loadSuite, loadSuiteDocument, mergeConfig, namespaceOf, parseStreamJson, parseSuite, registerAdapter, resolveGradeOptions, resolveGradingArtifactFromSuite, resolvePipelineInputs, runPipeline, runRepetition, runSuite, toEvaluationInstance, toHarnessMetrics, toInstancesJsonl, toTrajectory, toTrajectoryInstances, toolCallValid, toolNameMatch, toolParameterKeyMatch, toolParameterKvMatch, trajectoryAnyOrderMatch, trajectoryExactMatch, trajectoryInOrderMatch, trajectoryPrecision, trajectoryRecall, trajectorySingleToolUse, trajectoryToOtlp, trajectoryToTranscript };
|
|
123
124
|
|
|
124
125
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/metrics/tool-calls.ts"],"sourcesContent":["/**\n * Tool-call-level metrics operating on prediction/reference tool-call pairs.\n *\n * Implements Vertex-aligned per-call checks: validity, name match, parameter\n * key match, and full key-value match. Used by trajectory metrics and\n * available for custom eval pipelines.\n *\n * Scores are 0 or 1 per call; {@link computeToolCallMetrics} averages across\n * aligned index pairs (max length of predicted vs reference).\n */\n\nimport { parseToolInput, type TrajectoryInput, type WireToolCall } from \"./trajectory\";\nimport { serializeToolInput } from \"../eval-interchange/normalize\";\n\n/** Options for parameter value comparison. */\nexport interface ToolCallMetricOptions {\n /** When true, compare serialized JSON strictly (reserved for future semantics). */\n useStrictStringMatch?: boolean;\n}\n\n/** Aggregated tool-call metric scores (each 0..1). */\nexport interface ToolCallMetrics {\n tool_call_valid: number;\n tool_name_match: number;\n tool_parameter_key_match: number;\n tool_parameter_kv_match: number;\n}\n\ntype ToolCallInput = TrajectoryInput[number];\n\n/** Normalize harness or wire tool call to canonical wire shape for comparison. */\nfunction normalizeToolCall(toolCall: ToolCallInput): WireToolCall {\n if (typeof toolCall.tool_input === \"string\") {\n return {\n tool_name: toolCall.tool_name,\n tool_input: toolCall.tool_input,\n };\n }\n\n return {\n tool_name: toolCall.tool_name,\n tool_input: serializeToolInput(toolCall.tool_input),\n };\n}\n\n/** Parse tool_input JSON to an object map, or null when not a plain object. */\nfunction parsedArgs(toolCall: WireToolCall): Record<string, unknown> | null {\n const parsed = parseToolInput(toolCall.tool_input);\n if (parsed === null || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n return null;\n }\n return parsed as Record<string, unknown>;\n}\n\n/**\n * Whether a predicted tool call is well-formed (non-empty name, parseable JSON input).\n *\n * @returns 1 when valid, 0 otherwise.\n */\nexport function toolCallValid(toolCall: ToolCallInput): number {\n const normalized = normalizeToolCall(toolCall);\n if (!normalized.tool_name.trim()) return 0;\n\n try {\n JSON.parse(normalized.tool_input);\n return 1;\n } catch {\n return 0;\n }\n}\n\n/**\n * Whether predicted and reference tool names match exactly.\n *\n * @returns 1 on match, 0 otherwise.\n */\nexport function toolNameMatch(\n predicted: ToolCallInput,\n reference: ToolCallInput,\n): number {\n const predictedNorm = normalizeToolCall(predicted);\n const referenceNorm = normalizeToolCall(reference);\n return predictedNorm.tool_name === referenceNorm.tool_name ? 1 : 0;\n}\n\n/**\n * Whether parameter key sets match (same keys, same order after sort).\n *\n * Requires matching tool names first. Returns 0 when args are not objects.\n */\nexport function toolParameterKeyMatch(\n predicted: ToolCallInput,\n reference: ToolCallInput,\n): number {\n if (toolNameMatch(predicted, reference) === 0) return 0;\n\n const predictedArgs = parsedArgs(normalizeToolCall(predicted));\n const referenceArgs = parsedArgs(normalizeToolCall(reference));\n if (predictedArgs === null || referenceArgs === null) return 0;\n\n const predictedKeys = Object.keys(predictedArgs).sort();\n const referenceKeys = Object.keys(referenceArgs).sort();\n if (predictedKeys.length !== referenceKeys.length) return 0;\n\n return predictedKeys.every((key, index) => key === referenceKeys[index])\n ? 1\n : 0;\n}\n\n/** Deep equality via JSON serialization (handles nested objects in args). */\nfunction valuesEqual(\n left: unknown,\n right: unknown,\n useStrictStringMatch: boolean,\n): boolean {\n if (useStrictStringMatch) {\n return JSON.stringify(left) === JSON.stringify(right);\n }\n return JSON.stringify(left) === JSON.stringify(right);\n}\n\n/**\n * Whether all reference parameter key-value pairs match in the predicted call.\n *\n * Requires {@link toolParameterKeyMatch} first. Only keys present in reference\n * are checked (predicted may have extra keys).\n */\nexport function toolParameterKvMatch(\n predicted: ToolCallInput,\n reference: ToolCallInput,\n options: ToolCallMetricOptions = {},\n): number {\n if (toolParameterKeyMatch(predicted, reference) === 0) return 0;\n\n const predictedArgs = parsedArgs(normalizeToolCall(predicted))!;\n const referenceArgs = parsedArgs(normalizeToolCall(reference))!;\n\n for (const key of Object.keys(referenceArgs)) {\n if (\n !valuesEqual(\n predictedArgs[key],\n referenceArgs[key],\n options.useStrictStringMatch ?? false,\n )\n ) {\n return 0;\n }\n }\n\n return 1;\n}\n\n/**\n * Average tool-call metrics across index-aligned predicted/reference pairs.\n *\n * Denominator is `max(predicted.length, reference.length, 1)`. Missing\n * predicted calls at an index are skipped for pair metrics; validity still\n * counts when a predicted call exists.\n */\nexport function computeToolCallMetrics(\n predicted: ToolCallInput[],\n reference: ToolCallInput[],\n options: ToolCallMetricOptions = {},\n): ToolCallMetrics {\n const pairCount = Math.max(predicted.length, reference.length, 1);\n let valid = 0;\n let nameMatch = 0;\n let keyMatch = 0;\n let kvMatch = 0;\n\n for (let index = 0; index < pairCount; index += 1) {\n const predictedCall = predicted[index];\n const referenceCall = reference[index];\n if (!predictedCall) continue;\n\n valid += toolCallValid(predictedCall);\n if (!referenceCall) continue;\n\n nameMatch += toolNameMatch(predictedCall, referenceCall);\n keyMatch += toolParameterKeyMatch(predictedCall, referenceCall);\n kvMatch += toolParameterKvMatch(predictedCall, referenceCall, options);\n }\n\n return {\n tool_call_valid: valid / pairCount,\n tool_name_match: nameMatch / pairCount,\n tool_parameter_key_match: keyMatch / pairCount,\n tool_parameter_kv_match: kvMatch / pairCount,\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/metrics/tool-calls.ts"],"sourcesContent":["/**\n * Tool-call-level metrics operating on prediction/reference tool-call pairs.\n *\n * Implements Vertex-aligned per-call checks: validity, name match, parameter\n * key match, and full key-value match. Used by trajectory metrics and\n * available for custom eval pipelines.\n *\n * Scores are 0 or 1 per call; {@link computeToolCallMetrics} averages across\n * aligned index pairs (max length of predicted vs reference).\n */\n\nimport { parseToolInput, type TrajectoryInput, type WireToolCall } from \"./trajectory\";\nimport { serializeToolInput } from \"../eval-interchange/normalize\";\n\n/** Options for parameter value comparison. */\nexport interface ToolCallMetricOptions {\n /** When true, compare serialized JSON strictly (reserved for future semantics). */\n useStrictStringMatch?: boolean;\n}\n\n/** Aggregated tool-call metric scores (each 0..1). */\nexport interface ToolCallMetrics {\n tool_call_valid: number;\n tool_name_match: number;\n tool_parameter_key_match: number;\n tool_parameter_kv_match: number;\n}\n\ntype ToolCallInput = TrajectoryInput[number];\n\n/** Normalize harness or wire tool call to canonical wire shape for comparison. */\nfunction normalizeToolCall(toolCall: ToolCallInput): WireToolCall {\n if (typeof toolCall.tool_input === \"string\") {\n return {\n tool_name: toolCall.tool_name,\n tool_input: toolCall.tool_input,\n };\n }\n\n return {\n tool_name: toolCall.tool_name,\n tool_input: serializeToolInput(toolCall.tool_input),\n };\n}\n\n/** Parse tool_input JSON to an object map, or null when not a plain object. */\nfunction parsedArgs(toolCall: WireToolCall): Record<string, unknown> | null {\n const parsed = parseToolInput(toolCall.tool_input);\n if (parsed === null || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n return null;\n }\n return parsed as Record<string, unknown>;\n}\n\n/**\n * Whether a predicted tool call is well-formed (non-empty name, parseable JSON input).\n *\n * @returns 1 when valid, 0 otherwise.\n */\nexport function toolCallValid(toolCall: ToolCallInput): number {\n const normalized = normalizeToolCall(toolCall);\n if (!normalized.tool_name.trim()) return 0;\n\n try {\n JSON.parse(normalized.tool_input);\n return 1;\n } catch {\n return 0;\n }\n}\n\n/**\n * Whether predicted and reference tool names match exactly.\n *\n * @returns 1 on match, 0 otherwise.\n */\nexport function toolNameMatch(\n predicted: ToolCallInput,\n reference: ToolCallInput,\n): number {\n const predictedNorm = normalizeToolCall(predicted);\n const referenceNorm = normalizeToolCall(reference);\n return predictedNorm.tool_name === referenceNorm.tool_name ? 1 : 0;\n}\n\n/**\n * Whether parameter key sets match (same keys, same order after sort).\n *\n * Requires matching tool names first. Returns 0 when args are not objects.\n */\nexport function toolParameterKeyMatch(\n predicted: ToolCallInput,\n reference: ToolCallInput,\n): number {\n if (toolNameMatch(predicted, reference) === 0) return 0;\n\n const predictedArgs = parsedArgs(normalizeToolCall(predicted));\n const referenceArgs = parsedArgs(normalizeToolCall(reference));\n if (predictedArgs === null || referenceArgs === null) return 0;\n\n const predictedKeys = Object.keys(predictedArgs).sort();\n const referenceKeys = Object.keys(referenceArgs).sort();\n if (predictedKeys.length !== referenceKeys.length) return 0;\n\n return predictedKeys.every((key, index) => key === referenceKeys[index])\n ? 1\n : 0;\n}\n\n/** Deep equality via JSON serialization (handles nested objects in args). */\nfunction valuesEqual(\n left: unknown,\n right: unknown,\n useStrictStringMatch: boolean,\n): boolean {\n if (useStrictStringMatch) {\n return JSON.stringify(left) === JSON.stringify(right);\n }\n return JSON.stringify(left) === JSON.stringify(right);\n}\n\n/**\n * Whether all reference parameter key-value pairs match in the predicted call.\n *\n * Requires {@link toolParameterKeyMatch} first. Only keys present in reference\n * are checked (predicted may have extra keys).\n */\nexport function toolParameterKvMatch(\n predicted: ToolCallInput,\n reference: ToolCallInput,\n options: ToolCallMetricOptions = {},\n): number {\n if (toolParameterKeyMatch(predicted, reference) === 0) return 0;\n\n const predictedArgs = parsedArgs(normalizeToolCall(predicted))!;\n const referenceArgs = parsedArgs(normalizeToolCall(reference))!;\n\n for (const key of Object.keys(referenceArgs)) {\n if (\n !valuesEqual(\n predictedArgs[key],\n referenceArgs[key],\n options.useStrictStringMatch ?? false,\n )\n ) {\n return 0;\n }\n }\n\n return 1;\n}\n\n/**\n * Average tool-call metrics across index-aligned predicted/reference pairs.\n *\n * Denominator is `max(predicted.length, reference.length, 1)`. Missing\n * predicted calls at an index are skipped for pair metrics; validity still\n * counts when a predicted call exists.\n */\nexport function computeToolCallMetrics(\n predicted: ToolCallInput[],\n reference: ToolCallInput[],\n options: ToolCallMetricOptions = {},\n): ToolCallMetrics {\n const pairCount = Math.max(predicted.length, reference.length, 1);\n let valid = 0;\n let nameMatch = 0;\n let keyMatch = 0;\n let kvMatch = 0;\n\n for (let index = 0; index < pairCount; index += 1) {\n const predictedCall = predicted[index];\n const referenceCall = reference[index];\n if (!predictedCall) continue;\n\n valid += toolCallValid(predictedCall);\n if (!referenceCall) continue;\n\n nameMatch += toolNameMatch(predictedCall, referenceCall);\n keyMatch += toolParameterKeyMatch(predictedCall, referenceCall);\n kvMatch += toolParameterKvMatch(predictedCall, referenceCall, options);\n }\n\n return {\n tool_call_valid: valid / pairCount,\n tool_name_match: nameMatch / pairCount,\n tool_parameter_key_match: keyMatch / pairCount,\n tool_parameter_kv_match: kvMatch / pairCount,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,SAAS,kBAAkB,UAAuC;CAChE,IAAI,OAAO,SAAS,eAAe,UACjC,OAAO;EACL,WAAW,SAAS;EACpB,YAAY,SAAS;CACvB;CAGF,OAAO;EACL,WAAW,SAAS;EACpB,YAAY,mBAAmB,SAAS,UAAU;CACpD;AACF;;AAGA,SAAS,WAAW,UAAwD;CAC1E,MAAM,SAAS,eAAe,SAAS,UAAU;CACjD,IAAI,WAAW,QAAQ,OAAO,WAAW,YAAY,MAAM,QAAQ,MAAM,GACvE,OAAO;CAET,OAAO;AACT;;;;;;AAOA,SAAgB,cAAc,UAAiC;CAC7D,MAAM,aAAa,kBAAkB,QAAQ;CAC7C,IAAI,CAAC,WAAW,UAAU,KAAK,GAAG,OAAO;CAEzC,IAAI;EACF,KAAK,MAAM,WAAW,UAAU;EAChC,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;;;;;;AAOA,SAAgB,cACd,WACA,WACQ;CACR,MAAM,gBAAgB,kBAAkB,SAAS;CACjD,MAAM,gBAAgB,kBAAkB,SAAS;CACjD,OAAO,cAAc,cAAc,cAAc,YAAY,IAAI;AACnE;;;;;;AAOA,SAAgB,sBACd,WACA,WACQ;CACR,IAAI,cAAc,WAAW,SAAS,MAAM,GAAG,OAAO;CAEtD,MAAM,gBAAgB,WAAW,kBAAkB,SAAS,CAAC;CAC7D,MAAM,gBAAgB,WAAW,kBAAkB,SAAS,CAAC;CAC7D,IAAI,kBAAkB,QAAQ,kBAAkB,MAAM,OAAO;CAE7D,MAAM,gBAAgB,OAAO,KAAK,aAAa,CAAC,CAAC,KAAK;CACtD,MAAM,gBAAgB,OAAO,KAAK,aAAa,CAAC,CAAC,KAAK;CACtD,IAAI,cAAc,WAAW,cAAc,QAAQ,OAAO;CAE1D,OAAO,cAAc,OAAO,KAAK,UAAU,QAAQ,cAAc,MAAM,IACnE,IACA;AACN;;AAGA,SAAS,YACP,MACA,OACA,sBACS;CACT,IAAI,sBACF,OAAO,KAAK,UAAU,IAAI,MAAM,KAAK,UAAU,KAAK;CAEtD,OAAO,KAAK,UAAU,IAAI,MAAM,KAAK,UAAU,KAAK;AACtD;;;;;;;AAQA,SAAgB,qBACd,WACA,WACA,UAAiC,CAAC,GAC1B;CACR,IAAI,sBAAsB,WAAW,SAAS,MAAM,GAAG,OAAO;CAE9D,MAAM,gBAAgB,WAAW,kBAAkB,SAAS,CAAC;CAC7D,MAAM,gBAAgB,WAAW,kBAAkB,SAAS,CAAC;CAE7D,KAAK,MAAM,OAAO,OAAO,KAAK,aAAa,GACzC,IACE,CAAC,YACC,cAAc,MACd,cAAc,MACd,QAAQ,wBAAwB,KAClC,GAEA,OAAO;CAIX,OAAO;AACT;;;;;;;;AASA,SAAgB,uBACd,WACA,WACA,UAAiC,CAAC,GACjB;CACjB,MAAM,YAAY,KAAK,IAAI,UAAU,QAAQ,UAAU,QAAQ,CAAC;CAChE,IAAI,QAAQ;CACZ,IAAI,YAAY;CAChB,IAAI,WAAW;CACf,IAAI,UAAU;CAEd,KAAK,IAAI,QAAQ,GAAG,QAAQ,WAAW,SAAS,GAAG;EACjD,MAAM,gBAAgB,UAAU;EAChC,MAAM,gBAAgB,UAAU;EAChC,IAAI,CAAC,eAAe;EAEpB,SAAS,cAAc,aAAa;EACpC,IAAI,CAAC,eAAe;EAEpB,aAAa,cAAc,eAAe,aAAa;EACvD,YAAY,sBAAsB,eAAe,aAAa;EAC9D,WAAW,qBAAqB,eAAe,eAAe,OAAO;CACvE;CAEA,OAAO;EACL,iBAAiB,QAAQ;EACzB,iBAAiB,YAAY;EAC7B,0BAA0B,WAAW;EACrC,yBAAyB,UAAU;CACrC;AACF"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { s as SuiteConfig } from "./types-C0gBkl0-.js";
|
|
2
|
+
import { d as TestSuite, u as TestCase } from "./types-0QkNVyp9.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
//#region src/config/transform.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Thrown when a YAML suite fails to validate or transform. Carries a JSON-path-
|
|
8
|
+
* like trail so users can find the offending node in their config quickly.
|
|
9
|
+
*/
|
|
10
|
+
declare class ConfigError extends Error {
|
|
11
|
+
readonly path?: string | undefined;
|
|
12
|
+
constructor(message: string, path?: string | undefined);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/config/grading-loader.d.ts
|
|
16
|
+
/** Runtime shape of a parsed grading config file. */
|
|
17
|
+
interface GradingConfig {
|
|
18
|
+
judge: SuiteConfig & {
|
|
19
|
+
adapter?: string;
|
|
20
|
+
maxConcurrent?: number;
|
|
21
|
+
system_instruction?: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Load grading YAML from disk and resolve relative paths. */
|
|
25
|
+
declare function loadGradingConfig(filePath: string): Promise<GradingConfig>;
|
|
26
|
+
/**
|
|
27
|
+
* Parse grading YAML from a string.
|
|
28
|
+
*
|
|
29
|
+
* @param sourcePath Optional path for error messages and path resolution.
|
|
30
|
+
*/
|
|
31
|
+
declare function parseGradingConfig(yamlContent: string, sourcePath?: string): GradingConfig;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/config/pipeline-schema.d.ts
|
|
34
|
+
/** Runtime pipeline config with resolved absolute paths. */
|
|
35
|
+
interface PipelineConfig {
|
|
36
|
+
run?: PipelineRunStep;
|
|
37
|
+
grade?: PipelineGradeStep;
|
|
38
|
+
envelope?: PipelineEnvelopeStep;
|
|
39
|
+
}
|
|
40
|
+
/** Resolved `pipeline.run` step — harness eval run output path. */
|
|
41
|
+
interface PipelineRunStep {
|
|
42
|
+
output: string;
|
|
43
|
+
maxConcurrent?: number;
|
|
44
|
+
}
|
|
45
|
+
/** Resolved `pipeline.grade` step — LLM outcome grading inputs and output. */
|
|
46
|
+
interface PipelineGradeStep {
|
|
47
|
+
input?: string;
|
|
48
|
+
output: string;
|
|
49
|
+
maxConcurrent?: number;
|
|
50
|
+
}
|
|
51
|
+
/** Resolved `pipeline.envelope` step — EvalRunEnvelope export options. */
|
|
52
|
+
interface PipelineEnvelopeStep {
|
|
53
|
+
report?: string;
|
|
54
|
+
grading?: string;
|
|
55
|
+
output: string;
|
|
56
|
+
projection: "envelope" | "trajectory" | "instances";
|
|
57
|
+
includeRawStreamEvents?: boolean;
|
|
58
|
+
noTranscript?: boolean;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/config/suite-document.d.ts
|
|
62
|
+
/** Parsed suite.yaml including optional orchestration blocks. */
|
|
63
|
+
interface SuiteDocument {
|
|
64
|
+
/** Absolute path to the suite.yaml file. */
|
|
65
|
+
suitePath: string;
|
|
66
|
+
suite: TestSuite;
|
|
67
|
+
judge?: GradingConfig["judge"];
|
|
68
|
+
pipeline?: PipelineConfig;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/config/suite-document-loader.d.ts
|
|
72
|
+
interface LoadSuiteDocumentOptions {
|
|
73
|
+
/**
|
|
74
|
+
* When true (default), `judge:` and `pipeline:` blocks are validated against
|
|
75
|
+
* their Zod schemas and returned in the result. When false, they are silently
|
|
76
|
+
* stripped — used by {@link loadSuite} so callers that only need the
|
|
77
|
+
* `TestSuite` are not broken by malformed orchestration blocks.
|
|
78
|
+
*/
|
|
79
|
+
validateOrchestration?: boolean;
|
|
80
|
+
}
|
|
81
|
+
/** Load suite.yaml (or directory) including optional judge and pipeline blocks. */
|
|
82
|
+
declare function loadSuiteDocument(filePath: string, options?: LoadSuiteDocumentOptions): Promise<SuiteDocument>;
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/config/loader-internals.d.ts
|
|
85
|
+
/** Parse one case file: single case, array, or `{ cases: [...] }`. */
|
|
86
|
+
declare function parseCasesFile(yamlContent: string, sourcePath?: string): TestCase[];
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/config/loader.d.ts
|
|
89
|
+
/**
|
|
90
|
+
* Load a suite from a file path or directory path (suite portion only).
|
|
91
|
+
*
|
|
92
|
+
* Orchestration blocks (`judge:`, `pipeline:`) are silently stripped — callers
|
|
93
|
+
* that only need the `TestSuite` are not broken by malformed orchestration YAML.
|
|
94
|
+
* Use {@link loadSuiteDocument} when you need validated orchestration metadata.
|
|
95
|
+
*/
|
|
96
|
+
declare function loadSuite(filePath: string): Promise<TestSuite>;
|
|
97
|
+
/**
|
|
98
|
+
* Parse suite YAML from a string (single-file layout with inline cases).
|
|
99
|
+
*
|
|
100
|
+
* Unknown top-level keys such as `judge` and `pipeline` are stripped.
|
|
101
|
+
*/
|
|
102
|
+
declare function parseSuite(yamlContent: string, sourcePath?: string): TestSuite;
|
|
103
|
+
/** Parse `suite.yaml` for directory layout (cases may be omitted). @internal */
|
|
104
|
+
declare function parseSuiteDirectory(yamlContent: string, sourcePath: string): TestSuite;
|
|
105
|
+
//#endregion
|
|
106
|
+
export { loadSuiteDocument as a, GradingConfig as c, ConfigError as d, parseCasesFile as i, loadGradingConfig as l, parseSuite as n, SuiteDocument as o, parseSuiteDirectory as r, PipelineConfig as s, loadSuite as t, parseGradingConfig as u };
|
|
107
|
+
//# sourceMappingURL=loader-B1WmGGzf.d.ts.map
|