summaryrefslogtreecommitdiff
path: root/lib/rites/rite_ef/lectionary_ef.mli
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rites/rite_ef/lectionary_ef.mli')
-rw-r--r--lib/rites/rite_ef/lectionary_ef.mli96
1 files changed, 82 insertions, 14 deletions
diff --git a/lib/rites/rite_ef/lectionary_ef.mli b/lib/rites/rite_ef/lectionary_ef.mli
index e54a0b1..baf25d4 100644
--- a/lib/rites/rite_ef/lectionary_ef.mli
+++ b/lib/rites/rite_ef/lectionary_ef.mli
@@ -3,12 +3,13 @@ open Colitur_kernel
(** The EF lectionary resolution chain. All rubric knowledge about what a day
with no proper falls back to lives here, not in the kernel.
- [lectionary] is caller-supplied, not loaded by this module -- the same
- reasoning rite_ef.mli's own [context] doc comment already gives for why
- the sanctoral {!Colitur_kernel.Layer.t} stays a separate argument rather
- than an embedded field: it lets a caller load data/ef/lectionary.sexp
- however suits it, and leaves room for a future diocesan/proper
- lectionary overlay to attach without this module changing at all.
+ [lectionary] and [commons] are both caller-supplied, not loaded by this
+ module -- the same reasoning rite_ef.mli's own [context] doc comment
+ already gives for why the sanctoral {!Colitur_kernel.Layer.t} stays a
+ separate argument rather than an embedded field: it lets a caller load
+ data/ef/lectionary.sexp and data/ef/commons.sexp however suits it, and
+ leaves room for a future diocesan/proper lectionary overlay to attach
+ without this module changing at all.
An eager filesystem read at module initialisation was tried first and
reverted (fix round 1, coordinator review): [readings] used to close
@@ -18,17 +19,84 @@ open Colitur_kernel
missing from a bare `dune build`'s own default target (it was only
present because test/dune's own deps happened to materialise it,
masking the gap in every test run). See the task report for the
- reproduction.
+ reproduction. The Commons follow the same path for the same reason. *)
- Steps 1-3 (Tasks 4-5): the observed celebration's own proper, else the
- day's own temporal slug in the lectionary, else -- for a weekday whose
- own slug has no entry -- the preceding Sunday's temporal slug (never its
- observed one; a Sunday is guarded out because it has no PRECEDING Sunday
- to resume, not because consulting itself would loop -- [readings] is not
- recursive, see its own implementation comment). A day matching none of
- the three gets [] for now -- the Commons (Task 6) are not built here. *)
+(** The Commons of the 1962 Missal (Epistle and Gospel citations only) and
+ the per-saint assignments that route a readingless class-3 feast to one.
+
+ Two tables rather than one, because the two facts have different
+ warrants and different lifetimes: a FORMULARY is read from the Commune
+ Sanctorum and is the same for every saint sent to it, while an
+ ASSIGNMENT is read from one saint's own date in the Proprium Sanctorum.
+ A diocesan overlay adds assignments; it rarely adds formularies.
+
+ Assignment is explicit per saint, never inferred: {!Colitur_kernel.Subject.t}
+ is [Temporal|Saint|Bvm|Lord] and {!Colitur_kernel.Celebration.t} carries
+ no martyr/confessor/virgin/bishop/abbot classification at all, so there
+ is nothing to infer one from -- those words appear only inside display
+ names. A saint with no proper and no assignment gets no Common. *)
+module Commons : sig
+ type t
+
+ (** No formularies and no assignments -- the identity for this table, and
+ what a caller that genuinely has no Commons data should pass. Every
+ lookup returns [None]; nothing is silently invented. *)
+ val empty : t
+
+ (** Loads from a sexp file. Parse and validation failures come back as
+ [Error], never as an exception, and never at module-initialisation
+ time -- the same contract {!Colitur_kernel.Lectionary.load} makes.
+
+ [Error] (never a silently-degraded lookup) on: a duplicate common id;
+ a duplicate assignment for one saint; a formulary with no citations
+ (indistinguishable downstream from "no Common at all"); and an
+ assignment naming a common that does not exist (likewise). *)
+ val load : string -> (t, string) result
+
+ (** The Commons themselves, canonically sorted by id. *)
+ val formularies : t -> (Slug.t * Citation.t list) list
+
+ (** Saint slug -> common id, canonically sorted by saint. *)
+ val assignments : t -> (Slug.t * Slug.t) list
+end
+
+(** The Common assigned to a saint who has no proper, if any. Exposed for the
+ golden pins, which must show WHICH Common fired, not merely that two
+ citations appeared.
+
+ Takes the table explicitly for the same reason {!readings} takes
+ [~lectionary]: the data is the caller's, not this module's. *)
+val commons_for : commons:Commons.t -> Slug.t -> Citation.t list option
+
+(** The day's Epistle and Gospel citations, or [].
+
+ Four steps, in EXECUTION order 1, 4, 2, 3 (the numbers are the plan's and
+ are kept as written, so that every "step 3" already recorded in a test
+ name, comment or report still means the same branch):
+
+ - {b Step 1} -- the observed celebration's own proper.
+ - {b Step 4} -- a saint who is the day's observed office and has no
+ proper says his assigned Common. Runs before the temporal fallbacks,
+ not after them: this is the only step in the chain with a direct
+ primary-source warrant (the Missal names the Mass at each such saint's
+ own date), and placing it last makes it unreachable on every date in
+ 1583-9999 as well as wrong on the days it would fire. The full
+ argument, with the measurement behind it, is on the branch itself.
+ Guarded so it can only ever apply to a SANCTORAL observed office --
+ a feria, a Sunday, the Triduum and the RG 78 Saturday Office of the
+ BVM (whose observed celebration is its own temporal office) are
+ structurally excluded, not merely absent from the data.
+ - {b Step 2} -- the day's own temporal slug in the lectionary.
+ - {b Step 3} -- for a weekday whose own slug has no entry, the preceding
+ Sunday's temporal slug (never its observed one; a Sunday is guarded
+ out because it has no PRECEDING Sunday to resume, not because
+ consulting itself would loop -- [readings] is not recursive, see its
+ own implementation comment).
+
+ A day matching none of the four gets []. *)
val readings :
lectionary:Lectionary.t ->
+ commons:Commons.t ->
observed:Vocab_ef.rank Celebration.t ->
temporal:(Vocab_ef.season, Vocab_ef.rank) Temporal.t ->
date:Date.t ->