diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-14 13:22:16 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-14 13:22:16 +0200 |
| commit | 913974b10a993af251b25125d1a417c452ad785c (patch) | |
| tree | 5dd82811c100de6daa995bebd115a12434296508 /scripts/build-oracle-ef.sh | |
| parent | d7da4b09f7775276231d0241cfe2700d247728ee (diff) | |
| parent | 3b32c002d3eddda5ece9422442717657b9fee63b (diff) | |
| download | lectio-913974b10a993af251b25125d1a417c452ad785c.tar.gz lectio-913974b10a993af251b25125d1a417c452ad785c.zip | |
Merge branch 'polish-ui-and-calendar': the gomobile facade and the EF calendar fixes
Two bodies of work that shared a branch.
The gomobile facade (2026-08-03..05): mobile.PartLabels, Days, and the
observed rank on DayInfo, so dlectio stops hardcoding part IDs and rank
strings; the 1962 part labels become i18n data; the documented gomobile
bind command is corrected so it reproduces the shipped .aar.
The EF calendar fixes (2026-08-12): seven defects found by differencing
this engine against colitur, a second 1962 implementation built from the
Missal's General Rubrics rather than from this codebase. RG 96 transfers
were not skipping II-class days; a II-class privileged feria was not
yielding to a feast; Sunday ranks, the two Rose Sundays and Holy Thursday's
colour were wrong; and scripts/gen-sanctoral-ef inferred ranks, deduped
and tagged classes wrongly, which put 15 III-class feasts into the shipped
tridentine-calendar.ini as bare commemorations and dropped four entries
outright.
Holy Thursday was violet in both engines, which is how a shared lineage
hides a defect: this project's ini is generated from missalemeum and
colitur's data was bootstrapped from here, so an error inherited by both
is invisible to a differential. It took the Missal itself to see it.
The EF oracle test now asserts rank and colour, not season alone. One
known gap is recorded in the source rather than fixed, as out of scope:
RG 95 chained transfers (calendar.go).
Diffstat (limited to 'scripts/build-oracle-ef.sh')
| -rwxr-xr-x | scripts/build-oracle-ef.sh | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/scripts/build-oracle-ef.sh b/scripts/build-oracle-ef.sh index 2864551..32cb385 100755 --- a/scripts/build-oracle-ef.sh +++ b/scripts/build-oracle-ef.sh @@ -1,38 +1,42 @@ #!/usr/bin/env bash -# build-oracle-ef.sh — generate the EF (1962) regression oracle by fetching -# missalemeum's per-date proper API (the same source lectio's trad scraper uses, -# built on Divinum Officium data) for 2025-2026. +# build-oracle-ef.sh — build the EF (1962) regression oracle from the committed +# missalemeum snapshot (sources/snapshot.tar.gz, missalemeum/en/YYYY-MM-DD.json, +# 2026-01-01 .. 2027-12-31, 730 days), not a live fetch, so the oracle is +# reproducible offline and pinned to a known-good snapshot. # -# NOT run by `go test`. Requires network + curl + jq + GNU date. From repo root: +# Three things about this data that cost hours to learn (see oracle_ef_test.go): +# 1. info.id looks like "sancti:MM-DD:rank:colour", but its embedded rank is +# the rank of the PROPERS USED that day, not the day's own rank (e.g. +# 2026-01-02 is a class-4 feria whose id is "sancti:01-01:1:w" because it +# reuses the Circumcision's propers). Extracted here for provenance only +# -- never parse rank/colour out of it. Use info.rank/info.colors. +# 2. info.colors is an array; 14 of 730 days carry two values (Gaudete/ +# Laetare "pv", Palm Sunday "rv", Good Friday "bv", Holy Saturday "vw"). +# The Go test compares by membership, not equality. +# 3. A two-colour value on a weekday can be a proper-reuse artifact (a feria +# inside Gaudete/Laetare week reusing the Sunday's own propers) rather +# than a claim about that weekday's own colour. +# +# From repo root: # scripts/build-oracle-ef.sh # Writes internal/calendar/testdata/oracle-ef.json: -# { "YYYY-MM-DD": {"tempora": "...", "title": "...", "rank": N, "colour": "w"} } -# tempora is "" when missalemeum returns null (then the temporal identity is in -# title); the Go test derives the season from tempora-or-title. +# { "YYYY-MM-DD": {"id":"...", "tempora":"...", "title":"...", "rank":N, "colours":["w",...]} } set -euo pipefail out=internal/calendar/testdata/oracle-ef.json -mkdir -p "$(dirname "$out")" work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT -for y in 2025 2026; do - d="$y-01-01" - while [ "$(date -d "$d" +%Y)" = "$y" ]; do - echo "$d" - d=$(date -d "$d +1 day" +%F) - done -done > "$work/dates" +tar xzf sources/snapshot.tar.gz -C "$work" missalemeum/en -fetch() { - local d="$1" - local j - j=$(curl -sf --max-time 25 "https://www.missalemeum.com/en/api/v5/proper/$d" || true) - printf '%s' "$j" | jq -c --arg d "$d" \ - '{($d): (.[0].info | {id:(.id // ""), tempora:(.tempora // ""), title:.title, rank:.rank, colour:(.colors|join(""))})}' \ - 2>/dev/null || true -} -export -f fetch +jq -s ' + map({(.[0].info.date): { + id: (.[0].info.id // ""), + tempora: (.[0].info.tempora // ""), + title: .[0].info.title, + rank: .[0].info.rank, + colours: .[0].info.colors + }}) | add +' "$work"/missalemeum/en/*.json > "$out" -xargs -P 12 -I{} bash -c 'fetch "$@"' _ {} < "$work/dates" | jq -s 'add' > "$out" echo "wrote $out ($(jq 'length' "$out") days)" >&2 -rm -rf "$work" |
