calendar: split privileged-feria into two real precedence tiers
Deploy / deploy (push) Successful in 41s

A plain Duplex saint was losing to any privileged feria (Ember days
included) since the occurrence engine only let duplex-1-classis+ get
even a commemoration there. Verified this was wrong: St. Gregory the
Great, plain Duplex, outright wins against a Lenten Ember Saturday in
the real Monastic 1617 engine.

Splits TemporalCategory's single privileged-feria into privileged-feria
(the lesser tier — Lent's Ember days, verified — now behaves like an
ordinary Sunday: Duplex+ wins outright) and privileged-feria-major (Ash
Wednesday, Holy Week, the Easter Octave, verified via St. Mark only ever
being commemorated there, never winning — behaves like privileged-
Sunday). Everywhere else the old single category was ambiguous
(Pentecost's own Ember days/Vigil/Octave, the Vigil of Christmas)
defaults to the stricter major tier pending verification.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-10 15:51:09 -04:00
parent a2d86a4879
commit effe2b1333
6 changed files with 131 additions and 35 deletions
+36 -6
View File
@@ -42,13 +42,43 @@ describe('decideOccurrence — ordinary-feria', () => {
});
describe('decideOccurrence — privileged-feria', () => {
it('yields to nothing short of the top class', () => {
const majus = decideOccurrence('privileged-feria', 'id', saint('duplex-2-classis'));
expect(majus.winner).toEqual({ kind: 'temporal', id: 'id' });
expect(majus.commemorations).toEqual([]);
it('behaves exactly like an ordinary Sunday — duplex or higher wins outright, the feria is commemorated in return', () => {
// Verified: St. Gregory the Great, plain Duplex, outright wins against
// a Lenten Ember Saturday in the real Monastic 1617 engine.
const result = decideOccurrence('privileged-feria', 'id', saint('duplex'));
expect(result.winner).toEqual({ kind: 'sanctoral', id: 'x', name: 'St. Ereden', rank: 'duplex' });
expect(result.commemorations).toEqual([{ kind: 'temporal', id: 'id' }]);
});
const top = decideOccurrence('privileged-feria', 'id', saint('duplex-1-classis'));
expect(top.commemorations).toEqual([{ kind: 'sanctoral', id: 'x', name: 'St. Ereden', rank: 'duplex-1-classis' }]);
it('simplex stays and is commemorated, not transferred', () => {
const result = decideOccurrence('privileged-feria', 'id', saint('simplex'));
expect(result.winner).toEqual({ kind: 'temporal', id: 'id' });
expect(result.commemorations).toEqual([{ kind: 'sanctoral', id: 'x', name: 'St. Ereden', rank: 'simplex' }]);
});
it('semiduplex/vigil get nothing here — transfer instead', () => {
const result = decideOccurrence('privileged-feria', 'id', saint('semiduplex'));
expect(result.commemorations).toEqual([]);
expect(result.transfer).toEqual({ candidate: saint('semiduplex'), direction: 'forward' });
});
});
describe('decideOccurrence — privileged-feria-major', () => {
it('is never displaced, same as privileged-sunday — duplex-majus and up are commemorated', () => {
// Verified: St. Mark, Duplex II. classis, only ever commemorated —
// never wins outright — within the Easter Octave.
for (const rank of ['duplex-majus', 'duplex-2-classis', 'duplex-1-classis'] as const) {
const result = decideOccurrence('privileged-feria-major', 'id', saint(rank));
expect(result.winner).toEqual({ kind: 'temporal', id: 'id' });
expect(result.commemorations).toEqual([{ kind: 'sanctoral', id: 'x', name: 'St. Ereden', rank }]);
}
});
it('yields nothing short of duplex-majus — transfers instead', () => {
const result = decideOccurrence('privileged-feria-major', 'id', saint('duplex'));
expect(result.winner).toEqual({ kind: 'temporal', id: 'id' });
expect(result.commemorations).toEqual([]);
expect(result.transfer).toEqual({ candidate: saint('duplex'), direction: 'forward' });
});
});