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
+11 -1
View File
@@ -59,7 +59,17 @@ function applyIncomingTransfer(
return winner;
}
if (winner.kind === 'temporal') {
return { kind: 'sanctoral', id: candidate.id, name: candidate.name, rank: candidate.rank };
// Found via real data: a transferred-in Simplex saint was blindly
// winning outright even when it landed on a privileged Sunday (Trinity
// Sunday, specifically) — the arriving candidate needs to go through
// the *same* precedence rules a native occurrence would have used,
// not just take over because nothing else was assigned here.
const decided = decideOccurrence(temporalCategory, winner.id, candidate);
commemorations.push(...decided.commemorations);
// If the candidate fails here too (decided.transfer set), that's a
// transfer chain — not modeled, same "not delivered rather than
// guessed at" stance as the privileged-feria-major case above.
return decided.winner;
}
const collision = resolveCollision(candidate, winner);
commemorations.push(...collision.commemorations);