fix(report): Urdu rendered as tofu on prod whenever the STT mislabelled the language — cherry-pick of #307 - #308
Merged
Conversation
…age — 44 reports rendered as tofu (#307) Rifat reported a coach debrief that was "only empty boxes with no content" (R66). The screenshot was in the feedback sheet as a floating image the Sheets API will not return; pulling it out of an authenticated PDF export showed the teacher hero report with every Urdu glyph painted as a box while the English chrome rendered perfectly. The chain, end to end: 1. hero-report.service resolved lang = language || analysis.language || session.transcript_language || 'en' transcript_language is an STT label, and since 2026-08-11 Soniox has been returning 'en' / 'hindi' / 'javanese' / 'sindhi' for Urdu classroom audio (bd-bfy69, still open). So an Urdu-bodied report went down the Latin arm. 2. hero-report.template's Latin arm named ONLY 'Fraunces'/'Lexend'. The NastaliqUrdu @font-face was embedded but never referenced from any rule in that branch. 3. Railway's Chromium has no system fonts, so those glyphs had nothing to fall back to. macOS silently substitutes a system Nastaliq, which is exactly why every local render looked correct. Measured on prod: 44 already-generated reports carry non-Latin script while sitting in a non-ur/ar branch. Verified with CSS.getPlatformFontsForNode, before and after, same instrument: BEFORE the Urdu run resolved to the SYSTEM 'Noto Nastaliq Urdu' (isCustomFont=false — absent on Railway); AFTER it resolves to the EMBEDDED face in all three stacks. Latin still resolves to Lexend/Fraunces first; the fallbacks only catch what those cannot draw. Also fixed .pframe .pcap, which pinned LLM-generated photo captions to Latin-only Lexend in EVERY branch — so those tofu'd even on a correctly labelled Urdu report. That is the bd-2362 class: the small-print element nobody re-checks after the main stacks are fixed. Tests: 20 + 12 new, red-first against this tree (9 font assertions failed before the template change; the language suite could not resolve its module). Full suite shows zero new failures — the four suites that differed under the parallel run all pass in isolation both with and without the change. Closes: bd-osmk0 Closes: bd-gipr1 Co-authored-by: Claude Opus 5 <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.
Cherry-pick of #307 (already merged to
developand live on NIETE staging as5a93e8e, all four services SUCCESS).Prod
maincarries the identical defect — verified before picking:The Nastaliq
@font-faceis embedded but referenced by no rule in the Latin branch, so an Urdu-bodied report whose language was mislabelled by the STT had nothing to draw Urdu with. Railway's Chromium has no system fonts — every Urdu glyph painted as an empty box. 44 already-generated reports on prod are in that state, and a coach reported it (HITL R65/R66).Clean pick, no conflicts. Tests on this main-based tree: 42 passed across the two new suites plus the two neighbours most likely to be disturbed (
hero-report-english-chrome,html-to-pdf).Not fixed here: bd-bfy69 — Soniox writing Urdu as Devanagari. There is no Devanagari font in the repo, so that script will still not render; it is being fixed at source separately.
Closes: bd-osmk0
Closes: bd-gipr1
🤖 Generated with Claude Code