From 94ad73cf74d7f1cf02913e2f462c01028a8ef4b4 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Sat, 22 Aug 2026 13:48:08 +0200 Subject: fix(kernel): Mass_formulary.t.said is honestly optional -- was false for Votive The .mli promised said is "the slug whose Mass is said". For Votive (RG 78/309(a), the Saturday votive Mass of Our Lady) it was set to the day's own ferial slug -- whose Mass is exactly the one NOT said. A consumer joining rubrics to readings on that slug would silently get the wrong Mass: 2026-01-03 reports ef-christmas-1-saturday, which has zero entries in data/ef/lectionary.sexp, because the citations actually come from bvm_saturday_citations, a season-keyed function with no slug of its own anywhere in the shipped data. Chose the type-honest fix over the interim documentation one: said is now Slug.t option, None exactly for Votive, because there is genuinely no slug in the shipped data this field could report for that one source. Adding real ids for the five seasonal BVM Masses (the reviewer's first option) is out of scope -- a data restructuring this round explicitly does not carry. Threading the office slug through a second field was considered and rejected as redundant: the day's own office is already available on the same Liturgical_day.t via observed.slug, which every caller already has in scope regardless of via, so said does not need to duplicate it. colitur rubrics stays byte-identical: rubrics_line already has d.observed in scope and falls back to its slug when said is None, printing the exact value it always printed for a Votive row (verified directly, diffed against pre-fix output across four years). colitur day/readings are unaffected (neither reads Mass_formulary at all). colitur emit --format sexp's pretty-printed line count for 2027 moved 9011 -> 9025: every day's formulary record widened by said's own extra option wrapping, and to_string_hum wraps by column width. Cosmetic only, diffed line by line to confirm every change is this shape or a consequent wrap shift; recorded in test/cli.t alongside the 476(f) note it now sits next to. --- lib/kernel/mass_formulary.ml | 4 +++- lib/kernel/mass_formulary.mli | 29 +++++++++++++++++++++++++---- lib/rites/rite_ef/lectionary_ef.ml | 30 ++++++++++++++++++------------ lib/rites/rite_ef/lectionary_ef.mli | 14 +++++++++----- 4 files changed, 55 insertions(+), 22 deletions(-) (limited to 'lib') diff --git a/lib/kernel/mass_formulary.ml b/lib/kernel/mass_formulary.ml index cb3532b..60f9f1c 100644 --- a/lib/kernel/mass_formulary.ml +++ b/lib/kernel/mass_formulary.ml @@ -1,5 +1,7 @@ +open Sexplib0.Sexp_conv + type source = Proper | Own_slug | Preceding_sunday | Common | Votive [@@deriving sexp] -type t = { said : Slug.t; via : source } [@@deriving sexp] +type t = { said : Slug.t option; via : source } [@@deriving sexp] let source_to_string = function | Proper -> "proper" diff --git a/lib/kernel/mass_formulary.mli b/lib/kernel/mass_formulary.mli index a2faf64..b990e69 100644 --- a/lib/kernel/mass_formulary.mli +++ b/lib/kernel/mass_formulary.mli @@ -27,10 +27,31 @@ type source = is the RG 78/309(a) Saturday Mass of Our Lady. *) [@@deriving sexp] -type t = { said : Slug.t; via : source } [@@deriving sexp] +type t = { said : Slug.t option; via : source } [@@deriving sexp] -(** The slug whose Mass is said. For {!Proper}, {!Own_slug} and {!Votive} - this is the day's own; for {!Preceding_sunday} it is that Sunday's - TEMPORAL slug; for {!Common} it is the Common's own id. *) +(** The slug whose CITATIONS were actually used to build the day's + readings, when the shipped data can name one. + + [Some] for four of the five sources: {!Proper} and {!Own_slug} each + carry the day's own slug; {!Preceding_sunday} carries that Sunday's + TEMPORAL slug; {!Common} carries the Common's own id. + + [None] for {!Votive}, and ONLY for {!Votive} (whole-branch review fix + round, celebrant-rubrics-phase1): RG 309(a)'s five seasonal "Missae de + sancta Maria in sabbato" carry no slug of their own anywhere in the + shipped data -- their citations come from a season-keyed function + ({!Rite_ef.Lectionary_ef.bvm_saturday_citations}), never from a + [Lectionary.find] against any slug, so there is genuinely no slug this + field could honestly report. An earlier version of this type set + [said] to the day's own OFFICE slug for {!Votive} too (RG 78's Office + of Our Lady, kept unchanged under the votive Mass) -- readable at the + call site as "this is the slug whose Mass is said", which is false for + exactly this one case: that slug's own [Lectionary] entry, if it has + one at all, is NOT what the day's citations came from. [None] says so + directly instead of silently mis-naming a Mass. The day's own OFFICE + is not lost by this change -- it is still on the very same + {!Liturgical_day.t} this formulary lives on, via [observed.slug], + which every caller already has in scope regardless of [via]; this + field does not need to duplicate it. *) val source_to_string : source -> string diff --git a/lib/rites/rite_ef/lectionary_ef.ml b/lib/rites/rite_ef/lectionary_ef.ml index 1fba3de..b996412 100644 --- a/lib/rites/rite_ef/lectionary_ef.ml +++ b/lib/rites/rite_ef/lectionary_ef.ml @@ -260,7 +260,7 @@ let is_bvm_saturday_office (observed : Vocab_ef.rank Celebration.t) let readings ~lectionary ~commons ~observed ~temporal ~date ~temporal_at = match observed.Celebration.citations with | _ :: _ as cs -> - (Some { Mass_formulary.said = observed.Celebration.slug; via = Mass_formulary.Proper }, cs) + (Some { Mass_formulary.said = Some observed.Celebration.slug; via = Mass_formulary.Proper }, cs) | [] -> ( (* Step 4: a saint who is the day's observed office and has no proper says his assigned Common. The assignment is explicit, never @@ -357,7 +357,7 @@ let readings ~lectionary ~commons ~observed ~temporal ~date ~temporal_at = if sanctoral_office then commons_for ~commons observed.Celebration.slug else None with | Some (common_id, cs) -> - (Some { Mass_formulary.said = common_id; via = Mass_formulary.Common }, cs) + (Some { Mass_formulary.said = Some common_id; via = Mass_formulary.Common }, cs) | None -> ( (* The votive Mass of Our Lady on Saturday (RG 309(a)) runs HERE: after the proper (step 1) and the Common (step 4), which answer @@ -407,23 +407,29 @@ let readings ~lectionary ~commons ~observed ~temporal ~date ~temporal_at = [bvm_saturday_citations]'s own season-keyed SELECTION, not merely that some BVM Mass was chosen. - [said] is UNCHANGED by this correction and stays the day's own - temporal slug: [is_bvm_saturday_office] only ever fires when - [sanctoral_office] above is false, i.e. the observed celebration - already IS the day's own temporal office (the office + [said] used to be set HERE to the day's own temporal slug + (reasoning: [is_bvm_saturday_office] only ever fires when + [sanctoral_office] above is false, i.e. the observed + celebration already IS the day's own temporal office, which deliberately reuses the ordinary ferial slug, [Temporal_ef]'s - own [bvm_saturday_names]) -- only [via] needed correcting, the - office/Mass split [Votive] exists to name. *) + own [bvm_saturday_names]). CORRECTED (whole-branch review fix + round): that value is the OFFICE's slug, not the slug whose + Mass is actually said -- the five seasonal Masses RG 309(a) + names have no slug of their own anywhere in the shipped data, + so [said] is [None] here, honestly, rather than silently + naming the wrong thing. See {!Colitur_kernel.Mass_formulary.t}'s + own [said] citation for the full account; the office itself is + not lost, it is still [observed.slug] on the very same + {!Colitur_kernel.Liturgical_day.t} this formulary lives on. *) if is_bvm_saturday_office observed temporal then - let said = temporal.Temporal.office.Celebration.slug in - ( Some { Mass_formulary.said; via = Mass_formulary.Votive }, + ( Some { Mass_formulary.said = None; via = Mass_formulary.Votive }, bvm_saturday_citations temporal.Temporal.season ~month:(Date.month date) ~day:(Date.day date) ) else match Lectionary.find lectionary temporal.Temporal.office.Celebration.slug with | Some cs -> ( Some - { Mass_formulary.said = temporal.Temporal.office.Celebration.slug; + { Mass_formulary.said = Some temporal.Temporal.office.Celebration.slug; via = Mass_formulary.Own_slug }, cs ) | None -> ( @@ -478,5 +484,5 @@ let readings ~lectionary ~commons ~observed ~temporal ~date ~temporal_at = with | Some cs -> let said = sunday_temporal.Temporal.office.Celebration.slug in - (Some { Mass_formulary.said; via = Mass_formulary.Preceding_sunday }, cs) + (Some { Mass_formulary.said = Some said; via = Mass_formulary.Preceding_sunday }, cs) | None -> (None, [])))) diff --git a/lib/rites/rite_ef/lectionary_ef.mli b/lib/rites/rite_ef/lectionary_ef.mli index 0797c0d..715e9c2 100644 --- a/lib/rites/rite_ef/lectionary_ef.mli +++ b/lib/rites/rite_ef/lectionary_ef.mli @@ -123,11 +123,15 @@ val commons_for : commons:Commons.t -> Slug.t -> (Slug.t * Citation.t list) opti naming which of the five seasonal Masses is said, not a marker of the Mass's kind; see the implementation comment on this branch for the full account and the validation use this correction still leaves - available for Task 6.) [said] is still that slug: only the source - constructor differs from an ordinary Step 2 lookup, because the guard - that reaches this branch only ever fires when the observed celebration - already IS the day's own temporal office -- see the implementation - comment on that branch. + available for Task 6.) [said] is [None] here (whole-branch review fix + round, celebrant-rubrics-phase1): the five seasonal Masses RG 309(a) + names carry no slug of their own anywhere in the shipped data, so + there is no slug this field could honestly report -- see + {!Colitur_kernel.Mass_formulary.t}'s own [said] citation for the full + account. The day's own OFFICE (the guard that reaches this branch + only ever fires when the observed celebration already IS the day's + own temporal office) is unaffected and is still [observed.slug] on + the same {!Colitur_kernel.Liturgical_day.t}. - {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 -- cgit v1.3