summaryrefslogtreecommitdiff
path: root/lib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/precedence.ml3
-rw-r--r--lib/kernel/precedence.mli16
-rw-r--r--lib/kernel/validate.ml17
3 files changed, 34 insertions, 2 deletions
diff --git a/lib/kernel/precedence.ml b/lib/kernel/precedence.ml
index 05ad69f..d48203e 100644
--- a/lib/kernel/precedence.ml
+++ b/lib/kernel/precedence.ml
@@ -17,6 +17,7 @@ type ('s, 'r) rules = {
disposition : winner:'r candidate -> loser:'r candidate -> disposition;
admit :
observed:'r candidate ->
+ temporal:'r candidate ->
('r candidate * privilege) list ->
('r candidate * privilege) list;
}
@@ -55,7 +56,7 @@ let resolve rules ctx ~temporal ~sanctoral =
([], [], []) losers
in
let comms = List.rev comms and deferred = List.rev deferred in
- let admitted = rules.admit ~observed comms in
+ let admitted = rules.admit ~observed ~temporal comms in
let dropped =
List.filter (fun c -> not (List.exists (fun a -> fst a == fst c) admitted)) comms
in
diff --git a/lib/kernel/precedence.mli b/lib/kernel/precedence.mli
index ae054dd..d394cb1 100644
--- a/lib/kernel/precedence.mli
+++ b/lib/kernel/precedence.mli
@@ -34,12 +34,28 @@ type ('s, 'r) rules = {
(** RG 92-95: the loser's fate, which depends on the loser's own rank. *)
admit :
observed:'r candidate ->
+ temporal:'r candidate ->
('r candidate * privilege) list ->
('r candidate * privilege) list;
(** RG 108-111: how many commemorations are admitted, and in what order;
anything filtered out here is recorded in {!resolution.omitted}, not
dropped.
+ [temporal] is {!resolve}'s own [~temporal] argument, passed through
+ unchanged -- the day's temporal-cycle candidate, regardless of
+ whether it won. Fix round 1 (RG16(a) task): before this, a rite's
+ [admit] could only infer properties of the CIVIL DAY (chiefly "is
+ this a Sunday", RG 111(b)'s own two-tier admission rule) from
+ [observed]'s own fields -- a proxy that breaks the moment something
+ OTHER than the day's own temporal candidate can be [observed], the
+ exact shape RG 16(a) introduces (a Feast of the Lord standing in
+ the impeded Sunday's place "cum omnibus iuribus et privilegiis",
+ RG 91 entry 14). This is NOT a kernel definition of "Sunday" --
+ the kernel does not gain any rite-specific knowledge by this
+ parameter, it only threads through a value {!resolve} already
+ holds; a rite's own [admit] is free to ignore it entirely, the
+ same as [observed].
+
OBLIGATION ON THE IMPLEMENTATION, not enforced by this type: every
candidate this function returns must be a value taken UNCHANGED
from its input list, never rebuilt (e.g. via a [{ c with ... }]
diff --git a/lib/kernel/validate.ml b/lib/kernel/validate.ml
index cc8bdce..a3208dd 100644
--- a/lib/kernel/validate.ml
+++ b/lib/kernel/validate.ml
@@ -303,11 +303,26 @@ let run (rite : ('s, 'r) Rite.t) (layer : 'r Layer.t) ~year =
let observed_candidate : 'r Precedence.candidate =
{ Precedence.cel = d.Liturgical_day.observed; origin = Precedence.Sanctoral }
in
+ (* [~temporal] (fix round 1, RG16(a) task): {!Precedence.rules.admit}
+ now also takes the day's own temporal-cycle candidate, reused
+ here from {!Liturgical_day.t}'s own embedded [Temporal.t] --
+ the exact same value {!Calendar} passed to {!Precedence.resolve}
+ in the first place, so re-offering is against the SAME inputs,
+ not a reconstruction that could itself introduce a false
+ negative. [origin] is [Precedence.Temporal], genuinely (this IS
+ the temporal candidate, not a reconstructed sanctoral one). *)
+ let temporal_candidate : 'r Precedence.candidate =
+ { Precedence.cel = d.Liturgical_day.temporal.Temporal.office;
+ origin = Precedence.Temporal }
+ in
let as_candidates comms =
List.map (fun (c, p) -> ({ Precedence.cel = c; origin = Precedence.Sanctoral }, p)) comms
in
let offered = as_candidates d.Liturgical_day.commemorations in
- let readmitted = rite.Rite.rules.Precedence.admit ~observed:observed_candidate offered in
+ let readmitted =
+ rite.Rite.rules.Precedence.admit ~observed:observed_candidate
+ ~temporal:temporal_candidate offered
+ in
let norm l =
List.map (fun (c, p) -> (Slug.to_string c.Precedence.cel.Celebration.slug, p)) l
|> List.sort compare