Sangeetha-Grantha

TRACK-099: Backend Compiler Warning Cleanup — Zero Warnings Target

Status: Completed

Progress Log

Summary

Eliminate all 53 Kotlin compiler warnings across 9 backend files to achieve a zero-warning build. The vast majority (50/53) stem from TRACK-096 deprecated types that are still referenced by legacy scraping code. The remaining 3 are code quality issues.

Warning Inventory

By Deprecated Type (50 warnings)

Deprecated Type Replacement Count
ScrapedKrithiMetadata CanonicalExtractionDto 20
ScrapedSectionDto CanonicalSectionDto 14
KrithiStructureParser Python structure_parser.py 7
IWebScraper Remove (Python worker handles extraction) 4
ScrapedLyricVariantDto CanonicalLyricVariantDto 3
ScrapedTempleDetails CanonicalExtractionDto temple fields 2

Code Quality (3 warnings)

Warning File Line
Condition is always true ImportService.kt 491
Condition is always true ImportService.kt 517
Unnecessary safe call on non-null String ImportRoutes.kt 186

By File (53 warnings)

File Warnings Category
api/services/WebScrapingService.kt 23 Legacy scraping — candidate for removal
api/services/DeterministicWebScraper.kt 11 Legacy scraping — candidate for removal
api/services/LyricVariantPersistenceService.kt 7 Active — migrate to Canonical DTOs
api/services/ImportService.kt 4 2 deprecated refs + 2 code quality
api/services/scraping/StructuralVotingEngine.kt 3 Legacy scraping — migrate to Canonical DTOs
api/di/AppModule.kt 2 Remove IWebScraper DI binding
api/services/StructuralVotingProcessor.kt 1 Migrate ScrapedSectionDto ref
api/services/ScrapingPromptBuilder.kt 1 Remove KrithiStructureParser import
api/routes/ImportRoutes.kt 1 Fix unnecessary safe call

Approach

Phase 1: Remove Dead Code (target: ~38 warnings)

Files that implement the legacy Kotlin scraping pipeline superseded by the Python extraction worker:

Phase 2: Migrate Active Code to Canonical DTOs (target: ~12 warnings)

Files that are actively used but still reference deprecated DTOs:

Phase 3: Fix Code Quality (target: 3 warnings)

Parallelization Strategy

Three parallel agents:

Verification

# Must produce 0 lines of "w:" output
./gradlew :modules:backend:dal:clean :modules:backend:api:clean \
  :modules:backend:dal:compileKotlin :modules:backend:api:compileKotlin 2>&1 | grep "w:"

# All tests must pass
./gradlew :modules:backend:api:test

Dependencies

Risks

Ref

Ref: application_documentation/02-architecture/tech-stack.md