Purpose: Index ALL books across ALL canons. Prevent hiding. Make everything discoverable.
Location: bible/UniversalBibleSearch.kt
Responsibilities:
- Search ALL books without canonical filtering
- Get books by textual tradition (Masoretic, Septuagint, New Testament, Ethiopic)
- Get Septuagint-only books (deuterocanonical)
- Get Ethiopic-only books
- Get universal books (in all canons)
- Get books missing from Protestant canon
- Get corpus statistics
Key Functions:
fun searchBooks(query: String): List<BibleBook>
fun getAllBooksByTradition(): Map<TextTradition, List<BibleBook>>
fun getSeptuagintOnlyBooks(): List<BibleBook>
fun getEthiopicOnlyBooks(): List<BibleBook>
fun getUniversalBooks(): List<BibleBook>
fun getMissingFromProtestant(): List<BibleBook>
fun getCorpusStatistics(): CorpusStatisticsDesign Principles:
- No Hiding: Search returns ALL matching books, no canonical filtering
- Reveal the Past: Explicitly surface books Protestantism removed
- Tradition-First: Organize by textual tradition (Hebrew → Greek → Ge'ez)
- Statistical Transparency: Show exactly what's in each tradition
Purpose: Compose components for displaying search results with full metadata.
Location: ui/components/search/UniversalSearchComponents.kt
Responsibilities:
- Search bar with universal search
- Book cards showing tradition and canon badges
- Tradition badges (color-coded)
- Canon badges (color-coded)
- Search results list
- Corpus statistics card
- Empty states
Key Components:
@Composable fun UniversalSearchBar(query, onQueryChange)
@Composable fun BookCard(book, onClick)
@Composable fun TraditionBadge(tradition)
@Composable fun CanonBadges(canons)
@Composable fun SearchResultsList(books, onBookClick)
@Composable fun CorpusStatisticsCard(stats)Design Principles:
- Full Metadata: Show tradition, canon, section for every book
- Visual Clarity: Color-coded badges for traditions
- No Filter Indicators: Don't hide books with UI tricks
- Statistical Honesty: Show counts, not "..." ellipses
Purpose: Screen for exploring the COMPLETE biblical corpus by tradition.
Location: ui/screens/CorpusExplorerScreen.kt
Responsibilities:
- Show all books organized by textual tradition
- Tab navigation (Corpus, Septuagint, Ethiopic, Missing, Search)
- Statistics overview
- Tradition sections with descriptions
- "Books Missing from Protestant Canon" section
- Universal search (no canonical filtering)
Key Functions:
@Composable fun CorpusExplorerScreen(bibleManager, onBookClick, onBackClick)
@Composable fun CorpusOverviewContent(corpusStats, allBooksByTradition, onBookClick)
@Composable fun TraditionSection(tradition, books, onBookClick, description)
@Composable fun MissingBooksSection(missingBooks, onBookClick)Design Principles:
- Tradition-First Navigation: Tabs for Masoretic, Septuagint, Ethiopic
- Reveal the Missing: Explicit "Missing from Protestant" section
- Explain the History: Context for WHY books are missing
- No Canonical Filtering: Search across ALL canons
Purpose: Track which textual tradition each book belongs to.
Location: models/BibleBook.kt
Enums:
enum class TextTradition {
Masoretic, // Hebrew/Aramaic, 39 books
Septuagint, // Greek, includes deuterocanonical books
NewTestament, // Greek, 27 books
Ethiopic // Ge'ez, Ethiopian-canon-only books
}Responsibilities:
- Distinguish Masoretic from Septuagint
- Track Ethiopic texts
- Provide
isSeptuagintcomputed property - Support tradition-based filtering
Purpose: Track which canons include each book.
Location: models/BibleBook.kt
Enums:
enum class Canon {
Protestant,
Catholic,
Orthodox,
Ethiopian
}Responsibilities:
- Track canon membership per book
- Support multi-canon books
- Provide
isDeuterocanonicalandisEthiopianExclusivecomputed properties - Generate human-readable canonical status
Purpose: Logical grouping of books within a testament.
Location: models/BibleBook.kt
Enums:
enum class BookSection {
Pentateuch, Historical, Wisdom, MajorProphets, MinorProphets,
Deuterocanonical, EthiopianCanon,
Gospels, Acts, PaulineEpistles, GeneralEpistles, Apocalyptic
}Responsibilities:
- Group books logically
- Support section-based navigation
- Preserve canonical order within sections
Purpose: Route books to correct scrapers and handle errors gracefully.
Location: bible/BibleManager.kt
Key Functions:
suspend fun fetchChapter(book, chapter, version)
suspend fun fetchInterlinear(book, chapter)
suspend fun scrapeChapter(book, chapter, version)
suspend fun scrapeInterlinear(book, chapter)Responsibilities:
- Route to Wikisource for deuterocanonical books
- Route to Enoch scraper for Ethiopian books
- Route to BibleGateway for standard books
- Throw clear errors for NO_SOURCE books
- Log errors instead of crashing
Purpose: Cache-first fetching to protect endpoints from rate limiting.
Location: bible/BibleCacheManager.kt
Key Functions:
suspend fun ensureChapter(book, chapter): Boolean
suspend fun prefetchBook(book)
suspend fun prefetchWholeBible()
fun isBookCached(book): Boolean
fun cachedChapterCount(book): IntResponsibilities:
- Check cache before fetching
- Don't refetch cached content
- Prefetch entire books/books
- Track progress and errors
- Respect user canonical preferences
Purpose: User preferences for canonical display.
Location: settings/SettingsManager.kt (existing)
Settings:
showApocrypha: Include Catholic/Orthodox deuterocanonical booksshowEthiopian: Include Ethiopian-canon-only booksbibleGatewayVersion: Translation version
Responsibilities:
- Store user canonical preferences
- Map preferences to canon presets
- Persist across sessions
CorpusExplorerScreen
├─ UniversalBibleSearch
│ └─ BibleBook (models)
│ ├─ Canon enum
│ ├─ TextTradition enum
│ └─ BookSection enum
├─ UniversalSearchComponents (UI)
│ └─ BibleBook (models)
└─ BibleManager (for searchVersesEverywhere)
UniversalSearchComponents
└─ BibleBook (models)
BibleManager
├─ WikisourceApocryphaScraper
├─ WikisourceEnochScraper
└─ BibleScraper
BibleCacheManager
├─ BibleManager
└─ SettingsManager
❌ Avoid: Defaulting to Protestant canon and hiding everything else ✅ Do: Show ALL books by default in corpus explorer, filter only by explicit user choice
❌ Avoid: Search that only returns books in user's selected canon ✅ Do: Universal search returns ALL matching books across ALL canons
❌ Avoid: Showing only book name and chapter count ✅ Do: Show tradition, canon, section, and canonical status for EVERY book
❌ Avoid: Ordering books by Protestant canonical order ✅ Do: Order by textual tradition (Hebrew → Greek → Ge'ez) or section
❌ Avoid: Labeling deuterocanonical books as "optional" or "extra" ✅ Do: Treat all books equally, show which canons include them
❌ Avoid: Presenting the 66-book canon as "the Bible" ✅ Do: Explain historical context, show which books were removed and why
UniversalBibleSearchTest.kt(12 tests)- Search finds all matching books
- Case-insensitive search
- Tradition-based search
- Books by tradition
- Septuagint-only books
- Ethiopic-only books
- Universal books
- Missing from Protestant
- Canon-exclusive books
- Corpus statistics
- Nothing is hidden
- Can search by section
CanonAwareBibleBookTest.kt(20 tests)- Protestant canon = 66 books
- Catholic canon > 66 books
- Ethiopian canon is broadest
- Canon membership correctness
- Tradition assignments
- Sectional grouping
- Canonical ordering
- Canonical status descriptions
- Strong's prefix correctness
BibleCachingBehaviorTest.kt(12 tests)- Cache-first behavior
- No refetch when cached
- Prefetch is idempotent
- Error recovery
- Prefetch continues after failure
- Cache fraction accuracy
BookOfWisdomScraperRoutingTest.kt(6 tests)- Wisdom routing to Wikisource
- Wisdom in SUPPORTED_BOOKS
- Wisdom NOT in NO_SOURCE_BOOKS
- Verse parsing
- Network error propagation
- Index verses by tradition
- Show multiple translations (KJV, Septuagint, Ge'ez)
- Cross-tradition verse comparison
- Show when books were added/removed
- Timeline of canon development
- Interactive canon evolution visualization
- Masoretic reading plan
- Septuagint reading plan
- Ethiopic reading plan
- Track which tradition a note applies to
- Show tradition-specific commentary
- Export Masoretic OT only
- Export complete Ethiopian canon
- Export "missing from Protestant" books