Skip to content

fix(calendar): project interval recurrences without recurrence_start (ERR-2, QUAL-1)#590

Merged
tempus2016 merged 1 commit into
mainfrom
fix/err2-calendar-recurrence-anchor
Jun 25, 2026
Merged

fix(calendar): project interval recurrences without recurrence_start (ERR-2, QUAL-1)#590
tempus2016 merged 1 commit into
mainfrom
fix/err2-calendar-recurrence-anchor

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

ERR-2 / QUAL-1 — interval recurrences never projected without recurrence_start

Month-based (monthly/every_3_months/every_6_months) and every_2_days chores were never projected onto the HA calendar entity or the calendar card unless an explicit recurrence_start was 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 to created_date as the cadence anchor when recurrence_start is empty. An explicit recurrence_start still takes precedence.

QUAL-1: extracted the weekday map (was duplicated 3×) and the month-steps map into module-level _DOW_MAP / _MONTH_STEPS in coord_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

  • 4 new cases in test_calendar_projection.py (monthly / quarterly / every_2_days without start; explicit-start precedence). pytest over calendar/assignment/coordinator/expiry suites → 165 passed.
  • Card mirror verified on ha-dev via browserless: 9 date assertions (quarterly/monthly/every_2_days project on the right days, not others), zero console errors.

From AUDIT_REPORT.md §3.2 / §3.4.

…(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).
@github-actions github-actions Bot added backend Python integration code cards Lovelace cards / frontend (www/*.js) tests Test suite labels Jun 25, 2026
@tempus2016 tempus2016 merged commit 247d302 into main Jun 25, 2026
10 checks passed
@tempus2016 tempus2016 deleted the fix/err2-calendar-recurrence-anchor branch June 25, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Python integration code cards Lovelace cards / frontend (www/*.js) tests Test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant