{"record":{"id":"c614cf0901ae8617","repo":"zeroclaw-labs/zeroclaw","slug":"invalid-weekday-value-val-expected-0-7","errorCode":null,"errorMessage":"Invalid weekday value: {val} (expected 0-7)","messagePattern":"Invalid weekday value: (.+?) \\(expected 0-7\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/cron/schedule.rs","lineNumber":137,"sourceCode":"                fields[0], fields[1], fields[2], fields[3], fields[4]\n            ))\n        }\n        // crate-native syntax includes seconds (+ optional year)\n        6 | 7 => Ok(expression.to_string()),\n        _ => anyhow::bail!(\n            \"Invalid cron expression: {expression} (expected 5, 6, or 7 fields, got {field_count})\"\n        ),\n    }\n}\n\n/// Translate a single numeric weekday value from standard crontab semantics\n/// (0 or 7 = Sunday, 1 = Monday, …, 6 = Saturday) to cron-crate semantics\n/// (1 = Sunday, 2 = Monday, …, 7 = Saturday).\nfn translate_weekday_value(val: u8) -> Result<u8> {\n    match val {\n        0 | 7 => Ok(1), // Sunday\n        1..=6 => Ok(val + 1),\n        _ => anyhow::bail!(\"Invalid weekday value: {val} (expected 0-7)\"),\n    }\n}\n\n/// Enumerate the standard-crontab weekday values covered by `start-end`.\nfn standard_weekday_range_values(start: u8, end: u8) -> Vec<u8> {\n    // Enumerate the standard weekday values covered by the range, wrapping\n    // around the week (Sun=0..=6=Sat) when `end < start` (e.g. `5-0`).\n    let mut standard_days: Vec<u8> = Vec::new();\n    let mut day = start;\n    loop {\n        standard_days.push(day);\n        if day == end {\n            break;\n        }\n        // Step through the 0..=7 numbering used by standard crontab, treating 7\n        // as the Sunday alias so that a `…-7` endpoint terminates the loop.\n        day = if day >= 7 { 0 } else { day + 1 };\n    }","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/cron/schedule.rs#L119-L155","documentation":"Error \"Invalid weekday value: {val} (expected 0-7)\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-runtime/src/cron/schedule.rs:137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a weekday value 0-7 (0 or 7 = Sunday)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}