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_calendar.ml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test/test_calendar.ml') diff --git a/test/test_calendar.ml b/test/test_calendar.ml index 2f6df6d..aeaeea0 100644 --- a/test/test_calendar.ml +++ b/test/test_calendar.ml @@ -464,6 +464,13 @@ let real_ef_layer_for_transfer_probes = if diagnostics <> [] then failwith "unexpected overlay diagnostics loading the real EF layer"; layer) +(* [Rite_ef.context] takes [~lectionary] (fix round 1, coordinator review) -- + caller-supplied, same as the sanctoral layer above. *) +let real_ef_lectionary_for_transfer_probes = + match Colitur_kernel.Lectionary.load "../data/ef/lectionary.sexp" with + | Error e -> failwith ("../data/ef/lectionary.sexp: " ^ e) + | Ok l -> l + let test_transferred_commemoration_only_capped_out_at_target_settles_cleanly () = let probe_date = match Colitur_kernel.Date_spec.fixed ~month:4 ~day:26 with Ok d -> d | Error e -> failwith e @@ -479,7 +486,11 @@ let test_transferred_commemoration_only_capped_out_at_target_settles_cleanly () let augmented_layer = Colitur_kernel.Layer.set real_ef_layer_for_transfer_probes probe in (* Liturgical year "2010" (Advent 2010 -- eve of Advent 2011) covers both 25 and 26 April 2011. *) - let year = C.year Rite_ef.context augmented_layer 2010 in + let year = + C.year + (Rite_ef.context ~lectionary:real_ef_lectionary_for_transfer_probes) + augmented_layer 2010 + in let find_date target = match Array.to_list year |> List.find_opt (fun d -> D.compare d.LD.date target = 0) with | Some d -> d -- cgit v1.3