summaryrefslogtreecommitdiff
path: root/internal/calendar/oracle_ef_test.go
Commit message (Collapse)AuthorAgeFilesLines
* caldata: the Lenten Ember days were serving Lent I Sunday's MassLukasz Kasprzak2026-08-171-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Three lectionary sections were keyed ef-lent-1-{wednesday,friday,saturday} while temporal_ef.go's efEmberSlug computes ef-lent-ember-{wed,fri,sat}. The lookup in caldata.Readings takes the observed slug and has no alias table, so it missed the entries entirely and fell through to the preceding-Sunday fallback. Every Lenten Ember day since the data was added has served Lent I Sunday's Mass -- three days a year, in a season that prints a proper Mass daily. The values were already right; only the keys were wrong, and they were stale rather than mistaken: they predate Lent being added to efEmberSlug, and scripts/genlect.go keys off day.Observed.Slug, so re-running it would already write the correct names. Advent and September were never affected -- both already use the -ember- form. Renamed, and verified the whole file: every one of the 119 section names is now a slug the calendar actually computes, checked by sweeping 2005-2050. Those three were the only dead keys. Added TestEFLectionaryKeysAreReachableSlugs to make the class detectable rather than just this instance. Mutation-tested: reverting the three keys fails it, naming all three. Found by differencing against colitur, the sibling OCaml engine, while giving it a lectionary of its own. Worth recording how nearly it escaped: colitur inherited the same wrong keys from this file during its bootstrap, so both engines produced the same wrong Mass and the differential between them was silent. It only surfaced when colitur's data was checked against the Missal itself. Two implementations agreeing is not evidence when one was seeded from the other.
* oracle_ef_test: three structural coverage gaps in the strengthened testLukasz Kasprzak2026-08-121-5/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cheap fixes flagged in review, all confirmed against the committed snapshot before being applied: 1. An unmapped season phrase skipped the RANK AND COLOUR checks too, not just the season comparison -- `continue` in the wrong place. Confirmed live: neither Holy Thursday ("maundy"/"holy week" do not match the title "Holy Thursday" itself) nor any of the six September Ember days (no "ember" case exists at all; the Advent and Lent Ember days only ever passed by an incidental substring match on "advent"/"lent") had any oracle coverage at all -- reverting the Holy Thursday colour fix left this test green. Season skip and rank/colour checks are now independent. 2. Colour membership alone cannot catch a Rose regression: violet is a member of every rose/violet pair by construction (Gaudete/ Laetare), so "got violet, want one of [rose violet]" passed even with RG 131's Rose support removed entirely. On the day the pair actually names (oracle rank 1, the Sunday itself, not a weekday reusing its propers), a colour set containing rose now demands rose specifically. 3. `has("sexagesima")` never matched missalemeum's own ligatured "Sexagesimæ" -- confirmed in the committed snapshot: the ligatured form appears 10 times, the unligatured form only 4, and every ligatured instance mapped to season "" (skipped from ALL coverage, not merely a season miss, given finding 1 above). Normalised once, generally (æ -> ae), not as a single hardcoded word, so any other ligature this generator's own data may carry is covered too. Net effect on TestOracleEF: 730 checked (up from 691), 29 skipped (down from 39) -- the 10 reclaimed by fix 3. Still green: 0 unallow-listed rank or colour mismatches over the full snapshot.
* test(ef): un-gate the oracle test now the seven defects are fixedLukasz Kasprzak2026-08-121-10/+0
| | | | | | | | | Remove the LECTIO_EF_ORACLE_STRICT gate added when the strengthened rank/colour assertions first landed. All seven defects are fixed as of the previous four commits; TestOracleEF now passes unconditionally as part of the normal go test ./... run, with its small, cited allow-list (four entries, none of them one of the seven) doing the only remaining filtering.
* test(ef): strengthen the oracle test to assert rank and colourLukasz Kasprzak2026-08-121-12/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | internal/calendar/oracle_ef_test.go asserted Season only. lectio's own EF oracle test comment said as much ("rank/colour are reported informationally"), which is exactly why several precedence/colour defects in precedence_ef.go and temporal_ef.go shipped without ever failing a test: the suite was green while the observed office's own rank and liturgical colour could be wrong. Rebuild the oracle from the committed missalemeum snapshot (sources/snapshot.tar.gz, missalemeum/en/YYYY-MM-DD.json, 2026-01-01 .. 2027-12-31, 730 days) instead of a live 2025-2026 fetch, via a rewritten scripts/build-oracle-ef.sh -- offline, reproducible, and correctly separating info.rank/info.colors from info.id (whose embedded rank is the rank of the propers REUSED that day, not the day's own rank -- e.g. 2026-01-02 is a class-4 feria carrying id "sancti:01-01:1:w" because it reuses the Circumcision's propers). info.colors is an array (14 of 730 days carry two values -- Gaudete/ Laetare "pv", Palm Sunday "rv", Good Friday "bv", Holy Saturday "vw"), so the new Colour assertion is membership, not equality. The strengthened assertions immediately expose several real defects (rank mismatches on every Advent/Lent Sunday, the Ember days, the late-Advent and Christmas-octave ferias, and more) -- that is the point, this is the regression net subsequent commits fix against. Since the repo's convention is go test ./... green at every commit, TestOracleEF is gated behind LECTIO_EF_ORACLE_STRICT=1 for now rather than landed red; a later commit removes the gate once the fixes are in. Season alone stays green throughout (unchanged, always was). A small, cited allow-list (efAllowList) is included from this commit: genuine, defensible divergences unrelated to the fixes ahead of it -- RG 91 entry 27's un-built BVM Saturday Office, the pre-existing 6-13 January Christmastide/time-after-Epiphany season-boundary divergence, missalemeum's own RG 33 gap on a Sunday 9 August, and one collision (St Joseph vs the Friday of Passion Week, 2027) left explicitly unresolved even by the sibling project's much deeper primary-source pass. None of the four is one of the seven defects this branch fixes.
* test(calendar): EF oracle vs missalemeum 2025-2026 (0 season mismatches)Lukasz Kasprzak2026-07-271-0/+116
temporalEF validated against Divinum Officium data. Season-mapping handles the Whit octave (Paschaltide), the Christmas vigil (Advent), and the resumed Epiphany Sundays (within Time after Pentecost).