Skip to content

Fix Greek reading boundaries and add the weekday Menaion readings 2026 Issue #228 - #236

Open
dgrahamlong wants to merge 1 commit into
brianglass:mainfrom
dgrahamlong:fix-greek-reading-boundaries
Open

dgrahamlong wants to merge 1 commit into
brianglass:mainfrom
dgrahamlong:fix-greek-reading-boundaries

Conversation

@dgrahamlong

Copy link
Copy Markdown

Fix Greek reading boundaries and add the weekday Menaion readings 2026 hid

Problem

Comparing orthocal's Greek tradition with goarch.org and antiochian.org for 2026 showed 45 Epistle and Gospel fields on 44 dates where the passage was split differently: the same opening verse, a different closing one (e.g. Acts 15:5-34 where both sources print Acts 15:5-12). Extending the comparison to other years showed the same pattern across the cycle, plus a second class of misses that 2026 could not reveal.

What this does

Pericope boundaries. 62 readings where goarch.org and antiochian.org agree with each other and orthocal split the passage differently. Each gets a greek-tagged row in the same slot, so the common row still serves Slavic callers. tools/greek/load_exact_boundaries.py holds the table; every row names the citation it replaces and the years each source corroborates it, and the loader stops if a slot no longer reads what the row expects instead of overwriting it.

Weekday Menaion readings. Feb 15, Aug 2, Aug 9, Aug 16, Sep 6, Sep 12, Sep 20, Oct 11, Nov 22 and Dec 20 all fall on a Sunday in 2026, so the Sunday readings masked eleven saints' readings orthocal never carried for Greek use (Philemon for Onesimus and Philemon, Ignatius on Dec 20, the relics of Stephen, Matthias, the Holy Image, the Miracle at Colossae, Autonomos, Eustathius, Philip the Deacon). Added to tools/greek/load_shared_menaion.py in its existing format; all eleven pericopes already existed. The Feb 15 Philemon also explains the two "stale" Philemon years in the Prodigal Son Saturday note in docs/greek-commons.md: those were Feb 15 landing on that Saturday.

Two bugs found along the way.

  • Weekday cycle rows are stored twice, once after Pentecost and once before the next Pascha. Overriding one copy left the old boundary on dates that reach the other. Overrides now apply to both.
  • Verse.objects.lookup_reference took an explicit chapter on a chapterless book as the first verse, so Jude 1:11-25 returned all 25 verses.

Testing. calendarium/tests/data/antiochian-readings.tsv characterizes every harvested antiochian.org reading from 2018 to 2026 (3,095 lines) as exact, boundary, different or unresolved, comparing verse sets rather than strings so Gal 5:22-26; 6:1-2 and Gal 5.22-6.2 count as equal. The test regenerates the lines and fails with a diff naming the date, so a fix for one year that breaks another is visible. tools/greek/antiochian_characterize.py --write regenerates the file. The 45 fields from the original report are also asserted directly.

