ruvnet/ruflo · error · PodTemplateValidationError

pod-template at ${path}: field "${key}" must be a finite num

Error message

pod-template at ${path}: field "${key}" must be a finite number

What it means

Thrown by the requireNumber() helper inside the pod-template schema validator. Fires when a required numeric field is missing, not the number type, or is NaN/±Infinity. Used for budgetUsdMonthly, budgetUsdPerRun, bench.scheduleHours, auditReadView.retentionDays, and the optional reservationExpiryMs.

Source

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

const PII_POLICIES: PiiPolicy[] = ['soc2', 'gdpr', 'hipaa', 'permissive'];

function isObject(v: unknown): v is Record<string, unknown> {
  return typeof v === 'object' && v !== null && !Array.isArray(v);
}

function requireString(parent: Record<string, unknown>, key: string, path: string): string {
  const v = parent[key];
  if (typeof v !== 'string' || v.length === 0) {
    throw new PodTemplateValidationError(`field "${key}" must be a non-empty string`, path);
  }
  return v;
}

function requireNumber(parent: Record<string, unknown>, key: string, path: string): number {
  const v = parent[key];
  if (typeof v !== 'number' || !Number.isFinite(v)) {
    throw new PodTemplateValidationError(`field "${key}" must be a finite number`, path);
  }
  return v;
}

function requireBoolean(parent: Record<string, unknown>, key: string, path: string): boolean {
  const v = parent[key];
  if (typeof v !== 'boolean') {
    throw new PodTemplateValidationError(`field "${key}" must be a boolean`, path);
  }
  return v;
}

function requireArray<T>(parent: Record<string, unknown>, key: string, path: string,
                          itemValidator: (item: unknown, ipath: string) => T): T[] {
  const v = parent[key];
  if (!Array.isArray(v)) {
    throw new PodTemplateValidationError(`field "${key}" must be an array`, path);
  }

View on GitHub (pinned to 6b01dc5a68)

Solutions

  1. Read the error path and field name to identify which numeric field is malformed
  2. Ensure numeric fields are written as bare JSON numbers, not quoted strings
  3. Run validatePodTemplate() during CI on every pod template file

Example fix

// before:
{ "budgetUsdMonthly": "50", ... } // string, throws

// after:
{ "budgetUsdMonthly": 50, ... } // bare number
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(`Field type 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); // names the field and its expected type
    process.exit(1);
  }
  throw e;
}

Prevention

When it happens

Trigger: validatePodTemplate() encounters a field that requireNumber() reads and the value is undefined, a string (e.g., "50" from un-coerced YAML/JSON), a boolean, NaN, or Infinity.

Common situations: Budget written as a quoted string in JSON/YAML ("budgetUsdMonthly": "50"); a missing numeric field; a value computed from bad arithmetic producing NaN; a config that uses null as a placeholder.

Related errors


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