{"record":{"id":"5351dc72ac7387bb","repo":"ruvnet/ruflo","slug":"pod-template-at-path-auditreadview-must-be-an","errorCode":null,"errorMessage":"pod-template at ${path}: auditReadView must be an object","messagePattern":"pod-template at (.+?): auditReadView must be an object","errorType":"validation","errorClass":"PodTemplateValidationError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/business-pods/pod-schema.ts","lineNumber":158,"sourceCode":"  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  }\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*/,\\-]+$/;","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/business-pods/pod-schema.ts#L140-L176","documentation":"Thrown by validateAuditReadView() when the top-level auditReadView field is not a plain object (null, array, string, number, undefined). The auditReadView object must contain includedEventTypes and retentionDays, defining which event types are surfaced to the business-owner read view and for how long.","triggerScenarios":"validatePodTemplate() reads json.auditReadView and passes it to validateAuditReadView(); the value is missing (undefined), null, an array, or a primitive.","commonSituations":"The auditReadView field was omitted from the template; it was set to a string description; a minimal template skipped the compliance section.","solutions":["Read the error path (/auditReadView) confirming the field is missing or malformed","Provide a full object: { \"includedEventTypes\": [...], \"retentionDays\": N }","Copy the auditReadView block from a known-good reference template"],"exampleFix":"// before (field omitted entirely)\n// { \"name\": \"sales\", ... } // no auditReadView key -> undefined, throws\n\n// after:\n\"auditReadView\": {\n  \"includedEventTypes\": [\"reservation.committed\", \"reservation.budget_exceeded\"],\n  \"retentionDays\": 90\n}","handlingStrategy":"validation","validationCode":"import { validatePodTemplate, PodTemplateValidationError } from '@claude-flow/cli/business-pods/pod-schema';\n\ntry {\n  const pod = validatePodTemplate(parsedJson);\n} catch (e) {\n  if (e instanceof PodTemplateValidationError) {\n    console.error(`auditReadView error 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    console.error(e.message); // path is /auditReadView\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Always include a structured auditReadView object with includedEventTypes and retentionDays","Copy the auditReadView block from a known-good reference template","Validate templates with validatePodTemplate() in CI"],"tags":["validation","pod-template","schema","audit"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}