aboutsummaryrefslogtreecommitdiff
path: root/test/test_citation_coverage_of.ml
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-26 14:28:50 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-26 14:28:50 +0200
commite5cbc662227de4f3ab0089fe73f639f4f84601a4 (patch)
tree264b29424d2d3371f6f31f2b87ac111c74622808 /test/test_citation_coverage_of.ml
parente5066c0d082a09eca3d4c8bbf8da1cc04dde9104 (diff)
downloadcolitur-e5cbc662227de4f3ab0089fe73f639f4f84601a4.tar.gz
colitur-e5cbc662227de4f3ab0089fe73f639f4f84601a4.zip
fix(citation): make the well-formed reading-part set rite-supplied
I7 (final-review.md, 2026-08-25-colitur-of-phases-3-5): OF Sundays and solemnities shipped without the Second reading, and the lectionary data header called the First reading an "Epistle" -- EF vocabulary. The sole blocker was Validate's own kernel-hardcoded assertion that a well-formed day's sorted citation parts are exactly [First; Gospel]; Citation.part already carried Second. Rite.t gains citation_shapes : Citation.part list list, the fourth EF-shaped kernel misfit (after Preface.t, Mass_formulary.source, transfer_target's strictly-later contract) and the first fixed rather than only documented. EF supplies its one shape unchanged; OF supplies two, [First; Gospel] on a feria/feast/memorial and [First; Second; Gospel] on a Sunday or solemnity (OLM 1981 Praenotanda n. 66.1 vs n. 69.1, n. 84(b)/(c), page-image verified against olm-1981.pdf). Validate's "citations" check now matches against the rite's own declared shapes rather than a single literal pattern, preserving all three invariants it always enforced: zero or one complete shape, never partial; no part outside what the rite declares; no part repeated. bootstrap_lectionary_of.ml's cite now extracts a Second reading from Sunday-cycle ini sections only, correctly excluding the one stray `second` field lectio's snapshot carries on a weekday-cycle section (a content-verified scraping artifact). The hand-authored Christmas Day entry gains its own Second reading from the same OLM passage already cited for its First/Gospel. Regenerated data/of/lectionary.sexp: 771 entries unchanged, citation fields 1542 -> 1725 (+183, all Second readings), SHA-256 re-pinned, header wording fixed and a new coverage bullet added. Responsorial Psalm is deliberately still not emitted -- OLM 1981 Praenotanda n. 71 itself lists it apart from the readings proper as a chant with its own refrain, and the finding driving this change names only the missing Second reading. EF output verified byte-identical to the branch start (empty lib/rites/rite_ef + data/ef diff since v1.0.0, plus a direct binary comparison of `day`/`readings` for 2026, 1583 and 9999 against a worktree build of the pre-change commit). Tests: three new fixtures in test_validate.ml prove the generalisation holds both directions (a multi-shape rite accepts either of its declared shapes; a rite that never declared a shape still rejects it). test_citation_coverage_of.ml's pinned residual grows 41 -> 49, all new entries the same already-understood chapter-crossing shape.
Diffstat (limited to 'test/test_citation_coverage_of.ml')
-rw-r--r--test/test_citation_coverage_of.ml31
1 files changed, 22 insertions, 9 deletions
diff --git a/test/test_citation_coverage_of.ml b/test/test_citation_coverage_of.ml
index 70e63ad..7badd96 100644
--- a/test/test_citation_coverage_of.ml
+++ b/test/test_citation_coverage_of.ml
@@ -27,9 +27,20 @@
and {!Colitur_citation.Render}'s own consumption of it), deliberately
not built this task.
+ UPDATED, fix wave I7 (final-review.md, 2026-08-25-colitur-of-phases-3-5,
+ 2026-08-26): {!Rite.t.citation_shapes} (kernel change) plus
+ tools/bootstrap_lectionary_of.ml's own [cite] now also extract a Second
+ reading on every Sunday-cycle (Sunday/solemnity) entry, so the total grew
+ 1542 -> 1725 (+183, exactly the count data/of/lectionary.sexp's own
+ header COVERAGE (5) now discloses) and the unparseable residual grew
+ 41 -> 49: the same chapter-crossing shape, now also hit by 8 of the 183
+ new Second-reading references. Not a new failure MODE, just a bigger
+ population drawing from the same, already-understood one -- confirmed
+ below by [looks_chapter_crossing], unchanged, still holding for all 49.
+
This file pins that residual EXACTLY -- not merely "at least these fail"
-- so it fails loudly in BOTH directions: a NEW unconverted reference
- appearing (a regression) and one of these 41 starting to convert (this
+ appearing (a regression) and one of these 49 starting to convert (this
list going stale, e.g. because a future task builds cross-chapter
support) are both caught, the same discipline every allow-list in this
project's suite already follows (`expected_rows`, `expected_bands`, the
@@ -48,12 +59,14 @@ let lectionary () =
can never silently drift apart without one of them visibly failing to
regenerate/re-test clean. *)
let known_cross_chapter_residual =
- [ "1 Corinthians 12:31-13:13"; "1 John 1:5-2:2"; "1 John 2:29-3:6"; "1 John 3:22-4:6";
- "1 John 4:19-5:4"; "2 Corinthians 3:15-4:1,3-6"; "2 Samuel 18:9-10,14b,24-25a,30-19:3";
- "Colossians 1:24-2:3"; "Ecclesiastes 11:9-12:8"; "Ephesians 4:32-5:8"; "Exodus 11:10-12:14";
- "Exodus 14:21-15:1"; "Ezekiel 2:8-3:4"; "Galatians 4:22-24,26-27,31-5:1"; "Genesis 1:1-2:2";
- "Genesis 1:20-2:4a"; "Habakkuk 1:12-2:4"; "Hebrews 7:25-8:6"; "Isaiah 52:13-53:12";
- "Isaiah 8:23b-9:3"; "John 15:26-16:4a"; "John 18:1-19:42"; "Jonah 1:1-2:2,11"; "Luke 7:36-8:3";
+ [ "1 Corinthians 10:31-11:1"; "1 Corinthians 12:31-13:13"; "1 John 1:5-2:2"; "1 John 2:29-3:6";
+ "1 John 3:22-4:6"; "1 John 4:19-5:4"; "1 Thessalonians 3:12-4:2"; "2 Corinthians 3:15-4:1,3-6";
+ "2 Corinthians 4:13-5:1"; "2 Samuel 18:9-10,14b,24-25a,30-19:3"; "2 Thessalonians 1:11-2:2";
+ "2 Thessalonians 2:16-3:5"; "2 Timothy 3:14-4:2"; "Colossians 1:24-2:3"; "Ecclesiastes 11:9-12:8";
+ "Ephesians 4:30-5:2"; "Ephesians 4:32-5:8"; "Exodus 11:10-12:14"; "Exodus 14:21-15:1";
+ "Ezekiel 2:8-3:4"; "Galatians 4:22-24,26-27,31-5:1"; "Genesis 1:1-2:2"; "Genesis 1:20-2:4a";
+ "Habakkuk 1:12-2:4"; "Hebrews 7:25-8:6"; "Isaiah 52:13-53:12"; "Isaiah 8:23b-9:3";
+ "James 3:16-4:3"; "John 15:26-16:4a"; "John 18:1-19:42"; "Jonah 1:1-2:2,11"; "Luke 7:36-8:3";
"Malachi 1:14b-2:2b,8-10"; "Mark 2:23-3:6"; "Mark 8:34-9:1"; "Matthew 10:34-11:1";
"Matthew 18:21-19:1"; "Matthew 9:35-10:1,5a,6-8"; "Matthew 9:36-10:8";
"Numbers 13:1-2,25-14:1,26a-29a,34-35"; "Philippians 3:17-4:1"; "Revelation 20:1-4,11-21:2";
@@ -91,9 +104,9 @@ let test_of_citations_convert_or_are_the_known_cross_chapter_residual () =
cits)
(Colitur_kernel.Lectionary.entries (lectionary ()));
let bad = List.sort compare !bad in
- Alcotest.(check int) "1542 citation fields in data/of/lectionary.sexp today -- if this changes, the \
+ Alcotest.(check int) "1725 citation fields in data/of/lectionary.sexp today -- if this changes, the \
pinned residual below may need updating too, not just this count"
- 1542 !total;
+ 1725 !total;
Alcotest.(check (list string)) "the unconverted set is EXACTLY the known cross-chapter residual, no \
more and no fewer"
(List.sort compare known_cross_chapter_residual) bad;