fix(fallbacks): T4 — fail loud on missing configured render asset (font dir, background)#807
Open
beveradb wants to merge 1 commit into
Open
fix(fallbacks): T4 — fail loud on missing configured render asset (font dir, background)#807beveradb wants to merge 1 commit into
beveradb wants to merge 1 commit into
Conversation
…nt dir, background) Part of the silent-fallback audit (Theme 4). A *configured* branded asset that is missing must not silently substitute a different font/background on a paid deliverable. Mirrors the existing background-image check in lyrics_transcriber/output/video.VideoGenerator.__init__ (which already raises). - output/video._build_ass_filter: when the theme's karaoke font_path is set but the file is missing, the final MP4 used to silently drop :fontsdir and let libass resolve a system fallback font for the whole song. Now raises FileNotFoundError. (Unset font_path is still fine — no fontsdir, no raise.) - video_generator._create_background: when a title/end-screen background_image is set but missing, it used to silently fall back to a flat color. Now raises FileNotFoundError. (No background configured is still fine — flat color.) Scope: only these two clean "configured-but-missing → raise" cases are changed. The font *substitution* items (4.2 title/end font, 4.4 CDG arial, 4.8 measurement font) and duet/colour items (4.5-4.7) are intentionally left as-is — font substitution overlaps with legitimate CJK font fallback (test_video_generator_cjk_font) and warrants per-item treatment. Per Andrew's decision. Tests: new test_fallback_render_assets.py (raise + legitimate-unset cases). 105 render/video tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Theme 4 of the silent-fallback audit (
docs/archive/2026-06-09-fallback-audit-plan.md, in #805). A configured branded render asset that is missing must not silently substitute a different font/background on a paid deliverable. Mirrors the existing background-image check inoutput/video.VideoGenerator.__init__(which already raises).Changes
output/video._build_ass_filter(4.1): when the theme's karaokefont_pathis set but the file is missing, the final MP4 used to silently drop:fontsdir→ libass resolves a system fallback font for the whole song. Now raisesFileNotFoundError. (Unsetfont_pathis still fine — no fontsdir, no raise.)video_generator._create_background(4.3): a set-but-missing title/end-screenbackground_imageused to silently fall back to a flat color. Now raisesFileNotFoundError. (No background configured is still fine — flat color.)Scope (per your decision)
Only these two clean "configured-but-missing → raise" cases are changed. The font substitution items (4.2 title/end font, 4.4 CDG→arial, 4.8 measurement font) and duet/colour items (4.5–4.7) are left as-is — font substitution overlaps with legitimate CJK font fallback (
test_video_generator_cjk_font.py) and warrants per-item treatment.Testing
tests/unit/test_fallback_render_assets.py(raise + legitimate-unset cases)Review
@coderabbitai ignore
🤖 Generated with Claude Code