{"record":{"id":"05de8e7ad4b9371a","repo":"ruvnet/ruflo","slug":"pod-template-at-cronschedule-must-be-a-posix-cr","errorCode":null,"errorMessage":"pod-template at /: cronSchedule must be a POSIX cron expression (5 or 6 fields)","messagePattern":"pod-template at /: cronSchedule must be a POSIX cron expression \\(5 or 6 fields\\)","errorType":"validation","errorClass":"PodTemplateValidationError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/business-pods/pod-schema.ts","lineNumber":244,"sourceCode":"  }\n  const budgetUsdMonthly = requireNumber(json, 'budgetUsdMonthly', '/');\n  if (budgetUsdMonthly < 0) {\n    throw new PodTemplateValidationError('budgetUsdMonthly must be ≥0', '/');\n  }\n  const budgetUsdPerRun = requireNumber(json, 'budgetUsdPerRun', '/');\n  if (budgetUsdPerRun < 0) {\n    throw new PodTemplateValidationError('budgetUsdPerRun must be ≥0', '/');\n  }\n  if (budgetUsdMonthly > 0 && budgetUsdPerRun > budgetUsdMonthly) {\n    throw new PodTemplateValidationError(\n      'budgetUsdPerRun must not exceed budgetUsdMonthly',\n      '/',\n    );\n  }\n  const preferLocalExecution = requireBoolean(json, 'preferLocalExecution', '/');\n  const cronSchedule = requireString(json, 'cronSchedule', '/');\n  if (!CRON_RE.test(cronSchedule)) {\n    throw new PodTemplateValidationError(\n      'cronSchedule must be a POSIX cron expression (5 or 6 fields)',\n      '/',\n    );\n  }\n  const auditReadView = validateAuditReadView(json.auditReadView, '/auditReadView');\n\n  let reservationExpiryMs: number | undefined;\n  if (json.reservationExpiryMs !== undefined) {\n    const v = requireNumber(json, 'reservationExpiryMs', '/');\n    // ADR-164.1 §3.2 — bounded to [5_000, 300_000] ms.\n    if (v < 5_000 || v > 300_000) {\n      throw new PodTemplateValidationError(\n        'reservationExpiryMs must be within [5000, 300000] ms (ADR-164.1 §3.2)',\n        '/',\n      );\n    }\n    reservationExpiryMs = v;\n  }","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/business-pods/pod-schema.ts#L226-L262","documentation":"The top-level cronSchedule string must satisfy CRON_RE = /^([\\d*/,\\-]+\\s+){4,5}[\\d*/,\\-]+$/ — a POSIX cron expression of five or six space-separated fields containing only digits, *, /, -, and ,. The check is deliberately permissive on field semantics (real evaluation happens at schedule time); it only catches obviously malformed values. The 'pod-template at /:' prefix is the caller's path formatting, not part of the thrown message.","triggerScenarios":"cronSchedule set to '@daily' or '@hourly' (Vixie macros — rejected), named days/months like 'MON-FRI' or 'JAN', human text like 'every 6 hours', a 7-field expression (seconds + year), or an empty string. Six-field seconds-first expressions like '0 0 * * * *' do pass.","commonSituations":"Copying from crontab.guru or systemd timer syntax that uses macros/names; adding a seconds field AND a year field; quoting issues leaving a stray character in the string.","solutions":["Convert macros: '@daily' -> '0 0 * * *', '@hourly' -> '0 * * * *', '@weekly' -> '0 0 * * 0'","Replace named days/months with numbers: 'MON-FRI' -> '1-5', 'JAN' -> '1'","Verify locally: /^([\\d*/,\\-]+\\s+){4,5}[\\d*/,\\-]+$/.test(cronSchedule) before validating the template"],"exampleFix":"// before\n\"cronSchedule\": \"@daily\"\n// after\n\"cronSchedule\": \"0 0 * * *\"","handlingStrategy":"validation","validationCode":"const CRON_RE = /^([\\d*/,\\-]+\\s+){4,5}[\\d*/,\\-]+$/;\nif (!CRON_RE.test(json.cronSchedule)) {\n  json.cronSchedule = '0 * * * *'; // or convert '@daily' -> '0 0 * * *'\n}","typeGuard":"function isPosixCron(v: unknown): v is string {\n  return typeof v === 'string' && /^([\\d*/,\\-]+\\s+){4,5}[\\d*/,\\-]+$/.test(v);\n}","tryCatchPattern":"try { validatePodTemplate(json); } catch (err) {\n  if (err instanceof PodTemplateValidationError && /cronSchedule/.test(err.message)) {\n    // expand macros (@daily, @hourly) and named days (MON->1) into numeric fields\n  }\n}","preventionTips":["Expand @-macros and named weekdays/months to numeric POSIX fields before embedding","Test the regex locally in your editor — it accepts 5 or 6 numeric fields only"],"tags":["schema-validation","business-pods","cron","scheduling","configuration"],"backgroundTag":"invalid-cron-expression","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}