ID: TRACK-001 Status: Completed Owner: Sangita Grantha Architect Created: 2026-01-20 Updated: 2026-01-21
Build the backend orchestration engine for bulk importing Krithis. This includes the database schema, Ktor services, coroutine workers, and management APIs. (UI/UX is handled in TRACK-003 and TRACK-004).
database/for_import//application_documentation/01-requirements/features/bulk-import/bulk-import-orchestration-ops-plan-goose.mdBulkImportOrchestrationService (batch/job/task lifecycle + admin controls)BulkImportWorkerService (background coroutine workers + polling)/v1/admin/bulk-import/...) for batch managementApp.kt lifecycleWebScrapingService and ImportServiceblocked state logic (Basic confidence implemented)resolution_data)GET /imports?status=PENDING)POST /imports/{id}/review)overrides in ImportReviewRequest)findOrCreate for Composers, Ragas, and Talas to prevent race conditions during review.DELETE /batches/{id} endpoint and UI control for managing stuck/test batches.reviewImport to return meaningful messages instead of 500s.(Previous logs preserved)
talas_name_normalized_uq error in logs.findOrCreate in TalaRepository, RagaRepository, ComposerRepository to handle race conditions safely.ImportService.reviewImport in try-catch to provide user-friendly error messages.DELETE /v1/admin/bulk-import/batches/{id} endpoint and corresponding “Delete” button in Admin UI.EntityResolutionService with fuzzy matching (Levenshtein) for Composers, Ragas, Talas.resolution_data JSONB column to imported_krithis.BulkImportWorkerService to include EntityResolution worker loop.App.kt.TRACK-003 and TRACK-004.idempotency_key column + unique index via 11__bulk-import-hardening.sqlRETRYABLE with audit eventsPhase E (Hardening) descoped to post-launch. See conductor/handoff-simplify-and-ship.md