{"record":{"id":"200a81d97ccf8c14","repo":"ruvnet/ruflo","slug":"bench-schedulehours-must-be-1","errorCode":null,"errorMessage":"bench.scheduleHours must be ≥1","messagePattern":"bench\\.scheduleHours must be ≥1","errorType":"validation","errorClass":"PodTemplateValidationError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/business-pods/pod-schema.ts","lineNumber":151,"sourceCode":"  };\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  });\n  const retentionDays = requireNumber(item, 'retentionDays', path);\n  if (retentionDays < 1) {\n    throw new PodTemplateValidationError('auditReadView.retentionDays must be ≥1', path);\n  }","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/business-pods/pod-schema.ts#L133-L169","documentation":"Thrown by validatePodBench() in the business-pod template schema. After requireNumber() confirms bench.scheduleHours is a number, the value must be at least 1 — the bench (automated evaluation) must be scheduled at a minimum cadence of once per hour. PodTemplateValidationError carries the JSON-pointer path (e.g. /bench/scheduleHours) so you can locate the offending field.","triggerScenarios":"A pod template JSON passed to validatePodTemplate(), the business_pod_validate MCP tool, or pod-tick.mjs pre-flight where bench.scheduleHours is 0, negative, or a fraction below 1 (e.g. 0.5). requireNumber would already have rejected non-numbers with a different message, so this error means the value is numeric but < 1.","commonSituations":"Authors expressing cadence in minutes (scheduleHours: 30 for 'every 30 minutes'), porting configs where 0 meant 'disabled', or using 0.5 intending twice-per-hour. Sub-hour cadence belongs in cronSchedule, not scheduleHours.","solutions":["Set bench.scheduleHours to an integer >= 1 (e.g. 24 for daily bench runs)","If you need sub-hour bench scheduling, encode it in the top-level cronSchedule field instead","Re-validate with the business_pod_validate MCP tool and confirm the error path moves past /bench/scheduleHours"],"exampleFix":"// before\n\"bench\": { \"name\": \"weekly-review\", \"description\": \"...\", \"successCriteria\": [\"...\"], \"scheduleHours\": 0 }\n// after\n\"bench\": { \"name\": \"weekly-review\", \"description\": \"...\", \"successCriteria\": [\"...\"], \"scheduleHours\": 168 }","handlingStrategy":"try-catch","validationCode":"const t = JSON.parse(raw);\nif (typeof t?.bench?.scheduleHours !== 'number' || t.bench.scheduleHours < 1) {\n  throw new Error('fix bench.scheduleHours before validating');\n}","typeGuard":"function hasValidScheduleHours(t: unknown): boolean {\n  const b = (t as { bench?: { scheduleHours?: unknown } })?.bench;\n  return typeof b?.scheduleHours === 'number' && (b.scheduleHours as number) >= 1;\n}","tryCatchPattern":"import { validatePodTemplate, PodTemplateValidationError } from './pod-schema.js';\ntry {\n  const pod = validatePodTemplate(json);\n} catch (err) {\n  if (err instanceof PodTemplateValidationError && /scheduleHours/.test(err.message)) {\n    // err.path points at /bench/scheduleHours — surface to the template author\n  }\n  throw err;\n}","preventionTips":["Author templates in TypeScript with the PodTemplate type so the compiler catches bad cadence values","Add a CI schema check that runs validatePodTemplate on every template file","Keep a worked example template as the starting point for new pods"],"tags":["schema-validation","business-pods","pod-template","configuration"],"backgroundTag":"schema-validation-failed","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}