aboutsummaryrefslogtreecommitdiff
path: root/test/test_differential.ml
Commit message (Collapse)AuthorAgeFilesLines
* test(differential): split the Holy Family/Baptism collision out of C1 (C15)Lukasz Kasprzak2026-08-131-0/+34
| | | | | | | | | | | | | | | | | | | | | | | Before this task's Holy Family fix, colitur's generic Sunday fallback lost outright to the fixed Commemoration of the Baptism of the Lord on 13 January whenever it fell on a Sunday, producing the SAME slug lectio's own tridentine-calendar.ini shows there -- squarely inside C1's own 6-13 January blanket (only Season differed). Now that Holy Family (RG 17(b)) correctly outranks the fixed Baptism and excludes it as a commemoration (RG 91 entry 14, RG 112(a)), colitur's own slug on those seven dates (2008, 2013, 2019, 2030, 2036, 2041, 2047) changes to ef-time-after-epiphany-sunday-1 -- a genuine identity divergence against lectio, which has no Holy Family at all. C1's own predicate does not absorb it (jan_6_13_slug has no entry for that slug), so it surfaced as unexplained, exactly the check the task brief asked for: split it out into its own cited entry rather than widening C1's predicate to swallow it silently. C1's own expected_rows moves 368 -> 361 (back to its pre-rebootstrap value, for a third and different reason than either of the first two moves recorded in its own note); the new C15 covers the 7 rows, gated on the literal date list AND colitur's own slug, the same identity guard C1/C6/C8/C14 already apply.
* test(differential): two Layer C predicates that counted rows, not identitiesLukasz Kasprzak2026-08-121-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Both are the "cardinality where identity was required" flavour, and both were demonstrated passing a real defect by the fixture-refresh review rather than argued. C6 accepted `subset diffs [ Slug_f; Rank ]` while its own note said the shape had narrowed to slug-only after lectio's Christmas-octave rank was corrected. That did not merely over-permit: every one of the 138 rows already carries a Slug_f diff, so an added Rank diff changed neither the diff-set membership nor the count, and the entry was blind. Dropping the RG 91 entry 17 elevation in temporal_ef (Class2 -> Class4 on octave days 5-7) left both differential tests green with C6 still reporting 138. Narrowed to `diffs = [ Slug_f ]`; the same mutation now reddens both. C14 gated on lectio's date alone, with no colitur-slug guard, though fix round 1's finding 1 had established that a predicate must pin which celebration its citation is about -- C1, C6 and C8 all carry that guard. With compare_deferred switched to RG 98 origin order the observed celebration flips to the Annunciation on all three dates, and C14 still matched exactly 3 rows with its count pin green; the suite reddened only because the sibling dates fell outside every predicate. Guard added. No behaviour change: 277 tests green, and the allow-list counts are unmoved (C6 138, C14 3).
* test(differential): refresh the lectio fixture, close 9 entries, add C14Lukasz Kasprzak2026-08-121-107/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lectio moved 2386a45 -> 3b32c00 (seven EF calendar defects fixed, plus a sanctoral-generator root-cause fix); the committed fixture predates all of them. Regenerated with the same command the provenance note already named (`go run ./cmd/lectio-ef-dump 2005 2050`), read-only against lectio -- nothing there was touched. New SHA-256 asserted in both the provenance note and test_differential.ml's fixture_sha256. The dumper's two new name_en/name_pl columns are kept verbatim (the fixture is meant to be the exact command's raw output; the comparator already discards everything past field 7). Every C-entry's expected_rows was re-derived independently against the refreshed fixture (a Python re-implementation of diff_fields/ layer_c_reason, cross-checked against the real OCaml comparator's own failure output), not transcribed from a green run. Nine entries -- C2, C3, C4, C5, C7, C10, C11, C12, C13 -- now match zero rows and are closed: sexp row removed, layer_c_reason predicate and its now-dead helper bindings removed, citation preserved in docs/research/rules-register.md's new §3d with the specific lectio commit that fixed each one. C1 (361 -> 368) absorbs C13's former 7 rows now that lectio's own slug matches there too. C6 (138, unchanged count) narrows to a slug-only shape now that lectio's rank agrees. C8 (31, unchanged) survives untouched -- lectio still computes no Rogation days. C9's old shape ("Joseph observed ON a Lent Sunday") is also closed, but a narrower, different divergence survived under the same saint's slug: 3 years (2008, 2035, 2046) where Joseph's own congested RG96 walk collides with the Annunciation's separately-transferred "sedes propria". The old predicate's broad "any diff involving this slug" match was silently absorbing both under one citation -- split into a new id, C14, rather than folded back into C9, since the two are unrelated rules. lectio's own commit history (09a1444) documents this residual as a gap it deliberately left unresolved; colitur gives Joseph a real transferred day either way, which is why C14's verdict stands regardless of a genuinely open sub-question (recorded in the register, not resolved here) about which of the two feasts should claim the contested day first under RG98's "prius impeditum" wording. Re-triaged the full remaining 4975 raw differences: only 10 distinct field-diff signatures now, all resolving to Layer A/B noise or the four surviving citations, 0 unexplained. The crude "Sunday-rank" and "Holy Thursday" residues the task flagged both fully resolve once the real Layer A/B machinery runs (season-spelling and week-numbering artifacts, not substantive divergences) -- see the task report for the derivation. Teeth proof: perturbing ferial_rank to reproduce C4's old defect made 140 rows reappear as unexplained (the exact prior C4 count), reverted after capturing the failure message. 277 tests green (dune test) and 278 with COLITUR_EXHAUSTIVE_SWEEP=1 (the extra case is the 1583-9999 sweep itself).
* test(differential): fix round 1 (F2, F5) -- split 13-Jan-Sunday into C13Lukasz Kasprzak2026-08-121-5/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 13 January retagged subject=Lord (previous commit's regeneration) makes RG16(a) fire on the 7 years it falls on a Sunday within 2005-2050 (2008, 2013, 2019, 2030, 2036, 2041, 2047): colitur now observes the Baptism of the Lord itself where it used to observe the generic Sunday slug. The diff signature against lectio's fixture widens from {season;colour} to {season;slug;colour} -- but jan_6_13_slug already pre-authorised this exact slug across the whole 6-13 January window (correctly, for the other 39 non-Sunday years), so layer_c_reason routed the new, wider-shape rows into C1 unchanged, and C1's own expected_rows (a pure row count) did not move. A count proving cardinality where identity was required -- on the one day this branch itself already flags as still wrong under RG 112. Split into its own entry, C13, matched by an exact 7-date literal list checked before C1 in the if/elif chain. C1's own expected_rows corrected 368 -> 361 (independently re-derived: a Python script reading data/ef/sanctoral.sexp's regenerated output and the committed lectio fixture directly, replicating diff_fields/layer_c_reason's own logic outside the OCaml comparator -- not transcribed from the failing comparator's own count). C13's own citation records a refinement over the coordinator's framing, checked directly rather than assumed: lectio's committed fixture is a frozen snapshot that predates lectio's own equivalent fix to this entry's class field (the same staleness shape as C12). Confirmed by building lectio's own cmd/lectio-ef-dump from its current source tree (read-only) and running it fresh for all 7 dates -- lectio's LIVE engine now agrees with colitur's slug/rank/colour exactly, disagreeing only on season (the already-understood C1 divergence). This is not evidence colitur's answer is right against the Missal -- it is not (register's own RG112 item) -- only that this specific divergence from the fixture is a staleness artifact, not a live disagreement between the two engines' current logic. Also fixes F5: C12's own note said "5 of the 15 corrected slugs" while listing and counting 7 -- corrected to 7. Also corrects the module header's stale "13 January ... slug/rank/colour already equal lectio's exactly, in all 46 years" claim (true only for the 39 non-Sunday years now).
* test(differential): allow-list C12 for the 15-entry rank correctionLukasz Kasprzak2026-08-121-4/+22
| | | | | | | | | | | | | | | | | | | | | | | Re-bootstrapping sanctoral.sexp (previous commit) makes 7 of the 15 newly-corrected III-class feasts win an occurrence they previously lost as Commemoration_only: RG 91 entry 24 (a universal III-class feast) outranks entry 28 (a IV-class feria), and the occurrence code that resolves this already existed and needed no change. lectio's own committed differential fixture (test/fixtures/lectio-ef-2005-2050.txt) is a frozen snapshot predating lectio's own equivalent generator fix, so it still shows the class-4 feria observed with the same saint only as a trailing commemoration -- a new, expected divergence from that fixture, 14 rows in the 2005-2050 window. expected_rows (14) is independently re-derived by grepping the regenerated sanctoral.sexp's own post-regeneration civil-day output against the committed lectio fixture directly (two flat-file extractions cross-checked against each other), not transcribed from the comparator's own failing-test output. C12 reuses an id last used, and removed, by the RG16(a) task's own reverted Purification retag -- noted at both the old and new entries' own comments so the id's history is visible to a future reader.
* fix(rite-ef,kernel): follow the oracle on the Purification; admit reads the ↵Lukasz Kasprzak2026-08-121-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | day's own Sunday-ness, not observed Fix round 1 review, two findings landed together because each golden pin's correctness depends on both. CRITICAL (item 1): reverts this branch's own first-pass retag of the Purification (2 February) from Lord back to Bvm -> Lord. The calendarium titles it 'B. Mariae Virg.', but missalemeum -- this project's designated EF oracle -- treats it as taking an occurring II-class Sunday's place outright, commemorations empty, exactly RG16(a)'s own festum Domini treatment (2020-02-02, 2014-02-02, independently fetched). Control, 2019-09-08 (the Nativity of the BVM, an ordinary Marian feast, on a Sunday): the Sunday observed, the feast merely commemorated -- the opposite pattern, proving the Purification's own oracle treatment is deliberate, not a gap. RG16(a) alone, on the untouched data, would have matched the oracle character for character; retagging Bvm is what moved colitur away from it on 1200 domain-wide days. The user has ruled: follow the oracle. Genuine primary-text counter-evidence (RG120(b), the colour rule grouping 2 February under 'B. Mariae Virg.', a category separate from 'Domini') is recorded in the register, not discarded -- a different project could reasonably rule the other way on the same evidence. most-holy-name-of-mary stays retagged Bvm; that one was never disputed. Removes the now-unneeded C12 lectio allow-list entry (data/ef/ expected-divergences.sexp, test_differential.ml): with the Purification Lord again, colitur matches lectio's own class = lord on every affected date, no divergence to allow-list. IMPORTANT (item 2): Precedence.rules.admit gains a ~temporal parameter -- a genuine kernel signature change, unlike RG16(a) itself. RG111(b)'s own Sunday rank floor ('one commemoration, namely of a II-class feast') used to be detected by reading observed's own slug for a Sunday marker, which silently assumed observed IS the day's temporal-cycle office. RG16(a) breaks that assumption on purpose: a Feast of the Lord standing in for an impeded Sunday 'cum omnibus iuribus et privilegiis' keeps the day a dominica II classis for RG111(b) too, even though the FEAST, not the Sunday, is observed. Before this fix an unrelated saint (Pope Sixtus II et al., 6 August, Class3) was wrongly admitted into the freed slot on every one of 1178 domain-wide days. Oracle-confirmed directly: 2023-08-06 (a Sunday) shows him displaced, commemorations empty; 2026-08-06 (an ordinary Thursday) shows him admitted -- being a Sunday is exactly what excludes him. admit now reads Sunday-ness off ~temporal (the day's own temporal-cycle candidate, passed through from Precedence.resolve unchanged) instead of observed. Validate's own admission fixed-point invariant updated to pass the same real temporal candidate through. Both golden pins in test_golden.ml were promoted from actual colitur day output without independently consulting the rubric or the oracle first -- a real defect the review caught. Re-derived from both before re-pinning: 2028-08-06 and 2025-02-02 now pin comms=[], no commemoration at all, matching missalemeum exactly in both cases.
* data(ef): retag the Purification and Most Holy Name of Mary as BVM, not LordLukasz Kasprzak2026-08-121-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both entries carried (subject Lord) in data/ef/sanctoral.sexp, inherited unchecked from lectio's own class = lord field. The calendarium says otherwise: 2 February reads "IN PURIFICATIONE B. MARIAE VIRG." and 12 September reads "Sanctissimi Nominis Mariae" -- both name Mary, not the Lord, unlike the four genuine Lord entries' own "D. N. I. C." formula (Precious Blood, Transfiguration, Exaltation of the Holy Cross, Dedication of the Archbasilica of the Most Holy Saviour), all of which were checked against the same calendarium and left untouched. This matters together with RG16(a): applying the rule while the Purification was still mistagged Lord would have made it outrank an occurring II-class Sunday and then wrongly suppress that Sunday's own commemoration under RG16(a) too, the opposite of the intended fix. Retagged, the Purification no longer bands at RG91 entry 14, so the Sunday is observed and the Purification survives as its own ordinary commemoration. Corrected via a new data/ef/adjustments.sexp overlay (Set_subject Bvm), the same mechanism that file already uses to suppress vigil-of-christmas as a bootstrap duplicate, not a hand-edit of sanctoral.sexp itself: that file's own header asks for edits to go through the generator, and its SHA-256 provenance covers a byte-faithful mirror of lectio's INI. The Purification retag changes which day the lectio differential observes on 2 February whenever it falls on a Sunday (six years, 2005-2050); allow- listed as C12 in data/ef/expected-divergences.sexp, expected_rows derived independently (date -d <year>-02-02 for each year in range), not transcribed from a comparator run.
* kernel(temporal): Holy Thursday is white, per RG128(b)'s named exceptionLukasz Kasprzak2026-08-121-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | RG 128(b) excepts "Missa sive Chrismatis sive in Cena Domini feria V Hebdomadae sanctae" from the Septuagesima-to-Easter-Vigil violet span as a whole-Mass exception (unlike Palm Sunday's blessing/procession, which the same sentence carves out as only part of that day) -- so Holy Thursday's Mass is white, not violet. temporal_ef.ml fell through to the generic Passiontide ferial path (season_colour Passiontide = violet) for this date, since [named] has no entry for the Triduum at all (rank was already correct via [privileged_feria]; only colour was wrong). Found via Task 16's missalemeum oracle comparison: every other Triduum day's oracle colour set includes violet as an option (Good Friday "bv", Holy Saturday "vw" -- already-flagged, deliberately deferred per-action gaps, register §3b), but Holy Thursday's is white alone. This is a genuine NEW divergence from lectio too (lectio has no such exception and still prints violet for Holy Thursday) -- added as Layer C11 to the differential harness and data/ef/expected-divergences .sexp, 46 rows (2005-2050), rather than silently changing what that harness accepts. Also corrected a stale comment on season_colour claiming white's RG paragraph was never pinned -- RG 119 was found and cited in the register on 2026-08-11 but the correction was never copied into this file's own comment.
* test(differential): gate C1/C6 on slug family, pin the fixture's SHA-256Lukasz Kasprzak2026-08-121-10/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix round 1 on Task 15's review, four findings closed. C1 and C6 previously gated on calendar date alone -- unlike every other Layer C entry, which also checks the actual colitur slug that won. A future sanctoral change producing an unrelated celebration with the same diff shape (e.g. a promoted 29-31 December saint landing on C6's own [Slug_f; Rank]) would have been silently absorbed under a citation that has nothing to do with the real cause. Both entries now require, whenever Slug_f is in the diff set, that colitur's own slug be a member of an explicit closed list (jan_6_13_slug, nativity_octave_day_slugs) -- the same style advent_feria_slug already used for C4. Constructed the exact substitution via a temporary (unshipped) overlay Replace directive promoting thomas-becket to Class1 Feast White; confirmed the tightened predicate refuses to absorb it (46 unexplained rows, one per year); reverted. C10 gained the diff-field-subset restriction every other entry already had (it previously fired on the two pinned dates regardless of which fields differed). Fixed a stale doc comment ("SIX" columns; field has five constructors). The fixture's provenance note now records its SHA-256, and the suite asserts it as its own first test case (test_fixture_checksum), so a hand-edited or partially re-copied fixture fails loudly instead of silently becoming an unlabelled snapshot. Computed via the system sha256sum binary through Sys.command plus a redirected-output temp file -- no new library dependency, not even unix. Constructed a one-byte fixture edit and confirmed the checksum test fails independently of the row-comparison test; reverted. 237/237 tests green, clean-build verified.
* test: differential vs lectio 2005-2050 with a cited allow-listLukasz Kasprzak2026-08-121-0/+494
Validation layer 3 (design spec's five): compares colitur's real day-by-day EF output against lectio (sibling project, Go), 2005-2050, one line per civil day. Of 16801 day-pairs, 11206 already agree on the seven leading columns; the 5595 that don't resolve into exactly 25 distinct field-diff signatures, all triaged. Three strictly separate layers, per the controller's ruling (the brief's single flat allow-list assumed a handful of differences, not 5595): - Layer A (test_differential.ml, norm_season/norm_slug): vocabulary. An explicit, closed table of naming synonyms with no liturgical substance (lectio's easter/christmas vs colitur's paschaltide/christmastide; a handful of slugs that are two names for the identical office). No wildcards -- every entry is a literal string pair. - Layer B (strip_epiphany_index): numbering. The one slug family whose lectio/colitur index offset is not a constant (Time-after-Epiphany week numbering, register 3c#5) has its embedded digit stripped to a common form on both sides before comparing; rank and colour stay fully compared. - Layer C (data/ef/expected-divergences.sexp): the cited allow-list. Ten genuine liturgical disagreements, each citing its RG paragraph and naming which engine is right (always colitur, verified against the Missal/register, never against lectio's own behaviour). This is the only layer permitted to cover a difference in rank, colour, or which celebration is observed. Five extend or restate register 3c's already- documented divergences (season boundary, Sunday I-class, Advent Ember ferias, Rogations); five are new, found and adjudicated in this task (Lent Ember days, the Nativity Octave, Ember-day-vs-saint precedence, the St Joseph transfer off a Lent Sunday, and the 2011 Sacred Heart / Precious Blood / Visitation collision). expected_rows on each entry is an exact regression pin, asserted by the test, not documentation. 13 January (register 6's long-open "Baptism of the Lord" item) is confirmed empirically fixed already -- Task 11's sanctoral wiring closed it before this task started -- so it is not allow-listed; the only residual difference there is the season boundary already covered by C1. Two stated limits carried from the brief (commemorations are not comparable; lectio's own EF oracle asserts season only, 2025-2026 only, so a rank/colour difference is not presumptive evidence against colitur) plus a third found during this task (the week column is a display convention on both sides, not a liturgical fact, and is not compared at all) are documented in the test file's own doc comment. Fixture: test/fixtures/lectio-ef-2005-2050.txt, committed as plain text (1.4 MB), generated by lectio commit 2386a45; provenance recorded in the sibling .provenance file. Colitur's side is recomputed fresh from the library on every run, through the same Calendar/Rite_ef pipeline `colitur day` uses, not the compiled binary. Proved the harness has teeth by two reverted perturbations: a genuine colour difference injected into a fully-covered fixture row fails the "no unexplained differences" check with the exact mismatched row printed; a one-row drift in an allow-list entry's expected_rows fails the count check independently, showing it is not merely a duplicate of the first assertion. 236/236 tests green, clean-build verified, deterministic across OCAMLRUNPARAM=R.