| Metadata | Value |
|---|---|
| Status | Completed |
| Version | 1.0.0 |
| Last Updated | 2026-03-15 |
| Author | Sangeetha Grantha Team |
Fix the lyric variant persistence pipeline so that krithis imported via the Python extraction worker (CanonicalExtractionDto format) have their lyrics, sections, and lyric sections saved to the database. Backfill the 67 already-approved krithis from TRACK-093 that were approved with zero lyrics persisted.
A classic integration seam failure where two pipeline stages each worked correctly in isolation but the handoff between them was never tested end-to-end.
| Format | Producer | Consumer | Status |
|---|---|---|---|
ScrapedKrithiMetadata |
Legacy Kotlin scraper (WebScrapingService) |
LyricVariantPersistenceService |
Only format it understood |
CanonicalExtractionDto |
Python extraction worker (structure_parser.py) |
ExtractionResultProcessor |
What’s actually stored in parsed_payload |
The Python pipeline was built in TRACK-041+ to produce CanonicalExtractionDto, and ExtractionResultProcessor.enrichExistingImport() stores it in imported_krithis.parsed_payload. But LyricVariantPersistenceService was never updated to read it — it only knew ScrapedKrithiMetadata. The deserialization mismatch was swallowed by a catch(e) { println(...) } block, producing zero user-visible errors while silently skipping all lyric/section persistence.
catch (e: Exception) { println("Error processing scraped metadata: ${e.message}") } — no logger, no API error, no status changeCanonicalExtractionDto first, fall back to ScrapedKrithiMetadatapersistFromCanonical() method mapping canonical sections/variants to DBprintln error handler with logger.errorignoreUnknownKeys = true) for forward compatibilityPOST /v1/admin/imports/backfill-lyrics to re-run lyric persistence for approved krithis with empty variantsagastISvaraM) has empty sections in extraction payload (needs re-extraction, not backfill)krithi_lyric_variants populated (194 total sections)agastISvaraM) has sections: [] in extraction — no lyric content to persist| File | Change |
|---|---|
modules/backend/api/.../services/LyricVariantPersistenceService.kt |
Dual-format detection, persistFromCanonical(), proper logging |
modules/backend/api/.../routes/ImportRoutes.kt |
Backfill endpoint (pending) |
Ref: application_documentation/10-implementations/track-094-lyric-persistence-fix-backfill.md