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. --- bin/main.ml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'bin/main.ml') diff --git a/bin/main.ml b/bin/main.ml index f957190..582c776 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -397,13 +397,27 @@ let readings_line ~lang ~sigla (d : (Rite_ef.Vocab_ef.season, Rite_ef.Vocab_ef.r least surprising choice for a machine-readable field). Unlike [formulary], [d.creed] is a plain [bool] with no [option] to guard: a rite that has not implemented the rule answers [false] outright, so - there is no third "unknown" state this column could ever need to print. *) + there is no third "unknown" state this column could ever need to print. + + Whole-branch review fix round: {!Colitur_kernel.Mass_formulary.t.said} + itself gained an [option] (its own citation has the full account -- + [None] exactly for [Votive], where the shipped data genuinely names no + slug for the Mass actually said). This column's own OUTPUT does not + change for that reason: when [said] is [None] it falls back to + [d.observed]'s own slug -- the SAME value this column always printed + for a [Votive] day before [said] became honest, and it is a value this + function already has in scope regardless of [via]. So this is not + "print a placeholder for the missing case", it is "the value was + already available from a different field, and still is". *) let rubrics_line (d : (Rite_ef.Vocab_ef.season, Rite_ef.Vocab_ef.rank) Colitur_kernel.Liturgical_day.t) = let said, via = match d.Colitur_kernel.Liturgical_day.formulary with | Some f -> - ( Colitur_kernel.Slug.to_string f.Colitur_kernel.Mass_formulary.said, + ( Colitur_kernel.Slug.to_string + (match f.Colitur_kernel.Mass_formulary.said with + | Some s -> s + | None -> d.Colitur_kernel.Liturgical_day.observed.Colitur_kernel.Celebration.slug), Colitur_kernel.Mass_formulary.source_to_string f.Colitur_kernel.Mass_formulary.via ) | None -> ("-", "-") in -- cgit v1.3