chore(conductor): Add conductor setup files and new track 'timezone_rrule_20260218'

This commit is contained in:
2026-02-19 06:50:29 -08:00
parent 9b54e2d8a8
commit b94ebd30a2
13 changed files with 569 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# Track timezone_rrule_20260218 Context
- [Specification](./spec.md)
- [Implementation Plan](./plan.md)
- [Metadata](./metadata.json)

View File

@@ -0,0 +1,8 @@
{
"track_id": "timezone_rrule_20260218",
"type": "feature",
"status": "new",
"created_at": "2026-02-18T11:20:00Z",
"updated_at": "2026-02-18T11:20:00Z",
"description": "Upgrade the SilverBullet iCalendar plug to use DST-aware timezone resolution and add recurring event support using rrule."
}

View File

@@ -0,0 +1,40 @@
# Implementation Plan: Proper Timezone Handling & Recurring Events
## Phase 1: Foundation - Timezone Mapping & Resolver
- [ ] Task: Setup Timezone Map (WINDOWS_TO_IANA)
- [ ] Write failing tests for `resolveIanaName`
- [ ] Implement `WINDOWS_TO_IANA` mapping and `resolveIanaName` in `timezones.ts`
- [ ] Task: Implement UTC Offset Resolver using Intl
- [ ] Write failing tests for `getUtcOffsetMs`
- [ ] Implement `getUtcOffsetMs` in `timezones.ts`
- [ ] Task: Conductor - User Manual Verification 'Phase 1: Foundation' (Protocol in workflow.md)
## Phase 2: Core Logic - Extraction & Shifting
- [ ] Task: Fix Wall-Clock Extraction logic
- [ ] Write failing tests for `resolveEventStart` (mocking `Intl` if necessary)
- [ ] Implement `resolveEventStart` in `icalendar.ts` to handle local time ground truth
- [ ] Task: Conductor - User Manual Verification 'Phase 2: Core Logic' (Protocol in workflow.md)
## Phase 3: Features - Recurring Events & Filtering
- [ ] Task: Integrate `rrule` library
- [ ] Add `rrule` to `deno.json` imports
- [ ] Verify import works in a simple script
- [ ] Task: Implement Recurring Event Expansion
- [ ] Write failing tests for `expandRecurrences`
- [ ] Implement `expandRecurrences` in `icalendar.ts`
- [ ] Task: Implement EXDATE support
- [ ] Write failing tests for EXDATE exclusion
- [ ] Update `expandRecurrences` to handle `EXDATE`
- [ ] Task: Implement Status Filtering
- [ ] Write failing tests for filtering "CANCELLED" events
- [ ] Update sync logic to filter based on iCalendar status
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Features' (Protocol in workflow.md)
## Phase 4: Cleanup & Configuration
- [ ] Task: Remove obsolete configuration
- [ ] Write failing tests verifying `tzShift` is ignored/deprecated
- [ ] Remove `tzShift` and `hourShift` from `getSources` and `fetchAndParseCalendar`
- [ ] Task: Add `syncWindowDays` configuration
- [ ] Write failing tests for configurable expansion window
- [ ] Implement `syncWindowDays` in config and sync logic
- [ ] Task: Conductor - User Manual Verification 'Phase 4: Cleanup & Configuration' (Protocol in workflow.md)

View File

@@ -0,0 +1,36 @@
# Specification: Proper Timezone Handling & Recurring Events
## Overview
Upgrade the SilverBullet iCalendar plug to provide accurate, DST-aware timezone resolution and full support for recurring events (RRULE expansion). This replaces manual hour shifting with an automated, reliable system using IANA timezone standards and the `Intl` API.
## Functional Requirements
- **IANA Timezone Mapping:** Implement a comprehensive mapping of 139 Windows timezone names to IANA identifiers using Unicode CLDR data.
- **DST-Aware Offsets:** Calculate UTC offsets at runtime for specific event dates using the built-in `Intl.DateTimeFormat` API, ensuring accuracy during Daylight Saving Time transitions.
- **Robust Date Extraction:** Correct the wall-clock extraction logic to prevent "double-shifting" of event times.
- **Recurring Event Expansion:**
- Integrate the `rrule` library to expand recurring events into individual occurrences.
- Support `EXDATE` for excluding specific instances of a recurring series.
- Implement a configurable `syncWindowDays` (default: 365) to limit the expansion range.
- **Advanced Filtering:**
- Filter out "CANCELLED" events based on the iCalendar status field.
- (Optional) Add `includeTransparent` and `includeDeclined` per-source flags.
- **Error Handling & Fallbacks:**
- If a timezone is unrecognized, fallback to UTC and append a warning to the event's description.
- **Configuration Cleanup:**
- Remove the redundant `tzShift` / `hourShift` parameters.
- Add `syncWindowDays` global config.
## Non-Functional Requirements
- **Self-Contained:** Maintain the plug as a Deno-compatible project using `esm.sh` or `deno.json` imports.
- **Performance:** Ensure efficient expansion of recurrences, even for busy calendars.
## Acceptance Criteria
1. Events from various providers (Google, O365, Nextcloud) appear at the correct local time in SilverBullet, regardless of DST.
2. All occurrences of a weekly recurring event within the sync window are indexed.
3. Excluded dates (`EXDATE`) are correctly omitted from the index.
4. Cancelled events are not indexed.
5. The manual `tzShift` configuration is no longer required for correct time display.
## Out of Scope
- Full CalDAV synchronization (this remains a read-only `.ics` fetcher).
- UI for managing individual recurring instances (handled via SilverBullet queries).