Full precedence sweep of temporal-categories.yml, two more real bugs
Deploy / deploy (push) Successful in 1m27s
Deploy / deploy (push) Successful in 1m27s
Following the Ascensiontide fix, swept every remaining unverified Sunday/ feria precedence tier against the live reference engine: - commemorations.ts's privileged-sunday rule was itself wrong: a duplex-majus+ candidate was given a bare commemoration instead of transferring, never actually verified. Live-checked the Immaculate Conception (transfers off Advent II) and the Annunciation (transfers off Palm/Easter Sunday) - confirmed correct by direct instruction. privileged-sunday now transfers every rank unconditionally. - eastertide's own Sunday tier was backwards (privileged-sunday instead of ordinary-sunday) for the ordinary Sundays after Easter - live- verified twice (Finding of the Holy Cross, St. Mark both win outright). Easter Day itself still needs the stronger tier, now special-cased directly since Sundays never consult the offset table. Six existing tests updated to reflect real, live-verified behavior - each had the old wrong "commemorated in place" assumption baked into its expected value. Remaining unverified entries (Vigil of Pentecost/ Christmas, Corpus Christi/Sacred Heart) documented as such rather than silently assumed correct. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017XMSokiTD2Qc5vPP2YQu3Q
This commit is contained in:
@@ -34,27 +34,30 @@ describe('April sanctoral pull (first pass)', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('a privileged Eastertide Sunday bumps even St. Robert (plain Duplex, not Duplex majus) to transfer forward', () => {
|
||||
// 2029: Apr 29 is a privileged Sunday in Eastertide, so Robert can't
|
||||
// win or be commemorated there — he transfers to Monday and wins the
|
||||
// collision against St. Peter Martyr instead.
|
||||
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: 'temporal', id: 'easter-5' });
|
||||
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-robert',
|
||||
name: 'St. Robert, Abbot',
|
||||
nameLa: 'Sanctus Robertus, Abbas',
|
||||
rank: 'duplex',
|
||||
transferredFrom: '2029-04-29',
|
||||
id: 'st-peter-martyr',
|
||||
name: 'St. Peter Martyr, Martyr',
|
||||
nameLa: 'Sanctus Petrus Martyr, Martyr',
|
||||
rank: 'semiduplex',
|
||||
});
|
||||
expect(monday.commemorations).toEqual([
|
||||
{ kind: 'sanctoral', id: 'st-peter-martyr', name: 'St. Peter Martyr, Martyr', nameLa: 'Sanctus Petrus Martyr, Martyr', rank: 'semiduplex' },
|
||||
]);
|
||||
expect(monday.commemorations).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -141,18 +141,16 @@ describe('decideOccurrence — ordinary-sunday', () => {
|
||||
});
|
||||
|
||||
describe('decideOccurrence — privileged-sunday', () => {
|
||||
it('is never displaced; duplex-majus and up are commemorated', () => {
|
||||
for (const rank of ['duplex-majus', 'duplex-2-classis', 'duplex-1-classis'] as const) {
|
||||
it('is never displaced, and never gives even a bare commemoration to any rank — everything transfers forward', () => {
|
||||
// Live-verified 2026-09-01 (see data/calendar/temporal-categories.yml
|
||||
// and commemorations.ts's own `privileged-sunday` case comment):
|
||||
// even a Duplex I. classis feast (the Immaculate Conception on Advent
|
||||
// II, the Annunciation on Palm/Easter Sunday) transfers with no
|
||||
// commemoration at all — corrects an earlier, never-actually-verified
|
||||
// "duplex-majus+ still gets a nod" guess.
|
||||
for (const rank of ['duplex-majus', 'duplex-2-classis', 'duplex-1-classis', 'duplex', 'semiduplex', 'simplex'] as const) {
|
||||
const result = decideOccurrence('privileged-sunday', 'advent-1', saint(rank));
|
||||
expect(result.winner).toEqual({ kind: 'temporal', id: 'advent-1' });
|
||||
expect(result.commemorations).toEqual([{ kind: 'sanctoral', id: 'x', name: 'St. Ereden', rank }]);
|
||||
expect(result.transfer).toBeUndefined();
|
||||
}
|
||||
});
|
||||
|
||||
it('duplex, semiduplex, and simplex all transfer forward — no bare commemoration here', () => {
|
||||
for (const rank of ['duplex', 'semiduplex', 'simplex'] as const) {
|
||||
const result = decideOccurrence('privileged-sunday', 'advent-1', saint(rank));
|
||||
expect(result.commemorations).toEqual([]);
|
||||
expect(result.transfer).toEqual({ candidate: saint(rank), direction: 'forward' });
|
||||
}
|
||||
|
||||
@@ -66,21 +66,31 @@ describe('getDayLabel — ordinal temporal label', () => {
|
||||
});
|
||||
|
||||
it("Advent's own anchor Sunday is already week 1, not a separate anchor-week case", () => {
|
||||
// 2025-11-30 is also St. Andrew's own day (Duplex II. classis) — since
|
||||
// the November sanctoral pull, he's correctly commemorated alongside
|
||||
// Advent I rather than simply absent (confirmed against the live
|
||||
// reference engine, which shows the same pairing), so the label
|
||||
// reflects both, winner (Advent I, so privileged nothing can displace
|
||||
// it) first, commemorated saint after.
|
||||
expect(getDayLabel(resolveDay('2025-11-30')).en).toBe('The 1st Sunday of Advent (Semiduplex) — St. Andrew, Apostle');
|
||||
// 2025-11-30 is also St. Andrew's own day (Duplex II. classis) — a
|
||||
// privileged Sunday transfers *everything*, no rank exception
|
||||
// (live-verified 2026-09-01, correcting an earlier, inaccurate claim
|
||||
// that he was commemorated in place: the real Monastic 1617 engine
|
||||
// shows "Transfer: S. Andreæ Apostoli", not a commemoration), so the
|
||||
// label shows him as transferred away rather than paired alongside
|
||||
// Advent I.
|
||||
expect(getDayLabel(resolveDay('2025-11-30')).en).toBe('The 1st Sunday of Advent (Semiduplex) — St. Andrew, Apostle (transferred away)');
|
||||
// Dec 1 is where Andrew's own transfer actually lands (the next open
|
||||
// day, `privileged-feria-minor`'s Semiduplex+ threshold easily clears
|
||||
// for a Duplex II. classis) — live-verified 2026-09-01, the real
|
||||
// Monastic 1617 engine shows "S. Andreæ Apostoli ~ Duplex II. classis"
|
||||
// there outright, "Tempora: Feria II infra Hebdomadam I Adventus"
|
||||
// underneath, matching this.
|
||||
expect(getDayLabel(resolveDay('2025-12-01')).en).toBe('St. Andrew, Apostle (Duplex II Class, transferred) — In the 1st week of Advent');
|
||||
// Dec 4 (St. Barbara, merely commemorated, not high-ranked enough to
|
||||
// win outright) is a clean example of the season-ordinal label itself.
|
||||
// Advent drops the redundant leading weekday word now that the header
|
||||
// always shows the weekday on its own (see temporalLabel's
|
||||
// `dropWeekdayPrefix`).
|
||||
expect(getDayLabel(resolveDay('2025-12-01')).en).toBe('In the 1st week of Advent (Feria)');
|
||||
expect(getDayLabel(resolveDay('2025-12-04')).en).toBe('In the 1st week of Advent (Feria) — St. Barbara, Virgin and Martyr');
|
||||
// Latin: same weekday-drop, and the season-ordinal genitive
|
||||
// construction ("Hebdomada prima Adventus") needs no extra linking
|
||||
// word — 4th-declension "Adventus" has the same genitive form.
|
||||
expect(getDayLabel(resolveDay('2025-12-01')).la).toBe('In hebdomada prima Adventus (Feria)');
|
||||
expect(getDayLabel(resolveDay('2025-12-04')).la).toBe('In hebdomada prima Adventus (Feria) — Sancta Barbara, Virgo et Martyr');
|
||||
});
|
||||
|
||||
it('falls back to weekday + season name for seasons with no ordinal convention modeled', () => {
|
||||
|
||||
@@ -104,17 +104,21 @@ describe('resolveOrdo("compline", ...)', () => {
|
||||
|
||||
it('anticipates Advent I: the Saturday evening before switches to the Alma Redemptoris Mater and shows the anticipated day label', () => {
|
||||
// Nov 30, 2025 is Advent I Sunday -- also St. Andrew's own day
|
||||
// (Duplex II. classis), correctly commemorated alongside it since the
|
||||
// November sanctoral pull (see tests/calendar/day-label.test.ts). This
|
||||
// evening also anticipates Advent I from Nov 29, itself the Vigil of
|
||||
// St. Andrew -- but the Vigil isn't also shown alongside his own
|
||||
// feast (calendar/vespers.ts's own isVigilOfTomorrow check, keyed off
|
||||
// each Vigil's explicit `vigilOf` field): showing both would just be
|
||||
// redundant, the same feast named twice.
|
||||
// (Duplex II. classis), but a privileged Sunday transfers him
|
||||
// entirely rather than commemorating him in place (live-verified
|
||||
// 2026-09-01, see tests/calendar/day-label.test.ts). This evening
|
||||
// also anticipates Advent I from Nov 29, itself the Vigil of St.
|
||||
// Andrew -- calendar/vespers.ts's own isVigilOfTomorrow check only
|
||||
// suppresses the Vigil's own commemoration when tomorrow's page
|
||||
// *also* shows St. Andrew (which would be redundant); since he no
|
||||
// longer does (he's transferred away, not commemorated), both pieces
|
||||
// of information are genuinely distinct and both show.
|
||||
const eve = resolveOrdo('compline', '2025-11-29');
|
||||
const last = eve.parts[eve.parts.length - 1];
|
||||
expect(last?.kind === 'preces' ? last.label : undefined).toBe('Alma Redemptoris Mater');
|
||||
expect(eve.dayLabel?.en).toBe('The 1st Sunday of Advent (Semiduplex) — St. Andrew, Apostle');
|
||||
expect(eve.dayLabel?.en).toBe(
|
||||
'The 1st Sunday of Advent (Semiduplex) — Vigil of St. Andrew (of today) — St. Andrew, Apostle (transferred away)',
|
||||
);
|
||||
|
||||
const dayBefore = resolveOrdo('compline', '2025-11-28');
|
||||
const lastBefore = dayBefore.parts[dayBefore.parts.length - 1];
|
||||
|
||||
+12
-10
@@ -565,18 +565,20 @@ describe('resolveOrdo("lauds", ...)', () => {
|
||||
});
|
||||
|
||||
it('resolves both the winners collect and a commemorated saints collect on a day with a real commemoration', () => {
|
||||
// 2025-11-30: Advent I (the winner) with St. Andrew, Duplex II. classis,
|
||||
// commemorated alongside it (see tests/calendar/day-label.test.ts) --
|
||||
// he has only a bare collect authored (no st-andrew-commemoration.yml
|
||||
// Ant+V/R bundle yet), so this renders as a labeled 'preces' block
|
||||
// (see resolve-common.ts's sanctoralCommemorationPart), not a second
|
||||
// unlabeled 'prayer' the way it used to.
|
||||
const ordo = resolveOrdo('lauds', '2025-11-30');
|
||||
// 2029-01-14: post-Epiphany II (the winner, `ordinary-sunday`) with
|
||||
// St. Felix Presbyter, Simplex, commemorated alongside it — live-
|
||||
// verified 2026-09-01. (Not 2025-11-30/St. Andrew as this test used
|
||||
// to: a privileged Sunday transfers *everything*, no rank exception
|
||||
// — Andrew doesn't get a bare commemoration there at all, see
|
||||
// tests/calendar/day-label.test.ts. `ordinary-sunday`'s own Simplex
|
||||
// branch is the real case that still commemorates a saint in place.)
|
||||
const ordo = resolveOrdo('lauds', '2029-01-14');
|
||||
const collects = ordo.parts.filter((p) => p.kind === 'prayer');
|
||||
expect(collects.length).toBe(1);
|
||||
const andrewCommemoration = ordo.parts.find((p) => p.kind === 'preces' && p.label?.includes('Andrew'));
|
||||
expect(andrewCommemoration?.kind === 'preces' ? andrewCommemoration.text.text.en : undefined).toContain(
|
||||
'Andrew',
|
||||
const felixCommemoration = ordo.parts.find((p) => p.kind === 'preces' && p.label?.includes('Felix'));
|
||||
expect(felixCommemoration).toBeDefined();
|
||||
expect(felixCommemoration?.kind === 'preces' ? felixCommemoration.text.text.en : undefined).toContain(
|
||||
'palm tree',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -718,7 +718,7 @@ describe('resolveOrdo("matins", ...) rest-of-year temporal nocturn-readings swee
|
||||
['2026-04-19', 'easter-3'],
|
||||
['2026-04-27', 'easter-4'],
|
||||
['2026-05-04', 'easter-5'],
|
||||
['2026-05-11', 'easter-6'],
|
||||
['2026-05-10', 'easter-6 (the real Sunday — not 2026-05-11: since the eastertide-Sunday precedence fix (2026-09-01), St. Antoninus, Duplex, now correctly wins outright on his own day, May 10, rather than transferring onto Monday, so easter-6\'s own pooled readings show up there commemorated, not on the 11th)'],
|
||||
['2026-05-18', 'sunday-after-ascension'],
|
||||
['2026-04-05', 'easter-sunday'],
|
||||
['2026-05-24', 'pentecost-sunday'],
|
||||
|
||||
Reference in New Issue
Block a user