calendar: fix transferred candidates blindly winning outright

Found via real data (the May sanctoral pull): a transfer landing on a day
whose own native winner was temporal blindly took over as winner,
regardless of that day's own precedence category — so a transferred-in
Simplex saint (St. Felix I, impeded by Pentecost's Ember Saturday) was
overwriting Trinity Sunday itself instead of being merely commemorated,
the way a native Simplex candidate on an ordinary Sunday already
correctly is.

Fixes applyIncomingTransfer to run the arriving candidate through
decideOccurrence using the receiving day's own temporalCategory, the same
rules a native occurrence there would use, instead of assuming an empty
temporal slot means automatic victory.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-10 17:25:27 -04:00
parent 88074cdfe6
commit f0e32ae0c1
3 changed files with 38 additions and 2 deletions
+22
View File
@@ -31,4 +31,26 @@ describe('transfer mechanism (resolveDay integration)', () => {
rank: 'duplex-2-classis',
});
});
// 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.
it('a simplex saint impeded by a privileged feria transfers forward and is merely commemorated, not made to win, on the ordinary Sunday it lands on', () => {
// St. Felix I (May 30, Simplex) is impeded by that date's own
// Pentecost Ember Saturday (privileged-feria-major) and transfers
// forward into Trinity Sunday 2026 (May 31, an ordinary Sunday).
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([]);
expect(sunday.winner).toEqual({ kind: 'temporal', id: 'post-pentecost-01' });
expect(sunday.commemorations).toEqual([
{ kind: 'sanctoral', id: 'st-felix-i', name: 'St. Felix I, Pope and Martyr', rank: 'simplex' },
]);
});
});