scheduler: 5-field unix cron grammar + per-task tz (BREAKING)#21
Merged
Conversation
breaking: TASK.md `schedule:` replaced by `cron:` or `at:` with optional `tz:`. closes four scheduler gaps at once (time-of-day windows, weekday filtering, local-tz scheduling, anchored cadence) via cron-parser@5.5.0 exact-pinned. migration cheat sheet in CHANGELOG.md + docs/USAGE.md. behavior changes: - anchored cadence: `0 * * * *` fires at :00, no drift from last_run_at - no first-deploy catch-up: fresh tasks wait for the next cron moment (cron is anchored, not stateful) two live-verification fixes folded in: - tick driver anchors fresh cron tasks on bootTime (regression: anchoring on now meant `due` moved with the clock and the task never fired through the natural tick path) - /tasks output uses the dual-render pattern (md -> telegram-html for the bot, raw md for the web) so the listing renders properly on both surfaces 747 tests pass. version 0.4.0 -> 0.5.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BREAKING: TASK.md
schedule:field is replaced bycron:(5-field unix cron) orat:(ISO8601), with optional per-tasktz:(default:\$TZenv / host runtime tz). Addscron-parser@5.5.0exact-pinned to deps.One grammar closes four real scheduler gaps in one change: time-of-day windows, weekday filtering, local-tz scheduling, and anchored cadence. The live trigger that motivated this —
*/30 12-18 * * 1-5America/Denver for stretch reminders — required 13 separatedaily_atTASK.md files under the old grammar.Why (not what)
every <dur>drifts;daily_at HH:MMis UTC-only and one-shot; neither expresses "weekdays 12:00–18:30 my local tz."cron-parser@5.5.0handles tz + DST. Mature MIT lib, ~150 LOC of subtle DST math we don't write. Spring-forward skipped, fall-back single-fire — both unit-tested. Bringsluxontransitively.Migration cheat sheet
Full migration prose lives in `docs/USAGE.md` under "Migration from `schedule:` (pre-0.5.0)".
Behavior changes (call-outs for operators)
Live-verification fixes folded in
Two bugs surfaced during the dev-loop deploy:
Files touched
Anti-goal reversal
Reverses the "no cron in v1, kept the parser ~30 LOC" design note from `docs/ARCHITECTURE.md`. Justification lives in `PLAN.md § Adding cron-parser as a runtime dep`: replaces ~150 LOC of subtle tz/DST math we'd otherwise write, mature MIT lib, exact-pinned. Brings `luxon` transitively — earlier PLAN.md said "zero transitive deps" which is stale for v5.5.
Test plan