@alis-build/harness-eval 0.1.3 → 0.1.4
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 +101 -28
- package/dist/adapters/claude-code/index.d.ts +2 -2
- package/dist/adapters/codex/index.d.ts +2 -2
- package/dist/cli/bin.js +3 -3
- package/dist/config/loader.d.ts +1 -1
- package/dist/config/loader.js +1 -1
- package/dist/{index-DnvP1UBl.d.ts → index-C56AEDUr.d.ts} +2 -2
- package/dist/index.d.ts +9 -7
- package/dist/index.js +3 -3
- package/dist/{loader-DnQ6Jt0i.js → loader-CiBm4Kf6.js} +21 -2
- package/dist/loader-CiBm4Kf6.js.map +1 -0
- package/dist/{loader-B1WmGGzf.d.ts → loader-CrmzNwkq.d.ts} +3 -3
- package/dist/{reporter-Biy-5-9M.js → reporter-BKCJZRYr.js} +186 -17
- package/dist/reporter-BKCJZRYr.js.map +1 -0
- package/dist/runner/suite.d.ts +1 -1
- package/dist/runner/suite.js +1 -1
- package/dist/{suite-BcP64nlb.js → suite-C3-8EjUW.js} +543 -3
- package/dist/suite-C3-8EjUW.js.map +1 -0
- package/dist/{suite-BEShV0by.d.ts → suite-qyOGre2g.d.ts} +2 -2
- package/dist/types-Bac8_Ixb.js.map +1 -1
- package/dist/{types-0QkNVyp9.d.ts → types-CLt4Yygc.d.ts} +2 -2
- package/dist/{types-C0gBkl0-.d.ts → types-D0HR2WnP.d.ts} +8 -2
- package/dist/{types-Bu8uOZZN.d.ts → types-DFMpv_HJ.d.ts} +2 -2
- package/package.json +6 -1
- package/schemas/eval-run-envelope.schema.json +193 -183
- package/dist/loader-DnQ6Jt0i.js.map +0 -1
- package/dist/reporter-Biy-5-9M.js.map +0 -1
- package/dist/suite-BcP64nlb.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader-CiBm4Kf6.js","names":["parseYaml","formatZodError","parseYaml","formatZodError","parseYaml","formatZodError","parseYaml"],"sources":["../src/config/schema.ts","../src/config/transform.ts","../src/config/loader-internals.ts","../src/config/pipeline-schema.ts","../src/config/paths.ts","../src/config/grading-schema.ts","../src/config/suite-file-schema.ts","../src/config/suite-document-loader.ts","../src/config/grading-loader.ts","../src/config/loader.ts"],"sourcesContent":["/**\n * zod schemas for the YAML on-disk shape.\n *\n * Config uses a nested layout: generic harness fields at the top level,\n * adapter-specific options under a named key (e.g. `claudeCode`). Validated\n * raw shapes are transformed into runtime types by `src/config/transform.ts`.\n */\n\nimport { z } from \"zod\";\n\n/** Claude Code adapter-specific options (nested under `claudeCode`). */\nexport const ClaudeCodeConfigSchema = z\n .object({\n binary: z.string(),\n pluginDirs: z.array(z.string()),\n mcpConfig: z.string(),\n permissionMode: z.enum([\n \"default\",\n \"acceptEdits\",\n \"plan\",\n \"auto\",\n \"dontAsk\",\n \"bypassPermissions\",\n ]),\n effort: z.enum([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]),\n pluginUrls: z.array(z.string()),\n addDirs: z.array(z.string()),\n strictMcpConfig: z.boolean(),\n agent: z.string(),\n fallbackModel: z.string(),\n tools: z.string(),\n maxBudgetUsd: z.number().positive(),\n settings: z.string(),\n settingSources: z.string(),\n systemPrompt: z.string(),\n systemPromptFile: z.string(),\n appendSystemPrompt: z.string(),\n appendSystemPromptFile: z.string(),\n debug: z.union([z.string(), z.boolean()]),\n debugFile: z.string(),\n includeHookEvents: z.boolean(),\n noSessionPersistence: z.boolean(),\n disableSlashCommands: z.boolean(),\n bare: z.boolean(),\n safeMode: z.boolean(),\n allowDangerouslySkipPermissions: z.boolean(),\n dangerouslySkipPermissions: z.boolean(),\n allowedTools: z.array(z.string()),\n disallowedTools: z.array(z.string()),\n maxTurns: z.number().int().positive(),\n isolateConfig: z.boolean(),\n })\n .partial();\n\n/** Gemini CLI adapter-specific options (nested under `geminiCli` in suite YAML). */\nexport const GeminiCliConfigSchema = z\n .object({\n binary: z.string(),\n approvalMode: z.enum([\"default\", \"auto_edit\", \"yolo\", \"plan\"]),\n sandbox: z.string(),\n skipTrust: z.boolean(),\n includeDirectories: z.array(z.string()),\n allowedMcpServerNames: z.array(z.string()),\n extensions: z.array(z.string()),\n debug: z.boolean(),\n /** Fresh temp `GEMINI_CONFIG_DIR` per run when true. */\n isolateConfig: z.boolean(),\n })\n .partial();\n\n/** Codex CLI adapter-specific options (nested under `codex`). */\nexport const CodexConfigSchema = z\n .object({\n binary: z.string(),\n profile: z.string(),\n sandbox: z.enum([\"read-only\", \"workspace-write\", \"danger-full-access\"]),\n addDirs: z.array(z.string()),\n configOverrides: z.array(z.string()),\n askForApproval: z.enum([\"untrusted\", \"on-request\", \"never\"]),\n dangerouslyBypassApprovalsAndSandbox: z.boolean(),\n dangerouslyBypassHookTrust: z.boolean(),\n ephemeral: z.boolean(),\n ignoreUserConfig: z.boolean(),\n skipGitRepoCheck: z.boolean(),\n outputSchema: z.string(),\n outputLastMessage: z.string(),\n captureLastMessage: z.boolean(),\n isolateConfig: z.boolean(),\n })\n .partial();\n\n/** Generic + nested adapter config for one layer (defaultConfig, case, cell). */\nexport const ConfigPartialSchema = z\n .object({\n model: z.string(),\n cwd: z.string(),\n timeoutMs: z.number().int().positive(),\n env: z.record(z.string(), z.string()),\n claudeCode: ClaudeCodeConfigSchema,\n codex: CodexConfigSchema,\n geminiCli: GeminiCliConfigSchema,\n })\n .partial();\n\n/** A matrix cell — one point in the configuration matrix. */\nexport const MatrixCellSchema = z.object({\n label: z.string().min(1),\n config: ConfigPartialSchema,\n axes: z.record(z.string(), z.string()).optional(),\n});\n\n/** Reference tool call in suite YAML. */\nexport const ReferenceToolCallSchema = z.object({\n tool_name: z.string().min(1),\n tool_input: z.unknown(),\n});\n\n/** Reference trajectory in suite YAML — array of steps or object with mode + steps. */\nexport const ReferenceTrajectorySchema = z.union([\n z.array(ReferenceToolCallSchema),\n z.object({\n tool_name_mode: z.enum([\"harness\", \"bare\"]).optional(),\n steps: z.array(ReferenceToolCallSchema).min(1),\n }),\n]);\n\n/** A test case. */\nexport const TestCaseSchema = z.object({\n id: z.string().min(1),\n prompt: z.string().min(1),\n category: z.string().optional(),\n notes: z.string().optional(),\n expectations: z.array(z.string().min(1)).optional(),\n reference_trajectory: ReferenceTrajectorySchema.optional(),\n human_ratings: z.record(z.string(), z.number()).optional(),\n assertions: z.array(z.unknown()).min(1),\n repetitions: z.number().int().positive().optional(),\n config: ConfigPartialSchema.optional(),\n});\n\n/** Top-level suite shape. */\nexport const TestSuiteSchema = z.object({\n adapter: z.string().optional(),\n defaultConfig: ConfigPartialSchema.optional(),\n matrix: z.array(MatrixCellSchema).min(1),\n cases: z.array(TestCaseSchema).min(1),\n});\n\n/** Directory suite root (suite.yaml) — cases may live under cases/ as separate YAML files. */\nexport const SuiteDirectorySchema = z.object({\n adapter: z.string().optional(),\n defaultConfig: ConfigPartialSchema.optional(),\n matrix: z.array(MatrixCellSchema).min(1),\n cases: z.array(TestCaseSchema).optional(),\n});\n\nexport type RawTestSuite = z.infer<typeof TestSuiteSchema>;\n/** Raw shape of a directory suite root (`suite.yaml` with optional inline cases). */\nexport type RawSuiteDirectory = z.infer<typeof SuiteDirectorySchema>;\n/** Raw shape of one test case before assertion transformation. */\nexport type RawTestCase = z.infer<typeof TestCaseSchema>;\n/** Raw shape of one matrix cell before path resolution. */\nexport type RawMatrixCell = z.infer<typeof MatrixCellSchema>;\n","/**\n * Transform YAML-shape assertions into runtime tagged-union assertions.\n *\n * Why a hand-written transformer rather than zod? The YAML shape is single-key objects (`called: \"foo\"`) and the runtime\n * shape is a tagged union (`{ type: \"called\", tool: \"foo\" }`). zod CAN\n * express this via `z.union` with one member per assertion type, but the\n * error messages devolve into \"expected one of 19 alternatives, none\n * matched\" with no indication of which one the user was trying to write.\n * Hand-written transformers per-assertion give targeted errors like\n * `at cases[2].assertions[1].called: 'tool' field missing`.\n *\n * Shortcut policy: for ergonomics, four assertions accept a bare scalar in place of an\n * object: `called`, `not_called`, `response_contains`, and\n * `responded_without_tool_calls`. Everything else requires the verbose\n * object form. This keeps the transformer small without giving up the\n * 90% of YAML readability.\n */\n\nimport type {\n Assertion,\n Predicate,\n ThresholdedAssertion,\n ToolPattern,\n} from \"../types/assertions\";\nimport { parseCardinality } from \"../assertions/cardinality\";\nimport type { MatrixCell, TestCase, TestSuite } from \"../runner/types\";\nimport type { ReferenceTrajectoryConfig } from \"../types/eval-interchange\";\nimport type { RawMatrixCell, RawTestCase, RawTestSuite, RawSuiteDirectory } from \"./schema\";\n\n// error type\n\n/**\n * Thrown when a YAML suite fails to validate or transform. Carries a JSON-path-\n * like trail so users can find the offending node in their config quickly.\n */\nexport class ConfigError extends Error {\n constructor(\n message: string,\n public readonly path?: string,\n ) {\n super(path ? `[${path}] ${message}` : message);\n this.name = \"ConfigError\";\n }\n}\n\n// suite-level transformer\n\n/** Transform a zod-validated raw suite into the runtime `TestSuite` shape. */\nexport function transformSuite(raw: RawTestSuite): TestSuite {\n return transformSuiteParts(raw);\n}\n\n/** Transform a directory `suite.yaml` (cases optional) into runtime shape. */\nexport function transformSuiteDirectory(raw: RawSuiteDirectory): TestSuite {\n return transformSuiteParts({\n ...raw,\n cases: raw.cases ?? [],\n });\n}\n\n/** Transform parsed case files into runtime test cases. */\nexport function transformTestCases(\n raw: RawTestCase[],\n pathPrefix: string,\n): TestCase[] {\n return raw.map((c, i) => transformTestCase(c, `${pathPrefix}[${i}]`));\n}\n\n/** Merge suite-level parts shared by single-file and directory transforms. */\nfunction transformSuiteParts(raw: RawTestSuite): TestSuite {\n return {\n adapter: raw.adapter,\n defaultConfig: raw.defaultConfig,\n matrix: raw.matrix.map(transformMatrixCell),\n cases: raw.cases.map((c, i) => transformTestCase(c, `cases[${i}]`)),\n };\n}\n\n/**\n * Normalize reference trajectory YAML into {@link ReferenceTrajectoryConfig}.\n *\n * Accepts a bare step array or `{ tool_name_mode?, steps }` object form.\n */\nfunction normalizeReferenceTrajectory(\n raw: RawTestCase[\"reference_trajectory\"],\n path: string,\n): ReferenceTrajectoryConfig | undefined {\n if (raw === undefined) return undefined;\n\n if (Array.isArray(raw)) {\n return { steps: raw };\n }\n\n if (!isPlainObject(raw) || !Array.isArray(raw.steps)) {\n throw new ConfigError(\n \"reference_trajectory must be an array of tool calls or { tool_name_mode?, steps: [...] }\",\n path,\n );\n }\n\n return {\n tool_name_mode: raw.tool_name_mode,\n steps: raw.steps,\n };\n}\n\n/** Map raw matrix cell YAML to runtime {@link MatrixCell}. */\nfunction transformMatrixCell(raw: RawMatrixCell): MatrixCell {\n return {\n label: raw.label,\n config: raw.config,\n axes: raw.axes,\n };\n}\n\n/** Map one raw test case to runtime {@link TestCase}, transforming assertions. */\nfunction transformTestCase(raw: RawTestCase, path: string): TestCase {\n return {\n id: raw.id,\n prompt: raw.prompt,\n category: raw.category,\n notes: raw.notes,\n expectations: raw.expectations,\n reference_trajectory: normalizeReferenceTrajectory(\n raw.reference_trajectory,\n `${path}.reference_trajectory`,\n ),\n human_ratings: raw.human_ratings,\n repetitions: raw.repetitions,\n config: raw.config,\n assertions: raw.assertions.map((a, i) =>\n transformThresholdedAssertion(a, `${path}.assertions[${i}]`),\n ),\n };\n}\n\n// thresholded assertion\n\n/** Keys that may appear alongside an assertion-type key. Not assertion types themselves. */\nconst SIBLING_KEYS = new Set([\"threshold\"]);\n\n/**\n * Parse optional `threshold` sibling and delegate the assertion body to\n * {@link transformAssertion}.\n *\n * @throws {ConfigError} When the wrapper is not an object, threshold is out of\n * `[0, 1]`, or the nested assertion fails validation.\n *\n * @example\n * transformThresholdedAssertion({ called: \"Read\", threshold: 0.9 }, \"path\")\n * // → { assertion: { type: \"called\", tool: \"Read\" }, threshold: 0.9 }\n */\nfunction transformThresholdedAssertion(\n raw: unknown,\n path: string,\n): ThresholdedAssertion {\n if (!isPlainObject(raw)) {\n throw new ConfigError(`expected object, got ${typeOf(raw)}`, path);\n }\n\n const threshold = raw.threshold;\n if (threshold !== undefined) {\n if (typeof threshold !== \"number\" || threshold < 0 || threshold > 1) {\n throw new ConfigError(\n `threshold must be a number in [0, 1], got ${JSON.stringify(threshold)}`,\n `${path}.threshold`,\n );\n }\n }\n\n return {\n assertion: transformAssertion(raw, path),\n threshold: typeof threshold === \"number\" ? threshold : undefined,\n };\n}\n\n// assertion transformer (the bulk)\n\n/**\n * Transform one assertion from YAML shape to runtime shape.\n *\n * Finds the single non-sibling key, dispatches to the per-type transformer.\n * Per-type transformers handle both verbose-object and shortcut-scalar input\n * shapes where applicable.\n *\n * @param raw - Single assertion object from parsed YAML (may include `threshold` sibling).\n * @param path - JSON-path-like location for error messages (e.g. `cases[0].assertions[1]`).\n * @returns Runtime {@link Assertion} tagged union.\n * @throws {ConfigError} When the object has no assertion key, multiple type keys, or an unknown type.\n *\n * @example\n * transformAssertion({ called: \"Read\" }, \"cases[0].assertions[0]\")\n * // → { type: \"called\", tool: \"Read\" }\n *\n * @example\n * transformAssertion({ called: { tool: \"Read\", times: \">= 2\" } }, \"path\")\n * // → { type: \"called\", tool: \"Read\", times: \">= 2\" }\n */\nexport function transformAssertion(raw: unknown, path: string): Assertion {\n if (!isPlainObject(raw)) {\n throw new ConfigError(`expected object, got ${typeOf(raw)}`, path);\n }\n\n const typeKeys = Object.keys(raw).filter((k) => !SIBLING_KEYS.has(k));\n if (typeKeys.length === 0) {\n throw new ConfigError(\n `no assertion type key found (got only sibling keys: ${Object.keys(raw).join(\", \")})`,\n path,\n );\n }\n if (typeKeys.length > 1) {\n throw new ConfigError(\n `multiple assertion type keys; pick one: ${typeKeys.join(\", \")}`,\n path,\n );\n }\n\n const typeKey = typeKeys[0];\n const value = raw[typeKey];\n const valuePath = `${path}.${typeKey}`;\n\n switch (typeKey) {\n case \"called\":\n return transformCalled(value, valuePath);\n case \"not_called\":\n return transformNotCalled(value, valuePath);\n case \"called_any_of\":\n return transformCalledAnyOf(value, valuePath);\n case \"called_all_of\":\n return transformCalledAllOf(value, valuePath);\n\n case \"called_before\":\n return transformCalledBefore(value, valuePath);\n case \"sequence\":\n return transformSequence(value, valuePath);\n\n case \"called_with\":\n return transformCalledWith(value, valuePath);\n\n case \"responded_without_tool_calls\":\n return transformRespondedWithoutToolCalls(value, valuePath);\n case \"iterations_within\":\n return transformScalarMax(value, valuePath, \"iterations_within\");\n case \"cost_within_usd\":\n return transformScalarMax(value, valuePath, \"cost_within_usd\");\n case \"duration_within_ms\":\n return transformScalarMax(value, valuePath, \"duration_within_ms\");\n case \"finished_with\":\n return transformFinishedWith(value, valuePath);\n\n case \"response_contains\":\n return transformResponseText(value, valuePath, \"response_contains\");\n case \"response_not_contains\":\n return transformResponseText(value, valuePath, \"response_not_contains\");\n case \"response_matches\":\n return transformResponseMatches(value, valuePath);\n\n case \"all_of\":\n return transformAllOf(value, valuePath);\n case \"any_of\":\n return transformAnyOf(value, valuePath);\n case \"not\":\n return transformNot(value, valuePath);\n\n default:\n throw new ConfigError(`unknown assertion type: ${typeKey}`, path);\n }\n}\n\n// per-assertion transformers — YAML single-key shape → runtime tagged union\n\n/**\n * Transform `called` YAML (scalar or `{tool, times?}`) to runtime assertion.\n *\n * @throws {ConfigError} When value is neither string nor object, tool is invalid,\n * or `times` is not a valid cardinality string.\n *\n * @example\n * // Scalar shortcut\n * transformCalled(\"mcp__api__search_skills\", \"path\")\n * // → { type: \"called\", tool: \"mcp__api__search_skills\" }\n *\n * @example\n * // Verbose form with cardinality\n * transformCalled({ tool: \"Read\", times: \">= 1\" }, \"path\")\n * // → { type: \"called\", tool: \"Read\", times: \">= 1\" }\n */\nfunction transformCalled(value: unknown, path: string): Assertion {\n // Scalar shortcut: bare string is the tool name.\n if (typeof value === \"string\") {\n return { type: \"called\", tool: value };\n }\n if (!isPlainObject(value)) {\n throw new ConfigError(\n `expected string or object, got ${typeOf(value)}`,\n path,\n );\n }\n const tool = requireToolPattern(value.tool, `${path}.tool`);\n let times: string | undefined;\n if (value.times !== undefined) {\n times = requireString(value.times, `${path}.times`);\n try {\n parseCardinality(times);\n } catch (err) {\n throw new ConfigError(\n err instanceof Error ? err.message : `invalid cardinality: ${times}`,\n `${path}.times`,\n );\n }\n }\n return { type: \"called\", tool, times };\n}\n\n/**\n * Transform `not_called` YAML (scalar or `{tool}`).\n *\n * @throws {ConfigError} When value is neither string nor object with a valid `tool`.\n *\n * @example\n * transformNotCalled(\"Bash\", \"path\") // → { type: \"not_called\", tool: \"Bash\" }\n */\nfunction transformNotCalled(value: unknown, path: string): Assertion {\n if (typeof value === \"string\") {\n return { type: \"not_called\", tool: value };\n }\n if (!isPlainObject(value)) {\n throw new ConfigError(\n `expected string or object, got ${typeOf(value)}`,\n path,\n );\n }\n return {\n type: \"not_called\",\n tool: requireToolPattern(value.tool, `${path}.tool`),\n };\n}\n\n/**\n * Transform `called_any_of` — bare tool list or `{tools: [...]}`.\n *\n * @throws {ConfigError} When the value is not an array or `{tools: [...]}` object.\n *\n * @example\n * transformCalledAnyOf([\"Read\", \"Glob\"], \"path\")\n * // → { type: \"called_any_of\", tools: [\"Read\", \"Glob\"] }\n */\nfunction transformCalledAnyOf(value: unknown, path: string): Assertion {\n const tools = requireToolPatternList(value, path);\n return { type: \"called_any_of\", tools };\n}\n\n/**\n * Transform `called_all_of` — bare tool list or `{tools: [...]}`.\n *\n * @throws {ConfigError} When the value is not an array or `{tools: [...]}` object.\n *\n * @example\n * transformCalledAllOf({ tools: [\"Read\", \"Grep\"] }, \"path\")\n * // → { type: \"called_all_of\", tools: [\"Read\", \"Grep\"] }\n */\nfunction transformCalledAllOf(value: unknown, path: string): Assertion {\n const tools = requireToolPatternList(value, path);\n return { type: \"called_all_of\", tools };\n}\n\n/**\n * Transform `called_before: {first, then}` ordering assertion.\n *\n * @throws {ConfigError} When value is not an object or `first`/`then` are invalid patterns.\n *\n * @example\n * transformCalledBefore({ first: \"SearchSkills\", then: \"LoadSkill\" }, \"path\")\n * // → { type: \"called_before\", first: \"SearchSkills\", then: \"LoadSkill\" }\n */\nfunction transformCalledBefore(value: unknown, path: string): Assertion {\n if (!isPlainObject(value)) {\n throw new ConfigError(\n `expected object with {first, then}, got ${typeOf(value)}`,\n path,\n );\n }\n const first = requireToolPattern(value.first, `${path}.first`);\n const then = requireToolPattern(value.then, `${path}.then`);\n return { type: \"called_before\", first, then };\n}\n\n/**\n * Transform `sequence` — tool list with optional `strict` flag.\n *\n * @throws {ConfigError} When value is neither a pattern array nor `{tools, strict?}` object.\n *\n * @example\n * // Bare array (non-strict by default)\n * transformSequence([\"Read\", \"Edit\"], \"path\")\n *\n * @example\n * // Explicit strict ordering\n * transformSequence({ tools: [\"Read\", \"Edit\"], strict: true }, \"path\")\n */\nfunction transformSequence(value: unknown, path: string): Assertion {\n // Two forms: bare list of patterns, or {tools: [...], strict?: bool}.\n if (Array.isArray(value)) {\n return {\n type: \"sequence\",\n tools: value.map((v, i) => requireToolPattern(v, `${path}[${i}]`)),\n };\n }\n if (!isPlainObject(value)) {\n throw new ConfigError(\n `expected array or object, got ${typeOf(value)}`,\n path,\n );\n }\n const tools = requireToolPatternList(value.tools, `${path}.tools`);\n const strict =\n value.strict === undefined\n ? undefined\n : requireBool(value.strict, `${path}.strict`);\n return { type: \"sequence\", tools, strict };\n}\n\n/**\n * Transform `called_with: {tool, args}` with predicate validation on args.\n *\n * @throws {ConfigError} When `tool` or `args` is missing/invalid, or `args` fails\n * {@link validatePredicate}.\n *\n * @example\n * transformCalledWith(\n * { tool: \"Read\", args: { path: { contains: \"README\" } } },\n * \"path\",\n * )\n * // → { type: \"called_with\", tool: \"Read\", args: { path: { contains: \"README\" } } }\n */\nfunction transformCalledWith(value: unknown, path: string): Assertion {\n if (!isPlainObject(value)) {\n throw new ConfigError(\n `expected object with {tool, args}, got ${typeOf(value)}`,\n path,\n );\n }\n const tool = requireToolPattern(value.tool, `${path}.tool`);\n if (value.args === undefined) {\n throw new ConfigError(`missing required field 'args'`, `${path}.args`);\n }\n validatePredicate(value.args, `${path}.args`);\n return { type: \"called_with\", tool, args: value.args as Predicate };\n}\n\n/**\n * Transform `responded_without_tool_calls` — accepts true or empty object.\n *\n * @throws {ConfigError} When value is neither `true`, null, nor an empty object.\n *\n * @example\n * transformRespondedWithoutToolCalls(true, \"path\")\n * // → { type: \"responded_without_tool_calls\" }\n */\nfunction transformRespondedWithoutToolCalls(\n value: unknown,\n path: string,\n): Assertion {\n // Accepts `true`, `{}`, or omitted (since the key being present is enough).\n if (\n value === true ||\n value === null ||\n (isPlainObject(value) && Object.keys(value).length === 0)\n ) {\n return { type: \"responded_without_tool_calls\" };\n }\n throw new ConfigError(\n `expected true or empty object, got ${JSON.stringify(value)}`,\n path,\n );\n}\n\n/**\n * Transform budget assertions (`iterations_within`, `cost_within_usd`, `duration_within_ms`).\n *\n * @throws {ConfigError} When `max` is missing, non-positive, or not a number.\n *\n * @example\n * transformScalarMax(5, \"path\", \"iterations_within\")\n * // → { type: \"iterations_within\", max: 5 }\n *\n * @example\n * transformScalarMax({ max: 2.5 }, \"path\", \"cost_within_usd\")\n * // → { type: \"cost_within_usd\", max: 2.5 }\n */\nfunction transformScalarMax(\n value: unknown,\n path: string,\n type: \"iterations_within\" | \"cost_within_usd\" | \"duration_within_ms\",\n): Assertion {\n let max: number | undefined;\n if (typeof value === \"number\") {\n max = value;\n } else if (isPlainObject(value) && typeof value.max === \"number\") {\n max = value.max;\n } else {\n throw new ConfigError(\n `expected number or {max: number}, got ${JSON.stringify(value)}`,\n path,\n );\n }\n if (max <= 0) {\n throw new ConfigError(`max must be positive, got ${max}`, path);\n }\n return { type, max };\n}\n\n/**\n * Transform `finished_with` — stop reason string, list, or `{reasons}`.\n *\n * @throws {ConfigError} When value is not a string, string array, or `{reasons}` object.\n *\n * @example\n * transformFinishedWith(\"end_turn\", \"path\")\n * // → { type: \"finished_with\", reasons: \"end_turn\" }\n */\nfunction transformFinishedWith(value: unknown, path: string): Assertion {\n // Three forms: bare string, bare array of strings, or {reasons: string | string[]}.\n if (typeof value === \"string\") {\n return { type: \"finished_with\", reasons: value };\n }\n if (Array.isArray(value)) {\n return {\n type: \"finished_with\",\n reasons: value.map((v, i) => requireString(v, `${path}[${i}]`)),\n };\n }\n if (isPlainObject(value)) {\n const reasons = value.reasons;\n if (typeof reasons === \"string\") return { type: \"finished_with\", reasons };\n if (Array.isArray(reasons)) {\n return {\n type: \"finished_with\",\n reasons: reasons.map((v, i) =>\n requireString(v, `${path}.reasons[${i}]`),\n ),\n };\n }\n }\n throw new ConfigError(\n `expected string, string[], or {reasons: ...}, got ${JSON.stringify(value)}`,\n path,\n );\n}\n\n/**\n * Transform `response_contains` / `response_not_contains` scalar or `{text}`.\n *\n * @throws {ConfigError} When value is neither a string nor `{text: string}`.\n *\n * @example\n * transformResponseText(\"done\", \"path\", \"response_contains\")\n * // → { type: \"response_contains\", text: \"done\" }\n */\nfunction transformResponseText(\n value: unknown,\n path: string,\n type: \"response_contains\" | \"response_not_contains\",\n): Assertion {\n if (typeof value === \"string\") {\n return { type, text: value };\n }\n if (isPlainObject(value) && typeof value.text === \"string\") {\n return { type, text: value.text };\n }\n throw new ConfigError(\n `expected string or {text: string}, got ${JSON.stringify(value)}`,\n path,\n );\n}\n\n/**\n * Transform `response_matches: {pattern, flags?}`.\n *\n * @throws {ConfigError} When `pattern` is missing or not a string.\n *\n * @example\n * transformResponseMatches({ pattern: \"error\\\\d+\", flags: \"i\" }, \"path\")\n * // → { type: \"response_matches\", pattern: \"error\\\\d+\", flags: \"i\" }\n */\nfunction transformResponseMatches(value: unknown, path: string): Assertion {\n if (!isPlainObject(value)) {\n throw new ConfigError(\n `expected object with {pattern, flags?}, got ${typeOf(value)}`,\n path,\n );\n }\n const pattern = requireString(value.pattern, `${path}.pattern`);\n const flags =\n value.flags === undefined\n ? undefined\n : requireString(value.flags, `${path}.flags`);\n return { type: \"response_matches\", pattern, flags };\n}\n\n/**\n * Transform compound `all_of` assertion list.\n *\n * @throws {ConfigError} When value is not an array or `{assertions: [...]}`.\n *\n * @example\n * transformAllOf([{ called: \"Read\" }, { not_called: \"Bash\" }], \"path\")\n */\nfunction transformAllOf(value: unknown, path: string): Assertion {\n return { type: \"all_of\", assertions: transformCompoundList(value, path) };\n}\n\n/**\n * Transform compound `any_of` assertion list.\n *\n * @throws {ConfigError} When value is not an array or `{assertions: [...]}`.\n *\n * @example\n * transformAnyOf({ assertions: [{ called: \"Read\" }, { called: \"Glob\" }] }, \"path\")\n */\nfunction transformAnyOf(value: unknown, path: string): Assertion {\n return { type: \"any_of\", assertions: transformCompoundList(value, path) };\n}\n\n/**\n * Transform compound `not` — single nested assertion, no threshold.\n *\n * The inner assertion uses the same single-key YAML shape as top-level\n * assertions; thresholds apply only at the outer {@link transformThresholdedAssertion} level.\n *\n * @throws {ConfigError} Propagates from nested {@link transformAssertion}.\n *\n * @example\n * transformNot({ called: \"Bash\" }, \"path\")\n * // → { type: \"not\", assertion: { type: \"called\", tool: \"Bash\" } }\n */\nfunction transformNot(value: unknown, path: string): Assertion {\n // `not` takes a single assertion as its value (not a list). The inner\n // assertion uses the same single-key shape as top-level assertions, so\n // we recurse via the main transformer. We don't pass thresholds for\n // inner assertions — those only apply at the top level.\n return { type: \"not\", assertion: transformAssertion(value, path) };\n}\n\n/**\n * Parse compound assertion list from array or `{assertions: [...]}`.\n *\n * @throws {ConfigError} When value is neither form.\n */\nfunction transformCompoundList(value: unknown, path: string): Assertion[] {\n // Two forms: bare array of assertions, or {assertions: [...]}.\n const list = Array.isArray(value)\n ? value\n : isPlainObject(value) && Array.isArray(value.assertions)\n ? value.assertions\n : null;\n\n if (list === null) {\n throw new ConfigError(\n `expected array or {assertions: [...]}, got ${JSON.stringify(value)}`,\n path,\n );\n }\n\n return list.map((a, i) => transformAssertion(a, `${path}[${i}]`));\n}\n\n// predicate validation\n\nconst LEAF_OPS = new Set([\n \"equals\",\n \"contains\",\n \"not_contains\",\n \"regex\",\n \"gte\",\n \"lte\",\n \"gt\",\n \"lt\",\n \"one_of\",\n]);\nconst COMPOUND_OPS = new Set([\"any_of\", \"all_of\", \"not\"]);\n\n/**\n * Validate that a predicate is well-formed. The runtime engine is tolerant\n * (returns false on bad shapes), but the loader is strict — invalid\n * predicates are far more often user typos than intentional patterns.\n *\n * Permitted shapes:\n * - scalar (treated as `{equals: scalar}` at runtime)\n * - single-key object whose key is a leaf op (e.g. `{contains: \"x\"}`)\n * - single-key compound (`{any_of: [...]}`, `{all_of: [...]}`, `{not: ...}`)\n * - multi-key object (descend into fields; each value is a sub-predicate)\n *\n * @throws {ConfigError} When a compound op has a non-array value or a leaf op\n * has the wrong value type (e.g. non-string `contains`).\n */\nfunction validatePredicate(raw: unknown, path: string): void {\n // Scalars are valid (interpreted as equals at runtime).\n if (!isPlainObject(raw)) return;\n\n const keys = Object.keys(raw);\n if (keys.length === 1) {\n const key = keys[0];\n\n if (LEAF_OPS.has(key)) {\n validateLeafOperator(key, raw[key], `${path}.${key}`);\n return;\n }\n\n if (COMPOUND_OPS.has(key)) {\n if (key === \"not\") {\n validatePredicate(raw[key], `${path}.not`);\n } else {\n const arr = raw[key];\n if (!Array.isArray(arr)) {\n throw new ConfigError(\n `${key} must be an array, got ${typeOf(arr)}`,\n `${path}.${key}`,\n );\n }\n arr.forEach((sub, i) => validatePredicate(sub, `${path}.${key}[${i}]`));\n }\n return;\n }\n\n // Single key but not a known op — falls through to object predicate.\n }\n\n // Multi-key object: each field is a sub-predicate.\n for (const [field, sub] of Object.entries(raw)) {\n validatePredicate(sub, `${path}.${field}`);\n }\n}\n\n/**\n * Validate a leaf predicate operator's value shape at config load time.\n *\n * @throws {ConfigError} When the operator's value has the wrong type or `regex`\n * is not a valid JavaScript regular expression.\n */\nfunction validateLeafOperator(op: string, value: unknown, path: string): void {\n switch (op) {\n case \"equals\":\n return;\n case \"contains\":\n case \"not_contains\":\n if (typeof value !== \"string\") {\n throw new ConfigError(`${op} requires a string`, path);\n }\n return;\n case \"regex\":\n if (typeof value !== \"string\") {\n throw new ConfigError(\"regex requires a string\", path);\n }\n try {\n new RegExp(value);\n } catch {\n throw new ConfigError(`invalid regex: ${value}`, path);\n }\n return;\n case \"gte\":\n case \"lte\":\n case \"gt\":\n case \"lt\":\n if (typeof value !== \"number\") {\n throw new ConfigError(`${op} requires a number`, path);\n }\n return;\n case \"one_of\":\n if (!Array.isArray(value)) {\n throw new ConfigError(\"one_of requires an array\", path);\n }\n return;\n default:\n return;\n }\n}\n\n// small validation helpers\n\n/** Require a tool pattern string or `{ pattern }` object. */\nfunction requireToolPattern(value: unknown, path: string): ToolPattern {\n if (typeof value === \"string\") return value;\n if (isPlainObject(value) && typeof value.pattern === \"string\") {\n return { pattern: value.pattern };\n }\n throw new ConfigError(\n `expected string or {pattern: string}, got ${JSON.stringify(value)}`,\n path,\n );\n}\n\n/** Require a bare tool pattern array or `{ tools: [...] }` wrapper. */\nfunction requireToolPatternList(value: unknown, path: string): ToolPattern[] {\n // Two forms: bare array, or {tools: [...]}.\n const list = Array.isArray(value)\n ? value\n : isPlainObject(value) && Array.isArray(value.tools)\n ? value.tools\n : null;\n\n if (list === null) {\n throw new ConfigError(\n `expected array of tool patterns or {tools: [...]}, got ${JSON.stringify(value)}`,\n path,\n );\n }\n\n return list.map((v, i) => requireToolPattern(v, `${path}[${i}]`));\n}\n\n/** Require a string value at `path` or throw {@link ConfigError}. */\nfunction requireString(value: unknown, path: string): string {\n if (typeof value === \"string\") return value;\n throw new ConfigError(`expected string, got ${typeOf(value)}`, path);\n}\n\n/** Require a boolean value at `path` or throw {@link ConfigError}. */\nfunction requireBool(value: unknown, path: string): boolean {\n if (typeof value === \"boolean\") return value;\n throw new ConfigError(`expected boolean, got ${typeOf(value)}`, path);\n}\n\n/** True for non-null, non-array objects (YAML mapping nodes). */\nfunction isPlainObject(x: unknown): x is Record<string, unknown> {\n return typeof x === \"object\" && x !== null && !Array.isArray(x);\n}\n\n/** Human-readable type name for config error messages. */\nfunction typeOf(x: unknown): string {\n if (x === null) return \"null\";\n if (Array.isArray(x)) return \"array\";\n return typeof x;\n}\n","/**\n * Shared suite loader helpers (case file collection and parsing).\n */\n\nimport { readdir, readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { z } from \"zod\";\n\nimport type { TestCase } from \"../runner/types\";\nimport { TestCaseSchema, type RawTestCase } from \"./schema\";\nimport { ConfigError, transformTestCases } from \"./transform\";\n\n/** Parse one case file: single case, array, or `{ cases: [...] }`. */\nexport function parseCasesFile(\n yamlContent: string,\n sourcePath?: string,\n): TestCase[] {\n let raw: unknown;\n try {\n raw = parseYaml(yamlContent);\n } catch (err) {\n throw new ConfigError(\n `YAML parse error: ${err instanceof Error ? err.message : String(err)}`,\n sourcePath,\n );\n }\n\n const rawCases = extractRawCases(raw, sourcePath);\n return transformTestCases(rawCases, sourcePath ?? \"cases\");\n}\n\nfunction extractRawCases(raw: unknown, sourcePath?: string): RawTestCase[] {\n if (Array.isArray(raw)) {\n return raw.map((item, index) => validateRawCase(item, sourcePath, index));\n }\n\n if (raw && typeof raw === \"object\") {\n const obj = raw as Record<string, unknown>;\n if (Array.isArray(obj.cases)) {\n return obj.cases.map((item, index) =>\n validateRawCase(item, sourcePath, index),\n );\n }\n if (\"id\" in obj && \"prompt\" in obj && \"assertions\" in obj) {\n return [validateRawCase(raw, sourcePath, 0)];\n }\n }\n\n throw new ConfigError(\n \"expected a case object, array of cases, or { cases: [...] }\",\n sourcePath,\n );\n}\n\nfunction validateRawCase(\n raw: unknown,\n sourcePath: string | undefined,\n index: number,\n): RawTestCase {\n const validated = TestCaseSchema.safeParse(raw);\n if (!validated.success) {\n throw new ConfigError(\n `validation failed:\\n${formatZodError(validated.error, sourcePath)}`,\n sourcePath,\n );\n }\n\n return validated.data;\n}\n\n/** Recursively collect `.yaml` / `.yml` files under `casesDir`. */\nexport async function collectCaseYamlFiles(casesDir: string): Promise<string[]> {\n const files: string[] = [];\n\n async function walk(dir: string): Promise<void> {\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch (err) {\n if (\n err instanceof Error &&\n \"code\" in err &&\n (err as NodeJS.ErrnoException).code === \"ENOENT\"\n ) {\n return;\n }\n throw err;\n }\n\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n if (entry.isDirectory()) {\n await walk(fullPath);\n } else if (\n entry.isFile() &&\n (entry.name.endsWith(\".yaml\") || entry.name.endsWith(\".yml\"))\n ) {\n files.push(fullPath);\n }\n }\n }\n\n await walk(casesDir);\n return files.sort();\n}\n\nfunction formatZodError(err: z.ZodError, sourcePath?: string): string {\n return err.issues\n .map((issue) => {\n const path = issue.path.length > 0 ? issue.path.join(\".\") : \"(root)\";\n const prefix = sourcePath ? `${sourcePath} → ${path}` : path;\n return ` ${prefix}: ${issue.message}`;\n })\n .join(\"\\n\");\n}","/**\n * Zod schemas for optional `pipeline:` block in suite.yaml.\n *\n * Step presence under `pipeline` enables orchestration via `harness-eval pipeline`.\n */\n\nimport { z } from \"zod\";\n\n/** `pipeline.run` step — harness eval run. */\nexport const PipelineRunStepSchema = z\n .object({\n output: z.string().min(1).optional(),\n maxConcurrent: z.number().int().positive().optional(),\n })\n .optional();\n\n/** `pipeline.grade` step — LLM outcome grading. */\nexport const PipelineGradeStepSchema = z\n .object({\n input: z.string().min(1).optional(),\n output: z.string().min(1).optional(),\n maxConcurrent: z.number().int().positive().optional(),\n })\n .optional();\n\n/** `pipeline.envelope` step — EvalRunEnvelope export. */\nexport const PipelineEnvelopeStepSchema = z\n .object({\n report: z.string().min(1).optional(),\n grading: z.string().min(1).optional(),\n output: z.string().min(1).optional(),\n projection: z.enum([\"envelope\", \"trajectory\", \"instances\"]).optional(),\n includeRawStreamEvents: z.boolean().optional(),\n noTranscript: z.boolean().optional(),\n })\n .optional();\n\n/** Top-level optional pipeline block in suite.yaml. */\nexport const PipelineConfigSchema = z\n .object({\n run: PipelineRunStepSchema,\n grade: PipelineGradeStepSchema,\n envelope: PipelineEnvelopeStepSchema,\n })\n .partial();\n\n/** Validated YAML shape for the optional `pipeline:` block. */\nexport type RawPipelineConfig = z.infer<typeof PipelineConfigSchema>;\n/** Validated YAML shape for `pipeline.run`. */\nexport type RawPipelineRunStep = z.infer<typeof PipelineRunStepSchema>;\n/** Validated YAML shape for `pipeline.grade`. */\nexport type RawPipelineGradeStep = z.infer<typeof PipelineGradeStepSchema>;\n/** Validated YAML shape for `pipeline.envelope`. */\nexport type RawPipelineEnvelopeStep = z.infer<typeof PipelineEnvelopeStepSchema>;\n\n/** Runtime pipeline config with resolved absolute paths. */\nexport interface PipelineConfig {\n run?: PipelineRunStep;\n grade?: PipelineGradeStep;\n envelope?: PipelineEnvelopeStep;\n}\n\n/** Resolved `pipeline.run` step — harness eval run output path. */\nexport interface PipelineRunStep {\n output: string;\n maxConcurrent?: number;\n}\n\n/** Resolved `pipeline.grade` step — LLM outcome grading inputs and output. */\nexport interface PipelineGradeStep {\n input?: string;\n output: string;\n maxConcurrent?: number;\n}\n\n/** Resolved `pipeline.envelope` step — EvalRunEnvelope export options. */\nexport interface PipelineEnvelopeStep {\n report?: string;\n grading?: string;\n output: string;\n projection: \"envelope\" | \"trajectory\" | \"instances\";\n includeRawStreamEvents?: boolean;\n noTranscript?: boolean;\n}\n\n/** Default artifact filenames relative to the suite.yaml directory. */\nexport const DEFAULT_PIPELINE_OUTPUTS = {\n run: \"report.json\",\n grade: \"grading.json\",\n envelope: \"envelope.json\",\n} as const;\n","/**\n * Resolve relative paths in suite config against the suite file directory.\n *\n * YAML authors write paths relative to the suite file; this module absolutizes\n * them at load time so the runner and adapters receive filesystem-ready values.\n * Tilde-prefixed paths and inline JSON blobs (settings starting with `{`) are\n * left unchanged.\n */\n\nimport { isAbsolute, join } from \"node:path\";\n\nimport type { SuiteConfig } from \"../adapters/types\";\nimport type {\n PipelineConfig,\n PipelineEnvelopeStep,\n PipelineGradeStep,\n PipelineRunStep,\n} from \"./pipeline-schema\";\nimport { DEFAULT_PIPELINE_OUTPUTS } from \"./pipeline-schema\";\n\n/** Resolve a single path relative to `suiteDir` unless already absolute or `~/`. */\nfunction resolvePath(value: string, suiteDir: string): string {\n if (isAbsolute(value) || value.startsWith(\"~/\")) {\n return value;\n }\n return join(suiteDir, value);\n}\n\n/** Resolve Claude Code-specific path fields within a config block. */\nfunction resolveClaudeCodePaths(\n block: Record<string, unknown>,\n suiteDir: string,\n): Record<string, unknown> {\n const resolved = { ...block };\n if (typeof resolved.mcpConfig === \"string\") {\n resolved.mcpConfig = resolvePath(resolved.mcpConfig, suiteDir);\n }\n if (Array.isArray(resolved.pluginDirs)) {\n resolved.pluginDirs = resolved.pluginDirs.map((p) =>\n typeof p === \"string\" ? resolvePath(p, suiteDir) : p,\n );\n }\n if (Array.isArray(resolved.addDirs)) {\n resolved.addDirs = resolved.addDirs.map((p) =>\n typeof p === \"string\" ? resolvePath(p, suiteDir) : p,\n );\n }\n const filePathFields = [\n \"systemPromptFile\",\n \"appendSystemPromptFile\",\n \"debugFile\",\n ] as const;\n for (const field of filePathFields) {\n const value = resolved[field];\n // Inline JSON settings blobs start with `{` and are not filesystem paths.\n if (typeof value === \"string\" && !value.trim().startsWith(\"{\")) {\n resolved[field] = resolvePath(value, suiteDir);\n }\n }\n if (typeof resolved.settings === \"string\" && !resolved.settings.trim().startsWith(\"{\")) {\n resolved.settings = resolvePath(resolved.settings, suiteDir);\n }\n return resolved;\n}\n\n/** Resolve Codex-specific path fields within a config block. */\nfunction resolveCodexPaths(\n block: Record<string, unknown>,\n suiteDir: string,\n): Record<string, unknown> {\n const resolved = { ...block };\n if (Array.isArray(resolved.addDirs)) {\n resolved.addDirs = resolved.addDirs.map((p) =>\n typeof p === \"string\" ? resolvePath(p, suiteDir) : p,\n );\n }\n for (const field of [\"outputSchema\", \"outputLastMessage\"] as const) {\n const value = resolved[field];\n if (typeof value === \"string\") {\n resolved[field] = resolvePath(value, suiteDir);\n }\n }\n return resolved;\n}\n\n/** Resolve relative paths in a config layer relative to `suiteDir`. */\nexport function resolveConfigPaths(\n config: SuiteConfig | undefined,\n suiteDir: string,\n): SuiteConfig | undefined {\n if (!config) return undefined;\n\n const resolved: SuiteConfig = { ...config };\n if (typeof resolved.cwd === \"string\") {\n resolved.cwd = resolvePath(resolved.cwd, suiteDir);\n }\n if (\n resolved.claudeCode &&\n typeof resolved.claudeCode === \"object\" &&\n !Array.isArray(resolved.claudeCode)\n ) {\n resolved.claudeCode = resolveClaudeCodePaths(\n resolved.claudeCode as Record<string, unknown>,\n suiteDir,\n );\n }\n if (\n resolved.codex &&\n typeof resolved.codex === \"object\" &&\n !Array.isArray(resolved.codex)\n ) {\n resolved.codex = resolveCodexPaths(\n resolved.codex as Record<string, unknown>,\n suiteDir,\n );\n }\n return resolved;\n}\n\n/** Resolve paths on an entire suite after load. */\nexport function resolveSuitePaths(\n suite: {\n defaultConfig?: SuiteConfig;\n matrix: Array<{ config: SuiteConfig }>;\n cases: Array<{ config?: SuiteConfig }>;\n },\n suiteFilePath: string,\n): void {\n const suiteDir = configFileDir(suiteFilePath);\n\n suite.defaultConfig = resolveConfigPaths(suite.defaultConfig, suiteDir);\n for (const cell of suite.matrix) {\n cell.config = resolveConfigPaths(cell.config, suiteDir) ?? cell.config;\n }\n for (const testCase of suite.cases) {\n testCase.config = resolveConfigPaths(testCase.config, suiteDir);\n }\n}\n\n/** Parent directory of a suite or grading config file path. */\nfunction configFileDir(filePath: string): string {\n return filePath.includes(\"/\") || filePath.includes(\"\\\\\")\n ? filePath.replace(/[/\\\\][^/\\\\]+$/, \"\")\n : \".\";\n}\n\n/**\n * Heuristically resolve env var values that look like relative file paths.\n *\n * Used for grading config where credential or config paths may be expressed\n * relative to the grading YAML location.\n */\nfunction resolveEnvPaths(\n env: Record<string, string>,\n baseDir: string,\n): Record<string, string> {\n const resolved: Record<string, string> = {};\n for (const [key, value] of Object.entries(env)) {\n if (value.startsWith(\"./\") || value.startsWith(\"../\")) {\n resolved[key] = resolvePath(value, baseDir);\n } else {\n resolved[key] = value;\n }\n }\n return resolved;\n}\n\n/** Resolve relative paths in a standalone grading config file. */\nexport function resolveGradingConfigPaths(\n config: { judge: SuiteConfig & { maxConcurrent?: number; adapter?: string } },\n configFilePath: string,\n): void {\n const baseDir = configFileDir(configFilePath);\n const { adapter, maxConcurrent, ...rest } = config.judge;\n const resolved = resolveConfigPaths(rest, baseDir) ?? rest;\n config.judge = {\n ...resolved,\n adapter,\n maxConcurrent,\n };\n if (config.judge.env) {\n config.judge.env = resolveEnvPaths(config.judge.env, baseDir);\n }\n}\n\n/** Resolve a pipeline artifact path relative to the suite.yaml directory. */\nexport function resolvePipelinePath(\n value: string | undefined,\n defaultRelative: string,\n suiteDir: string,\n): string {\n const rel = value ?? defaultRelative;\n return resolvePath(rel, suiteDir);\n}\n\n/** Resolve relative paths in a parsed pipeline config. */\nexport function resolvePipelineConfigPaths(\n pipeline: PipelineConfig,\n suiteFilePath: string,\n): PipelineConfig {\n const suiteDir = configFileDir(suiteFilePath);\n const resolved: PipelineConfig = {};\n\n if (pipeline.run) {\n resolved.run = resolvePipelineRunStep(pipeline.run, suiteDir);\n }\n if (pipeline.grade) {\n resolved.grade = resolvePipelineGradeStep(pipeline.grade, suiteDir);\n }\n if (pipeline.envelope) {\n resolved.envelope = resolvePipelineEnvelopeStep(pipeline.envelope, suiteDir);\n }\n\n return resolved;\n}\n\n/** Resolve one pipeline step's run output path. */\nfunction resolvePipelineRunStep(\n step: PipelineRunStep,\n suiteDir: string,\n): PipelineRunStep {\n return {\n ...step,\n output: resolvePipelinePath(step.output, DEFAULT_PIPELINE_OUTPUTS.run, suiteDir),\n };\n}\n\n/** Resolve grade step input (optional) and output paths. */\nfunction resolvePipelineGradeStep(\n step: PipelineGradeStep,\n suiteDir: string,\n): PipelineGradeStep {\n return {\n ...step,\n input: step.input\n ? resolvePipelinePath(step.input, DEFAULT_PIPELINE_OUTPUTS.run, suiteDir)\n : undefined,\n output: resolvePipelinePath(\n step.output,\n DEFAULT_PIPELINE_OUTPUTS.grade,\n suiteDir,\n ),\n };\n}\n\n/** Resolve envelope step report, grading, and output paths. */\nfunction resolvePipelineEnvelopeStep(\n step: PipelineEnvelopeStep,\n suiteDir: string,\n): PipelineEnvelopeStep {\n return {\n ...step,\n report: step.report\n ? resolvePipelinePath(step.report, DEFAULT_PIPELINE_OUTPUTS.run, suiteDir)\n : undefined,\n grading: step.grading\n ? resolvePipelinePath(\n step.grading,\n DEFAULT_PIPELINE_OUTPUTS.grade,\n suiteDir,\n )\n : undefined,\n output: resolvePipelinePath(\n step.output,\n DEFAULT_PIPELINE_OUTPUTS.envelope,\n suiteDir,\n ),\n };\n}\n","/**\n * Zod schema for standalone grading YAML (`grading.yaml`).\n *\n * The top-level `judge` block reuses {@link ConfigPartialSchema} fields plus\n * grader-specific concurrency and system-instruction overrides.\n */\n\nimport { z } from \"zod\";\n\nimport { ConfigPartialSchema } from \"./schema\";\n\n/** Top-level `judge` block — mirrors harness config fields plus grader concurrency. */\nexport const JudgeConfigSchema = ConfigPartialSchema.extend({\n adapter: z.string().optional(),\n maxConcurrent: z.number().int().positive().optional(),\n /** Optional judge prompt prefix (maps to upstream system_instruction). */\n system_instruction: z.string().optional(),\n});\n\nexport const GradingConfigSchema = z.object({\n judge: JudgeConfigSchema,\n});\n\nexport type RawGradingConfig = z.infer<typeof GradingConfigSchema>;\n/** Raw shape of the nested `judge` block before path resolution. */\nexport type RawJudgeConfig = z.infer<typeof JudgeConfigSchema>;\n","/**\n * Superset suite.yaml schemas including optional `judge:` and `pipeline:` blocks.\n *\n * Kept separate from `schema.ts` to avoid a circular import with `grading-schema.ts`.\n */\n\nimport { z } from \"zod\";\n\nimport { JudgeConfigSchema } from \"./grading-schema\";\nimport { PipelineConfigSchema } from \"./pipeline-schema\";\nimport { SuiteDirectorySchema, TestSuiteSchema } from \"./schema\";\n\n/** Single-file suite with optional inline judge and pipeline orchestration. */\nexport const SuiteFileSingleSchema = TestSuiteSchema.extend({\n judge: JudgeConfigSchema.optional(),\n pipeline: PipelineConfigSchema.optional(),\n});\n\n/** Directory suite root with optional inline judge and pipeline orchestration. */\nexport const SuiteFileDirectorySchema = SuiteDirectorySchema.extend({\n judge: JudgeConfigSchema.optional(),\n pipeline: PipelineConfigSchema.optional(),\n});\n\n/** Validated single-file suite.yaml root (suite fields + optional judge/pipeline). */\nexport type RawSuiteFileSingle = z.infer<typeof SuiteFileSingleSchema>;\n/** Validated directory suite.yaml root (matrix + optional judge/pipeline). */\nexport type RawSuiteFileDirectory = z.infer<typeof SuiteFileDirectorySchema>;\n","/**\n * Load a unified suite.yaml document (suite + optional judge + pipeline).\n */\n\nimport { readFile, stat } from \"node:fs/promises\";\nimport { join, relative, resolve } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport type { z } from \"zod\";\n\nimport type { TestCase, TestSuite } from \"../runner/types\";\nimport type { SuiteConfig } from \"../adapters/types\";\nimport {\n resolveGradingConfigPaths,\n resolvePipelineConfigPaths,\n resolveSuitePaths,\n} from \"./paths\";\nimport type { PipelineConfig } from \"./pipeline-schema\";\nimport { DEFAULT_PIPELINE_OUTPUTS } from \"./pipeline-schema\";\nimport { SuiteDirectorySchema, TestSuiteSchema } from \"./schema\";\nimport type { RawSuiteFileDirectory } from \"./suite-file-schema\";\nimport { SuiteFileDirectorySchema, SuiteFileSingleSchema } from \"./suite-file-schema\";\nimport {\n ConfigError,\n transformSuite,\n transformSuiteDirectory,\n} from \"./transform\";\nimport { collectCaseYamlFiles, parseCasesFile } from \"./loader-internals\";\n\ntype JudgeConfig = SuiteConfig & {\n adapter?: string;\n maxConcurrent?: number;\n system_instruction?: string;\n};\n\nimport type { SuiteDocument } from \"./suite-document\";\n\nexport type { SuiteDocument } from \"./suite-document\";\n\nexport interface LoadSuiteDocumentOptions {\n /**\n * When true (default), `judge:` and `pipeline:` blocks are validated against\n * their Zod schemas and returned in the result. When false, they are silently\n * stripped — used by {@link loadSuite} so callers that only need the\n * `TestSuite` are not broken by malformed orchestration blocks.\n */\n validateOrchestration?: boolean;\n}\n\n/** Load suite.yaml (or directory) including optional judge and pipeline blocks. */\nexport async function loadSuiteDocument(\n filePath: string,\n options: LoadSuiteDocumentOptions = {},\n): Promise<SuiteDocument> {\n const absolutePath = resolve(filePath);\n let info;\n try {\n info = await stat(absolutePath);\n } catch (err) {\n throw new ConfigError(\n `failed to read suite path: ${err instanceof Error ? err.message : String(err)}`,\n filePath,\n );\n }\n\n const strict = options.validateOrchestration !== false;\n\n if (info.isDirectory()) {\n return loadSuiteDocumentDirectory(absolutePath, strict);\n }\n return loadSuiteDocumentFile(absolutePath, strict);\n}\n\n/** Load suite.yaml from a directory layout (cases under `cases/`). */\nasync function loadSuiteDocumentDirectory(dir: string, strict: boolean): Promise<SuiteDocument> {\n const suiteYamlPath = join(dir, \"suite.yaml\");\n let content: string;\n try {\n content = await readFile(suiteYamlPath, \"utf8\");\n } catch (err) {\n throw new ConfigError(\n `missing suite.yaml in suite directory: ${err instanceof Error ? err.message : String(err)}`,\n dir,\n );\n }\n\n const { judge, pipeline, suite: base } = parseSuiteFileRoot(\n content,\n suiteYamlPath,\n \"directory\",\n strict,\n );\n\n const casesDir = join(dir, \"cases\");\n const caseFiles = await collectCaseYamlFiles(casesDir);\n\n type TaggedCase = { relPath: string; index: number; testCase: TestCase };\n const tagged: TaggedCase[] = base.cases.map((testCase, index) => ({\n relPath: \"suite.yaml\",\n index,\n testCase,\n }));\n\n for (const filePath of caseFiles) {\n const fileContent = await readFile(filePath, \"utf8\");\n const cases = parseCasesFile(fileContent, filePath);\n const relPath = relative(casesDir, filePath);\n for (const [index, testCase] of cases.entries()) {\n tagged.push({ relPath, index, testCase });\n }\n }\n\n tagged.sort((a, b) => {\n const pathCmp = a.relPath.localeCompare(b.relPath);\n if (pathCmp !== 0) return pathCmp;\n return a.index - b.index;\n });\n\n // Stable order: inline suite.yaml cases first, then cases/*.yaml lexicographically.\n const cases = tagged.map((entry) => entry.testCase);\n if (cases.length === 0) {\n throw new ConfigError(\"suite directory has no test cases\", dir);\n }\n\n const suite: TestSuite = { ...base, cases };\n resolveSuitePaths(suite, suiteYamlPath);\n\n return buildSuiteDocument(suiteYamlPath, suite, judge, pipeline);\n}\n\n/** Load a single suite.yaml file (inline cases). */\nasync function loadSuiteDocumentFile(absolutePath: string, strict: boolean): Promise<SuiteDocument> {\n let content: string;\n try {\n content = await readFile(absolutePath, \"utf8\");\n } catch (err) {\n throw new ConfigError(\n `failed to read suite file: ${err instanceof Error ? err.message : String(err)}`,\n absolutePath,\n );\n }\n\n const { judge, pipeline, suite } = parseSuiteFileRoot(\n content,\n absolutePath,\n \"single\",\n strict,\n );\n resolveSuitePaths(suite, absolutePath);\n return buildSuiteDocument(absolutePath, suite, judge, pipeline);\n}\n\n/**\n * Parse suite.yaml root and validate against the appropriate schema.\n *\n * When `strict` is true, uses extended schemas that validate `judge:` and\n * `pipeline:` blocks (for `loadSuiteDocument`). When false, uses base schemas\n * that silently strip unknown keys (for `loadSuite`).\n */\nfunction parseSuiteFileRoot(\n yamlContent: string,\n sourcePath: string,\n layout: \"directory\" | \"single\",\n strict: boolean,\n): {\n suite: TestSuite;\n judge?: JudgeConfig;\n pipeline?: PipelineConfig;\n} {\n let raw: unknown;\n try {\n raw = parseYaml(yamlContent);\n } catch (err) {\n throw new ConfigError(\n `YAML parse error: ${err instanceof Error ? err.message : String(err)}`,\n sourcePath,\n );\n }\n\n if (!strict) {\n const schema = layout === \"directory\" ? SuiteDirectorySchema : TestSuiteSchema;\n const validated = schema.safeParse(raw);\n if (!validated.success) {\n throw new ConfigError(\n `validation failed:\\n${formatZodError(validated.error, sourcePath)}`,\n sourcePath,\n );\n }\n const transform = layout === \"directory\" ? transformSuiteDirectory : transformSuite;\n return { suite: transform(validated.data as Parameters<typeof transform>[0]) };\n }\n\n if (layout === \"directory\") {\n const validated = SuiteFileDirectorySchema.safeParse(raw);\n if (!validated.success) {\n throw new ConfigError(\n `validation failed:\\n${formatZodError(validated.error, sourcePath)}`,\n sourcePath,\n );\n }\n return extractSuiteFileParts(validated.data, sourcePath, transformSuiteDirectory);\n }\n\n const validated = SuiteFileSingleSchema.safeParse(raw);\n if (!validated.success) {\n throw new ConfigError(\n `validation failed:\\n${formatZodError(validated.error, sourcePath)}`,\n sourcePath,\n );\n }\n return extractSuiteFileParts(validated.data, sourcePath, transformSuite);\n}\n\n/** Split validated YAML into suite, judge, and pipeline with path resolution. */\nfunction extractSuiteFileParts<T extends RawSuiteFileDirectory>(\n data: T,\n sourcePath: string,\n transform: (raw: T) => TestSuite,\n): {\n suite: TestSuite;\n judge?: JudgeConfig;\n pipeline?: PipelineConfig;\n} {\n const { judge: rawJudge, pipeline: rawPipeline, ...suiteRaw } = data;\n const suite = transform(suiteRaw as T);\n\n let judge: JudgeConfig | undefined;\n if (rawJudge) {\n judge = { ...rawJudge };\n resolveGradingConfigPaths({ judge }, sourcePath);\n }\n\n let pipeline: PipelineConfig | undefined;\n if (rawPipeline) {\n pipeline = transformPipelineConfig(rawPipeline);\n pipeline = resolvePipelineConfigPaths(pipeline, sourcePath);\n }\n\n return { suite, judge, pipeline };\n}\n\n/** Apply default artifact filenames when a pipeline step key is present but paths are omitted. */\nfunction transformPipelineConfig(\n raw: NonNullable<RawSuiteFileDirectory[\"pipeline\"]>,\n): PipelineConfig {\n const pipeline: PipelineConfig = {};\n if (raw.run !== undefined) {\n pipeline.run = {\n output: raw.run?.output ?? DEFAULT_PIPELINE_OUTPUTS.run,\n maxConcurrent: raw.run?.maxConcurrent,\n };\n }\n if (raw.grade !== undefined) {\n pipeline.grade = {\n input: raw.grade?.input,\n output: raw.grade?.output ?? DEFAULT_PIPELINE_OUTPUTS.grade,\n maxConcurrent: raw.grade?.maxConcurrent,\n };\n }\n if (raw.envelope !== undefined) {\n pipeline.envelope = {\n report: raw.envelope?.report,\n grading: raw.envelope?.grading,\n output: raw.envelope?.output ?? DEFAULT_PIPELINE_OUTPUTS.envelope,\n projection: raw.envelope?.projection ?? \"envelope\",\n includeRawStreamEvents: raw.envelope?.includeRawStreamEvents,\n noTranscript: raw.envelope?.noTranscript,\n };\n }\n return pipeline;\n}\n\n/** Assemble the runtime {@link SuiteDocument} from parsed parts. */\nfunction buildSuiteDocument(\n suitePath: string,\n suite: TestSuite,\n judge?: JudgeConfig,\n pipeline?: PipelineConfig,\n): SuiteDocument {\n return {\n suitePath: resolve(suitePath),\n suite,\n judge,\n pipeline,\n };\n}\n\nfunction formatZodError(err: z.ZodError, sourcePath?: string): string {\n return err.issues\n .map((issue) => {\n const path = issue.path.length > 0 ? issue.path.join(\".\") : \"(root)\";\n const prefix = sourcePath ? `${sourcePath} → ${path}` : path;\n return ` ${prefix}: ${issue.message}`;\n })\n .join(\"\\n\");\n}\n","/**\n * Load standalone grading YAML for `harness-eval grade`.\n *\n * Also accepts unified suite.yaml files with an inline `judge:` block.\n */\n\nimport { readFile, stat } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport type { z } from \"zod\";\n\nimport type { SuiteConfig } from \"../adapters/types\";\nimport { resolveGradingConfigPaths } from \"./paths\";\nimport { GradingConfigSchema } from \"./grading-schema\";\nimport {\n SuiteFileDirectorySchema,\n SuiteFileSingleSchema,\n} from \"./suite-file-schema\";\nimport { ConfigError } from \"./transform\";\n\n/** Runtime shape of a parsed grading config file. */\nexport interface GradingConfig {\n judge: SuiteConfig & {\n adapter?: string;\n maxConcurrent?: number;\n system_instruction?: string;\n };\n}\n\n/** Load grading YAML from disk and resolve relative paths. */\nexport async function loadGradingConfig(filePath: string): Promise<GradingConfig> {\n const absolutePath = resolve(filePath);\n let info;\n try {\n info = await stat(absolutePath);\n } catch (err) {\n throw new ConfigError(\n `failed to read grading config: ${err instanceof Error ? err.message : String(err)}`,\n filePath,\n );\n }\n\n if (info.isDirectory()) {\n return loadGradingFromSuiteYaml(join(absolutePath, \"suite.yaml\"));\n }\n\n let content: string;\n try {\n content = await readFile(absolutePath, \"utf8\");\n } catch (err) {\n throw new ConfigError(\n `failed to read grading config: ${err instanceof Error ? err.message : String(err)}`,\n filePath,\n );\n }\n\n if (isSuiteRoot(parseYaml(content))) {\n return parseGradingFromSuiteRaw(parseYaml(content), absolutePath);\n }\n\n return parseGradingConfig(content, absolutePath);\n}\n\n/**\n * Parse grading YAML from a string.\n *\n * @param sourcePath Optional path for error messages and path resolution.\n */\nexport function parseGradingConfig(\n yamlContent: string,\n sourcePath?: string,\n): GradingConfig {\n let raw: unknown;\n try {\n raw = parseYaml(yamlContent);\n } catch (err) {\n throw new ConfigError(\n `YAML parse error: ${err instanceof Error ? err.message : String(err)}`,\n sourcePath,\n );\n }\n\n if (isSuiteRoot(raw)) {\n return parseGradingFromSuiteRaw(raw, sourcePath ?? \"suite.yaml\");\n }\n\n const validated = GradingConfigSchema.safeParse(raw);\n if (!validated.success) {\n throw new ConfigError(\n `validation failed:\\n${formatZodError(validated.error, sourcePath)}`,\n sourcePath,\n );\n }\n\n const config: GradingConfig = {\n judge: { ...validated.data.judge },\n };\n\n if (sourcePath) {\n resolveGradingConfigPaths(config, sourcePath);\n }\n\n return config;\n}\n\n/** Detect unified suite.yaml by presence of suite-specific keys (vs standalone grading YAML). */\nfunction isSuiteRoot(raw: unknown): boolean {\n if (raw === null || typeof raw !== \"object\") return false;\n return \"cases\" in raw || (\"matrix\" in raw && \"adapter\" in raw);\n}\n\nasync function loadGradingFromSuiteYaml(suiteYamlPath: string): Promise<GradingConfig> {\n let content: string;\n try {\n content = await readFile(suiteYamlPath, \"utf8\");\n } catch (err) {\n throw new ConfigError(\n `failed to read suite file: ${err instanceof Error ? err.message : String(err)}`,\n suiteYamlPath,\n );\n }\n\n let raw: unknown;\n try {\n raw = parseYaml(content);\n } catch (err) {\n throw new ConfigError(\n `YAML parse error: ${err instanceof Error ? err.message : String(err)}`,\n suiteYamlPath,\n );\n }\n\n return parseGradingFromSuiteRaw(raw, suiteYamlPath);\n}\n\nfunction parseGradingFromSuiteRaw(\n raw: unknown,\n sourcePath: string,\n): GradingConfig {\n const single = SuiteFileSingleSchema.safeParse(raw);\n if (single.success) {\n if (!single.data.judge) {\n throw new ConfigError(\"suite file has no judge block\", sourcePath);\n }\n const config: GradingConfig = { judge: { ...single.data.judge } };\n resolveGradingConfigPaths(config, sourcePath);\n return config;\n }\n\n const directory = SuiteFileDirectorySchema.safeParse(raw);\n if (directory.success) {\n if (!directory.data.judge) {\n throw new ConfigError(\"suite file has no judge block\", sourcePath);\n }\n const config: GradingConfig = { judge: { ...directory.data.judge } };\n resolveGradingConfigPaths(config, sourcePath);\n return config;\n }\n\n const err = directory.error ?? single.error;\n throw new ConfigError(\n `validation failed:\\n${formatZodError(err, sourcePath)}`,\n sourcePath,\n );\n}\n\n/** Format a zod validation error with optional source file prefix. */\nfunction formatZodError(err: z.ZodError, sourcePath?: string): string {\n return err.issues\n .map((issue) => {\n const path = issue.path.length > 0 ? issue.path.join(\".\") : \"(root)\";\n const prefix = sourcePath ? `${sourcePath} → ${path}` : path;\n return ` ${prefix}: ${issue.message}`;\n })\n .join(\"\\n\");\n}\n","/**\n * Load a `TestSuite` from a YAML file, directory, or string.\n *\n * For unified suite.yaml with optional `judge:` and `pipeline:` blocks,\n * use {@link loadSuiteDocument}.\n */\n\nimport { resolve } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { z } from \"zod\";\n\nimport type { TestSuite } from \"../runner/types\";\nimport { parseCasesFile } from \"./loader-internals\";\nimport { resolveSuitePaths } from \"./paths\";\nimport { SuiteDirectorySchema, TestSuiteSchema } from \"./schema\";\nimport { loadSuiteDocument } from \"./suite-document-loader\";\nimport { ConfigError, transformSuite, transformSuiteDirectory } from \"./transform\";\n\nexport { ConfigError } from \"./transform\";\nexport {\n loadGradingConfig,\n parseGradingConfig,\n type GradingConfig,\n} from \"./grading-loader\";\nexport { loadSuiteDocument, type SuiteDocument } from \"./suite-document-loader\";\n\n/**\n * Load a suite from a file path or directory path (suite portion only).\n *\n * Orchestration blocks (`judge:`, `pipeline:`) are silently stripped — callers\n * that only need the `TestSuite` are not broken by malformed orchestration YAML.\n * Use {@link loadSuiteDocument} when you need validated orchestration metadata.\n */\nexport async function loadSuite(filePath: string): Promise<TestSuite> {\n const doc = await loadSuiteDocument(filePath, { validateOrchestration: false });\n return doc.suite;\n}\n\n/**\n * Parse suite YAML from a string (single-file layout with inline cases).\n *\n * Unknown top-level keys such as `judge` and `pipeline` are stripped.\n */\nexport function parseSuite(\n yamlContent: string,\n sourcePath?: string,\n): TestSuite {\n let raw: unknown;\n try {\n raw = parseYaml(yamlContent);\n } catch (err) {\n throw new ConfigError(\n `YAML parse error: ${err instanceof Error ? err.message : String(err)}`,\n sourcePath,\n );\n }\n\n const validated = TestSuiteSchema.safeParse(raw);\n if (!validated.success) {\n throw new ConfigError(\n `validation failed:\\n${formatZodError(validated.error, sourcePath)}`,\n sourcePath,\n );\n }\n\n const suite = transformSuite(validated.data);\n if (sourcePath) {\n resolveSuitePaths(suite, resolve(sourcePath));\n }\n return suite;\n}\n\n/** Parse `suite.yaml` for directory layout (cases may be omitted). @internal */\nexport function parseSuiteDirectory(\n yamlContent: string,\n sourcePath: string,\n): TestSuite {\n let raw: unknown;\n try {\n raw = parseYaml(yamlContent);\n } catch (err) {\n throw new ConfigError(\n `YAML parse error: ${err instanceof Error ? err.message : String(err)}`,\n sourcePath,\n );\n }\n\n const validated = SuiteDirectorySchema.safeParse(raw);\n if (!validated.success) {\n throw new ConfigError(\n `validation failed:\\n${formatZodError(validated.error, sourcePath)}`,\n sourcePath,\n );\n }\n\n return transformSuiteDirectory(validated.data);\n}\n\nexport { parseCasesFile } from \"./loader-internals\";\n\nfunction formatZodError(err: z.ZodError, sourcePath?: string): string {\n return err.issues\n .map((issue) => {\n const path = issue.path.length > 0 ? issue.path.join(\".\") : \"(root)\";\n const prefix = sourcePath ? `${sourcePath} → ${path}` : path;\n return ` ${prefix}: ${issue.message}`;\n })\n .join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;AAWA,MAAa,yBAAyB,EACnC,OAAO;CACN,QAAQ,EAAE,OAAO;CACjB,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC;CAC9B,WAAW,EAAE,OAAO;CACpB,gBAAgB,EAAE,KAAK;EACrB;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,EAA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,SAAS,KACrC,IAAI,MAAM;CAC/B,CAAC,CAAC,CACD,KAAK,IAAI;AACd"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as SuiteConfig } from "./types-
|
|
2
|
-
import { d as TestSuite, u as TestCase } from "./types-
|
|
1
|
+
import { s as SuiteConfig } from "./types-D0HR2WnP.js";
|
|
2
|
+
import { d as TestSuite, u as TestCase } from "./types-CLt4Yygc.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/config/transform.d.ts
|
|
@@ -104,4 +104,4 @@ declare function parseSuite(yamlContent: string, sourcePath?: string): TestSuite
|
|
|
104
104
|
declare function parseSuiteDirectory(yamlContent: string, sourcePath: string): TestSuite;
|
|
105
105
|
//#endregion
|
|
106
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-
|
|
107
|
+
//# sourceMappingURL=loader-CrmzNwkq.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as buildJudgeArgs } from "./claude-code-C_7hxC8z.js";
|
|
2
|
-
import { n as createLimit, t as runSuite, u as getAdapter } from "./suite-
|
|
3
|
-
import { s as buildJudgeArgs$
|
|
4
|
-
import { i as loadGradingConfig, l as ConfigError, o as loadSuiteDocument, s as DEFAULT_PIPELINE_OUTPUTS, t as loadSuite } from "./loader-
|
|
2
|
+
import { h as buildJudgeArgs$1, m as prepareGeminiCliEnv, n as createLimit, t as runSuite, u as getAdapter } from "./suite-C3-8EjUW.js";
|
|
3
|
+
import { s as buildJudgeArgs$2 } from "./codex-0cHO2te9.js";
|
|
4
|
+
import { i as loadGradingConfig, l as ConfigError, o as loadSuiteDocument, s as DEFAULT_PIPELINE_OUTPUTS, t as loadSuite } from "./loader-CiBm4Kf6.js";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
6
|
import { readFile, stat, writeFile } from "node:fs/promises";
|
|
7
7
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -102,6 +102,23 @@ function extractCodexResponseText(stdout) {
|
|
|
102
102
|
}
|
|
103
103
|
return trimmed;
|
|
104
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Extract judge response text from Gemini CLI `--output-format json` stdout.
|
|
107
|
+
*
|
|
108
|
+
* Parses `{ response, stats, error? }` and returns the `response` field when
|
|
109
|
+
* present. When stdout is empty, {@link spawnCollectStdout} may already have
|
|
110
|
+
* recovered the JSON payload from stderr before this runs.
|
|
111
|
+
*/
|
|
112
|
+
function extractGeminiCliResponseText(stdout) {
|
|
113
|
+
const trimmed = stdout.trim();
|
|
114
|
+
if (!trimmed) return "";
|
|
115
|
+
try {
|
|
116
|
+
const data = JSON.parse(trimmed);
|
|
117
|
+
if (typeof data.response === "string" && data.response.length > 0) return data.response;
|
|
118
|
+
if (data.error?.message) return data.error.message;
|
|
119
|
+
} catch {}
|
|
120
|
+
return trimmed;
|
|
121
|
+
}
|
|
105
122
|
/** Walk a stream-json event array and return the final assistant or result text. */
|
|
106
123
|
function extractFromEventArray(events) {
|
|
107
124
|
const result = events.find((e) => typeof e === "object" && e !== null && e.type === "result");
|
|
@@ -186,10 +203,10 @@ function normalizeGraderJson(raw) {
|
|
|
186
203
|
//#endregion
|
|
187
204
|
//#region src/grader/spawn-judge.ts
|
|
188
205
|
/**
|
|
189
|
-
* Shared subprocess utilities for judge graders (Claude
|
|
206
|
+
* Shared subprocess utilities for judge graders (Claude, Codex, Gemini CLI).
|
|
190
207
|
*
|
|
191
208
|
* Owns detached spawn, process-group teardown, and SIGTERM → SIGKILL
|
|
192
|
-
* escalation so
|
|
209
|
+
* escalation so all graders share one implementation.
|
|
193
210
|
*/
|
|
194
211
|
const KILL_GRACE_MS = 5e3;
|
|
195
212
|
/** Kill the detached process group (fallback to single process if group kill fails). */
|
|
@@ -235,25 +252,58 @@ function spawnCollectStdout(options) {
|
|
|
235
252
|
const stderrHint = stderrChunks.join("").trim().slice(0, 400);
|
|
236
253
|
reject(/* @__PURE__ */ new Error(`grader timed out after ${timeoutMs}ms` + (stderrHint ? ` (stderr: ${stderrHint})` : "")));
|
|
237
254
|
}, timeoutMs);
|
|
238
|
-
const finalize = (err) => {
|
|
255
|
+
const finalize = (err, output) => {
|
|
239
256
|
clearTimeout(timer);
|
|
240
257
|
if (killEscalation) clearTimeout(killEscalation);
|
|
241
258
|
if (err) reject(err);
|
|
242
|
-
else resolve(chunks.join(""));
|
|
259
|
+
else resolve(output ?? chunks.join(""));
|
|
243
260
|
};
|
|
244
261
|
child.on("error", (err) => finalize(err));
|
|
245
262
|
child.on("close", (code) => {
|
|
246
|
-
|
|
247
|
-
|
|
263
|
+
const stdout = chunks.join("");
|
|
264
|
+
const stderr = stderrChunks.join("");
|
|
265
|
+
if (stdout.length > 0) {
|
|
266
|
+
finalize(void 0, stdout);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
const stderrJson = extractJsonPayload(stderr);
|
|
270
|
+
if (stderrJson) {
|
|
271
|
+
finalize(void 0, stderrJson);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (code !== 0) {
|
|
275
|
+
finalize(/* @__PURE__ */ new Error(`grader exited ${code}: ${stderr.slice(0, 500)}`));
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
finalize(void 0, stdout);
|
|
248
279
|
});
|
|
249
280
|
});
|
|
250
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
* Return trailing JSON object from mixed stderr output.
|
|
284
|
+
*
|
|
285
|
+
* Gemini CLI judge runs sometimes print warnings before the JSON envelope;
|
|
286
|
+
* scan from the first `{` and validate with `JSON.parse`.
|
|
287
|
+
*/
|
|
288
|
+
function extractJsonPayload(text) {
|
|
289
|
+
const trimmed = text.trim();
|
|
290
|
+
if (!trimmed) return null;
|
|
291
|
+
const jsonStart = trimmed.indexOf("{");
|
|
292
|
+
if (jsonStart < 0) return null;
|
|
293
|
+
const candidate = trimmed.slice(jsonStart);
|
|
294
|
+
try {
|
|
295
|
+
JSON.parse(candidate);
|
|
296
|
+
return candidate;
|
|
297
|
+
} catch {
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
251
301
|
//#endregion
|
|
252
302
|
//#region src/grader/claude-grader.ts
|
|
253
303
|
/**
|
|
254
304
|
* Grade expectations by spawning Claude as judge (skill-creator grader pattern).
|
|
255
305
|
*/
|
|
256
|
-
const DEFAULT_TIMEOUT_MS$
|
|
306
|
+
const DEFAULT_TIMEOUT_MS$2 = 3e5;
|
|
257
307
|
/**
|
|
258
308
|
* Judge subprocess defaults — grading is a single-shot JSON response, not an agent session.
|
|
259
309
|
* Without these, Claude Code may load plugins/MCP and loop on tools until timeout.
|
|
@@ -282,7 +332,7 @@ function createClaudeGrader(options = {}) {
|
|
|
282
332
|
*/
|
|
283
333
|
async function runClaudeGrader(input, options = {}) {
|
|
284
334
|
const binary = options.binary ?? options.claudeCode?.binary ?? "claude";
|
|
285
|
-
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS$
|
|
335
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS$2;
|
|
286
336
|
const prompt = buildGraderPrompt(input);
|
|
287
337
|
const model = options.model ?? options.claudeCode?.model;
|
|
288
338
|
const responseText = extractClaudeResponseText(await spawnCollectStdout({
|
|
@@ -347,7 +397,7 @@ function buildChildEnv(extraEnv) {
|
|
|
347
397
|
/**
|
|
348
398
|
* Grade expectations by spawning Codex as judge.
|
|
349
399
|
*/
|
|
350
|
-
const DEFAULT_TIMEOUT_MS = 3e5;
|
|
400
|
+
const DEFAULT_TIMEOUT_MS$1 = 3e5;
|
|
351
401
|
/** Judge subprocess defaults — single-shot grading without persistent sessions. */
|
|
352
402
|
const JUDGE_CODEX_DEFAULTS = {
|
|
353
403
|
ephemeral: true,
|
|
@@ -372,12 +422,12 @@ function createCodexGrader(options = {}) {
|
|
|
372
422
|
*/
|
|
373
423
|
async function runCodexGrader(input, options = {}) {
|
|
374
424
|
const binary = options.binary ?? options.codex?.binary ?? "codex";
|
|
375
|
-
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
425
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS$1;
|
|
376
426
|
const prompt = buildGraderPrompt(input);
|
|
377
427
|
const model = options.model ?? options.codex?.model;
|
|
378
428
|
const responseText = extractCodexResponseText(await spawnCollectStdout({
|
|
379
429
|
binary,
|
|
380
|
-
args: buildJudgeArgs$
|
|
430
|
+
args: buildJudgeArgs$2(prompt, {
|
|
381
431
|
...mergeJudgeCodexOptions(options.codex),
|
|
382
432
|
model,
|
|
383
433
|
cwd: options.cwd
|
|
@@ -426,6 +476,99 @@ async function runCodexGrader(input, options = {}) {
|
|
|
426
476
|
};
|
|
427
477
|
}
|
|
428
478
|
//#endregion
|
|
479
|
+
//#region src/grader/gemini-cli-grader.ts
|
|
480
|
+
/**
|
|
481
|
+
* Grade expectations by spawning Gemini CLI as judge.
|
|
482
|
+
*/
|
|
483
|
+
const DEFAULT_TIMEOUT_MS = 3e5;
|
|
484
|
+
/** Judge subprocess defaults — single-shot grading without interactive approval. */
|
|
485
|
+
const JUDGE_GEMINI_CLI_DEFAULTS = {
|
|
486
|
+
approvalMode: "yolo",
|
|
487
|
+
/** Avoid loading user MCP servers, skills, and extensions for lightweight grading. */
|
|
488
|
+
isolateConfig: true
|
|
489
|
+
};
|
|
490
|
+
/** Merge user-supplied Gemini CLI options over judge-safe defaults. */
|
|
491
|
+
function mergeJudgeGeminiCliOptions(geminiCli) {
|
|
492
|
+
return {
|
|
493
|
+
...JUDGE_GEMINI_CLI_DEFAULTS,
|
|
494
|
+
...geminiCli
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
/** Factory returning a {@link GraderFn} bound to subprocess options. */
|
|
498
|
+
function createGeminiCliGrader(options = {}) {
|
|
499
|
+
return (input) => runGeminiCliGrader(input, options);
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Spawn Gemini CLI as judge, parse JSON response, align with input expectations.
|
|
503
|
+
*
|
|
504
|
+
* Uses {@link prepareGeminiCliEnv} for config isolation and {@link spawnCollectStdout}
|
|
505
|
+
* which may recover JSON from stderr when stdout is empty. Unparseable output fails
|
|
506
|
+
* all expectations and sets {@link GraderOutput.error}.
|
|
507
|
+
*/
|
|
508
|
+
async function runGeminiCliGrader(input, options = {}) {
|
|
509
|
+
const binary = options.binary ?? options.geminiCli?.binary ?? "gemini";
|
|
510
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
511
|
+
const prompt = buildGraderPrompt(input);
|
|
512
|
+
const model = options.model ?? options.geminiCli?.model;
|
|
513
|
+
const geminiCli = mergeJudgeGeminiCliOptions(options.geminiCli);
|
|
514
|
+
const args = buildJudgeArgs$1(prompt, {
|
|
515
|
+
...geminiCli,
|
|
516
|
+
model
|
|
517
|
+
});
|
|
518
|
+
const { env, cleanup } = await prepareGeminiCliEnv({
|
|
519
|
+
isolateConfig: geminiCli.isolateConfig,
|
|
520
|
+
env: options.env
|
|
521
|
+
});
|
|
522
|
+
let stdout;
|
|
523
|
+
try {
|
|
524
|
+
stdout = await spawnCollectStdout({
|
|
525
|
+
binary,
|
|
526
|
+
args,
|
|
527
|
+
timeoutMs,
|
|
528
|
+
env,
|
|
529
|
+
cwd: options.cwd
|
|
530
|
+
});
|
|
531
|
+
} finally {
|
|
532
|
+
await cleanup();
|
|
533
|
+
}
|
|
534
|
+
const responseText = extractGeminiCliResponseText(stdout);
|
|
535
|
+
const parsed = parseGraderJson(responseText);
|
|
536
|
+
if (!parsed) return {
|
|
537
|
+
expectations: input.expectations.map((text) => ({
|
|
538
|
+
text,
|
|
539
|
+
passed: false,
|
|
540
|
+
evidence: "Grader returned unparseable output"
|
|
541
|
+
})),
|
|
542
|
+
summary: {
|
|
543
|
+
passed: 0,
|
|
544
|
+
failed: input.expectations.length,
|
|
545
|
+
total: input.expectations.length,
|
|
546
|
+
passRate: 0
|
|
547
|
+
},
|
|
548
|
+
error: `failed to parse grader JSON from response: ${responseText.slice(0, 200)}`
|
|
549
|
+
};
|
|
550
|
+
const expectations = input.expectations.map((text, i) => {
|
|
551
|
+
const graded = parsed.expectations[i];
|
|
552
|
+
return {
|
|
553
|
+
text,
|
|
554
|
+
passed: graded?.passed ?? false,
|
|
555
|
+
evidence: graded?.evidence ?? "No evidence returned"
|
|
556
|
+
};
|
|
557
|
+
});
|
|
558
|
+
const passed = expectations.filter((e) => e.passed).length;
|
|
559
|
+
const total = expectations.length;
|
|
560
|
+
return {
|
|
561
|
+
expectations,
|
|
562
|
+
summary: {
|
|
563
|
+
passed,
|
|
564
|
+
failed: total - passed,
|
|
565
|
+
total,
|
|
566
|
+
passRate: total === 0 ? 0 : passed / total
|
|
567
|
+
},
|
|
568
|
+
evalFeedback: parsed.evalFeedback
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
//#endregion
|
|
429
572
|
//#region src/grader/expectations.ts
|
|
430
573
|
/**
|
|
431
574
|
* Load expectations sidecar (YAML or JSON).
|
|
@@ -545,6 +688,13 @@ async function gradeReport(report, options = {}) {
|
|
|
545
688
|
env: options.env,
|
|
546
689
|
cwd: options.cwd,
|
|
547
690
|
codex: options.codex
|
|
691
|
+
}) : options.judgeAdapter === "gemini-cli" ? createGeminiCliGrader({
|
|
692
|
+
binary: options.binary,
|
|
693
|
+
model: options.model,
|
|
694
|
+
timeoutMs: options.timeoutMs,
|
|
695
|
+
env: options.env,
|
|
696
|
+
cwd: options.cwd,
|
|
697
|
+
geminiCli: options.geminiCli
|
|
548
698
|
}) : createClaudeGrader({
|
|
549
699
|
binary: options.binary,
|
|
550
700
|
model: options.model,
|
|
@@ -685,7 +835,8 @@ function resolveGradeOptions(fileConfig, cli = {}, configPath) {
|
|
|
685
835
|
const adapter = judge?.adapter ?? "claude-code";
|
|
686
836
|
const claudeCode = judge?.claudeCode ?? {};
|
|
687
837
|
const codex = judge?.codex ?? {};
|
|
688
|
-
const
|
|
838
|
+
const geminiCli = judge?.geminiCli ?? {};
|
|
839
|
+
const adapterBlock = adapter === "codex" ? codex : adapter === "gemini-cli" ? geminiCli : claudeCode;
|
|
689
840
|
const binary = cli.binary ?? adapterBlock.binary;
|
|
690
841
|
const model = cli.model ?? judge?.model ?? adapterBlock.model;
|
|
691
842
|
if (adapter === "codex") return {
|
|
@@ -706,7 +857,25 @@ function resolveGradeOptions(fileConfig, cli = {}, configPath) {
|
|
|
706
857
|
},
|
|
707
858
|
gradingConfigPath: configPath
|
|
708
859
|
};
|
|
709
|
-
if (adapter
|
|
860
|
+
if (adapter === "gemini-cli") return {
|
|
861
|
+
sourceReport: cli.sourceReport,
|
|
862
|
+
expectationsPath: cli.expectationsPath,
|
|
863
|
+
model,
|
|
864
|
+
binary,
|
|
865
|
+
timeoutMs: cli.timeoutMs ?? judge?.timeoutMs,
|
|
866
|
+
maxConcurrent: cli.maxConcurrent ?? judge?.maxConcurrent,
|
|
867
|
+
systemInstruction: judge?.system_instruction,
|
|
868
|
+
env: judge?.env,
|
|
869
|
+
cwd: judge?.cwd,
|
|
870
|
+
judgeAdapter: "gemini-cli",
|
|
871
|
+
geminiCli: {
|
|
872
|
+
...geminiCli,
|
|
873
|
+
binary: void 0,
|
|
874
|
+
model: void 0
|
|
875
|
+
},
|
|
876
|
+
gradingConfigPath: configPath
|
|
877
|
+
};
|
|
878
|
+
if (adapter !== "claude-code") throw new Error(`unsupported grading adapter "${adapter}" (supported: claude-code, codex, gemini-cli)`);
|
|
710
879
|
return {
|
|
711
880
|
sourceReport: cli.sourceReport,
|
|
712
881
|
expectationsPath: cli.expectationsPath,
|
|
@@ -2213,4 +2382,4 @@ function formatReport(report, options) {
|
|
|
2213
2382
|
//#endregion
|
|
2214
2383
|
export { serializeToolInput as A, TRAJECTORY_SCHEMA_VERSION as B, trajectoryExactMatch as C, trajectorySingleToolUse as D, trajectoryRecall as E, loadSuiteReport as F, trajectoryToTranscript as I, createCodexGrader as L, gradingReportPassed as M, resolveGradeOptions as N, toEvaluationInstance as O, gradeReport as P, createClaudeGrader as R, trajectoryAnyOrderMatch as S, trajectoryPrecision as T, buildEvalRunEnvelopeFromFiles as _, envelopeCommand as a, computeTrajectoryMetrics as b, getOptionInt as c, resolveGradingArtifactFromSuite as d, resolvePipelineInputs as f, buildEvalRunEnvelope as g, toTrajectory as h, runPipeline as i, formatGradingConsole as j, toTrajectoryInstances as k, hasOption as l, toInstancesJsonl as m, emitOtel as n, parseEnvelopeProjection as o, suiteDirectoryFromPath as p, trajectoryToOtlp as r, getOption as s, formatReport as t, parseArgs as u, enrichRepetitionWithProtojson as v, trajectoryInOrderMatch as w, parseToolInput as x, toHarnessMetrics as y, EVAL_RUN_SCHEMA_VERSION as z };
|
|
2215
2384
|
|
|
2216
|
-
//# sourceMappingURL=reporter-
|
|
2385
|
+
//# sourceMappingURL=reporter-BKCJZRYr.js.map
|