Repository navigation
Support day, month, and year recurrence intervals - #11
Closed
seungjuchoi wants to merge 1 commit into
Closed
seungjuchoi wants to merge 1 commit into
seungjuchoi wants to merge 1 commit into
Conversation
Extend the recurrence rule grammar with every N days, every N months, yearly, and every N years. All new rules anchor on the series start date: day intervals count from it, month intervals keep its day number and clamp to shorter months, and yearly rules keep its month and day, returning on February 28 outside leap years for February 29 anchors. The natural-language schedule input additionally accepts annually, every year, and friendly interval forms such as every 3 days. Rebuild the recurrence_series table to relax the frequency and interval CHECK constraints, and bump the sync protocol version so older peers fail fast with a clear upgrade error instead of choking on rule payloads they cannot parse.
Owner
|
Hey, thanks a lot for the pull request. I really appreciate it The change turned out to be more complex than I expected, and workflow-wise it was easier for me to reimplement it using my own AI workflow and test it from scratch. This isn’t personal or a reflection on your work. Your PR was helpful in shaping and validating the feature. Thanks again for taking the time to contribute! 🙏 |
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.
Hi! Thanks for building aven — I use it daily and it has been great.
One gap I kept running into is that the recurrence grammar has no day-based intervals and nothing above monthly, so things like "water the plants every 3 days" or "wedding anniversary every year" can only be approximated with rules like
every 52 weeks. This PR extends the rule grammar to cover those cases.What's added
every N daysevery N monthsyearlyevery N yearsAll new rules anchor on
--repeat-start-on, consistent with the existingmonthlybehavior:daily/monthlywith interval 1 evaluate exactly as before.The TUI/natural-language input additionally accepts
annually,every year, and friendly forms likeevery 3 days, and the AI intake prompt and docs are updated to match.Implementation notes
RecurrenceFrequencygains aYearlyvariant, and the interval-must-be-1 restriction on daily/monthly is lifted. Weekday sets remain weekly-only.recurrence_seriesis rebuilt to relax the frequency/interval CHECK constraints, following the same pattern as20260728183707_support_monthly_recurrence.sql(data copied over, trigger and indexes recreated).SYNC_PROTOCOL_VERSIONis bumped 13 → 14 so older peers get a cleansync-protocol-unsupportederror instead of failing mid-apply on a frequency they can't parse — following the precedent of the task-metadata bump (12 → 13). Happy to handle this differently if you'd prefer another compatibility strategy.RecurrenceFrequencyenum gainsYearly.Deliberately not included:
monthly on 15/monthly on last day/monthly on last fri, since those need new rule fields (ordinal weekdays, explicit month days) and felt like a separate design discussion. Monthly dates stay start-date-anchored.Testing
cargo test --workspace,cargo clippy,cargo fmtall clean on my machine (the only failures are a handful of pre-existing ones that also fail for me on a cleanmaincheckout — happy to share details).yearly,every 3 days,every 3 months(Jan 31 anchor → Oct 31 slot), andevery 2 yearsseries against a fresh DB and verifiedrecur listlabels and slots.Happy to adjust anything — naming, migration approach, or scope. Thanks for taking a look!