Bhavana AI

AI/ML insights

Dev Log: January 7, 2026

podcast-summarizer-v2

Wrapped up the major architectural transformation of the podcast summarizer, splitting the monolith into separate services and switching from Azure SDK-based coordination to database leases. Created the PR capturing the full scope of changes across orchestrator, GPU transcriber, and CPU processor. Ran into Azure Container Apps resource validation issues with memory units and CPU/memory ratios, then shifted focus to fixing a delivery deduplication bug where previously-sent episodes would trigger unique constraint violations. The fix properly handles all delivery states, reusing existing work for sent episodes and resetting failed ones for retry. Also addressed environment-specific config for Container Apps job naming and added client-side sorting to the admin dashboard.

The PR captures a complete architectural transformation:

  1. Monolith → Microservices: Single processor split into Orchestrator + GPU Transcriber + CPU Processor
  2. Azure SDK → DB Leases: More reliable coordination via atomic SQL operations
  3. 40 test milestones ensure correctness of distributed coordination invariants

Azure Container Apps Jobs have strict resource validation:

  • Memory must be in Gi units (not Mi)
  • CPU/memory must match specific ratios (0.25:0.5, 0.5:1.0, etc.)
  • The scale property only applies to scheduled/event triggers, not manual
  • The uq_delivery_subscription_episode constraint ensures one delivery per subscription+episode pair
  • The validation service only checked for PENDING/PROCESSING status when looking for existing deliveries
  • A previously SENT delivery will trigger an INSERT that violates the unique constraint
  • The fix handles all delivery states correctly by checking for any existing delivery first
  • For already-sent episodes, validation completes immediately (no need to reprocess)
  • For failed deliveries, the system resets them for retry (clearing last_error and processing_attempts)
  • This pattern prevents unique constraint violations while enabling efficient reuse of existing work
  • Azure Container Apps job names follow the pattern job-<type>-<baseName> where baseName includes the environment suffix (e.g., podsum-prod)
  • The config system uses environment variables to override defaults - when they’re not set, the default values are used
  • Always ensure environment variables are set in Bicep for any config that varies by environment
  • Client-side sorting is ideal for admin dashboards where page sizes are small (20-50 rows) - no API changes needed
  • The tri-state sort cycle (asc → desc → none) lets users easily reset sorting
  • Extracting sort utilities to lib/sort.ts keeps components clean and avoids React Fast Refresh warnings about non-component exports