Sangeetha-Grantha

Metadata Value
Status Completed
Version 1.2.1
Last Updated 2026-02-19
Author Sangita Grantha Architect

TRACK-041: Enhanced Sourcing Logic & Structural Voting

1. Objective

Harden the Krithi import pipeline by implementing multi-source structural voting and authoritative source prioritization.

2. Context

3. Implementation Plan

4. Artifacts

Artifact Path Description
Strategy document application_documentation/01-requirements/krithi-data-sourcing/quality-strategy.md Comprehensive strategy covering all sourcing & quality work
Implementation checklist application_documentation/01-requirements/krithi-data-sourcing/implementation-checklist.md Phase-by-phase task breakdown with acceptance criteria
StructuralVotingEngine modules/backend/api/.../services/scraping/StructuralVotingEngine.kt Multi-source section structure voting
ImportService (enhanced) modules/backend/api/.../services/ImportService.kt ComposerSourcePriority, structural voting integration
KrithiStructureParser (enhanced) modules/backend/api/.../services/scraping/KrithiStructureParser.kt Multi-script detection, Madhyama Kala, Tamil subscripts
CanonicalExtractionDto modules/shared/domain/.../import/CanonicalExtractionDto.kt Universal extraction format (Kotlin)
Canonical schema (Python) tools/krithi-extract-enrich-worker/src/schema.py Pydantic model matching Kotlin DTO
Canonical JSON schema shared/domain/model/import/canonical-extraction-schema.json JSON Schema for validation
Migration 23 database/migrations/23__source_authority_enhancement.sql Source authority model
Migration 24 database/migrations/24__krithi_source_evidence.sql Source evidence tracking
Migration 25 database/migrations/25__structural_vote_log.sql Structural vote audit trail
Migration 26 database/migrations/26__import_task_format_tracking.sql Format tracking
Migration 27 database/migrations/27__extraction_queue.sql Kotlin ↔ Python extraction queue
Source registry seed database/seed_data/04_import_sources_authority.sql Import sources with tier rankings
PDF extraction service tools/krithi-extract-enrich-worker/ Python service (PyMuPDF, OCR, transliteration)
Dockerfile tools/krithi-extract-enrich-worker/Dockerfile Container image with Tesseract + Indic packs
Docker Compose compose.yaml Extended with krithi-extract-enrich-worker service
CLI extraction command tools/sangita-cli/src/commands/extraction.rs sangita-cli extraction start/stop/status/logs
Sourcing UI/UX Plan application_documentation/01-requirements/krithi-data-sourcing/ui-ux-plan.md UI/UX requirements for sourcing & extraction monitoring screens
ExtractionResultProcessor modules/backend/api/.../services/ExtractionResultProcessor.kt Processes DONE extraction queue items → source evidence + structural voting
Migration 28 database/migrations/28__extraction_ingested_status.sql Adds INGESTED status to extraction_status enum

5. Progress Log