Skip to content

fix(fallbacks): T4 — fail loud on missing configured render asset (font dir, background)#807

Open
beveradb wants to merge 1 commit into
mainfrom
fix/fallback-t4-render-assets
Open

fix(fallbacks): T4 — fail loud on missing configured render asset (font dir, background)#807
beveradb wants to merge 1 commit into
mainfrom
fix/fallback-t4-render-assets

Conversation

@beveradb

Copy link
Copy Markdown
Collaborator

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 in output/video.VideoGenerator.__init__ (which already raises).

Changes

  • output/video._build_ass_filter (4.1): when the theme's karaoke font_path is 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 raises FileNotFoundError. (Unset font_path is still fine — no fontsdir, no raise.)
  • video_generator._create_background (4.3): a set-but-missing title/end-screen background_image used to silently fall back to a flat color. Now raises FileNotFoundError. (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

  • New tests/unit/test_fallback_render_assets.py (raise + legitimate-unset cases)
  • 105 render/video tests pass

Review

  • CodeRabbit CLI review completed locally (0 findings)

@coderabbitai ignore


🤖 Generated with Claude Code

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant