fix(scheduler): refuse dates that do not exist, and an unreadable --now in gram plan #114

Merged
abiwab merged 1 commit from fix/calendar-dates into main 2026-11-06 20:59:17 +01:00
Owner

First fix of the pre-1.4.0 audit (.notes/AUDIT-1.4.md, B1 and B2).

Dates that do not exist. gram plan --serve "2026-02-30 20:00" planned for March 2: every date reader checked the shape and day <= 31, never the length of the month, so Date.UTC rolled the day over without a word.

  • Scheduler: isCalendarDate() (exported), used by parseLocalIso, localDateTime, addDays, daysBetween and parseAvailability (a date key like 2026-02-30=none is now refused as a key).
  • CLI: --serve and --find refuse such a date with a clear message.
  • Language server: a serveAt on such a date is dropped like any other invalid one (the run sheet falls back on days) instead of leaving the panel empty.

--now. It was passed as is, so --now banana ended in a stack trace raised while drawing the plan. parseNow() checks it with the zone of the plan and says what it expects.

Pending changesets extended (cli-plan-command, scheduler-package), both unreleased. Scheduler API reference updated in en and fr.

Gates: lint, typecheck, 2199 tests, conformance (103 + 24).

First fix of the pre-1.4.0 audit (`.notes/AUDIT-1.4.md`, B1 and B2). **Dates that do not exist.** `gram plan --serve "2026-02-30 20:00"` planned for March 2: every date reader checked the shape and `day <= 31`, never the length of the month, so `Date.UTC` rolled the day over without a word. - Scheduler: `isCalendarDate()` (exported), used by `parseLocalIso`, `localDateTime`, `addDays`, `daysBetween` and `parseAvailability` (a date key like `2026-02-30=none` is now refused as a key). - CLI: `--serve` and `--find` refuse such a date with a clear message. - Language server: a `serveAt` on such a date is dropped like any other invalid one (the run sheet falls back on days) instead of leaving the panel empty. **`--now`.** It was passed as is, so `--now banana` ended in a stack trace raised while drawing the plan. `parseNow()` checks it with the zone of the plan and says what it expects. Pending changesets extended (`cli-plan-command`, `scheduler-package`), both unreleased. Scheduler API reference updated in en and fr. Gates: lint, typecheck, 2199 tests, conformance (103 + 24).
fix(scheduler): refuse dates that do not exist, and an unreadable --now in gram plan
All checks were successful
CI / Build, Test & Publish (pull_request) Successful in 3m49s
619ab737a2
abiwab merged commit e8dc98e252 into main 2026-11-06 20:59:17 +01:00
abiwab deleted branch fix/calendar-dates 2026-11-06 20:59:18 +01:00
Sign in to join this conversation.
No description provided.