{"record":{"id":"597ae633051ccb45","repo":"ruvnet/ruflo","slug":"bench-successcriteria-must-have-1-entry","errorCode":null,"errorMessage":"bench.successCriteria must have ≥1 entry","messagePattern":"bench\\.successCriteria must have ≥1 entry","errorType":"validation","errorClass":"PodTemplateValidationError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/business-pods/pod-schema.ts","lineNumber":147,"sourceCode":"    role: requireString(item, 'role', path),\n    agentType: requireString(item, 'agentType', path),\n    description: requireString(item, 'description', path),\n    preferLocal: requireBoolean(item, 'preferLocal', path),\n  };\n}\n\nfunction validatePodBench(item: unknown, path: string): PodBench {\n  if (!isObject(item)) throw new PodTemplateValidationError('bench must be an object', path);\n  const name = requireString(item, 'name', path);\n  const description = requireString(item, 'description', path);\n  const successCriteria = requireArray(item, 'successCriteria', path, (s, sp) => {\n    if (typeof s !== 'string' || s.length === 0) {\n      throw new PodTemplateValidationError('successCriteria entries must be non-empty strings', sp);\n    }\n    return s;\n  });\n  if (successCriteria.length === 0) {\n    throw new PodTemplateValidationError('bench.successCriteria must have ≥1 entry', path);\n  }\n  const scheduleHours = requireNumber(item, 'scheduleHours', path);\n  if (scheduleHours < 1) {\n    throw new PodTemplateValidationError('bench.scheduleHours must be ≥1', path);\n  }\n  return { name, description, successCriteria, scheduleHours };\n}\n\nfunction validateAuditReadView(item: unknown, path: string): PodAuditReadView {\n  if (!isObject(item)) {\n    throw new PodTemplateValidationError('auditReadView must be an object', path);\n  }\n  const includedEventTypes = requireArray(item, 'includedEventTypes', path, (s, sp) => {\n    if (typeof s !== 'string' || s.length === 0) {\n      throw new PodTemplateValidationError('includedEventTypes entries must be non-empty strings', sp);\n    }\n    return s;\n  });","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/business-pods/pod-schema.ts#L129-L165","documentation":"Thrown by validatePodBench() when bench.successCriteria is a valid array but has zero entries. A bench must have at least one acceptance criterion — an empty criteria list would make Darwin /loop scoring vacuous, so the schema enforces ≥1.","triggerScenarios":"validatePodTemplate() with \"successCriteria\": [] (all other bench fields fine). The earlier requireArray check passes because [] is an array; only the length check catches it.","commonSituations":"Templates scaffolded with empty placeholder lists to 'fill in later'; programmatic generation that filters out all criteria for some pods; users assuming criteria are optional decoration.","solutions":["Add at least one concrete, measurable criterion string to bench.successCriteria","If the pod genuinely has no success definition yet, finish defining it before registering the template — the schema intentionally blocks criterion-less pods","Use the /bench/successCriteria path from the error to locate the list","Lint in CI so placeholder templates can't ship"],"exampleFix":"// before\n\"bench\": { \"name\": \"b\", \"description\": \"d\", \"successCriteria\": [], \"scheduleHours\": 24 }\n// after\n\"bench\": { \"name\": \"b\", \"description\": \"d\", \"successCriteria\": [\"≥1 closed deal per month\"], \"scheduleHours\": 24 }","handlingStrategy":"validation","validationCode":"const criteria = (template.bench as { successCriteria?: string[] }).successCriteria ?? [];\nif (criteria.length === 0) fail('bench.successCriteria needs at least one measurable criterion');","typeGuard":"function hasAtLeastOneCriterion(bench: unknown): boolean {\n  return typeof bench === 'object' && bench !== null &&\n    Array.isArray((bench as { successCriteria?: unknown[] }).successCriteria) &&\n    ((bench as { successCriteria: unknown[] }).successCriteria.length > 0);\n}","tryCatchPattern":"try {\n  validatePodTemplate(template);\n} catch (e) {\n  if (e instanceof PodTemplateValidationError && e.message.includes('must have ≥1 entry')) {\n    fail('A bench without acceptance criteria makes /loop scoring meaningless — add one');\n  } else throw e;\n}","preventionTips":["Forbid empty successCriteria in template generators — require at least one criterion at authoring time","Treat placeholder scaffolds ([]) as CI failures, not warnings","Pair each new pod with one concrete, measurable criterion from day one"],"tags":["pod","schema","validation","json","bench","empty-array"],"backgroundTag":"schema-validation-failed","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}