Spot the bug in the eval aggregator

from LLM application evals
Node 24 advanced 5 min 3 issues to find

Find the evaluation errors in this generated aggregator.

JavaScript
function summarize(rows) {
  const scored = rows.filter((row) => row.score);
  const average = scored.reduce(
    (sum, row) => sum + row.score,
    0,
  ) / scored.length;

  const failures = rows.filter((row) => row.error).length;
  return {
    average,
    failures,
    release: average >= 0.8,
  };
}
Open in playground
Report an error