Add BRAINIALL diarized transcription example - #125
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughAdds a Trigger.dev example for Portuguese and Spanish diarized transcription through BRAINIALL. The workflow validates consent, language, API credentials, source hosts, redirects, media types, and a 25 MB streaming limit. It uploads audio for transcription, generates speaker-labelled SRT and WebVTT captions, and returns transcript metadata. The project also adds configuration, setup documentation, environment templates, and tests for source validation, API handling, caption formatting, and workflow validation. Estimated code review effort: 4 (Complex) | ~60 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@brainiall-diarized-transcription/src/lib/captions.ts`:
- Around line 106-110: Update the token-joining condition in the captions join
logic to treat Spanish inverted question and exclamation marks (¿ and ¡) as
opening punctuation, preventing a space after them while preserving existing
punctuation behavior. Add a regression test covering separate Spanish
punctuation tokens, including joinTokens(["¿", "Cómo", "estás", "?"]) and the
equivalent exclamation case.
In `@brainiall-diarized-transcription/src/lib/source.ts`:
- Around line 131-138: Wrap the response-body reading and cancellation flow
around reader.read() and reader.cancel() in the relevant download function with
error handling that replaces any rejection, including errors containing signed
URL query data, with the existing generic download error used by the later fetch
error path. Ensure the reader is still cancelled when the size limit is
exceeded, and add a regression test using a ReadableStream that throws a fake
query secret to verify the redacted error is returned.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 49665272-8316-44b9-85ae-aa90258bbd4e
⛔ Files ignored due to path filters (1)
brainiall-diarized-transcription/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (16)
README.mdbrainiall-diarized-transcription/.env.examplebrainiall-diarized-transcription/.gitignorebrainiall-diarized-transcription/README.mdbrainiall-diarized-transcription/package.jsonbrainiall-diarized-transcription/src/lib/brainiall.tsbrainiall-diarized-transcription/src/lib/captions.tsbrainiall-diarized-transcription/src/lib/source.tsbrainiall-diarized-transcription/src/lib/workflow.tsbrainiall-diarized-transcription/src/trigger/transcribe.tsbrainiall-diarized-transcription/tests/brainiall.test.tsbrainiall-diarized-transcription/tests/captions.test.tsbrainiall-diarized-transcription/tests/source.test.tsbrainiall-diarized-transcription/tests/workflow.test.tsbrainiall-diarized-transcription/trigger.config.tsbrainiall-diarized-transcription/tsconfig.json
| if ( | ||
| !result || | ||
| /^[,.;:!?%…\)\]\}]/u.test(token) || | ||
| /[\(\[\{]$/u.test(result) | ||
| ) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve Spanish inverted punctuation.
joinTokens(["¿", "Cómo", "estás", "?"]) returns "¿ Cómo estás?". The current condition inserts a space after ¿ and ¡. Add both characters to the opening-punctuation expression. Add a regression test for separate Spanish punctuation tokens.
Proposed fix
- /[\(\[\{]$/u.test(result)
+ /[\(\[\{¿¡]$/u.test(result)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if ( | |
| !result || | |
| /^[,.;:!?%…\)\]\}]/u.test(token) || | |
| /[\(\[\{]$/u.test(result) | |
| ) { | |
| if ( | |
| !result || | |
| /^[,.;:!?%…\)\]\}]/u.test(token) || | |
| /[\(\[\{¿¡]$/u.test(result) | |
| ) { |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@brainiall-diarized-transcription/src/lib/captions.ts` around lines 106 - 110,
Update the token-joining condition in the captions join logic to treat Spanish
inverted question and exclamation marks (¿ and ¡) as opening punctuation,
preventing a space after them while preserving existing punctuation behavior.
Add a regression test covering separate Spanish punctuation tokens, including
joinTokens(["¿", "Cómo", "estás", "?"]) and the equivalent exclamation case.
|
Thanks for the thorough review — both findings were real and are now fixed: 1. Spanish inverted punctuation ( 2. Error redaction on body reads ( Full suite passes (22 tests). Ready for another look whenever convenient. |
Summary
Safety boundaries
Content-Lengthand while streamingmaxAttempts: 1prevents an automatic repeat of a metered requestValidation
npm ci --ignore-scriptsnpm run check— 20 tests passed and TypeScript passedgit diff --checkDependency audit note
npm audit --omit=devreports 19 advisories (1 low, 14 moderate, 4 high, 0 critical), all in the current Trigger.dev 4.5.8 transitive dependency tree. No forced or breaking dependency rewrite was applied in this example.Summary by CodeRabbit
New Features
Security
Documentation
Tests