Skip to content

CL-5770: Cron correctness (POSIX steps, DOM/DOW OR, timezones) - #15

Closed
TheGreatAxios wants to merge 2 commits into
cl-5769-routines-hardening-ownership-checks-safe-claims-failurefrom
cl-5770-cron-correctness-step-fields-domdow-semantics-timezones
Closed

CL-5770: Cron correctness (POSIX steps, DOM/DOW OR, timezones)#15
TheGreatAxios wants to merge 2 commits into
cl-5769-routines-hardening-ownership-checks-safe-claims-failurefrom
cl-5770-cron-correctness-step-fields-domdow-semantics-timezones

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

Closes CL-5770. Stacked on #13 (CL-5769) so routines package changes stay linear.

  • Step fields offset from field minimum (*/2 on DOM → 1,3,5… not 2,4,6…)
  • DOM/DOW OR when both restricted (0 0 13 * 5 = 13th or Friday)
  • Sunday = 0 or 7
  • Optional IANA timezone on daily / weekly / cron; nextFireAt remains a UTC instant; DST-correct via Intl
  • Impossible schedules rejected at save (0 0 31 2 *) via bounded minute lookahead (366 days)
  • Web cadence + next-run estimate use the same @corbits/routines/cron path and timezone

Logic stays in packages/routines; web only renders.

Test plan

Align packages/routines cron with Vixie/POSIX semantics and make schedules wall-clock safe. Step fields offset from field min; DOM/DOW OR when both restricted; day-of-week 7 is Sunday; optional IANA timezone on daily/weekly/cron with UTC storage; impossible expressions rejected at save via bounded lookahead. Web cadence/next-run shares the package path.
- Fix block-comment syntax error in cron.ts (*/N sequence closed the
  comment); reword to avoid the delimiter collision.
- Apply prettier formatting to changed routine/hub files and a
  pre-existing prettier violation in webhook-triggers management-routes
  (required for prettier --check .).
- Replace non-null assertions in routine-scheduler/store tests with an
  expectPresent narrowing helper.
@TheGreatAxios
TheGreatAxios force-pushed the cl-5770-cron-correctness-step-fields-domdow-semantics-timezones branch from 27bcd95 to 2a2fac2 Compare August 9, 2026 07:00
@TheGreatAxios
TheGreatAxios deleted the branch cl-5769-routines-hardening-ownership-checks-safe-claims-failure August 9, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant