aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-28 16:15:13 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-28 16:15:13 +0200
commit4fb9eac2fdb9bc22af2b63c1d5df6da7780b58cf (patch)
treefecd834254d5b1c2fdf2bc4319a4d3038ca38e98 /test
parentd0807440309e2357d51cd56c72a443072b0ba57f (diff)
downloadcolitur-4fb9eac2fdb9bc22af2b63c1d5df6da7780b58cf.tar.gz
colitur-4fb9eac2fdb9bc22af2b63c1d5df6da7780b58cf.zip
test(of): pin the six corrupt Year II Gospels in Ordinary Time
Built the litcal readings comparison the OF provenance notes had left as future work, and it found a defect class the existing layers structurally could not see: the litcal layer compares season, grade and identity, and stops there, so every reading colitur serves has been validated by nothing except the lineage it arrived on. Ten references are corrupt. Nine end at verse 22 where the OLM ends them at 20; the tenth reads "Matthew 17:9a,10-135", a verse Matthew 17 does not have. Every one lives in a Year II entry or in of-advent-2-saturday, which has no year cycle -- not one Year I entry is affected, which is what makes this a transcription fault rather than ten independent slips. This commit adds only the detection, and only for the six the invariant can reach. In Ordinary Time the OF weekday Gospel does not depend on the year of the cycle: OLM n. 69 point 4 alternates the FIRST reading and leaves the Gospel a single one-year series. So of-ordinary-time-<n>-<day>-i and its -ii twin must carry the same Gospel string, and six pairs do not. Scoped to Ordinary Time deliberately. The unscoped sweep reports 17 further disagreeing pairs in of-advent-3/4-* and of-christmas-*, all of them correct: those weekdays are keyed to the calendar DATE (OLM n. 69 point 3), so their -i/-ii entries describe two different dates rather than two years of one cycle. An unscoped test would report seventeen false positives and would, rightly, be switched off by whoever read it next. Pinned rather than green, because the fix is not ours to make here: data/of/lectionary.sexp's own header forbids hand-editing a generated artifact, and lectio's internal/caldata/of-lectionary.ini carries all ten verbatim. The exact six are listed, so the test fails if a seventh appears and equally if one is fixed without updating the list -- both are changes a reader must see. Mutation-tested in both directions: introducing a seventh violation reddens it, and correcting Mark 1:14-22 reddens it too. Evidence for the corrections, in docs/research/of/olm-1981-ocr.txt, the Latin OLM itself rather than a witness: "Mc 1, 14-20", "Mc 4, 1-20", "Mc 5, 1-20", "Mt 7, 15-20", "Mt 17, 14-20", "Mt 18, 15-20", "1 Sam 1, 9-20", "1 Sam 3, 1-10. 19-20", "Mt 17, 10-13". litcal independently confirms three of the six Gospels and all four references the invariant cannot reach. James 5:13-22 is unlocatable in the OCR but impossible on its face: James ends at 5:20.
Diffstat (limited to 'test')
-rw-r--r--test/test_lectionary_of.ml78
1 files changed, 77 insertions, 1 deletions
diff --git a/test/test_lectionary_of.ml b/test/test_lectionary_of.ml
index dc02176..6b599c1 100644
--- a/test/test_lectionary_of.ml
+++ b/test/test_lectionary_of.ml
@@ -488,6 +488,79 @@ let test_christmas_date_keyed_no_drift () =
check_year 2024;
check_year 2025
+(* ------------------------------------------------------------------ *)
+(* In ORDINARY TIME the OF weekday Gospel does not depend on which year of
+ the two-year cycle is running: OLM n. 69 point 4 alternates the FIRST
+ reading between Year I and Year II and leaves the Gospel a single
+ one-year series. So for every [of-ordinary-time-<n>-<day>-i] there is an
+ [...-ii] whose Gospel reference is the SAME STRING, and a pair that
+ disagrees is a data defect rather than a liturgical fact.
+
+ This is deliberately scoped to Ordinary Time. The same sweep over the
+ whole file reports 17 further disagreeing pairs in [of-advent-3/4-*] and
+ [of-christmas-*] -- all of them CORRECT: those weekdays are keyed to the
+ calendar DATE (17-24 December, and the Christmas octave, OLM n. 69
+ point 3, the rule [date_keyed_slug] above implements), so their -i/-ii
+ entries describe two different dates rather than two years of one cycle.
+ An unscoped version of this test would report seventeen false positives
+ and would, correctly, be switched off by whoever next read it.
+
+ PINNED, NOT GREEN (2026-08-28). Six pairs violate the invariant today,
+ and every one is the same transcription fault: a Year II Gospel ending at
+ verse 22 where the OLM ends it at 20. All six are confirmed against the
+ Latin OLM itself (docs/research/of/olm-1981-ocr.txt: "Mc 1, 14-20",
+ "Mc 4, 1-20", "Mc 5, 1-20", "Mt 7, 15-20", "Mt 17, 14-20",
+ "Mt 18, 15-20"), and three of them independently against litcal.
+
+ The defect is UPSTREAM and verbatim -- lectio's own
+ internal/caldata/of-lectionary.ini carries all six -- and this file's own
+ header forbids hand-editing a generated artifact, so the correction has to
+ be made there and the file regenerated. Until then the exact six are
+ listed here. The test fails if a SEVENTH appears, and equally if one is
+ FIXED without updating this list: both are changes a reader must see. *)
+let known_year_ii_gospel_defects =
+ [ "of-ordinary-time-1-monday";
+ "of-ordinary-time-12-wednesday";
+ "of-ordinary-time-18-saturday";
+ "of-ordinary-time-19-wednesday";
+ "of-ordinary-time-3-wednesday";
+ "of-ordinary-time-4-monday" ]
+
+let test_ordinary_time_gospel_is_year_independent () =
+ let entries = Lectionary.entries (real_lectionary ()) in
+ let gospel_of cits =
+ match List.find_opt (fun c -> c.Colitur_kernel.Citation.part = Colitur_kernel.Citation.Gospel) cits with
+ | Some c -> Some c.Colitur_kernel.Citation.reference
+ | None -> None
+ in
+ let by_slug = List.map (fun (s, c) -> (Slug.to_string s, gospel_of c)) entries in
+ let find s = match List.assoc_opt s by_slug with Some g -> g | None -> None in
+ let has_prefix p s = String.length s >= String.length p && String.sub s 0 (String.length p) = p in
+ let has_suffix suf s =
+ String.length s >= String.length suf && String.sub s (String.length s - String.length suf) (String.length suf) = suf
+ in
+ let ordinary_time_stems =
+ List.filter_map
+ (fun (s, _) ->
+ if has_prefix "of-ordinary-time-" s && has_suffix "-i" s && not (has_suffix "-ii" s) then
+ Some (String.sub s 0 (String.length s - 2))
+ else None)
+ by_slug
+ in
+ let stems = List.sort_uniq compare ordinary_time_stems in
+ let violations =
+ List.filter
+ (fun stem ->
+ match (find (stem ^ "-i"), find (stem ^ "-ii")) with
+ | Some a, Some b -> a <> b
+ | _ -> false)
+ stems
+ in
+ Alcotest.(check bool) "the sweep actually found Ordinary Time pairs to check" true (List.length stems > 100);
+ Alcotest.(check (list string))
+ "Ordinary Time: Year I and Year II share one Gospel, except the six pinned upstream defects"
+ known_year_ii_gospel_defects (List.sort compare violations)
+
let suite =
[ Alcotest.test_case "Sunday cycle table (OLM n.66, straddles Advent I)" `Quick test_sunday_cycle_table;
Alcotest.test_case "weekday cycle table (OLM n.69.4, straddles Advent I)" `Quick test_weekday_cycle_table;
@@ -504,5 +577,8 @@ let suite =
Alcotest.test_case "O-Antiphon date-keyed reading does not drift (17 December)" `Quick
test_o_antiphon_no_drift;
Alcotest.test_case "Christmas-season date-keyed reading does not drift (2 January)" `Quick
- test_christmas_date_keyed_no_drift
+ test_christmas_date_keyed_no_drift;
+ Alcotest.test_case
+ "Ordinary Time Gospel is year-independent (OLM n. 69.4); six upstream defects pinned" `Quick
+ test_ordinary_time_gospel_is_year_independent
]