From ec7d895c00c571b37ad9255b99b2e1756776c9e1 Mon Sep 17 00:00:00 2001
From: Peter Stone <thepeterstone@gmail.com>
Date: Tue, 17 Feb 2026 14:43:42 -1000
Subject: Add calendar cache layer, incremental sync tests, completion
 assertions

- Google Calendar events now cached via CacheFetcher pattern with
  stale-cache fallback on API errors (new migration 015, store methods,
  fetchCalendarEvents handler, BuildTimeline reads from store)
- Todoist incremental sync path covered by 5 new tests
- Task completion tests assert response body, headers, and template data

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---
 migrations/015_calendar_events.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 migrations/015_calendar_events.sql

(limited to 'migrations/015_calendar_events.sql')

diff --git a/migrations/015_calendar_events.sql b/migrations/015_calendar_events.sql
new file mode 100644
index 0000000..071f735
--- /dev/null
+++ b/migrations/015_calendar_events.sql
@@ -0,0 +1,11 @@
+CREATE TABLE IF NOT EXISTS calendar_events (
+    id TEXT PRIMARY KEY,
+    summary TEXT NOT NULL,
+    description TEXT,
+    start_time DATETIME NOT NULL,
+    end_time DATETIME NOT NULL,
+    html_link TEXT,
+    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
+);
+
+CREATE INDEX IF NOT EXISTS idx_calendar_events_start ON calendar_events(start_time);
-- 
cgit v1.2.3

