aboutsummaryrefslogtreecommitdiff
path: root/test/test_lectionary_ef.ml
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-22 13:48:08 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-22 13:48:08 +0200
commit94ad73cf74d7f1cf02913e2f462c01028a8ef4b4 (patch)
tree6b184dc0563f8eb43867ca4f8060230f21dedc47 /test/test_lectionary_ef.ml
parentff7fa965d68631b5caac771d6db3a0f2110cb5dd (diff)
downloadcolitur-94ad73cf74d7f1cf02913e2f462c01028a8ef4b4.tar.gz
colitur-94ad73cf74d7f1cf02913e2f462c01028a8ef4b4.zip
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.
Diffstat (limited to 'test/test_lectionary_ef.ml')
-rw-r--r--test/test_lectionary_ef.ml40
1 files changed, 30 insertions, 10 deletions
diff --git a/test/test_lectionary_ef.ml b/test/test_lectionary_ef.ml
index 04076c7..3e0880e 100644
--- a/test/test_lectionary_ef.ml
+++ b/test/test_lectionary_ef.ml
@@ -591,22 +591,22 @@ let test_commons_load_rejects_bad_data () =
let formulary_cases =
[ (* step 1: a saint with his own proper -- same date as
[test_step1_proper_beats_any_common_john_of_god]. *)
- (2038, 3, 8, "john-of-god", Colitur_kernel.Mass_formulary.Proper);
+ (2038, 3, 8, Some "john-of-god", Colitur_kernel.Mass_formulary.Proper);
(* step 2: the day's own temporal slug -- same date as
[test_step2_lenten_feria_has_its_own], Monday of Lent I. *)
- (2026, 2, 23, "ef-lent-1-monday", Colitur_kernel.Mass_formulary.Own_slug);
+ (2026, 2, 23, Some "ef-lent-1-monday", Colitur_kernel.Mass_formulary.Own_slug);
(* step 3: a feria resuming the preceding Sunday. The task brief's own
snippet pinned this date against week 9 ("ef-time-after-pentecost-
sunday-9"); running the real resolver against 2026 shows 3 August
2026 is Monday of week 10, resuming 2 August's "...sunday-10" --
corrected per the brief's own "find the dates by running the current
binary if they drift" instruction. *)
- (2026, 8, 3, "ef-time-after-pentecost-sunday-10",
+ (2026, 8, 3, Some "ef-time-after-pentecost-sunday-10",
Colitur_kernel.Mass_formulary.Preceding_sunday);
(* step 4: a saint sent to a Common -- same date as
[test_step4_commons_perpetua_and_felicity]; [said] is the Common's
OWN id (data/ef/commons.sexp), not the saint's slug. *)
- (2038, 3, 6, "common-of-non-virgins-1", Colitur_kernel.Mass_formulary.Common);
+ (2038, 3, 6, Some "common-of-non-virgins-1", Colitur_kernel.Mass_formulary.Common);
(* Fix round 1 (coordinator review): the RG 309(a)/RG 78 Saturday votive
Mass of Our Lady, structurally reached between steps 4 and 2 (see
[readings]' own implementation comment) but tagged [Votive], not
@@ -623,9 +623,16 @@ let formulary_cases =
2026 verified directly against the real resolver (`colitur day
2026`), not trusted from a supplied date, given this session's own
drifted-pin history: a IV-class Saturday, "Officium sanctae Mariae in
- sabbato", temporal slug [ef-time-after-pentecost-9-saturday]. [said]
- is unaffected by the retag and stays that same (reused ferial) slug. *)
- (2026, 8, 1, "ef-time-after-pentecost-9-saturday", Colitur_kernel.Mass_formulary.Votive) ]
+ sabbato", temporal slug [ef-time-after-pentecost-9-saturday].
+ (CORRECTED, whole-branch review fix round: [said] used to be
+ claimed "unaffected by the retag" and pinned to that same reused
+ ferial slug -- that was the defect this round fixed. [said] is
+ [None] here: the shipped data names no slug for the votive Mass
+ actually said, only for the office it replaces. The office slug
+ itself is checked separately, below, via [observed.slug], not
+ through [said] -- see {!Colitur_kernel.Mass_formulary.t}'s own
+ citation for why the two are no longer conflated.) *)
+ (2026, 8, 1, None, Colitur_kernel.Mass_formulary.Votive) ]
let test_formulary_reports_its_source () =
List.iter
@@ -634,10 +641,10 @@ let test_formulary_reports_its_source () =
match day.Colitur_kernel.Liturgical_day.formulary with
| None -> Alcotest.failf "%04d-%02d-%02d: no formulary" y m d
| Some f ->
- Alcotest.(check string)
+ Alcotest.(check (option string))
(Printf.sprintf "%04d-%02d-%02d slug" y m d)
expected_slug
- (Colitur_kernel.Slug.to_string f.Colitur_kernel.Mass_formulary.said);
+ (Option.map Colitur_kernel.Slug.to_string f.Colitur_kernel.Mass_formulary.said);
Alcotest.(check string)
(Printf.sprintf "%04d-%02d-%02d source" y m d)
(Colitur_kernel.Mass_formulary.source_to_string expected_via)
@@ -645,6 +652,17 @@ let test_formulary_reports_its_source () =
f.Colitur_kernel.Mass_formulary.via))
formulary_cases
+(* [said = None] on the Votive day above does not mean the office is lost --
+ {!Colitur_kernel.Mass_formulary.t}'s own citation says a caller reads it
+ off [observed.slug] instead, on the very same {!Colitur_kernel.
+ Liturgical_day.t}. Checked directly, not merely asserted: the same
+ 1 August 2026 date, same expected slug the old (pre-fix) [said] field
+ used to carry. *)
+let test_votive_office_slug_still_available_via_observed () =
+ let d = day 2026 8 1 in
+ Alcotest.(check string) "2026-08-01 observed slug" "ef-time-after-pentecost-9-saturday"
+ (Colitur_kernel.Slug.to_string d.Colitur_kernel.Liturgical_day.observed.Colitur_kernel.Celebration.slug)
+
let suite =
[ ("step 1: sanctoral proper", `Quick, test_step1_sanctoral_proper);
("step 2: own temporal proper", `Quick, test_step2_lenten_feria_has_its_own);
@@ -685,4 +703,6 @@ let suite =
("Commons.load rejects the four silent-degradation defects", `Quick,
test_commons_load_rejects_bad_data);
("the formulary reports its own source, one day per step", `Quick,
- test_formulary_reports_its_source) ]
+ test_formulary_reports_its_source);
+ ("the Votive office slug is still available via observed, not said", `Quick,
+ test_votive_office_slug_still_available_via_observed) ]