feat: add durable provider cache

Add a private provider-neutral SQLite WAL cache with transactional migrations, retained raw payloads and tombstones, per-window opaque checkpoints, and reserved outbox/conflict tables.

Verify migrations, permissions, identity invariants, concurrent access, atomic pull-page rollback, and future-schema rejection with deterministic tests. No OAuth, networking, secrets, or Graph synchronization is included yet.
This commit is contained in:
2026-07-18 10:53:41 +01:00
parent cfca6ab6d0
commit 787daf00dd
9 changed files with 1794 additions and 24 deletions

View File

@@ -112,6 +112,29 @@ values incompatible with the event's `DTSTART` time basis or `TZID`, detached
read-only. Remaining local-data work includes detached overrides and rule
editing.
## Remote calendar foundation
Remote calendars must cross a durable local boundary before they are exposed to
the UI. That boundary is a private, provider-neutral SQLite cache in WAL mode,
with versioned migrations that either commit completely or leave the prior
schema intact. It keeps raw provider payloads, inactive calendars, and
tombstoned events so refreshes and older clients do not erase information. Each
opaque incremental cursor belongs to a particular calendar and time window and
is committed atomically with every pulled page. Normalized event instances feed
immutable snapshots rather than exposing provider response types to the month
view.
The cache also reserves transactional outbox and conflict records for future
offline writes, but remote mutation behavior is not part of this phase. OAuth
tokens and other credentials never belong in the calendar database; account
secrets will be held by the Freedesktop Secret Service.
This foundation does not make Office 365 usable yet: Nocal currently performs no
OAuth flow, HTTP request, or Microsoft Graph synchronization. The next product
slice introduces injectable HTTP and PKCE authentication with fake transports,
then adds read-only Graph delta synchronization. Remote writes remain gated on
the durability and conflict paths being exercised end to end.
## Local file interchange
Import and export are explicit command-line workflows. They never contact the