{"record":{"id":"61a46e9ff36476a9","repo":"ruvnet/ruflo","slug":"pod-template-at-path-field-key-must-be-a","errorCode":null,"errorMessage":"pod-template at ${path}: field \"${key}\" must be a non-empty string","messagePattern":"pod-template at (.+?): field \"(.+?)\" must be a non-empty string","errorType":"validation","errorClass":"PodTemplateValidationError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/business-pods/pod-schema.ts","lineNumber":96,"sourceCode":" * callers can render a precise message.\n */\nexport class PodTemplateValidationError extends Error {\n  constructor(message: string, public path: string) {\n    super(`pod-template at ${path}: ${message}`);\n    this.name = 'PodTemplateValidationError';\n  }\n}\n\nconst PII_POLICIES: PiiPolicy[] = ['soc2', 'gdpr', 'hipaa', 'permissive'];\n\nfunction isObject(v: unknown): v is Record<string, unknown> {\n  return typeof v === 'object' && v !== null && !Array.isArray(v);\n}\n\nfunction requireString(parent: Record<string, unknown>, key: string, path: string): string {\n  const v = parent[key];\n  if (typeof v !== 'string' || v.length === 0) {\n    throw new PodTemplateValidationError(`field \"${key}\" must be a non-empty string`, path);\n  }\n  return v;\n}\n\nfunction requireNumber(parent: Record<string, unknown>, key: string, path: string): number {\n  const v = parent[key];\n  if (typeof v !== 'number' || !Number.isFinite(v)) {\n    throw new PodTemplateValidationError(`field \"${key}\" must be a finite number`, path);\n  }\n  return v;\n}\n\nfunction requireBoolean(parent: Record<string, unknown>, key: string, path: string): boolean {\n  const v = parent[key];\n  if (typeof v !== 'boolean') {\n    throw new PodTemplateValidationError(`field \"${key}\" must be a boolean`, path);\n  }\n  return v;","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/business-pods/pod-schema.ts#L78-L114","documentation":"Thrown by the requireString() helper inside the pod-template schema validator. Fires when a required string field is missing (undefined), not the string type, or an empty string. The error carries the field name (key) and the JSON-pointer path so the caller can render a precise location. Used for top-level fields (name, displayName, roomId) and nested object fields (agent.role, bench.name, etc.).","triggerScenarios":"validatePodTemplate() encounters a field that requireString() is asked to read (name, displayName, roomId, piiPolicy, cronSchedule, agent.role, agent.agentType, agent.description, bench.name, bench.description) and that field is absent, non-string, or empty.","commonSituations":"A typo in the JSON key (e.g., \"displayname\" instead of \"displayName\" leaves displayName undefined); an empty string value; a value accidentally written as a number (roomId: 123); a truncated/copy-paste template missing a field.","solutions":["Read the error's path and field name — they tell you exactly which JSON key to fix","Cross-check against the PodTemplate interface in pod-schema.ts for the full list of required string fields","Use the business_pod_validate MCP tool to validate before deploying a pod template"],"exampleFix":"// before:\n{ \"name\": \"sales\", \"displayname\": \"Sales Pod\", ... } // typo: displayname\n// throws: pod-template at /: field \"displayName\" must be a non-empty string\n\n// after:\n{ \"name\": \"sales\", \"displayName\": \"Sales Pod\", ... }","handlingStrategy":"validation","validationCode":"import { validatePodTemplate, PodTemplateValidationError } from '@claude-flow/cli/business-pods/pod-schema';\n\ntry {\n  const pod = validatePodTemplate(parsedJson);\n  // pod is now a typed PodTemplate\n} catch (e) {\n  if (e instanceof PodTemplateValidationError) {\n    console.error(`Invalid pod template 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    // e.path is the JSON pointer; e.message names the field\n    console.error(`Validation failed: ${e.message}`);\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Run validatePodTemplate() on every pod template file during CI, before deployment","Use the business_pod_validate MCP tool for interactive validation","Cross-check field names against the PodTemplate interface to avoid typos"],"tags":["validation","pod-template","schema","strings"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}