ruvnet/ruflo · error · PodTemplateValidationError
auditReadView must be an object
Error message
auditReadView must be an object
What it means
Thrown by validateAuditReadView() when json.auditReadView fails the isObject() check. The audit read-view (which event types an auditor can see and for how long) must be a plain JSON object with includedEventTypes and retentionDays — null, arrays, strings, and numbers are all rejected, and omission yields undefined which also fails isObject().
Source
Thrown at v3/@claude-flow/cli/src/business-pods/pod-schema.ts:158
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;
});
const retentionDays = requireNumber(item, 'retentionDays', path);
if (retentionDays < 1) {
throw new PodTemplateValidationError('auditReadView.retentionDays must be ≥1', path);
}
return { includedEventTypes, retentionDays };
}
// POSIX cron — five or six space-separated fields. Permissive on field
// contents (digits, *, -, /, ,) — actual cron evaluation happens at schedule
// time. We only catch obviously malformed values here.
const CRON_RE = /^([\d*/,\-]+\s+){4,5}[\d*/,\-]+$/;View on GitHub (pinned to fa13ee4ad6)
Solutions
- Provide auditReadView as an object: { "includedEventTypes": ["..."], "retentionDays": 90 }
- If you meant 'no audit view', note the schema does not allow omitting it — pick a minimal retention and event list
- Validate again via business_pod_validate to confirm the next field-level errors (if any) surface
Example fix
// before
"auditReadView": ["pod.started", "pod.completed"]
// after
"auditReadView": { "includedEventTypes": ["pod.started", "pod.completed"], "retentionDays": 90 } Defensive patterns
Strategy: validation
Validate before calling
const av = (JSON.parse(raw) as Record<string, unknown>).auditReadView;
const ok = typeof av === 'object' && av !== null && !Array.isArray(av);
if (!ok) throw new Error('auditReadView must be an object with includedEventTypes and retentionDays'); Type guard
function isAuditReadViewLike(v: unknown): v is { includedEventTypes: unknown; retentionDays: unknown } {
return typeof v === 'object' && v !== null && !Array.isArray(v)
&& 'includedEventTypes' in v && 'retentionDays' in v;
} Try / catch
try { validatePodTemplate(json); } catch (err) {
if (err instanceof PodTemplateValidationError && err.path === '/auditReadView') {
// rewrite auditReadView as { includedEventTypes: [...], retentionDays: N }
}
} Prevention
- Use the exported PodAuditReadView-equivalent shape as a TS type in template generators
- Never inline the event list directly under auditReadView
When it happens
Trigger: A pod template where auditReadView is missing entirely, set to null, an array (e.g. a bare list of event types), or a string like "all". Path reported is /auditReadView.
Common situations: Authors inlining the event-type list directly under auditReadView instead of nesting it under includedEventTypes, or scaffolding templates with a null placeholder that was never filled in.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- includedEventTypes entries must be non-empty strings
- auditReadView.retentionDays must be ≥1
- bench.scheduleHours must be ≥1
- roomId may only contain [A-Za-z0-9_.\-:/@#]
- agents must have ≥1 entry
AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18).
Data as JSON: /api/errors/6c6a60bd9542d202.
Report an issue: GitHub.