earendil-works/pi · error · TypeError

Harness names must be unique within an eval set.

Error message

Harness names must be unique within an eval set.

What it means

Error "Harness names must be unique within an eval set." thrown in earendil-works/pi.

Source

Thrown at packages/evals/src/vitest-evals/harness-table.ts:124

	if (canonicalInput === undefined) throw new TypeError("Eval input must be JSON-serializable.");
	return createHash("sha256").update(canonicalInput).digest("hex");
}

export function deriveEvalGroupKey(input: unknown, repetition: number): string {
	return JSON.stringify([deriveInputKey(input), repetition]);
}

function validateOptions<TInput, TOutput extends JsonValue | undefined>(
	evalSet: string,
	baseline: Harness<TInput, TOutput>,
	candidates: readonly Harness<TInput, TOutput>[],
	repetitions: number,
): void {
	if (!evalSet.trim()) throw new TypeError("evalSet must not be empty.");
	if (candidates.length === 0) throw new TypeError("At least one candidate harness is required.");
	const harnesses = [baseline, ...candidates];
	const names = new Set(harnesses.map((harness) => harness.name));
	if (names.size !== harnesses.length) throw new TypeError("Harness names must be unique within an eval set.");
	if (!Number.isSafeInteger(repetitions) || repetitions < 1) {
		throw new TypeError("repetitions must be a positive integer.");
	}
}

function withIterationArtifact<TInput, TOutput extends JsonValue | undefined>(
	harness: Harness<TInput, TOutput>,
	plan: EvalHarnessIterationPlan,
): Harness<TInput, TOutput> {
	return {
		name: harness.name,
		async run(input, context) {
			const groupKey = deriveEvalGroupKey(input, plan.repetition);
			const artifact: EvalHarnessIterationArtifact = { ...plan, groupKey };
			context.setArtifact(EVAL_HARNESS_ITERATION_ARTIFACT, artifact);
			const attachIterationArtifact = <TRun extends HarnessRun>(run: TRun): TRun => {
				run.artifacts = { ...context.artifacts, ...run.artifacts, [EVAL_HARNESS_ITERATION_ARTIFACT]: artifact };
				return run;

View on GitHub (pinned to 4af9d21d3b)

When it happens

Trigger: Thrown at packages/evals/src/vitest-evals/harness-table.ts:124 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/9b75b2a6f592f092. Report an issue: GitHub.