From a2fba71d8cccc765c4a987df99fa780f5467514d Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 25 Aug 2026 22:38:31 +0200 Subject: fix(of): Nativity Vigil no longer suppresses a Sunday of Advent Temporal_of.named claimed 24 December unconditionally as of-nativity-vigil (Sollemnitas), and temporal's dispatch matched named before sunday_slug. On a Sunday 24 December, the Fourth Sunday of Advent -- Tabula I.2, Normae n. 5's own privileged Sundays of Advent, Lent and Easter -- was silently replaced by the Vigil. named now returns None for 24 December when that date is itself a Sunday, so temporal's dispatch falls through to sunday_slug and the day resolves as of-advent-sunday-4. The Vigil Mass is an evening Mass of the following solemnity, not an office belonging to 24 December's own civil day -- the same civil-day-granularity reasoning already applied to Holy Thursday (Precedence_of.band's entry-1 comment) and to expected-divergences-litcal.sexp's L1 entry. Every non-Sunday 24 December is unaffected. Audited every other named entry for the same latent shape (see .superpowers/sdd/of-r8-advent-iv-report.md): none of them has it, either because the date can never fall on a Sunday, or because the date IS the definition of that Sunday (Palm Sunday, Easter, Pentecost, Trinity, Christ the King), or because the competing movable-Sunday windows are constructed to exclude that date. Added test_nativity_vigil_yields_to_advent_sunday, covering 2028-12-24 and 2034-12-24 (both inside the litcal fixture window) and the 2026-12-24 non-Sunday control. Re-ran the litcal layer: no allow-list counts moved, since it compares only season and Ordinary-Time week, and both readings of 24 December are "advent" either way. Updated test_precedence_of.ml's "entry 3, not 9" comment, which had carried this as a known, unfixed defect, to describe the fix; its own pinned assertion (a hand-built Thursday candidate) needed no change. --- test/test_precedence_of.ml | 36 +++++++++++++++++++++++++----------- test/test_temporal_of.ml | 23 +++++++++++++++++++++++ 2 files changed, 48 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/test_precedence_of.ml b/test/test_precedence_of.ml index 4de9f9a..610cbfb 100644 --- a/test/test_precedence_of.ml +++ b/test/test_precedence_of.ml @@ -162,17 +162,31 @@ let part2_cases = entry 3. The pinned assertion above is still correct for the Thursday it names; only the earlier "band 30" framing read as unconditional, which it is not. - There is a real, KNOWN, UNFIXED Phase 1 defect behind this: [named] - (temporal_of.ml) claims 24 December unconditionally and is matched - BEFORE [sunday_slug] in [temporal]'s dispatch, so on a 24-December - Sunday the Fourth Sunday of Advent gets NO office at all -- it is - silently replaced by [of-nativity-vigil]. 2028-12-24 and 2034-12-24 - both fall inside the litcal fixture window, and that layer cannot see - the gap: it compares season and Ordinary-Time week only, and colitur - still says "advent" on that date either way. NOT fixed in this wave - (final review Important #4, ledger ruling R8) -- it changes Phase 1 - behaviour, needs its own tests, and needs the litcal layer re-run. - Carried as the first item of the next task. *) + RESOLVED (task R8, 2026-08-25): the Phase 1 defect this paragraph used + to describe -- [named] (temporal_of.ml) claiming 24 December + unconditionally, matched BEFORE [sunday_slug] in [temporal]'s + dispatch, so a 24-December Sunday silently lost the Fourth Sunday of + Advent to [of-nativity-vigil] -- is fixed. [named] now returns [None] + for 24 December when that date is itself a Sunday, citing Tabula + I.2/Normae n. 5 and the identical Holy Thursday granularity argument + (b) above already makes; [temporal]'s dispatch then falls through to + [sunday_slug] exactly as it does for every other Sunday [named] does + not claim, landing on [of-advent-sunday-4]. Paragraph (d) above + already anticipated the RIGHT band (20, via [is_privileged_sunday]) + for that case; this fix is what makes that band actually reachable + from a real [temporal] call rather than only from this row's own + hand-built candidate. Confirmed on both 2028-12-24 and 2034-12-24 + (test_temporal_of.ml, "nativity vigil yields to Advent Sunday IV"): + [named] claims nothing, [temporal] resolves to [of-advent-sunday-4], + and the non-Sunday case (2026-12-24 here) is unchanged. The litcal + layer was re-run: no allow-list count moved (L1's 36, the 1876 + witnessed Ordinary Time weeks, and the 859 unwitnessed count are all + unchanged), because that layer compares season and Ordinary-Time week + only and both readings of 24 December are "advent" either way -- the + exact blind spot this same paragraph named above. This row's own + pinned assertion (a hand-built candidate, Thursday 2026-12-24, band + 30) needed no change: it was never wrong, only the claim that no test + anywhere exercised the Sunday case. *) ( "entry 3, not 9: the Nativity Vigil is a solemnity, though 24 December \ is also a late-Advent feria", ctx ~iso:"2026-12-24" ~season:Vocab_of.Advent, diff --git a/test/test_temporal_of.ml b/test/test_temporal_of.ml index 7560413..1ccd098 100644 --- a/test/test_temporal_of.ml +++ b/test/test_temporal_of.ml @@ -230,6 +230,28 @@ let test_ferial_slugs () = Alcotest.(check string) "ordinary weekday" "of-ordinary-time-2-monday" (slug_of (d 2026 1 19)); Alcotest.(check string) "lent weekday" "of-lent-6-monday" (slug_of (d 2026 3 30)) +(* R8 fix: a Sunday 24 December must yield the Fourth Sunday of Advent, not + the Vigil -- Tabula I.2/Normae n. 5, and temporal_of.ml's own [named] + comment for the full argument (the same civil-day-granularity reasoning + already applied to Holy Thursday). 2028-12-24 and 2034-12-24 are the two + such Sundays inside the litcal fixture window (2023-12-03..2035-12-01); + 2026-12-24, a Thursday, is the non-Sunday control. *) +let test_nativity_vigil_yields_to_advent_sunday () = + List.iter + (fun (y, label) -> + let dt = d y 12 24 in + Alcotest.(check bool) (label ^ ": 24 Dec is a Sunday") true (D.weekday dt = D.Sun); + Alcotest.(check string) (label ^ ": named claims nothing") "" (named_slug dt); + Alcotest.(check string) (label ^ ": temporal resolves to Advent IV") "of-advent-sunday-4" (slug_of dt); + Alcotest.(check string) (label ^ ": season is still advent") "advent" (season_str dt); + Alcotest.(check (option int)) (label ^ ": week 4") (Some 4) (T.week dt)) + [ (2028, "2028"); (2034, "2034") ]; + (* Non-Sunday 24 December: unaffected, the Vigil still wins. *) + let thu = d 2026 12 24 in + Alcotest.(check bool) "2026: 24 Dec is a Thursday, not a Sunday" true (D.weekday thu <> D.Sun); + Alcotest.(check string) "2026: named still claims the vigil" "of-nativity-vigil" (named_slug thu); + Alcotest.(check string) "2026: temporal still resolves to the vigil" "of-nativity-vigil" (slug_of thu) + let test_colours () = let colour_of dt = (T.temporal dt).Colitur_kernel.Temporal.office.Colitur_kernel.Celebration.colour in Alcotest.(check string) "Good Friday is red" "red" (Colitur_kernel.Colour.to_string (colour_of (d 2026 4 3))); @@ -387,6 +409,7 @@ let suite = Alcotest.test_case "ordinary time resumption" `Quick test_ordinary_time_resumption; Alcotest.test_case "sunday slugs" `Quick test_sunday_slugs; Alcotest.test_case "ferial slugs" `Quick test_ferial_slugs; + Alcotest.test_case "nativity vigil yields to Advent Sunday IV" `Quick test_nativity_vigil_yields_to_advent_sunday; Alcotest.test_case "colours" `Quick test_colours; Alcotest.test_case "domain edges do not raise" `Quick test_domain_edges_do_not_raise; Alcotest.test_case "exhaustive domain sweep" `Slow test_exhaustive_domain_sweep ] -- cgit v1.3