{"record":{"id":"7549826ffb3c58c1","repo":"jdx/mise","slug":"agent-agent-name-start-calendar-interval-fie","errorCode":null,"errorMessage":"agent '{agent_name}' `start_calendar_interval.{field}` must be between {min} and {max}","messagePattern":"agent '(.+?)' `start_calendar_interval\\.(.+?)` must be between (.+?) and (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/launchd.rs","lineNumber":212,"sourceCode":"                    interval.validate(agent_name)?;\n                }\n                Ok(())\n            }\n        }\n    }\n}\n\nfn validate_range(\n    agent_name: &str,\n    field: &str,\n    value: Option<u8>,\n    min: u8,\n    max: u8,\n) -> Result<()> {\n    if let Some(value) = value\n        && !(min..=max).contains(&value)\n    {\n        bail!(\n            \"agent '{agent_name}' `start_calendar_interval.{field}` must be between {min} and {max}\"\n        );\n    }\n    Ok(())\n}\n\nimpl std::fmt::Display for LaunchdRequest {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        write!(f, \"{} ({})\", self.name, self.label)\n    }\n}\n\npub(crate) fn is_available() -> bool {\n    cfg!(target_os = \"macos\") && crate::file::which(\"launchctl\").is_some()\n}\n\npub(crate) fn unavailable_reason() -> String {\n    if cfg!(target_os = \"macos\") {","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/launchd.rs#L194-L230","documentation":"Thrown by the shared range validator for `StartCalendarInterval` fields when a provided calendar value falls outside its valid range: minute 0-59, hour 0-23, day 1-31, weekday 0-7, month 1-12. These mirror launchd/cron calendar semantics, and out-of-range values would never match a real time. The error names the specific field and its allowed min/max.","triggerScenarios":"Setting `minute = 60`, `hour = 24`, `month = 0`, `day = 32`, or `weekday = 8` in a `start_calendar_interval` entry; off-by-one mistakes like `month = 13` or 1-based/0-based confusion on weekday (0 and 7 are both Sunday, but 8 is invalid).","commonSituations":"Porting cron expressions where minute ranges differ; confusing day-of-month ranges (1-31) with hour ranges; forgetting weekday accepts 0-7 while month is 1-12.","solutions":["Clamp the offending field into its documented range (minute 0-59, hour 0-23, day 1-31, weekday 0-7, month 1-12).","Re-check 0-based vs 1-based semantics: weekday starts at 0 (Sunday) and allows 7, but day and month start at 1.","Split values that can't be expressed in one field (e.g. minute 90) into multiple intervals or use `start_interval` instead.","Use a cron/launchd reference table when translating schedules."],"exampleFix":"# before\n[agents.report.system.start_calendar_interval]\nminute = 90\n\n# after\n[agents.report.system.start_calendar_interval]\nminute = 30","handlingStrategy":"validation","validationCode":"const RANGES = { minute:[0,59], hour:[0,23], day:[1,31], weekday:[0,7], month:[1,12] };\nfor (const [f,[min,max]] of Object.entries(RANGES)) {\n  const v = interval[f];\n  if (v !== undefined && (v < min || v > max)) throw new Error(`${f} must be ${min}..${max}`);\n}","typeGuard":"function inRange(v, min, max) { return v !== undefined && v >= min && v <= max; }","tryCatchPattern":null,"preventionTips":["Keep a reference table: minute 0-59, hour 0-23, day 1-31, weekday 0-7, month 1-12.","Remember weekday is 0-based (0 and 7 = Sunday); day and month are 1-based.","Unit-test schedule generators against the ranges."],"tags":["launchd","config","validation","range"],"backgroundTag":"value-out-of-range","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}