ruvnet/ruflo · error · PodTemplateValidationError

pod-template at ${path}: bench.successCriteria must have ≥1

Error message

pod-template at ${path}: bench.successCriteria must have ≥1 entry

What it means

Thrown inside validatePodBench() after all successCriteria entries pass the non-empty-string check. Fires when the array exists and all entries are valid strings, but the array has zero elements. A bench must define at least one acceptance criterion to be meaningful.

Source

Thrown at v3/@claude-flow/cli/src/business-pods/pod-schema.ts:147

    role: requireString(item, 'role', path),
    agentType: requireString(item, 'agentType', path),
    description: requireString(item, 'description', path),
    preferLocal: requireBoolean(item, 'preferLocal', path),
  };
}

function validatePodBench(item: unknown, path: string): PodBench {
  if (!isObject(item)) throw new PodTemplateValidationError('bench must be an object', path);
  const name = requireString(item, 'name', path);
  const description = requireString(item, 'description', path);
  const successCriteria = requireArray(item, 'successCriteria', path, (s, sp) => {
    if (typeof s !== 'string' || s.length === 0) {
      throw new PodTemplateValidationError('successCriteria entries must be non-empty strings', sp);
    }
    return s;
  });
  if (successCriteria.length === 0) {
    throw new PodTemplateValidationError('bench.successCriteria must have ≥1 entry', path);
  }
  const scheduleHours = requireNumber(item, 'scheduleHours', path);
  if (scheduleHours < 1) {
    throw new PodTemplateValidationError('bench.scheduleHours must be ≥1', path);
  }
  return { name, description, successCriteria, scheduleHours };
}

function validateAuditReadView(item: unknown, path: string): PodAuditReadView {
  if (!isObject(item)) {
    throw new PodTemplateValidationError('auditReadView must be an object', path);
  }
  const includedEventTypes = requireArray(item, 'includedEventTypes', path, (s, sp) => {
    if (typeof s !== 'string' || s.length === 0) {
      throw new PodTemplateValidationError('includedEventTypes entries must be non-empty strings', sp);
    }
    return s;
  });

View on GitHub (pinned to 6b01dc5a68)

Solutions

  1. Add at least one non-empty acceptance criterion string to bench.successCriteria
  2. Model the criteria on a reference template's bench block

Example fix

// before:
"successCriteria": [] // empty array, throws

// after:
"successCriteria": ["Pipeline value increased week-over-week"]
Defensive patterns

Strategy: validation

Validate before calling

import { validatePodTemplate, PodTemplateValidationError } from '@claude-flow/cli/business-pods/pod-schema';

try {
  const pod = validatePodTemplate(parsedJson);
} catch (e) {
  if (e instanceof PodTemplateValidationError) {
    console.error(`successCriteria length error at ${e.path}: ${e.message}`);
  }
}

Try / catch

import { validatePodTemplate, PodTemplateValidationError } from '@claude-flow/cli/business-pods/pod-schema';

try {
  const pod = validatePodTemplate(raw);
} catch (e) {
  if (e instanceof PodTemplateValidationError) {
    console.error(e.message);
    process.exit(1);
  }
  throw e;
}

Prevention

When it happens

Trigger: validatePodBench() validates successCriteria as an array of non-empty strings (passes), then checks successCriteria.length === 0 and throws.

Common situations: A template created with an empty successCriteria placeholder ("successCriteria": []); a programmatic generator that produced no criteria.

Related errors


AI-assisted analysis of ruvnet/ruflo@6b01dc5a68 (2026-08-12). Data as JSON: /api/errors/75f0b540dac0cae1. Report an issue: GitHub.