earendil-works/pi · error · TypeError
repetitions must be a positive integer.
Error message
repetitions must be a positive integer.
What it means
Error "repetitions must be a positive integer." thrown in earendil-works/pi.
Source
Thrown at packages/evals/src/vitest-evals/harness-table.ts:126
}
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;
};
try {View on GitHub (pinned to 4af9d21d3b)
When it happens
Trigger: Thrown at packages/evals/src/vitest-evals/harness-table.ts:126 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/00d7c501682970d4.
Report an issue: GitHub.