| Metadata | Value |
|---|---|
| Status | Proposed |
| Version | 1.1.0 |
| Last Updated | 2026-09-10 |
| Author | Sangita Grantha Architect |
| Document Type | Decision record |
[!NOTE] Decision record: preserve the original rationale and check its decision/supersession status. Current runtime guidance is in system architecture and Flyway migrations.
The Technical Retrospective (2026-02-12) identified that the “Heuristic Split” between Kotlin and Python is the root cause of ingestion failures. Specifically:
The Python structure_parser.py will be the exclusive owner of:
MEANING, NOTES, GIST, and WORD_DIVISION into their own JSON fields. These must never be appended to lyric sections.BeautifulSoup4 to detect language boundaries in HTML (e.g., Blogspot tags or script changes) and produce separate CanonicalLyricVariant objects. This prevents the “Merged Language” bug where Telugu and Malayalam were stored in the same row.Moving candidate discovery to Python leverages high-performance libraries:
resolutionCandidates field.guru-guha, bias heavily toward Muthuswami Dikshitar).The extraction_queue will support HTML, PDF, and DOCX.
PENDING task; Python polls and processes.BulkImportRepository must atomically increment total_tasks whenever a sub-task (like Resolution) is spawned, ensuring progress bars never stall at 50%.Kotlin remains the owner of the Decision UI:
entity_resolution_cache to train future extractions.KrithiStructureParser.kt, DeterministicWebScraper.kt.INSERT.| Feature | Current State (Brittle) | Proposed UEE (Robust) |
|---|---|---|
| Language Logic | Kotlin tries to split scraped text. | Python splits at the source (HTML nodes). |
| Heuristics | Duplicated in 2 languages. | Single Python module for all formats. |
| Data Quality | Meanings merged into lyrics. | Hard-stop at Metadata markers. |
| Progress Tracking | Stalls at job boundaries. | Dynamic total_tasks incrementing. |
structure_parser.py.HtmlExtractor.py using BeautifulSoup4.BulkImportRepository to support dynamic task totals.ImportService.kt to call the UEE queue.db reset and run Dikshitar-Krithi-Test-20.csv to verify zero “dirty data” variants.Centralizing the “Intelligence” of the pipeline in Python transforms the Kotlin backend into a durable “System of Record” that is decoupled from the volatility of web scraping and document parsing.