Primitives-first AI subtitle post-processor: add MuxDataAdapter, debug artifacts, and workflow updates#8688
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
subject may not be emptytype may not be emptyheader must not be longer than 100 characters, current length is 110 |
1 similar comment
subject may not be emptytype may not be emptyheader must not be longer than 100 characters, current length is 110 |
Motivation
Description
MuxDataAdapter(apis/api-media/src/lib/aiSubtitles/muxDataAdapter.ts) that uses@mux/ai/primitives(fetchTranscriptForAsset,parseVTTCues,getStoryboardUrl,buildTranscriptUrl) to return normalizedSegment[], raw VTT and storyboard/playback info.apis/api-media/src/lib/aiSubtitles/*and exported viaindex.ts.fetch-transcriptstep and updated workflow bundle/steps/worker to callgetTranscriptSegments, pass raw transcript into the processor, persist validation debug artifacts to R2 when failures occur, and use primitives-built VTT URLs when tracks are ready (apis/api-media/src/workers/aiSubtitlePostProcessor/*).apis/api-media/src/lib/aiSubtitles/__tests__to assert fallback determinism and retry-before-fallback AI flow.PostProcessErrorcarrying artifacts for downstream persistence.prds/watch/ai-subtitle-post-processor.md,...-learnings.md) to require primitives-only Mux reads, mandate aMuxDataAdaptercomponent, and require debug outputs on validation failure.Testing
pnpm nx lint api-media— executed but failed due to pre-existing repository lint errors unrelated to these changes (import/order and other repo-wide issues).pnpm nx test api-media --testPathPattern aiSubtitles— the new aiSubtitles test files are present, but the test run was blocked by existing repository test-harness issues (prismaMock/PrismaClientexport error) so the suite could not complete.If you want, I can next (1) run an isolated Jest invocation directly against the new
__tests__folder to demonstrate the aiSubtitles logic in isolation, or (2) help remediate the unrelated lint/test-harness issues so repo-widelintandtestcomplete end-to-end.Codex Task