The comparison parser in ingest_antiochian.py now reads the remaining antiochian.org title shapes (ST. JAMES' UNIVERSAL LETTER, ST. PAUL TO THE HEBREWS, a bare range after ;), which had been scoring orthocal as wrong on days it was right.

Results

Greek readings against goarch.org, by verse set:

year before after
2024 89.5% 98.7%
2025 90.3% 99.4%
2026 92.9% 100%

Antiochian.org golden file, 2018-2026: exact 3029, different 63, boundary 2, unresolved 1. "Different" includes days the two sources disagree with each other, so it cannot reach zero.

Slavic output on every affected date is byte-for-byte unchanged (checked 2024-2027 and 2031). Greek fasting was audited at the same time and needs nothing: 99.7-100% per year against goarch.org, and the residual days are ones docs/fasting-refactor-scope.md already declines to change.

Left alone

  • Feast transfers (Forty Martyrs to the Friday before a Saturday of Souls, St George to Bright Monday): one year of evidence each and new logic, so not attempted here.
  • The Theophany and January cluster the docs describe as not computable.
  • One single-source boundary (Luke 4:37-44 vs 4:38-44, 2025-09-29) and St Simon's May 10 Gospel, each with one year of evidence.
  • The Holy Friday composite Gospel row, which an earlier maintainer commit already overrides on the same slot.

Verification

Full suite passes (204 tests). Both loaders re-run as no-ops on the resulting fixture, and loading the boundary table from main produces the same rows as the previous version did.

@dgrahamlong dgrahamlong changed the title Fix Greek reading boundaries and add the weekday Menaion readings 2026 Fix Greek reading boundaries and add the weekday Menaion readings 2026 Issue #228 Sep 18, 2026
@brianglass

Copy link
Copy Markdown
Owner

@dgrahamlong, sorry I failed to notice your PR. I'll try to review it in the next week or two.

…6 hid

Greek readings against goarch.org: 2024 89.5% -> 98.7%, 2025 90.3% ->
99.4%, 2026 92.9% -> 100%. Slavic output is unchanged.

- 62 pericope boundaries where goarch.org and antiochian.org agree and
  orthocal split the passage differently. Rows are keyed by the citation
  they replace and carry the years each source corroborates them, and
  the loader stops rather than overwrite a row it does not recognise.
- 11 weekday saints' readings that a 2026-only audit could not see,
  because each date falls on a Sunday in 2026.
- Weekday cycle rows are stored twice, once per Paschal year; overrides
  now apply to both copies.
- Chapterless books took an explicit chapter as the first verse, so
  "Jude 1:11-25" returned all 25 verses.
- A golden-file test characterizes every harvested antiochian.org
  reading (2018-2026) by verse set, so a fix for one year that breaks
  another shows up as a diff naming the date.
@brianglass
brianglass force-pushed the fix-greek-reading-boundaries branch from 0f984b7 to f053fed Compare October 2, 2026 18:37

@brianglass brianglass left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. It's a careful piece of work, and the verse-set golden file across 2018-2026 is a great safety net. I checked the shadowing, the double-stored weekday cycle rows, the Jude 1:11-25 fix and the new antiochian.org title parsing, and they all look right. The two comments inline are about reproducing the data from the loader scripts, not about the readings themselves.

🤖 Review prepared with Claude Code

'Luke 10:38-42, 11:27-28 in every year from 2022 through 2026, which '
'goarch.org corroborates for 2026. Taking the later, stable value'),
(5, 7, 'Epistle', 'Acts 26.1-5, 12-20', 'Appearance of the Cross over Jerusalem',
(5, 7, 'Epistle', 'Acts 26.1, 12-20', 'Appearance of the Cross over Jerusalem',

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This row (and the new (9, 12) Autonomos row asking for 'John 11.47-54') now looks up a pericope that doesn't exist on main. Only load_exact_boundaries.py creates Acts 26.1, 12-20 and John 11.47-54. So running this script against a pre-PR database raises Pericope.DoesNotExist from Pericope.objects.get(sdisplay=...) (line 106) at the May 7 row, before any of the new weekday-Menaion rows are written. And because the loop isn't in a transaction, the rows before it stay applied.

Could you either document the run order (README and docstring: load_exact_boundaries.py first), or have this script create any missing pericope the way exact_pericope() does? Wrapping the loop in transaction.atomic() would also stop a failed run from leaving the database half-updated.


def exact_pericope(base, title):
display, sdisplay = normalized_displays(title)
if found := Pericope.objects.filter(sdisplay=sdisplay).first():

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exact_pericope() reuses any existing pericope with the same sdisplay, but the committed fixtures/calendarium.json has two grk pericopes that duplicate existing ones:

  • pk 1064 (311grk, Matthew, Matt 16.13-19) duplicates pk 72
  • pk 1017 (312grk, Matthew, Matt 27.62-66) duplicates pk 124

Both are new in this PR (main stops at pk 1013). So the fixture isn't what this script produces: rerunning it against the committed fixture would point Reading 1814 (Holy Friday) and the new 9/13 Gospel at pk 124 and pk 72, and orphan the two grk copies. That contradicts the "a second run changes nothing" promise in the docstring. Could you regenerate the fixture from the script, or repoint those readings at pk 72/124 and drop the duplicates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants