# A day's precedence category under the temporal cycle alone, before any
# sanctoral feast is weighed against it — see calendar/types.ts's
# TemporalCategory doc comment for why this is coarser than `season`, and
# calendar/commemorations.ts for how it's actually used (decideOccurrence).
#
# RECONSTRUCTED, not verified against a primary source: the two rubric
# documents actually present in the reference engine
# (divinum-officium-reference/web/www/horas/Help/Rubrics/) are both later
# editions (~1960) with a different, renumbered classification than the
# pre-1955 system this app targets. This is a best-effort reconstruction
# from general knowledge of that older tradition — expect corrections.
#
# `bySeason` gives the default for an ordinary Sunday/feria falling in that
# season. `offsets`/`offsetRanges` (from Easter, same convention as
# easter-offsets.yml) and `fixedDates` (MM-DD) override that default for
# specific privileged ferias that don't line up with a whole season.
#
# `privileged-feria` vs `privileged-feria-major`: two real tiers, not one
# — see calendar/types.ts's TemporalCategory doc comment for how this was
# found and calendar/commemorations.ts for the rule each gets. Lent's Ember
# days are directly verified as the lesser tier (a plain Duplex wins
# outright there); Ash Wednesday, Holy Week, and the Easter Octave are the
# major tier (Easter Octave directly verified — Holy Week and Ash
# Wednesday are strong prior knowledge, not independently re-verified
# here). Where this app *doesn't* have direct evidence either way —
# Pentecost's own Ember days, the Vigil of Christmas — it defaults to the
# major (stricter) tier as the safer guess, pending verification. Pentecost's
# own *Octave* (as opposed to its Ember days) is the one exception: it's
# no longer classified via this table at all — see the offsetRanges
# section below and calendar/octaves.ts.
#
# September Ember days (Wed/Fri/Sat nearest the Exaltation of the Cross,
# Sept 14) are now modeled too, live-verified `privileged-feria-minor` —
# see calendar/temporal.ts's septemberEmberDayOffset, called directly from
# resolveTemporalCategory below (can't be expressed as a plain
# offset/fixedDate entry in this table: the anchor is "nearest Sept 14,"
# a fixed-calendar-date rule with its own year-dependent Sunday-finding
# math, same shape as adventStart's "nearest Nov 30"). Advent Ember days
# don't need any entry here at all — Advent's own `privileged-feria-minor`
# season default below already covers them, no live evidence found that
# they need a stronger tier (see calendar/temporal.ts's
# adventEmberDayOffset, used only for their own content id, not
# precedence). Both get their own distinct proper content
# (collect/Matins readings) via calendar/ember-days.ts, separate from this
# precedence-only table.
# Lent's Ember days *are* modeled (clean Easter offsets, directly
# verified). Pentecost's own Ember days share this same offset-based
# fixability but currently fall to the plain `ordinary-feria` default
# instead (see the offsetRanges comment below) — unverified, a real gap,
# not a guess dressed up as one.
bySeason:
  # Advent's ordinary ferias verified `privileged-feria-minor` during the
  # December sanctoral pull (see calendar/types.ts's TemporalCategory doc
  # comment) -- weaker than the Ember-day `privileged-feria` tier, but real
  # standing nonetheless, unlike a plain `ordinary-feria`.
  advent: { sunday: privileged-sunday, feria: privileged-feria-minor }
  # Christmastide's ferias are folded into the privileged-feria-minor
  # default for the whole season as a simplification of "the Octave of
  # Christmas (Dec 25 - Jan 1) is privileged" — slightly overbroad into Jan
  # 2-5, harmless. Verified `privileged-feria-minor` specifically (not the
  # stronger `privileged-feria`) during the December pull: St. Thomas of
  # Canterbury, Semiduplex, wins outright within the Octave (Dec 29) in the
  # real Monastic 1617 engine, which `privileged-feria`'s Duplex+ threshold
  # would wrongly forbid.
  #
  # The Sunday itself is `ordinary-sunday`, NOT `privileged-sunday` —
  # originally miscoded as privileged-sunday (Advent's own Sundays' tier),
  # which was backwards: live-verified against all six possible collision
  # dates (Dec 26 St. Stephen, 27 St. John, 28 Holy Innocents — all
  # Duplex-II-classis — plus 31 St. Silvester, plain Duplex), every one of
  # them wins outright over the Sunday, which is merely commemorated in
  # return — exactly ordinary-sunday's Duplex+ rule, and the reverse of
  # privileged-sunday's (which would keep the Sunday primary and only nod
  # to the saint). Dec 29 (St. Thomas Becket, Semiduplex) still transfers
  # off the Sunday rather than winning, and a day with no saint at all
  # (e.g. Dec 30) still resolves to the Sunday cleanly — both of those
  # match ordinary-sunday too, so nothing here actually depended on the
  # stronger tier.
  christmastide: { sunday: ordinary-sunday, feria: privileged-feria-minor }
  epiphanytide: { sunday: ordinary-sunday, feria: ordinary-feria }
  septuagesima: { sunday: privileged-sunday, feria: ordinary-feria }
  lent: { sunday: privileged-sunday, feria: ordinary-feria }
  passiontide: { sunday: privileged-sunday, feria: ordinary-feria }
  eastertide: { sunday: privileged-sunday, feria: ordinary-feria }
  ascensiontide: { sunday: ordinary-sunday, feria: ordinary-feria }
  pentecost: { sunday: privileged-sunday, feria: ordinary-feria }
  trinitytide: { sunday: ordinary-sunday, feria: ordinary-feria }
  # Corpus Christi/Sacred Heart are themselves "feasts of the Lord" that
  # shouldn't cede to an ordinary saint — modeled here as
  # privileged-feria-major (rather than injecting a separate synthetic
  # FeastClass) since with the small sanctoral calendar this app has, a
  # real clash is unlikely and the practical effect (temporal wins) is the
  # same either way.
  corpus-christi: { sunday: ordinary-sunday, feria: privileged-feria-major }
  sacred-heart: { sunday: ordinary-sunday, feria: privileged-feria-major }

