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_golden.ml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test/test_golden.ml') diff --git a/test/test_golden.ml b/test/test_golden.ml index a873738..188e37f 100644 --- a/test/test_golden.ml +++ b/test/test_golden.ml @@ -63,6 +63,7 @@ module V = Rite_ef.Vocab_ef runs from _build/default/test/). *) let sanctoral_path = "../data/ef/sanctoral.sexp" let adjustments_path = "../data/ef/adjustments.sexp" +let lectionary_path = "../data/ef/lectionary.sexp" (* Loaded once at module init, same convention test_validate.ml's own [real_ef_layer] uses (not test_oracle.ml/test_differential.ml's @@ -83,12 +84,21 @@ let real_ef_layer = (String.concat "; " (List.map Overlay.diagnostic_to_string diagnostics))); layer) +(* [Rite_ef.context] takes [~lectionary] (fix round 1, coordinator review) -- + caller-supplied, same as [real_ef_layer] above. *) +let real_ef_lectionary = + match Colitur_kernel.Lectionary.load lectionary_path with + | Error e -> failwith (Printf.sprintf "%s: failed to load: %s" lectionary_path e) + | Ok l -> l + +let real_ef_rite = Rite_ef.context ~lectionary:real_ef_lectionary + let mk y m d = match Date.make ~year:y ~month:m ~day:d with Ok t -> t | Error e -> failwith e (* [Cal.day] recomputes its whole liturgical year on every call (calendar.mli -- "pure, no cache"); acceptable here, same as test_rite_ef.ml's own use of [Cal.year] for a handful of dates, not a hot loop. *) -let fetch y m d = Cal.day Rite_ef.context real_ef_layer (mk y m d) +let fetch y m d = Cal.day real_ef_rite real_ef_layer (mk y m d) let slug_s (c : V.rank Cel.t) = Slug.to_string c.Cel.slug let rank_s (c : V.rank Cel.t) = V.rank_to_string c.Cel.rank -- cgit v1.3