{"record":{"id":"ca61ee900fe35778","repo":"sickn33/agentic-awesome-skills","slug":"value-v-out-of-range-for-fielddef-name-fi","errorCode":null,"errorMessage":"Value ${v} out of range for ${fieldDef.name} (${fieldDef.min}-${fieldDef.max})","messagePattern":"Value (.+?) out of range for (.+?) \\((.+?)-(.+?)\\)","errorType":"validation","errorClass":"CronError","httpStatus":null,"severity":"error","filePath":"skills/cron-doctor/scripts/cron-engine.js","lineNumber":151,"sourceCode":"  }\n\n  if (t.includes('-')) {\n    const parts = t.split('-');\n    if (parts.length !== 2) throw new CronError(`Invalid range \"${t}\" in ${fieldDef.name}`, fieldIndex);\n    const a = parseSingleNum(parts[0].trim(), fieldDef, fieldIndex);\n    const b = parseSingleNum(parts[1].trim(), fieldDef, fieldIndex);\n    addRange(values, a, b, fieldDef);\n    return;\n  }\n\n  const v = parseSingleNum(t, fieldDef, fieldIndex);\n  addOne(values, v, fieldDef, fieldIndex);\n}\n\nfunction addOne(values, v, fieldDef, fieldIndex) {\n  if (fieldDef.key === 'dow' && v === 7) { values.add(0); return; }\n  if (v < fieldDef.min || v > fieldDef.max) {\n    throw new CronError(`Value ${v} out of range for ${fieldDef.name} (${fieldDef.min}-${fieldDef.max})`, fieldIndex);\n  }\n  values.add(v);\n}\n\nfunction addRange(values, lo, hi, fieldDef) {\n  if (lo > hi) [lo, hi] = [hi, lo];\n  if (lo < fieldDef.min || hi > fieldDef.max) {\n    throw new CronError(`Range ${lo}-${hi} out of bounds for ${fieldDef.name} (${fieldDef.min}-${fieldDef.max})`, -1);\n  }\n  for (let v = lo; v <= hi; v++) {\n    if (fieldDef.key === 'dow' && v === 7) { values.add(0); continue; }\n    values.add(v);\n  }\n}\n\n// ---- Full expression parser ----\nfunction parseCron(expr) {\n  const parts = String(expr).trim().split(/\\s+/);","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/sickn33/agentic-awesome-skills/blob/58d857988fcfac6986206bca2b2fe223aa437e4b/skills/cron-doctor/scripts/cron-engine.js#L133-L169","documentation":"addOne validates a single resolved numeric value against the field's min/max (minute 0-59, hour 0-23, dom 1-31, month 1-12, dow 0-6) and throws when it falls outside. Reached from parseItem for bare numbers and step bases. Special case: dow 7 is accepted and mapped to 0 (Sunday).","triggerScenarios":"Values like minute 60, hour 24, month 0 or 13, dom 0 or 32, dow 8; also step expressions whose base is out of range, e.g. '70/5' in the minute field.","commonSituations":"Using hour 24 for midnight; assuming 0-indexed months (JS Date getMonth() habits); off-by-one on day-of-week; porting expressions from schedulers with different bounds.","solutions":["Clamp the value to the bounds shown in the message, e.g. hour 24 -> 0, minute 60 -> 0","Use 0-6 for day-of-week (7 is accepted as Sunday)","Remember day-of-month and month start at 1"],"exampleFix":"// before\n'0 24 * * *'  // hour 24 invalid\n\n// after\n'0 0 * * *'   // midnight","handlingStrategy":"validation","validationCode":"const LIMITS = { minute:[0,59], hour:[0,23], dom:[1,31], month:[1,12], dow:[0,7] };\nconst fields = String(expr).trim().split(/\\s+/);\nconst valid = fields.length === 5 && fields.every((f, i) =>\n  f.split(',').every(t => {\n    const nums = t.split(/[-/]/).filter(s => /^\\d+$/.test(s));\n    return t === '*' || nums.length === 0 || nums.every(n => {\n      const v = Number(n); return v >= LIMITS[i][0] && v <= LIMITS[i][1];\n    });\n  }));\nif (!valid) throw new Error('Field value out of range');","typeGuard":null,"tryCatchPattern":"try { parseCron(expr); } catch (e) { if (e instanceof CronError && /out of range/.test(e.message)) reportField(e.fieldIndex); else throw e; }","preventionTips":["Remember bounds: months 1-12, dom 1-31, hours 0-23, dow 0-6 (7=Sunday)","Never use JS Date getMonth() 0-11 values as cron months","Lint schedule constants against validate() before deploy"],"tags":["cron","range-check","validation"],"backgroundTag":"cron-expression-invalid","analyzedSha":"58d857988fcfac6986206bca2b2fe223aa437e4b","analyzedAt":"2026-08-26T11:55:59.350Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}