Route bible-plan incipit/responsory lookup through the book-alias table
bible-plan.ts's *.yml import uses English-style book abbreviations
("jdt", "1kgs", "luke", ...) for ~30 books where that diverges from
this store's canonical form ("jdth", "3reg", "luc", ...).
scripture/index.ts's own BOOK_ALIASES already normalized this for
verse-text lookup, but the incipit (bible-book-incipits.ts) and
responsory (matins-responsories.ts) lookups used the raw abbreviation
directly, silently missing on any canonically-keyed book and falling
back to a bare "Reading" heading. The 3 Gospel aliases self-healed via
a separate citation-regex fallback that only exists for Gospels; every
other aliased book (Judith, Kings, Samuel, Esdras, Osee, Jonas, Josue,
Micheas, Abdias, Judges, the Johannine epistles, James, Jude, Philemon,
Titus, Zacharias, Sophonias) had no such fallback. Exports
canonicalBook from scripture/index.ts and routes both lookups through
it -- one shared normalization instead of two independently-aliased
ones that can drift again.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGjUyhUZJaSjiniEmnLdak
This commit is contained in:
@@ -17,3 +17,24 @@ describe('getBiblePlanReadings citation labels', () => {
|
||||
expect(readings[2]?.citation.la).toBe('Luke 18:1-23');
|
||||
});
|
||||
});
|
||||
|
||||
// A reading's `label` (the "Léctio libri..." incipit) previously looked up
|
||||
// bible-book-incipits.ts's canonical-abbreviation-only table using the raw
|
||||
// book abbreviation from data/hours/bible-plan/*.yml -- which, for ~30
|
||||
// books, is one of scripture/index.ts's own English-style aliases (e.g.
|
||||
// "jdt" for Judith), not the canonical form ("jdth") that table is keyed
|
||||
// by. The alias resolved verse *text* fine (getScriptureChapter already
|
||||
// consulted the alias table) but silently missed the label lookup,
|
||||
// rendering as the generic "Reading" heading instead -- live case: Sept
|
||||
// 18 2026's own Ember Friday commemoration, `post-pentecost-16-friday`'s
|
||||
// first reading (Judith 11-13). Fixed 2026-09-03 by routing both the
|
||||
// incipit and responsory lookups through scripture/index.ts's own
|
||||
// `canonicalBook`, the same normalization the text lookup already used.
|
||||
describe('getBiblePlanReadings label uses the same book-alias normalization as verse-text lookup', () => {
|
||||
it('an aliased book ("jdt" for Judith) still gets its real incipit label, not the generic fallback', () => {
|
||||
const readings = getBiblePlanReadings('post-pentecost-16', 'friday', '2026-09-18');
|
||||
expect(readings[0]?.citation.la).toBe('Jdt 11-13');
|
||||
expect(readings[0]?.label?.en).toBe('A reading from the book of Judith');
|
||||
expect(readings[0]?.label?.la).toBe('Léctio libri Judith');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user