fix(cal): refuse phrases the scheduler cannot resolve exactly #428

Merged
KofTwentyTwo merged 1 commits from fix/nl-scheduler-honesty into dev 2026-08-15 02:04:00 +00:00
1 Commits
Author SHA1 Message Date
james.maes f5d8c8a153 fix(cal): refuse phrases the scheduler cannot resolve exactly
NaturalLanguageScheduler ignored the requested weekday and time
entirely, always returning the reference instant plus 24 hours, and
never errored on unrecognised phrasing. Every input produced a
plausible-looking event at the wrong time, which a user only discovers
by missing the meeting.

Replace it with a small, exactly-specified grammar:

  <summary> today|tomorrow|YYYY-MM-DD at <time> for <duration>

Everything outside that grammar returns an error. Weekday phrasings
("next Tuesday") are refused as genuinely ambiguous rather than
resolved, since the two common readings differ by a week. A time of
day and a duration are both mandatory, so neither is defaulted.

Resolution now requires an explicit IANA time zone; a bare Unix
timestamp cannot anchor "3pm". Wall-clock times go through the zone's
DST rules and both anomalies are reported: times inside a
spring-forward gap and times inside a fall-back overlap are refused
rather than silently shifted or disambiguated. Durations are added as
elapsed time, so events spanning a transition keep their real length.

parse now returns ParsedSchedulingIntent instead of a CalendarEvent
with invented "default" account and calendar ids. There are no
in-tree callers, so no behaviour visible to a client changes.

Refs #258
2026-08-14 20:52:26 -05:00