aboutsummaryrefslogtreecommitdiff
path: root/test/test_rite_ef.ml
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-12 17:13:06 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-12 17:13:06 +0200
commita2654a1e4d8987a251bcefbad2b0f0b867a6c6e6 (patch)
tree39360eccd3fa8ee5379fc46276d1e0ef0e6ff2b5 /test/test_rite_ef.ml
parente19adb9c7ea369cafe76e7eff50e9248a4a954d0 (diff)
parente5b368dec8fdc9ab983ee0f1dee69c37883cbe12 (diff)
downloadcolitur-a2654a1e4d8987a251bcefbad2b0f0b867a6c6e6.tar.gz
colitur-a2654a1e4d8987a251bcefbad2b0f0b867a6c6e6.zip
Merge branch 'ef-rg16a': RG 16(a), RG 111(b), RG 113, and commemoration identity
Closes the largest known-wrong-output item on record (RG 16(a): a Feast of the Lord occurring on a II-class Sunday leaves the Sunday uncommemorated -- 5996 wrong days over 1583-9999) together with RG 111(b)'s rank floor on the day it holds, and gives the oracle layer the ability to compare commemoration identity rather than only presence and count. Also corrects a methodological defect that had produced wrong rulings in both this project and its sibling: docs/research/ holds an electronic transcription alongside two photographic scans, and the transcription silently drops commemoration lines -- seven across the year. Reasoning from its silence had convicted the oracle wrongly on 14 August and ruled a genuine 9 August commemoration spurious. The scans are the primary source; the rule is now recorded at the top of the register. RG 113 replaces an alphabetical same-rank tie-break that had no rubrical warrant. A bare Commemoratio has no row in RG 91's table at all, so band no longer hands one the entry of a III-class universal feast: 4451 days, all four reordered pairs verified against a photographic scan, zero observed-day changes.
Diffstat (limited to 'test/test_rite_ef.ml')
-rw-r--r--test/test_rite_ef.ml94
1 files changed, 93 insertions, 1 deletions
diff --git a/test/test_rite_ef.ml b/test/test_rite_ef.ml
index c150a6d..84dc060 100644
--- a/test/test_rite_ef.ml
+++ b/test/test_rite_ef.ml
@@ -87,6 +87,53 @@ let test_vigil_of_christmas_suppressed () =
Alcotest.(check bool) "vigil-of-christmas appears NOWHERE in the resolved year" false
appears_anywhere
+(* RG16(a) task (register §6.0 + the sanctoral subject audit, this task's
+ own report). data/ef/sanctoral.sexp is left untouched (still a faithful
+ mirror of lectio, subject `Lord` for every entry below except
+ `most-holy-name-of-mary` -- see test_sanctoral_ef.ml's own "explicit
+ class = lord" spot-check, which loads that file WITHOUT applying this
+ overlay and still passes); the one real correction lives entirely in
+ data/ef/adjustments.sexp's single remaining [Edit] directive, the same
+ mechanism [test_vigil_of_christmas_suppressed] above already proves for
+ a sibling bootstrap defect.
+
+ CORRECTED, fix round 1 (CRITICAL finding, item 1): this test used to
+ also assert `purification-of-the-blessed-virgin-mary` was retagged
+ `Bvm`. REVERTED -- the user has ruled: follow the oracle (register §6.0
+ has the full account, both the calendarium argument for `Bvm` and the
+ oracle evidence against it). The Purification is `Lord` again, one of
+ FIVE untouched entries this test now re-verifies, not four.
+
+ This is the ONE test in the suite that observes the one live retag
+ actually takes effect through the real pipeline -- without it, a typo in
+ the directive's slug (silently a no-op diagnostic, not a hard failure --
+ Overlay.apply's own contract) or a reverted adjustments.sexp would leave
+ every other test green ([test_sanctoral_ef.ml] deliberately never
+ applies the overlay). Also re-verifies the five entries the audit
+ confirmed correct and left untouched, so a future accidental retag of
+ one of THEM would be caught here too, not just the one that changed. *)
+let test_rg16a_subject_retag_in_effect () =
+ let layer = real_layer () in
+ let subject_of slug =
+ match Layer.find layer (Slug.of_string_exn slug) with
+ | Some e -> e.Layer.cel.Cel.subject
+ | None -> Alcotest.failf "slug %s not found in the overlaid layer" slug
+ in
+ Alcotest.(check bool) "Most Holy Name of Mary retagged Bvm (calendarium: \"Nominis Mariae\")" true
+ (subject_of "most-holy-name-of-mary" = Subject.Bvm);
+ Alcotest.(check bool)
+ "Purification stays Lord (reverted, fix round 1 -- the user's ruling: follow the oracle)" true
+ (subject_of "purification-of-the-blessed-virgin-mary" = Subject.Lord);
+ Alcotest.(check bool) "Precious Blood stays Lord (calendarium: \"D. N. I. C.\") -- audit, not touched" true
+ (subject_of "precious-blood-of-our-lord-jesus-christ" = Subject.Lord);
+ Alcotest.(check bool) "Transfiguration stays Lord (calendarium: \"D. N. I. C.\") -- audit, not touched" true
+ (subject_of "transfiguration-of-our-lord" = Subject.Lord);
+ Alcotest.(check bool) "Exaltation of the Holy Cross stays Lord -- audit, not touched" true
+ (subject_of "exaltation-of-the-holy-cross" = Subject.Lord);
+ Alcotest.(check bool)
+ "Dedication of the Archbasilica of the Most Holy Saviour stays Lord -- audit, not touched" true
+ (subject_of "dedication-of-the-archbasilica-of-our-holy-savior" = Subject.Lord)
+
(* Coordinator review, finding 2, reproduced through the project's OWN
extension path (an overlay), the same way the reviewer found it: adding
an I-class feast on 25 December (competing against, and losing to, the
@@ -251,10 +298,51 @@ let test_search_genuinely_enters_the_window () =
"the walked span is at least 8 days -- the octave alone (Easter..Easter+7), not a one-day hop"
true (List.length walked >= 8)
+(* Task B fix round 1 (coordinator finding 1), end to end with REAL data:
+ 22 September 2027 is a September Ember Wednesday -- the OBSERVED day is
+ the Ember office itself ([band] entry 18, RG 91, beats both sanctoral
+ candidates), and RG 111(c) ("other II class: one") admits exactly ONE
+ of the two competing losers, "maurice-and-companions-martyrs"
+ ([Commemoration_only], Class3) and "thomas-of-villanova" ([Feast],
+ Class3). Before the fix, [Precedence_ef.band] gave Maurice the SAME
+ table entry (24) as Thomas, so the residual slug tie-break picked
+ Maurice ('m' < 't') and OMITTED Thomas -- contrary to the calendarium's
+ own 22 September row ("S. Thomae de Villanova Ep. et Conf., III
+ classis. / Commemoratio Ss. Mauritii et Soc. Mm.": Thomas is the one
+ WITH a table entry) and to missalemeum (test/test_oracle.ml's own
+ former M17 allow-list entry -- oracle "commemorations": Thomas,
+ "displaced": Maurice -- deleted once this fix made the divergence
+ disappear). This is the SAME date the oracle harness itself checks,
+ pinned here too so a regression shows up at the OCaml level, not only
+ via the fixture comparison. *)
+let test_maurice_thomas_band_fidelity_end_to_end () =
+ let layer = real_layer () in
+ (* [Calendar.year]'s own liturgical-year convention (Advent-anchored, see
+ calendar.ml's [year_bounds]): the label [y] spans December of civil
+ year [y] through November of civil year [y+1], so 22 September 2027
+ is reached via [Cal.year ... 2026], not 2027 -- the same
+ [y-1]/straddling indexing test_oracle.ml's own header comment already
+ documents for exactly this reason. *)
+ let days = Cal.year Rite_ef.context layer 2026 in
+ let day = Array.to_list days |> List.find (fun d -> Date.compare d.LD.date (mk 2027 9 22) = 0) in
+ Alcotest.(check string) "the September Ember Wednesday office itself is observed (band entry 18)"
+ "ef-september-ember-wed" (slug_of day.LD.observed);
+ Alcotest.(check (list string))
+ "St Thomas of Villanova (band entry 24, a real table row) is the sole commemoration"
+ [ "thomas-of-villanova" ]
+ (List.map (fun (c, _) -> slug_of c) day.LD.commemorations);
+ Alcotest.(check (list string))
+ "St Maurice and Companions (Commemoration_only, unclassified -- no table row) is omitted, not \
+ commemorated"
+ [ "maurice-and-companions-martyrs" ]
+ (List.map (fun (c, _) -> slug_of c) day.LD.omitted)
+
let suite =
( "Rite_ef (real data: overlay-in-effect, domain-ceiling)",
[ Alcotest.test_case "the overlay suppression is observably in effect" `Quick
test_vigil_of_christmas_suppressed;
+ Alcotest.test_case "RG16(a) task: the two subject retags are in effect, the other four untouched"
+ `Quick test_rg16a_subject_retag_in_effect;
Alcotest.test_case "RG96 search does not raise at the domain ceiling (real data)" `Quick
test_transfer_search_does_not_raise_at_domain_ceiling;
Alcotest.test_case "no transfer ever lands inside [Easter, Easter+7], 2005-2050" `Quick
@@ -262,4 +350,8 @@ let suite =
Alcotest.test_case "transfer_target skips the whole Easter octave from inside Holy Week" `Quick
test_transfer_target_skips_the_whole_easter_octave;
Alcotest.test_case "the search genuinely enters the window (not vacuous)" `Quick
- test_search_genuinely_enters_the_window ] )
+ test_search_genuinely_enters_the_window;
+ Alcotest.test_case
+ "band fidelity end-to-end: Ember Wednesday observed, Thomas of Villanova the sole \
+ commemoration, Maurice omitted (2027-09-22)" `Quick
+ test_maurice_thomas_band_fidelity_end_to_end ] )