Fix getDayCollects skipping octave commemorations on outright-win days

The substitutedOctaveId gate only checked temporalCategory, not who
actually won the day, so a saint winning outright within an active
octave (e.g. St. Bernard vs. the Assumption octave, Aug 20) silently
lost that octave's own commemoration block at Lauds/Vespers. Now
mirrors resolveOfficeWinner's real gate (day.winner.kind and
ALWAYS_OVERRIDE_TEMPORAL_IDS).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L3wxvz3mPXiHxkPB5JpnmD
This commit is contained in:
2026-08-21 07:38:49 -04:00
parent 833983c875
commit 1ed15f15c0
+9 -1
View File
@@ -522,8 +522,16 @@ function octaveCommemorationPart(commemoration: Extract<Commemoration, { kind: '
*/
export function getDayCollects(day: LiturgicalDay): ResolvedPart[] {
const parts: ResolvedPart[] = [{ kind: 'prayer', text: getDayCollect(day) }];
// Mirrors resolveOfficeWinner's own gate: an octave only actually
// supplied the primary collect when the day's winner itself wasn't a
// real sanctoral feast (or one of the ALWAYS_OVERRIDE_TEMPORAL_IDS) —
// otherwise the winner's own content stood on its own (e.g. St.
// Bernard, Aug 20, outright beats the Assumption octave's threshold)
// and the octave still needs its own commemoration block below.
const substitutedOctaveId =
day.temporalCategory === 'ordinary-feria' ? resolveActiveOctave(day.date)?.id : undefined;
day.winner.kind !== 'sanctoral' && !ALWAYS_OVERRIDE_TEMPORAL_IDS.has(day.winner.id) && day.temporalCategory === 'ordinary-feria'
? resolveActiveOctave(day.date)?.id
: undefined;
for (const commemoration of day.commemorations) {
if (commemoration.kind === 'temporal') {
parts.push({ kind: 'prayer', text: toResolvedText(getTemporalProper(`${commemoration.id}-collect`)) });