ScheduleDefinition

ScheduleDefinition :: # (opaque)

A checked appointment declaration with immutable interpretation context. No series identifier, query window or evaluation progress is stored here. Supply an application identifier and a bounded source-label window to cursor. Native policies and iCalendar mode/ending intent remain distinct origins. Construction normalizes at most 4096 overrides and combined inclusions in O(n log n); it never enumerates starts or resolves zones. Native lists may share storage. An iCalendar origin retains its unlowered PERIOD declarations alongside prepared execution selectors. This is not a persistence format.

from_native : NativeSpec -> Try(ScheduleDefinition, Error)

Prepare a reusable native appointment declaration with explicit rules, duration/end overrides and start policies. Validate and normalize endings once; no window or occurrence expansion is required.

from_ical : ICalSpec -> Try(ScheduleDefinition, Error)

Prepare a checked iCalendar rule with compatible UTC or local interpretation context. Retain its original PERIOD declarations for export while preparing native execution.

definition : ScheduleDefinition -> Definition

Native overrides are normalized; iCalendar retains its mode and PERIOD origins. Reading a declaration does not interpret it or create a cursor.

cursor : id, ScheduleDefinition, Window -> Try(TimedSchedule(id), [EmptyWindow, ReversedWindow, OutOfRange, ..])

Fresh execution state for each window; COUNT remains anchored at DTSTART. Definition validation is not repeated. Interpretation errors remain lazy checked results of TimedSchedule consumption under its normal budgets.

is_eq : ScheduleDefinition, ScheduleDefinition -> Bool

Declaration equality includes origin, retained selectors/exception labels, ending intent and complete immutable context. It does not establish that different recurrence declarations enumerate the same occurrence set. Cost follows finite definition fields and transitions, never query extent.

to_hash : ScheduleDefinition, Hasher -> Hasher

Hash declaration identity including origin, ending intent and complete immutable context. It does not hash an enumerated occurrence set.

to_inspect : ScheduleDefinition -> Str

Return a bounded diagnostic summary without advancing cursors or enumerating occurrences. Use typed accessors for application logic; this text is not a storage format.

NativeSpec : { rule : TimedRecurrence, duration : Duration, overrides : List(EndOverride), context : Context }

Native recurrence, default duration, source-specific endings and explicit immutable start context. End policies remain part of each calendar/local ending.

ICalSpec : { rule : ICalTimedRule, context : Context }

Checked extracted iCalendar rule plus a compatible context: UTC for UTC declarations or explicit rules for local/floating declarations.

Definition : [Native(NativeSpec), ICal(ICalSpec)]

Original native or iCalendar declaration retained by the prepared schedule. Does not contain an application series ID, query window or cursor progress.

Error : [InvalidDuration, TooManyOverrides, ConflictingEnding(LocalDateTime), TooManyPeriods, IncompatibleContext, TooManySelectors, OutOfRange]

Invalid default duration, excessive/conflicting overrides, incompatible interpretation context or out-of-range preparation. Runtime zone interpretation can still fail during cursor consumption.