| Metadata |
Value |
| Status |
Archived |
| Version |
1.0.0 |
| Last Updated |
2026-09-10 |
| Author |
Sangeetha Grantha Team |
| Document Type |
Archive |
Krithi Data Sourcing Strategy and Implementation Checklist
[!NOTE]
Historical evidence: results, counts, commands, and observations below belong to the original work described here. The editorial update date is not a new test or corpus verification. For present behavior, use current ingestion guide.
[!WARNING]
This document has been archived. It is superseded by:
1. Objective
Design and implement a long-term sourcing strategy that ingests Krithis and related metadata from high-integrity sources (HTML, PDF, and other document formats), while preserving musicological correctness, provenance, and editorial quality.
2. Context and Drivers
- Current bulk import is hyperlink + HTML-centric.
- Target sources include:
https://guruguha.org/wp-content/uploads/2025/01/mdskt.pdf
https://guruguha.org/wp-content/uploads/2022/03/mdeng.pdf
https://swathithirunalfestival.org/swathi-thirunal/
https://www.shivkumar.org/music/
https://karnatik.com/composers.shtml
- Existing tracks:
conductor/tracks/TRACK-039-data-quality-audit-krithi-structure.md
conductor/tracks/TRACK-040-krithi-remediation-deduplication.md
conductor/tracks/TRACK-041-enhanced-sourcing-logic.md
3. Current Baseline (As-Is)
Strengths
- Mature orchestration model with batch/job/task lifecycle, retries, watchdogs, and event logs.
- Staging table (
imported_krithis) already supports:
- parsed payload
- resolution candidates
- duplicate candidates
- quality metrics
- Deterministic section extraction exists and is already integrated with review flow.
- Entity resolution and dedup pipelines exist and are worker-driven.
Gaps
- Manifest and scrape flows are primarily URL + HTML driven.
- No first-class PDF/document extraction stage in the worker pipeline.
- Structural voting and authority source prioritization are pending.
- Quality scoring is generic and does not yet include format confidence or source authority.
- Review UX does not fully expose source-level evidence and provenance.
4. Strategic Principles
- Authority first: prefer curated, composer-specific authoritative sources.
- Structure before enrichment: lock canonical section structure first, enrich metadata later.
- Provenance by default: every asserted field should be traceable to source artifact and extractor run.
- Confidence-gated progression: do not auto-approve low-confidence structural imports.
- Reproducible pipeline: version all extraction and normalization logic for replayability.
- Fix-forward operations: remediation is auditable, reversible, and measurable.
5. Target Architecture (To-Be)
5.1 Multi-Layer Pipeline
- Acquisition Layer
- Accepts URL, PDF URL, local document upload, and mixed manifests.
- Produces source artifacts with checksum and MIME metadata.
- Format Extraction Layer
- HTML extractor.
- PDF text extractor.
- OCR extractor for scanned PDFs/images.
- Optional DOC/DOCX/RTF extractor.
- Structure Canonicalization Layer
- Runs structural voting across multiple extractions/sources.
- Produces canonical section template and confidence.
- Enrichment Layer
- Adds language variants, deity, temple, notes, and secondary metadata.
- Governance Layer
- Applies quality gates, dedup checks, review routing, and audit tracking.
5.2 Source Authority Policy
Initial authority map (field-sensitive, composer-sensitive):
- Muthuswami Dikshitar: Guruguha (primary)
- Swathi Thirunal: Swathi Thirunal Festival (primary)
- General composer metadata / fallback indexing: Karnatik, Shivkumar
Note: authority should be resolved by field type (structure vs metadata vs meaning), not a single global source rank.
6. Data and Schema Evolution Plan
6.1 Short-Term (No breaking changes)
Use parsed_payload and task evidence_path to store:
- Source artifact metadata
- Extractor output candidates
- Candidate section structures
- Chosen structure and vote rationale
6.2 Medium-Term (Recommended schema additions)
Add dedicated tables:
source_documents
- one row per acquired source artifact
extraction_runs
- extractor type/version, confidence, status, error details
structure_candidates
- candidate section sequences, source weights, vote scores
field_assertions
- per-field provenance (source, extractor, confidence)
enrichment_runs
- phase-wise enrichment status and outcomes
6.3 Compatibility Goals
- Keep existing
imported_krithis and import_batch flows operational.
- Integrate new tables incrementally.
- Avoid rewiring canonical
krithis write paths until confidence model is stable.
7. Multi-Phase Ingestion Strategy
Phase A: Structural Grounding
- Ingest from authority source(s).
- Parse and normalize section markers.
- Run structural voting where multi-source evidence exists.
- Persist only structural template + minimal core metadata.
- Resolve composer/raga/tala with current resolver.
- Resolve duplicates.
- Apply confidence scoring for core fields.
Phase C: Variant and Language Enrichment
- Add lyric variants in additional scripts/languages.
- Align variants to canonical section template.
- Flag drift (missing sections, merged sections, metadata pollution).
Phase D: Contextual Enrichment
- Deity, temple, kshetra, geo metadata.
- Meaning/notes extraction with explicit provenance.
- Scheduled audits for section drift and duplication regressions.
- Controlled remediation jobs with before/after evidence.
8. Quality Model and Review Gates
8.1 Scoring Dimensions
- Structural confidence
- Source authority score
- Extraction confidence (including OCR confidence for scans)
- Entity resolution confidence
- Deduplication confidence
- Validation and consistency score
8.2 Gate Policy
- Auto-approve eligible only if:
- high structural confidence
- high authority match
- no high-confidence duplicate conflict
- no unresolved critical fields
- Otherwise route to manual review with evidence.
8.3 Review UX Requirements
- Show per-field source lineage.
- Show all structure candidates and selected winner.
- Show artifact links (HTML/PDF pages or snapshots) and extraction logs.
9. TRACK Alignment
TRACK-039 (Audit)
- Complete full structural audit by source/language/composer.
- Add confidence drift and metadata pollution quantification.
TRACK-041 (Enhanced Sourcing Logic)
- Implement
ComposerSourcePriority + field-level authority logic.
- Implement
StructuralVotingEngine.
- Extend parser normalization for technical headers and script-specific markers.
- Build remediation jobs for:
- section normalization
- lyric metadata cleanup
- duplicate variant merge
- Start with Dikshitar high-priority set, then expand.
10. Risks and Mitigations
- Scanned PDF quality variance
- Mitigation: OCR confidence thresholds + mandatory manual review below threshold.
- Source structure drift
- Mitigation: versioned extractor profiles, source-specific handlers, regression fixtures.
- False-positive dedup merges
- Mitigation: conservative merge policy + human sign-off for medium confidence.
- Model-driven extraction instability
- Mitigation: deterministic parser precedence where available + schema-constrained JSON output.
- Operational load increase
- Mitigation: staged rollout, capped concurrency, queue-level observability.
11. 90-Day Delivery Roadmap
Sprint Window 1 (Days 1-20)
- Add source artifact abstraction.
- Add PDF extraction worker stage (MVP).
- Persist extraction evidence and confidence.
Sprint Window 2 (Days 21-45)
- Implement structural voting engine.
- Implement authority map and source weighting.
- Add review UI evidence panel.
Sprint Window 3 (Days 46-70)
- Add enrichment phases and gating.
- Upgrade quality scoring with structural/authority dimensions.
Sprint Window 4 (Days 71-90)
- Execute remediation pilot (Dikshitar).
- Measure KPIs and adjust thresholds.
- Prepare production rollout guide and runbook updates.
12. Detailed Implementation Checklist
Use this as the execution checklist for engineering, data, and editorial teams.
12.1 Discovery and Design
12.2 Schema and Contracts
12.3 Acquisition and Manifest Handling
12.5 Structure Canonicalization and Voting
12.6 Entity Resolution and Dedup
12.7 Enrichment Pipeline
12.8 Review and Admin UX
12.9 Quality Scoring and Auto-Approval
12.10 Observability and Operations
12.11 Testing and Validation
12.13 Governance and Change Control
13. Success Criteria
- Structural consistency across variants improves to target threshold.
- Reduction in manual correction effort per import batch.
- High-confidence auto-approval precision improves without quality regressions.
- Clear provenance coverage for all critical metadata fields.
- Remediation backlog decreases with no increase in duplicate regressions.
- Freeze and approve authority matrix and confidence rubric.
- Implement PDF extraction MVP and common candidate schema.
- Implement structural voting MVP and review UI evidence panel.
- Run Dikshitar pilot batch with end-to-end quality measurement.
- Finalize production rollout and runbook updates based on pilot outcomes.
Section index · Documentation home · Feature status