{"record":{"id":"b7bcb883db8a27eb","repo":"mastra-ai/mastra","slug":"no-scorers-provided","errorCode":"NO_SCORERS_PROVIDED","errorMessage":"At least one scorer or gate must be provided","messagePattern":"At least one scorer or gate must be provided","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/evals/run/index.ts","lineNumber":773,"sourceCode":"          hasAnyTurnAssertions = true;\n          // Validate per-turn threshold bounds upfront so errors surface before execution.\n          for (const entry of turn.scorers) {\n            if (isScorerWithThreshold(entry)) {\n              validateThresholdConfig(entry.threshold, entry.scorer.id);\n            }\n          }\n        }\n      }\n    }\n  }\n\n  // Validate scorers\n  if (Array.isArray(scorers)) {\n    // Gate-only runs are valid: a non-empty gates array satisfies the\n    // \"at least one scorer\" requirement even when scorers is empty.\n    // Per-turn gates/scorers also satisfy it.\n    if (scorers.length === 0 && !hasGates && !hasAnyTurnAssertions) {\n      throw new MastraError({\n        domain: 'SCORER',\n        id: 'NO_SCORERS_PROVIDED',\n        category: 'USER',\n        text: 'At least one scorer or gate must be provided',\n      });\n    }\n  } else if (isWorkflow(target) && isWorkflowScorerConfig(scorers)) {\n    const hasScorers =\n      (scorers.workflow && scorers.workflow.length > 0) ||\n      (scorers.steps && Object.keys(scorers.steps).length > 0) ||\n      (scorers.trajectory && scorers.trajectory.length > 0);\n\n    if (!hasScorers) {\n      throw new MastraError({\n        domain: 'SCORER',\n        id: 'NO_SCORERS_PROVIDED',\n        category: 'USER',\n        text: 'At least one workflow, step, or trajectory scorer must be provided',","sourceCodeStart":755,"sourceCodeEnd":791,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/evals/run/index.ts#L755-L791","documentation":"An eval run must have something to evaluate: when `scorers` is an array it must be non-empty, unless the run supplies gates (top-level `gates`) or per-turn assertions, which alone are valid. This error means runEvals was invoked with no scoring or gating criteria at all, so the run would have no observable outcome.","triggerScenarios":"Calling runEvals with `scorers: []` and no gates/per-turn assertions; passing an empty scorers array built dynamically after filtering by name; forgetting to load scorer registrations in a config-driven setup.","commonSituations":"Config files where all scorers were commented out or filtered out by an env flag; programmatically assembling scorer lists that end up empty; misunderstanding that gate-only runs are allowed but no-criteria runs are not.","solutions":["Pass at least one scorer, e.g. `scorers: [myScorer]`","Add gates (`gates: [...]`) or per-turn assertions if you intend a gate-only run","Check the code that builds the scorers array — log its length before runEvals and fail early if 0"],"exampleFix":"// before\nrunEvals({ target: agent, scorers: [], data });\n// after\nrunEvals({ target: agent, scorers: [answerRelevanceScorer], data });","handlingStrategy":"validation","validationCode":"if (Array.isArray(scorers) && scorers.length === 0 && !gates?.length && !hasTurnAssertions(data)) {\n  throw new Error('runEvals requires at least one scorer or gate');\n}","typeGuard":"function hasEvaluationCriteria(scorers: unknown[], gates?: unknown[]): boolean {\n  return scorers.length > 0 || (gates?.length ?? 0) > 0;\n}","tryCatchPattern":"try {\n  await runEvals({ target, scorers, data, gates });\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'NO_SCORERS_PROVIDED') {\n    console.error('No scorers/gates configured — check flag-gated scorer loading');\n  } else throw e;\n}","preventionTips":["Fail fast where the scorers array is built: assert length > 0","Remember gate-only runs are valid; don't add dummy scorers to bypass the check","Log the resolved scorer list in config-driven setups"],"tags":["evals","configuration","validation"],"backgroundTag":"missing-required-config","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}