{"record":{"id":"f27a3a9766e96d32","repo":"ruvnet/ruflo","slug":"includedeventtypes-entries-must-be-non-empty-strin","errorCode":null,"errorMessage":"includedEventTypes entries must be non-empty strings","messagePattern":"includedEventTypes entries must be non-empty strings","errorType":"validation","errorClass":"PodTemplateValidationError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/business-pods/pod-schema.ts","lineNumber":162,"sourceCode":"    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  }\n  return { includedEventTypes, retentionDays };\n}\n\n// POSIX cron — five or six space-separated fields. Permissive on field\n// contents (digits, *, -, /, ,) — actual cron evaluation happens at schedule\n// time. We only catch obviously malformed values here.\nconst CRON_RE = /^([\\d*/,\\-]+\\s+){4,5}[\\d*/,\\-]+$/;\n\n/**\n * Validate `json` and return a typed `PodTemplate`. Throws\n * `PodTemplateValidationError` with a JSON-pointer-style path on failure.","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/business-pods/pod-schema.ts#L144-L180","documentation":"Thrown by the per-entry validator inside requireArray() for auditReadView.includedEventTypes. Every entry must be a string of length > 0; anything else — number, null, boolean, empty string — is rejected at the entry's own path (/auditReadView/includedEventTypes/<index>).","triggerScenarios":"A template with includedEventTypes containing numeric event codes (e.g. [1, 2]), null entries, or \"\" (e.g. from programmatic generation or a hand-edited file with an empty slot).","commonSituations":"Mapping numeric event IDs from another telemetry system into the pod template, or scripts that join a possibly-empty list into JSON leaving \"\" placeholders.","solutions":["Replace non-string entries with their string event-type names (e.g. 1 -> \"pod.started\")","Remove empty-string and null entries from the array","Add a lint/test step that asserts every includedEventTypes entry matches /^\\S+$/ before shipping the template"],"exampleFix":"// before\n\"includedEventTypes\": [\"pod.started\", 42, null]\n// after\n\"includedEventTypes\": [\"pod.started\", \"budget.exceeded\"]","handlingStrategy":"validation","validationCode":"const evts = av.includedEventTypes;\nconst ok = Array.isArray(evts) && evts.every(e => typeof e === 'string' && e.length > 0);\nif (!ok) throw new Error('includedEventTypes must be non-empty strings');","typeGuard":"function isNonEmptyStringArray(v: unknown): v is string[] {\n  return Array.isArray(v) && v.every(e => typeof e === 'string' && e.length > 0);\n}","tryCatchPattern":"try { validatePodTemplate(json); } catch (err) {\n  if (err instanceof PodTemplateValidationError && err.path.startsWith('/auditReadView/includedEventTypes/')) {\n    const idx = Number(err.path.split('/').pop()); // offending entry index\n  }\n}","preventionTips":["Filter generated lists: arr.filter((e): e is string => typeof e === 'string' && e.length > 0)","Map numeric event IDs to names at the boundary of your template pipeline"],"tags":["schema-validation","business-pods","audit","configuration"],"backgroundTag":"schema-validation-failed","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}