{"record":{"id":"68badd1490629452","repo":"ruvnet/ruflo","slug":"pod-template-at-path-budgetusdperrun-must-not","errorCode":null,"errorMessage":"pod-template at ${path}: budgetUsdPerRun must not exceed budgetUsdMonthly","messagePattern":"pod-template at (.+?): budgetUsdPerRun must not exceed budgetUsdMonthly","errorType":"validation","errorClass":"PodTemplateValidationError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/business-pods/pod-schema.ts","lineNumber":236,"sourceCode":"  }\n  const bench = validatePodBench(json.bench, '/bench');\n  const piiPolicy = requireString(json, 'piiPolicy', '/');\n  if (!PII_POLICIES.includes(piiPolicy as PiiPolicy)) {\n    throw new PodTemplateValidationError(\n      `piiPolicy must be one of: ${PII_POLICIES.join(', ')}`,\n      '/',\n    );\n  }\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.","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/business-pods/pod-schema.ts#L218-L254","documentation":"Thrown by validatePodTemplate() when budgetUsdPerRun exceeds budgetUsdMonthly AND budgetUsdMonthly is greater than 0. A single run should never cost more than the entire monthly cap (when a cap is set). When budgetUsdMonthly is 0 (unlimited), this check is skipped. The error message includes the 'pod-template at /:' prefix added by PodTemplateValidationError's constructor.","triggerScenarios":"budgetUsdMonthly is a positive number (e.g. 100) and budgetUsdPerRun is larger (e.g. 150). For example, monthly=500, perRun=600 triggers it; monthly=0, perRun=999 does not.","commonSituations":"Per-run estimate was computed independently from the monthly cap and the two were never reconciled; a decimal point error (e.g. perRun=50.00 vs monthly=5.00).","solutions":["Lower budgetUsdPerRun to be less than or equal to budgetUsdMonthly","Or raise budgetUsdMonthly to accommodate the per-run cost","Or set budgetUsdMonthly to 0 (unlimited) if the monthly cap is intentionally not enforced"],"exampleFix":"// before\n{ \"budgetUsdMonthly\": 100, \"budgetUsdPerRun\": 150 }\n\n// after\n{ \"budgetUsdMonthly\": 500, \"budgetUsdPerRun\": 150 }","handlingStrategy":"validation","validationCode":"if (template.budgetUsdMonthly > 0 && template.budgetUsdPerRun > template.budgetUsdMonthly) {\n  throw new Error('budgetUsdPerRun must not exceed budgetUsdMonthly (or set monthly to 0 for unlimited)');\n}","typeGuard":"function budgetsAreConsistent(monthly: number, perRun: number): boolean {\n  return monthly === 0 || perRun <= monthly;\n}","tryCatchPattern":"try {\n  validatePodTemplate(json);\n} catch (e) {\n  if (e instanceof PodTemplateValidationError && e.message.includes('budgetUsdPerRun must not exceed')) {\n    // Either raise budgetUsdMonthly or lower budgetUsdPerRun\n  }\n}","preventionTips":["Reconcile per-run and monthly budgets before deployment","Set budgetUsdMonthly to 0 to disable the monthly cap","Watch for decimal-point errors: 5.00 vs 50.00"],"tags":["pod-template","validation","schema","budget"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}