fix(calendar): project interval recurrences without recurrence_start (ERR-2, QUAL-1)#590
Merged
Merged
Conversation
…(ERR-2, QUAL-1) Month-based (monthly/every_3_months/every_6_months) and every_2_days chores were never projected onto the HA calendar (or the calendar card) unless an explicit recurrence_start was set — so quarterly/biannual chores never appeared anywhere despite being claimable. Both the Python projection (_is_chore_scheduled_for_date) and its JS card mirror (_isChoreScheduledOn) now fall back to created_date as the cadence anchor when recurrence_start is empty. An explicit recurrence_start still takes precedence. Also (QUAL-1) extracted the weekday map (was duplicated 3x) and the month-steps map into module-level _DOW_MAP/_MONTH_STEPS in coord_chores. Note: the completion-relative availability model is intentionally unchanged; this fixes the concrete 'never projects' bug. Tests: 4 new calendar-projection cases (monthly/quarterly/every_2_days without start; explicit-start precedence). 165 related tests pass. Card mirror verified on ha-dev via browserless (9 date assertions).
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.
ERR-2 / QUAL-1 — interval recurrences never projected without
recurrence_startMonth-based (
monthly/every_3_months/every_6_months) andevery_2_dayschores were never projected onto the HA calendar entity or the calendar card unless an explicitrecurrence_startwas set — so quarterly/biannual chores never appeared anywhere, despite being claimable.Fix
Both the Python projection (
coord_calendar._is_chore_scheduled_for_date) and its JS card mirror (taskmate-calendar-card.js _isChoreScheduledOn) now fall back tocreated_dateas the cadence anchor whenrecurrence_startis empty. An explicitrecurrence_startstill takes precedence.QUAL-1: extracted the weekday map (was duplicated 3×) and the month-steps map into module-level
_DOW_MAP/_MONTH_STEPSincoord_chores.py.Scope note: the completion-relative availability model (
is_chore_available_for_child) is intentionally left unchanged — it is heavily relied upon and tested. This PR fixes the concrete, verified "never projects" bug; the availability vs calendar models legitimately differ (completion-relative vs schedule-relative).Testing
test_calendar_projection.py(monthly / quarterly / every_2_days without start; explicit-start precedence).pytestover calendar/assignment/coordinator/expiry suites → 165 passed.From AUDIT_REPORT.md §3.2 / §3.4.