Files
vu/tests/calendar/april-sanctoral.test.ts
T
will 7482df1777
Deploy / deploy (push) Successful in 1m56s
Give each day of Easter's octave its own real content
Easter Monday-Saturday previously all inherited Easter Sunday's single
collect and single-nocturn Matins content via the shared `easter-sunday`
temporal id, even though the reference engine gives each of the six days
its own real proper (own title, rank, collect, Gospel+homily). Adds six
new temporal-feasts records (anchor `{kind: easter, offset: 1..6}`, same
mechanism as the Passiontide batch), six new collects transcribed from
each day's own Office Oratio, and six new nocturn-readings files with
each day's own Gospel pericope (from the Missal) and patristic homily.

Also fixes two mechanism gaps this surfaced: hours/matins.ts's 3-nocturn/
Sunday-style gate was keyed by `winner.id` (now per-weekday) instead of
`temporalId` (still shared for the whole octave, which is what actually
supplies the content); and the Wednesday-Saturday ferial antiphon
override was keyed by the old shared `easter-sunday` id.

Fact-checked two adjacent assumptions along the way: commemorations stay
fully suppressed Monday-Saturday (the user's own 2026-09-01 "no
commemoration from Palm Sunday through Low Sunday" instruction already
covers this span, unchanged), and the correct per-day names are "Die N
infra Octavam Paschæ" (Mon-Fri) / "Sabbato in Albis" (Sat only) rather
than a blanket "Hebdomada in Albis" for every day.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W8cttEhwbN3f6hiHQHqCae
2026-09-06 08:38:49 -04:00

101 lines
5.4 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { resolveDay } from '../../src/calendar';
import { getDayCollect } from '../../src/hours/resolve-common';
// Clean per-annum years for these dates (no Sunday collision, and clear of
// the movable Holy Week/Easter Octave that usually overshadows several of
// them) — see data/calendar/saints/*.yml for per-saint source detail.
describe('April sanctoral pull (first pass)', () => {
it('St. Mark wins outright with a real proper collect on an ordinary date', () => {
const day = resolveDay('2042-04-25');
expect(day.winner).toEqual({
kind: 'sanctoral',
id: 'st-mark',
name: 'St. Mark, Evangelist',
nameLa: 'Sanctus Marcus, Evangelista',
rank: 'duplex-2-classis',
});
expect(getDayCollect(day).status.en).toBe('verified');
});
it('St. Mark gets nothing at all within the Easter Octave — not even a bare commemoration — and surfaces on the 1st day of the Easter-octave backlog instead', () => {
// Corrected 2026-09-01: nothing is ever commemorated anywhere from
// Palm Sunday through Low Sunday, no exception for any rank (direct
// instruction; live-verified against the Annunciation on Holy
// Thursday and Chair of St. Peter at Antioch on Ash Wednesday, both
// Duplex-majus+ and both transferring with zero commemoration). Per
// further direct instruction the same day, this doesn't cascade
// day-by-day looking for a free day: the Nth day after Low Sunday
// celebrates the Nth candidate that cleared the backlog's own
// duplex-majus+ floor that year (native-date order), winning
// outright and demoting whatever would have natively been there to
// a commemoration — see calendar/index.ts's `applyEasterOctaveBacklog`.
// Mark (Duplex II. classis, well above the floor) is the only
// candidate in 2030's own backlog, so he lands the 1st day after Low
// Sunday (Apr 28 that year) outright.
const native = resolveDay('2030-04-25');
// 2030-04-25 is Easter+4 (Thursday of Easter week); `winner.id` is
// this weekday's own real temporal-feasts id since 2026-09-06 (see
// calendar/temporal-feasts/easter-thursday.yml), not the shared
// `easter-sunday` governing-week id. The override mechanism pushes a
// `{kind:'temporal', id:'easter-sunday'}` commemoration for the coarse
// id it replaces, same shape every other movable feast (Ascension,
// Corpus Christi, the Passiontide days) already does; harmless, since
// day-label.ts's collectCommemorations deliberately drops any
// commemoration whose id equals the plain governing weekday (see
// tests/calendar/transfer.test.ts's own Holy Monday case for the same
// shape).
expect(native.winner).toEqual({ kind: 'temporal', id: 'easter-thursday' });
expect(native.commemorations).toEqual([{ kind: 'temporal', id: 'easter-sunday' }]);
expect(native.transferredAway?.candidate.id).toBe('st-mark');
const landing = resolveDay('2030-04-29');
expect(landing.winner).toEqual({
kind: 'sanctoral',
id: 'st-mark',
name: 'St. Mark, Evangelist',
nameLa: 'Sanctus Marcus, Evangelista',
rank: 'duplex-2-classis',
transferredFrom: '2030-04-25',
});
// St. Robert, native to this day, is demoted to a commemoration
// rather than winning or being skipped past.
expect(landing.commemorations.some((c) => c.kind === 'sanctoral' && c.id === 'st-robert')).toBe(true);
});
it('St. Robert beats St. Catherine of Siena on their shared monastic-calendar date', () => {
const day = resolveDay('2043-04-29');
expect(day.winner).toEqual({ kind: 'sanctoral', id: 'st-robert', name: 'St. Robert, Abbot', nameLa: 'Sanctus Robertus, Abbas', rank: 'duplex' });
expect(day.commemorations).toEqual([
{ kind: 'sanctoral', id: 'st-catherine-of-siena', name: 'St. Catherine of Siena, Virgin', nameLa: 'Sancta Catharina Senensis, Virgo', rank: 'simplex' },
]);
});
it('an ordinary Eastertide Sunday (not Easter Day, not within its Octave) still lets St. Robert (plain Duplex) win outright, same as any weekday', () => {
// 2029: Apr 29 is an ordinary (not privileged) Sunday in Eastertide —
// live-verified 2026-09-01 (`eastertide`'s own `bySeason` entry, see
// data/calendar/temporal-categories.yml): "S. Roberti Abbatis ~
// Duplex" wins outright there, same as data/calendar/temporal-
// categories.yml's `ordinary-sunday` rule for any other season, with
// the Sunday itself only noted as a `Scriptura` line, not primary.
const sunday = resolveDay('2029-04-29');
expect(sunday.winner).toEqual({ kind: 'sanctoral', id: 'st-robert', name: 'St. Robert, Abbot', nameLa: 'Sanctus Robertus, Abbas', rank: 'duplex' });
expect(sunday.commemorations).toEqual([
{ kind: 'temporal', id: 'easter-5' },
{ kind: 'sanctoral', id: 'st-catherine-of-siena', name: 'St. Catherine of Siena, Virgin', nameLa: 'Sancta Catharina Senensis, Virgo', rank: 'simplex' },
]);
// Apr 30 resolves St. Peter Martyr cleanly on his own day — no
// transferred-Robert collision, since Robert already won on the 29th.
const monday = resolveDay('2029-04-30');
expect(monday.winner).toEqual({
kind: 'sanctoral',
id: 'st-peter-martyr',
name: 'St. Peter Martyr, Martyr',
nameLa: 'Sanctus Petrus Martyr, Martyr',
rank: 'semiduplex',
});
expect(monday.commemorations).toEqual([]);
});
});