offsets:
  -46: privileged-feria-major # Ash Wednesday
  -39: privileged-feria # Lent Ember Wednesday (Wed after 1st Sunday of Lent) — verified: Duplex wins outright here
  -37: privileged-feria # Lent Ember Friday
  -36: privileged-feria # Lent Ember Saturday — verified: Duplex wins outright here (St. Gregory the Great)
  48: privileged-feria-major # Vigil of Pentecost — unverified, defaulted to the stricter tier

offsetRanges:
  - { fromOffset: -6, toOffset: -1, category: privileged-feria-major } # ferias of Holy Week
  - { fromOffset: 1, toOffset: 6, category: privileged-feria-major } # Easter octave — verified: even Duplex II. classis (St. Mark) only gets commemorated, never wins
  # Pentecost's own Octave (offsets 50-55) is deliberately absent from
  # this table now -- it used to be classified privileged-feria-major
  # here, but user-confirmed rule (2026-08) is that a Duplex+ saint wins
  # outright within it, which the generic octave layer
  # (calendar/octaves.ts, data/calendar/temporal-feasts/pentecost-
  # sunday.yml) now handles directly. Leaving these offsets unlisted lets
  # them fall through to the `pentecost` season default (ordinary-feria,
  # see bySeason above), so a real sanctoral candidate reaches the octave
  # layer intact instead of being transferred away by a stricter feria
  # tier first. Pentecost's own Ember days (within this same range, in
  # years they land there) get the same ordinary-feria default as a
  # result -- still unverified for Pentecost specifically, not the
  # Lent-Ember-day privileged-feria treatment; a real gap, just an
  # existing one, not introduced by this change.

fixedDates:
  "12-24": privileged-feria-major # Vigil of Christmas — unverified, defaulted to the stricter tier
