da3b6e893e
Deploy / deploy (push) Successful in 46s
Adds calendar/octaves.ts: a lookback over the past week collecting every
octave (sanctoral or temporal) still active on a date, stacking multiple
at once (Christmas + St. Stephen + St. John + Holy Innocents all
commemorated together within the Christmas Octave). Declared via an
optional `octave` field on a saint's own record or a new small
TemporalFeastRecord (calendar/temporal-feasts.ts) for temporal ids like
Christmas/Pentecost that didn't have a metadata record before -- data-
driven per user design discussion, with `{ enabled: true }` alone using
sensible defaults (8 days, semiduplex threshold) so a minimal declaration
works without authored content.
Wired into resolveDay as a post-processing layer: doesn't change how a
single day's own precedence contest is decided, just adds commemorations
for active octaves and occasionally overrides the winner when the
occurring saint doesn't clear the strictest active octave's threshold.
Populated so far: St. Lawrence's own octave (the one that repeatedly cost
real saints their spot in August), the three Comites Christi octaves
(Stephen/John/Innocents -- Thomas of Canterbury deliberately excluded,
per discussion), and Pentecost's (duplex threshold, user-specified).
Pentecost's octave offsets are also removed from temporal-categories.yml's
privileged-feria-major classification, letting a real candidate reach the
new octave layer instead of being transferred away first -- with the
side effect that Pentecost's own Ember Saturday no longer forces a
transfer (a sub-threshold saint is now commemorated in place instead, see
tests/calendar/transfer.test.ts's updated case). Assumption, Nativity
BVM, Immaculate Conception, and All Saints' own octaves are not yet
populated with octave data -- deliberately deferred to a follow-up pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
88 lines
4.7 KiB
TypeScript
88 lines
4.7 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { resolveDay } from '../../src/calendar';
|
|
|
|
describe('transfer mechanism (resolveDay integration)', () => {
|
|
// The Vigil of St. Lawrence (Aug 9) is a real content entry specifically
|
|
// added to exercise this — Aug 9, 2026 is a Sunday, so the vigil (rank
|
|
// 'vigil') can't win or be commemorated there (see
|
|
// commemorations.ts's ordinary-sunday rule) and must transfer backward.
|
|
// Since the August pull, Aug 8 is no longer an empty landing day — Ss.
|
|
// Cyriacus, Largus, and Smaragdus (Semiduplex, a fixed, non-movable
|
|
// date) natively occupy it every year, so the backward-transferred
|
|
// vigil runs into collision.ts's sanctoral-vs-sanctoral rules instead of
|
|
// landing untouched: Semiduplex outranks 'vigil' on the shared
|
|
// FeastClass scale, so Cyriacus wins and the vigil is commemorated
|
|
// rather than displacing him — real transfer+collision interaction, not
|
|
// a data error, same class of finding as July's Apollinaris/Vigil-of-
|
|
// St.-James case.
|
|
it('a vigil impeded by an ordinary Sunday transfers backward to Saturday and collides with the real feast already there', () => {
|
|
const saturday = resolveDay('2026-08-08');
|
|
const sunday = resolveDay('2026-08-09');
|
|
const monday = resolveDay('2026-08-10');
|
|
|
|
expect(saturday.winner).toEqual({
|
|
kind: 'sanctoral',
|
|
id: 'ss-cyriacus-largus-and-smaragdus',
|
|
name: 'Ss. Cyriacus, Largus, and Smaragdus, Martyrs',
|
|
rank: 'semiduplex',
|
|
});
|
|
expect(saturday.commemorations).toEqual([
|
|
{ kind: 'sanctoral', id: 'vigil-of-st-lawrence', name: 'Vigil of St. Lawrence', rank: 'vigil' },
|
|
]);
|
|
|
|
// The Sunday's own winner is unaffected by the vigil, but St. Romanus
|
|
// (the vigil's own stub secondary, see st-romanus.yml) still surfaces
|
|
// as a commemoration here: he lost his own local clash against the
|
|
// vigil before the vigil transferred away, and that loss stands
|
|
// independently of the transfer -- confirmed against the live
|
|
// reference engine, which shows the same commemoration on this date.
|
|
expect(sunday.winner).toEqual({ kind: 'temporal', id: 'post-pentecost-11' });
|
|
expect(sunday.commemorations).toEqual([
|
|
{ kind: 'sanctoral', id: 'st-romanus', name: 'St. Romanus, Martyr', rank: 'simplex' },
|
|
]);
|
|
|
|
// St. Lawrence's own day (Monday) is unaffected by the backward transfer.
|
|
expect(monday.winner).toEqual({
|
|
kind: 'sanctoral',
|
|
id: 'st-lawrence',
|
|
name: 'St. Lawrence, Martyr',
|
|
rank: 'duplex-2-classis',
|
|
});
|
|
});
|
|
|
|
// Originally found via real data (the May sanctoral pull): a
|
|
// transferred-in candidate was blindly winning outright whenever the
|
|
// receiving day's own native winner was temporal, regardless of that
|
|
// day's own precedence category — so a transferred-in Simplex was
|
|
// overwriting Trinity Sunday itself instead of going through the same
|
|
// ordinary-Sunday rule a native candidate would have. That fix (in
|
|
// applyIncomingTransfer) is unchanged and still covered here, but the
|
|
// concrete St. Felix I / Trinity Sunday scenario that first surfaced it
|
|
// no longer demonstrates a *transfer* at all: since the octave
|
|
// mechanism (calendar/octaves.ts) was added, Pentecost's own Ember
|
|
// Saturday is no longer classified `privileged-feria-major` (see
|
|
// data/calendar/temporal-categories.yml), so Felix now wins his own day
|
|
// outright under the permissive `ordinary-feria` default — then gets
|
|
// caught and commemorated in place by Pentecost's octave itself
|
|
// (threshold: duplex), never even reaching a transfer. He simply
|
|
// doesn't appear on Trinity Sunday at all anymore. Kept here anyway as
|
|
// a still-useful demonstration of the octave layer's own override path.
|
|
it("St. Felix I, below Pentecost's octave threshold, is commemorated in place on his own day rather than transferring anywhere", () => {
|
|
const saturday = resolveDay('2026-05-30');
|
|
const sunday = resolveDay('2026-05-31');
|
|
|
|
expect(saturday.winner).toEqual({ kind: 'temporal', id: 'pentecost-sunday' });
|
|
expect(saturday.commemorations).toEqual([
|
|
{ kind: 'sanctoral', id: 'st-felix-i', name: 'St. Felix I, Pope and Martyr', rank: 'simplex' },
|
|
{ kind: 'octave', id: 'pentecost-sunday', name: 'Pentecost' },
|
|
]);
|
|
|
|
// Felix doesn't reach Trinity Sunday at all now -- but Trinity Sunday
|
|
// is day 8 of Pentecost's own 8-day octave (the default length, not
|
|
// yet independently confirmed to be right for Pentecost specifically),
|
|
// so Pentecost's own octave commemoration still persists here.
|
|
expect(sunday.winner).toEqual({ kind: 'temporal', id: 'post-pentecost-01' });
|
|
expect(sunday.commemorations).toEqual([{ kind: 'octave', id: 'pentecost-sunday', name: 'Pentecost' }]);
|
|
});
|
|
});
|