{"record":{"id":"b899f10b59164996","repo":"ruvnet/ruflo","slug":"pod-template-at-path-budgetusdperrun-must-be","errorCode":null,"errorMessage":"pod-template at ${path}: budgetUsdPerRun must be ≥0","messagePattern":"pod-template at (.+?): budgetUsdPerRun must be ≥0","errorType":"validation","errorClass":"PodTemplateValidationError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/business-pods/pod-schema.ts","lineNumber":233,"sourceCode":"  });\n  if (allowedMcpTools.length === 0) {\n    throw new PodTemplateValidationError('allowedMcpTools must have ≥1 entry', '/');\n  }\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;","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/business-pods/pod-schema.ts#L215-L251","documentation":"Thrown by validatePodTemplate() when budgetUsdPerRun is a valid finite number but is negative. This value drives the reservation amount for each pod tick, so it must be zero or positive.","triggerScenarios":"The budgetUsdPerRun field is set to any negative number. The requireNumber helper already verified it is finite; this check rejects negative amounts.","commonSituations":"A negative value was used as a 'not configured' sentinel; a sign error from a cost-estimation script.","solutions":["Set budgetUsdPerRun to 0 or a positive dollar amount (e.g. 0.50)","Use 0 rather than -1 for 'no per-run budget'"],"exampleFix":"// before\n{ \"budgetUsdPerRun\": -0.05 }\n\n// after\n{ \"budgetUsdPerRun\": 0.05 }","handlingStrategy":"validation","validationCode":"if (typeof template.budgetUsdPerRun !== 'number' || template.budgetUsdPerRun < 0) {\n  throw new Error('budgetUsdPerRun must be >= 0');\n}","typeGuard":"function isValidPerRunBudget(v: unknown): boolean {\n  return typeof v === 'number' && Number.isFinite(v) && v >= 0;\n}","tryCatchPattern":"try {\n  validatePodTemplate(json);\n} catch (e) {\n  if (e instanceof PodTemplateValidationError && e.message.includes('budgetUsdPerRun must be')) {\n    // Set budgetUsdPerRun to 0 or a positive number\n  }\n}","preventionTips":["Use 0 for no per-run budget, never negative","Verify the amount is in USD","Estimate per-run cost from the pod's expected token/compute usage"],"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"}