{"record":{"id":"f8df5482c0b82f39","repo":"JuliusBrussee/caveman","slug":"recordoutcome-evidence-must-contain-at-most-max","errorCode":null,"errorMessage":"recordOutcome: evidence must contain at most ${MAX_EVIDENCE_REFS} references","messagePattern":"recordOutcome: evidence must contain at most (.+?) references","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/mastra/src/index.ts","lineNumber":671,"sourceCode":"    throw new Error(\"recordOutcome: evidence must be a plain object\");\n  }\n  const evidenceRefs = Object.entries(input.evidence).map(([key, value]) => {\n    if (!key.trim()) throw new Error(\"recordOutcome: evidence keys must be non-empty\");\n    if (typeof value !== \"string\" && typeof value !== \"number\" && typeof value !== \"boolean\") {\n      throw new Error(`recordOutcome: evidence.${key} must be a string, number, or boolean`);\n    }\n    if (typeof value === \"number\" && !Number.isFinite(value)) {\n      throw new Error(`recordOutcome: evidence.${key} must be a finite number`);\n    }\n    const ref = `${key}:${String(value)}`;\n    if (!ref.slice(key.length + 1)) throw new Error(`recordOutcome: evidence.${key} must be non-empty`);\n    return ref;\n  });\n  if (evidenceRefs.length === 0) {\n    throw new Error(\"recordOutcome: evidence must contain at least one reference\");\n  }\n  if (evidenceRefs.length > MAX_EVIDENCE_REFS) {\n    throw new Error(`recordOutcome: evidence must contain at most ${MAX_EVIDENCE_REFS} references`);\n  }\n\n  const confidence = input.confidence;\n  if (typeof confidence !== \"number\" || !Number.isFinite(confidence) || confidence < 0 || confidence > 1) {\n    throw new Error(\"recordOutcome: confidence is required and must be a number within [0,1]\");\n  }\n  if (typeof input.source !== \"string\" || !OUTCOME_SOURCES.has(input.source)) {\n    throw new Error(\"recordOutcome: source is required and must be one of ci|environment|database|business_event|human\");\n  }\n\n  const occurredAt = input.occurredAt === undefined ? new Date() : new Date(input.occurredAt);\n  if (Number.isNaN(occurredAt.getTime())) {\n    throw new Error(\"recordOutcome: occurredAt must be a valid date\");\n  }\n\n  const body = JSON.stringify({\n    correlation_kind: \"task\",\n    correlation_id: taskId,","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/packages/mastra/src/index.ts#L653-L689","documentation":"Validation guard in recordOutcome: after mapping the caller's evidence object to key:value reference strings, the count exceeded MAX_EVIDENCE_REFS. The evidence input is at fault — trim it to the maximum number of allowed references.","triggerScenarios":"Thrown at packages/mastra/src/index.ts:671 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the evidence object to at most MAX_EVIDENCE_REFS keys, keeping only the strongest references","Split the outcome into multiple recordOutcome calls if more references are genuinely needed","Check the MAX_EVIDENCE_REFS constant in packages/mastra/src/index.ts for the exact limit"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}