From f8d694d0cc19b71598e1ab64254efb069969f0a0 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Sat, 15 Aug 2026 00:36:43 +0200 Subject: kernel+ef: fix round 1 -- lectionary caller-supplied, not eager Critical (coordinator review): a clean `dune build` produced a `colitur` that died at startup on EVERY subcommand, including ones touching no lectionary data at all. Root cause was two-fold: data/ef/lectionary.sexp was never added to the root default-build alias (only materialised as a side effect of the test suite's own deps, which is why every check in the prior report passed), and Rite_ef.context loaded it as a module-init side effect via failwith, undoing Lectionary.load's own "never raises" promise at a point no caller could catch. Fixed structurally: Rite_ef.context is now a function taking ~lectionary, Lectionary_ef.readings takes ~lectionary, and neither touches the filesystem any more -- the same caller-supplied discipline the sanctoral layer already had, restoring rite_ef.mli's own pre-existing claim about it and leaving a seam for a future diocesan lectionary overlay. bin/main.ml grows load_ef_lectionary, a sibling of load_ef_layer, routed through the same colitur: %s / exit 2 path. data/ef/lectionary.sexp added to the root default alias. Every caller of Rite_ef.context updated to supply it. Also: two new tests that genuinely distinguish chain step 1 from step 2 (19 March 2026, Joseph's own proper over a competing temporal entry; 13 January 2030, Holy Family reached only through the temporal slug, the Baptism entirely absent) -- the prior two tests both survived swapping the chain order. Both new pins verified directly against the real data. The chain's own comment now states plainly that its warrant is lectio's observed behaviour, not a confirmed Missal citation, per the rules register's own open item. --- test/test_differential.ml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/test_differential.ml') diff --git a/test/test_differential.ml b/test/test_differential.ml index a4e550d..0b68f90 100644 --- a/test/test_differential.ml +++ b/test/test_differential.ml @@ -207,6 +207,13 @@ let real_layer () = (List.map Overlay.diagnostic_to_string diagnostics); layer +(* [Rite_ef.context] takes [~lectionary] (fix round 1, coordinator review) -- + caller-supplied, same as [real_layer] above. *) +let real_lectionary () = + match Colitur_kernel.Lectionary.load "../data/ef/lectionary.sexp" with + | Ok l -> l + | Error e -> Alcotest.failf "../data/ef/lectionary.sexp: failed to load: %s" e + (* --- The seven-column row both streams share (commemorations excluded, --- *) (* limit 1 above). *) type row = { @@ -255,9 +262,10 @@ let lectio_rows () = List.map row_of_line (read_lines fixture_path) test_rite_ef.ml already made for [real_layer] above. *) let colitur_rows_2005_2050 () = let layer = real_layer () in + let rite = Rite_ef.context ~lectionary:(real_lectionary ()) in let by_rata : (int, (V.season, V.rank) LD.t) Hashtbl.t = Hashtbl.create 20000 in for y = 2004 to 2050 do - let days = Cal.year Rite_ef.context layer y in + let days = Cal.year rite layer y in Array.iter (fun (d : (V.season, V.rank) LD.t) -> Hashtbl.replace by_rata (Date.to_rata d.LD.date) d) days done; let mk y m d = match Date.make ~year:y ~month:m ~day:d with Ok t -> t | Error e -> failwith e in -- cgit v1.3