6bb4c6a80f
Deploy / deploy (push) Successful in 59s
Blind per-date source-file reading (Sancti/SanctiM MM-DD.txt) turned out
unreliable for collect authorship: those files are era-merged, carrying
centuries of accumulated saints behind rubric-conditional gating, so a
naive read often returned a saint canonized long after 1617 instead of
the Monastic-Tridentine-era one actually on this calendar (St. Didacus
instead of All Saints of the Benedictine Order, St. Rose of Lima instead
of Ss. Felix and Adauctus, etc).
Fixed by pulling from web/www/Tabulae/Kalendaria/'s own era-specific
calendar tables (1570.txt Tridentine base + M1617.txt's Monastic diffs)
instead, cross-validated against the pre-1955/Divino Afflatu chain
(1888->1906->1939->1954) as a corroborating signal. Cross-referencing all
205 existing saint records against this table confirmed 204/205 were
already correctly placed -- the earlier live-query verification work was
sound, only blind file-reading was flawed -- so no sanctoral-calendar.yml
corrections were needed, just the collect content itself.
Two collect shapes came out of the 94: 34 proper collects (own YAML file,
Latin verified against source, English translated+draft where the source
lacked it) and 60 resolved via a new Common-collect templating mechanism
-- SaintRecord.collectCommon/collectName plus substituteName() in
resolve-common.ts, filling a template's {N} placeholders positionally
from the saint's own declined name, across 21 new common/collect-c*.yml
templates named after the source's own C-numbering.
St. Michael's Sep 29 propers resolved via its whole-file @Sancti/05-08
inheritance (Apparition of St. Michael, May 8). St. Martha's plural-
template default was overridden to the singular collect-c6a since she's
one person, not a pair.
Also fixes a latent bug this surfaced: getDayCollect looked up
`${collectCommon}-collect`, but collect-c*.yml files are id'd as
`collect-c2` etc with no such suffix -- caught by a smoke test where
every one of the 93 non-Michael saints resolved as missing.
4 pre-existing tests updated: they asserted specific saints (St.
Benedict, St. Romanus Abbot, St. Anthony Abbot) had no authored collect,
which is no longer true; resolve-common.test.ts's generic "missing" case
now uses a synthetic day/winner since no real unauthored saint remains
as an example.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
57 lines
2.5 KiB
TypeScript
57 lines
2.5 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 Ascension/Pentecost/Trinity-adjacent observances that usually
|
|
// overshadow several of them) — see data/calendar/saints/*.yml for
|
|
// per-saint source detail.
|
|
describe('May sanctoral pull (first pass)', () => {
|
|
it('Ss. Philip and James win outright with a real proper collect and antiphon', () => {
|
|
const day = resolveDay('2029-05-01');
|
|
expect(day.winner).toEqual({
|
|
kind: 'sanctoral',
|
|
id: 'ss-philip-and-james',
|
|
name: 'Ss. Philip and James, Apostles',
|
|
rank: 'duplex-2-classis',
|
|
});
|
|
expect(getDayCollect(day).status.en).toBe('verified');
|
|
});
|
|
|
|
it('two stubs are genuinely unwinnable in the real historical calendar, not just an artifact of the year checked', () => {
|
|
// Ss. Alexander/Eventius/Theodulus/Juvenal always lose to the Finding
|
|
// of the Holy Cross (May 3) in real practice — but that's a fixed
|
|
// feast of the Lord, which this app doesn't model at all (same known
|
|
// gap as Circumcision/Epiphany/Purification/Annunciation), so the stub
|
|
// wins by default here rather than being displaced the way it really
|
|
// would be.
|
|
const may3 = resolveDay('2033-05-03');
|
|
expect(may3.winner).toEqual({
|
|
kind: 'sanctoral',
|
|
id: 'ss-alexander-eventius-theodulus-and-juvenal',
|
|
name: 'Ss. Alexander I, Eventius, and Theodulus, Martyrs, and Juvenal, Bishop and Confessor',
|
|
rank: 'simplex',
|
|
});
|
|
|
|
// St. Pudentiana always loses to St. Peter Celestine (May 19, also fixed-date) —
|
|
// this one *is* modeled (both are real sanctoral records), so it
|
|
// resolves correctly.
|
|
const may19 = resolveDay('2038-05-19');
|
|
expect(may19.winner).toEqual({
|
|
kind: 'sanctoral',
|
|
id: 'st-peter-celestine',
|
|
name: 'St. Peter Celestine, Pope and Confessor',
|
|
rank: 'duplex',
|
|
});
|
|
expect(may19.commemorations).toEqual([
|
|
{ kind: 'sanctoral', id: 'st-pudentiana', name: 'St. Pudentiana, Virgin', rank: 'simplex' },
|
|
]);
|
|
});
|
|
|
|
it('a saint with no proper collect of his own resolves via the Common of an Abbot instead', () => {
|
|
const day = resolveDay('2038-05-22'); // St. Romanus, Abbot
|
|
expect(day.winner).toEqual({ kind: 'sanctoral', id: 'st-romanus-abbot', name: 'St. Romanus, Abbot', rank: 'duplex' });
|
|
expect(getDayCollect(day).status.en).toBe('verified');
|
|
});
|
|
});
|