Context
Notifications sends email, SMS and WhatsApp and keeps quiet hours.IdentityResolver answered only a verified email
and a locale, so the service had no verified number to text and no time zone for quiet hours. Quiet hours in Muslim
markets also fall around prayer times, and no package computed them.
Decision
- The whole principal.
IdentityResolver.principalOf(principalId)returns theVerifiedPrincipal, which now carries the verifiedphone(E.164) and thetimeZone(IANA) besideemailandlocale. Both are optional: an unverified number is never returned, and a principal without a zone of their own leaves the caller to fall back to the tenant’s or the location’s. Nothing is copied into the caller’s tables (ADR 0134).@stackra/identity’s drivers implement the new method. - Prayer times are computed, the method is data.
@stackra/calendarhas aPrayerTimesport and a computed driver (sun position, the praytimes.org method). The method is the pack keycalendar.prayer_times: the Fajr angle, Isha as an angle or minutes after Maghrib, the Asr factor (1 or 2), minutes added to sunset for Maghrib, and a high-latitude rule (none,angle_based,middle_of_night,one_seventh). No authority’s angles are written in code; a market or a tenant’s location picks them in its pack. A driver over a published table can replace the computed one where a market requires the authority’s own timetable. - Instants out. A day’s times are UTC instants rounded to the minute; the caller formats them in the place’s zone.
Consequences
- Every
IdentityResolverimplementation addsprincipalOf. - Packs for markets with prayer-aware quiet hours need a
calendar.prayer_timesentry; without one the calendar refuses rather than guesses.
Enforcement
packages/foundation/contracts/src/core/ports/__tests__/identity-resolver.port.test.ts;
packages/foundation/calendar/src/core/drivers/__tests__/computed-prayer-times.driver.test.ts and
packages/foundation/calendar/src/core/functions/__tests__/prayer-method-from-pack.function.test.ts.
Supersedes and sources
Supersedes: none. Sources: OSservices/notifications/SPEC.md gaps 2 and 4; STA-838; STA-840.