{"record":{"id":"bc6873608c2f4378","repo":"ruvnet/ruflo","slug":"pod-template-at-path-bench-must-be-an-object","errorCode":null,"errorMessage":"pod-template at ${path}: bench must be an object","messagePattern":"pod-template at (.+?): bench must be an object","errorType":"validation","errorClass":"PodTemplateValidationError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/business-pods/pod-schema.ts","lineNumber":137,"sourceCode":"  const v = parent[key];\n  if (!Array.isArray(v)) {\n    throw new PodTemplateValidationError(`field \"${key}\" must be an array`, path);\n  }\n  return v.map((item, idx) => itemValidator(item, `${path}/${key}[${idx}]`));\n}\n\nfunction validatePodAgent(item: unknown, path: string): PodAgent {\n  if (!isObject(item)) throw new PodTemplateValidationError('agent must be an object', path);\n  return {\n    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","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/business-pods/pod-schema.ts#L119-L155","documentation":"Thrown by validatePodBench() when the top-level bench field is not a plain object (null, array, string, number, undefined). The bench object must contain name, description, successCriteria, and scheduleHours. isObject() excludes null and arrays.","triggerScenarios":"validatePodTemplate() reads json.bench and passes it to validatePodBench(); the value is null, an array, a string, or undefined (missing).","commonSituations":"The bench field was omitted from the template entirely; bench was set to a string description instead of a structured object; a malformed template from an external source.","solutions":["Read the error path (/bench) confirming the field is missing or malformed","Provide a full bench object: { \"name\": \"...\", \"description\": \"...\", \"successCriteria\": [...], \"scheduleHours\": N }","Copy the bench block from a known-good reference template (e.g., the sales pod)"],"exampleFix":"// before:\n\"bench\": \"weekly revenue check\" // string, throws\n\n// after:\n\"bench\": {\n  \"name\": \"sales-bench\",\n  \"description\": \"Weekly pipeline revenue check\",\n  \"successCriteria\": [\"Pipeline value increased\"],\n  \"scheduleHours\": 168\n}","handlingStrategy":"validation","validationCode":"import { validatePodTemplate, PodTemplateValidationError } from '@claude-flow/cli/business-pods/pod-schema';\n\ntry {\n  const pod = validatePodTemplate(parsedJson);\n} catch (e) {\n  if (e instanceof PodTemplateValidationError) {\n    console.error(`Bench error at ${e.path}: ${e.message}`);\n  }\n}","typeGuard":null,"tryCatchPattern":"import { validatePodTemplate, PodTemplateValidationError } from '@claude-flow/cli/business-pods/pod-schema';\n\ntry {\n  const pod = validatePodTemplate(raw);\n} catch (e) {\n  if (e instanceof PodTemplateValidationError) {\n    console.error(e.message); // path is /bench\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Always include a structured bench object in pod templates — never omit it or use a bare string","Copy the bench block from a known-good reference template as a starting point","Validate templates with validatePodTemplate() in CI"],"tags":["validation","pod-template","schema","bench"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}