Repository navigation
Reject impossible /schedule calendar dates instead of overflowing the month - #349
Merged
tylerreckart merged 5 commits intoSep 21, 2026
Merged
Conversation
… month. on YYYY-MM-DD only checked 1..12 / 1..31, so Feb 31 and Jun 31 were accepted and mktime rolled them into the next month. Round-trip the civil date at noon and fail closed with invalid YYYY-MM-DD. Co-authored-by: Tyler Reckart <tylerreckart@users.noreply.github.com>
This was referenced Sep 17, 2026
…e5-4dec-9a2b-1c10bad828db-1da3 # Conflicts: # CHANGELOG.md
tylerreckart
marked this pull request as ready for review
September 21, 2026 12:58
tylerreckart
enabled auto-merge (squash)
September 21, 2026 12:58
…e5-4dec-9a2b-1c10bad828db-1da3 # Conflicts: # CHANGELOG.md
…e5-4dec-9a2b-1c10bad828db-1da3 # Conflicts: # CHANGELOG.md
…e5-4dec-9a2b-1c10bad828db-1da3 # Conflicts: # CHANGELOG.md
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.
on YYYY-MM-DDonly checked month 1–12 and day 1–31, soon 2027-02-31/on 2026-06-31/ non-leapFeb 29parsed as success.mktimethen normalized the overflow (Feb 31 → early March) and the one-shot fired on a different civil day than the agent asked for.parse_ymdnow round-trips the date at noon and fails closed withinvalid YYYY-MM-DD. Leap dayon 2028-02-29still works. Distinct from #318 (interval integer overflow) and #334 (resume/pause status).unit_schedule_parser8/8 locally (+ ASan/UBSan, 79 assertions).merge-tree vs main: CLEAN. vs #334:
schedule_parser.cpp/ tests auto-merge (parse_ymd vs resume helpers); only CHANGELOG[Unreleased]sibling-conflicts, same as #321–#348.Note
Low Risk
Localized validation change in schedule phrase parsing with new unit tests; behavior tightens invalid input only and does not alter valid schedules beyond rejecting previously mis-normalized dates.
Overview
/scheduleone-shot dates now fail closed on impossible calendar days instead of acceptingon YYYY-MM-DDwhen only month/day ranges were checked andmktimesilently rolled overflow (e.g. Feb 31 → March).parse_ymdround-trips the parsed date throughmktimeat local noon and requires the normalizedtmfields to match the input, which rejects Jun 31, non-leap Feb 29, etc., while still allowing valid leap days. Unit tests cover overflow rejection, leap-year acceptance, and the existinginvalid YYYY-MM-DDerror path.The changelog
[Unreleased]section documents this fix.Reviewed by Cursor Bugbot for commit 376e71e. Bugbot is set up for automated code reviews on this repo. Configure here.