Sangeetha-Grantha

Metadata Value
Status Completed
Version 1.0.0
Last Updated 2026-03-15
Author Sangeetha Grantha Team

Goal

Fix the guru-guha.blogspot.com extraction pipeline end-to-end so that all 26+ krithis imported from this source have correct structural sections (PALLAVI, ANUPALLAVI, CHARANAM) and clean lyrics — no metadata pollution, no navigation cruft, no URLs in lyric text.

Motivation

Krithis imported from guru-guha.blogspot.com showed “abhayAmbA jagadambA - rAgaM kalyANi - tALaM Adi” as lyrics under an UNKNOWN section type. Root causes:

  1. False metadata boundary: The structure parser’s “Meaning” pattern matched “Meaning of Kriti” navigation links at offset 48, truncating the entire lyric window
  2. Navigation table pollution: Language-switch <table> elements (English Devanagari Tamil …) were extracted as lyric content
  3. URL noise in lyrics: Fragment links like <a href="#V1">text</a> rendered as "text (full-url#V1)"
  4. Stale sections not upgraded: Once an import had all-OTHER sections from a bad extraction, re-extraction didn’t replace them
  5. Retry counter not reset: ExtractionQueueRepository.retry() reset status to PENDING but left attempts at max, so the claim query returned no rows

Implementation Plan

Python Extraction Worker Fixes

Backend Fixes

Re-extraction Cycle

Files Modified

File Change
tools/krithi-extract-enrich-worker/src/html_extractor.py Navigation table stripping, link filtering
tools/krithi-extract-enrich-worker/src/structure_parser.py Metadata boundary hardening, minimum-content guard
tools/krithi-extract-enrich-worker/src/worker.py URL-based composer inference fallback
tools/krithi-extract-enrich-worker/tests/test_html_extractor.py Guru-guha blog tests
modules/backend/api/.../services/LyricVariantPersistenceService.kt Section upgrade, multi-status backfill
modules/backend/api/.../routes/ImportRoutes.kt Re-extract endpoint, typed response DTOs
modules/backend/dal/.../repositories/KrithiLyricRepository.kt deleteAllVariants()
modules/backend/dal/.../repositories/ExtractionQueueRepository.kt Reset attempts in retry()

Ref: application_documentation/10-implementations/track-097-guru-guha-blog-source-adapter.md