Merge loops/events into architecture: events-on-sx iCal interop + series booking + tz fixes (366 tests, 13 suites)

iCalendar export+import (occurrence-exact round-trip), whole-series booking
(book/cancel across all occurrences), cross-event conflict-checked booking, and
timezone-aware iCal export (local->UTC stamps).
This commit is contained in:
2026-06-07 19:52:06 +00:00
8 changed files with 830 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ capacity rules, transactional booking, and a flow-driven notification dispatcher
## Status (rolling)
`bash lib/events/conformance.sh`**311/311** (Phases 1-4 + 10 ext: …timezones+DST, e2e delivery pipeline, cross-event conflict-checked booking)
`bash lib/events/conformance.sh`**366/366** (Phases 1-4 + 13 ext + tz-aware iCal export fix)
## Ground rules
@@ -88,6 +88,34 @@ lib/events/api.sx ── (events/schedule) (events/book) (events/agenda) ──
## Progress log
- 2026-06-07 — Fix: timezone-aware iCal export. Bug — tz events store wall-clock
LOCAL times, but export stamped them with a `Z` (UTC) suffix, so a London
18:00 event falsely read as 18:00 UTC. `ev-ical-conv` now converts a tz
event's DTSTART / UNTIL / EXDATE / RDATE local→UTC before formatting (London
summer 18:00 → 170000Z; Paris → 160000Z); non-tz events unchanged. Documented
caveat: a UTC RRULE drifts from a wall-clock-stable tz recurrence across a DST
boundary — full fidelity needs VTIMEZONE (deferred). +6 tests, 366/366 green.
- 2026-06-07 — iCalendar import / round-trip (extension). `ical.sx` now parses
VEVENT/VCALENDAR text back into events (`ev/ical-lines->event`,
`ev/parse-vcalendar`): DTSTART/DURATION/RRULE (incl. ordinal BYDAY, BYMONTHDAY,
UNTIL/COUNT/INTERVAL) and EXDATE/RDATE. Round-trip is occurrence-exact —
export→import expands to the identical occurrence set (tested across one-off /
daily-count / weekly+exdate+rdate / monthly-ordinal / bymonthday). Completes
bidirectional interop. +19 tests, 360/360 green.
- 2026-06-07 — Whole-series booking (extension). `ev/book-series!` /
`ev/cancel-series!` apply a booking/cancel to every occurrence of one event
in a window (e.g. RSVP the whole weekly class), returning per-occurrence
(occ-key status) results; capacity is still enforced per occurrence (some
:booked, some :full). Idempotent re-book (all :already). `ev/series-count`
(tally a status), `ev/series-booked` (which occurrences the actor holds).
+9 tests, 341/341 green. This was the last flagged feature — surface saturated.
- 2026-06-07 — iCalendar (RFC 5545) export (extension). `ical.sx` serializes
events to VEVENT / VCALENDAR text for import by standard clients. UTC
basic-format stamps (YYYYMMDDTHHMM00Z), DURATION (PT#H#M), and the full RRULE
model (FREQ/INTERVAL/COUNT/UNTIL/BYDAY incl. monthly ordinals "2TU"/"-1FR"/
BYMONTHDAY) plus EXDATE/RDATE. Line-oriented: `ev/event->ical-lines` /
`ev/events->ical-lines` return content lines; `ev/ical-render` joins with
CRLF (wire format). +21 tests, 332/332 green.
- 2026-06-07 — Cross-event conflict-checked booking (extension). Capacity is
per-event, but `ev/book-checked!` also prevents an attendee double-booking
THEMSELVES across different events: it consults the actor's persist-derived