fix(report): Urdu rendered as tofu on prod whenever the STT mislabelled the language — cherry-pick of #307 - #309
Closed
hyasin270 wants to merge 2 commits into
Closed
fix(report): Urdu rendered as tofu on prod whenever the STT mislabelled the language — cherry-pick of #307#309hyasin270 wants to merge 2 commits into
hyasin270 wants to merge 2 commits into
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>
…in's ratchet was red before this PR Unrelated to the report fix; found because it blocked the cherry-pick's CI. The logger ratchet was already failing on plain origin/main (391 live vs 389 allowlisted, verified by running it on the untouched branch tip) — the photo-gate sweep was added to main without re-baselining. develop is green because its allowlist carries these two entries. Fixed rather than grandfathered: both are genuine error paths an on-caller would want to see, and the gate's own header says a NEW violation should get the level, not the allowlist. Live count drops 391 -> 389 and matches the existing allowlist, so no re-baseline is needed and the backlog does not grow. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Author
|
Superseded by #311, which carries the same ratchet fix alongside the Devanagari cherry-pick so prod takes one deploy instead of two. |
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 (merged to
develop, live on NIETE staging as5a93e8e, all four services SUCCESS). Reopened from #308, whose head SHA was stuck on the first commit.Prod
maincarries the identical defect — verified on the untouched tip before picking:The Nastaliq
@font-faceis embedded but referenced by no rule in the Latin branch, so an Urdu-bodied report whose language the STT mislabelled 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).Two commits
552fb2a— the cherry-pick. Clean, no conflicts.8446fc8— unrelated, and only here because it blocked this PR's CI: thelogToFile severity ratchetwas already red on plainorigin/main(391 live vs 389 allowlisted — verified by running it on the untouched branch tip;developis green because its allowlist carries these entries). The photo-gate sweep was added tomainwithout re-baselining. Both callsites are genuine error paths, so they now passlevel='error'rather than being grandfathered — which is what the gate's own header asks for. Live count drops to 389 and matches the existing allowlist, so the backlog does not grow.Tests
42 passed on this main-based tree across the two new suites plus the two neighbours most likely to be disturbed (
hero-report-english-chrome,html-to-pdf); logger ratchet 17/17 green.Not fixed here: bd-bfy69 — Soniox writing Urdu as Devanagari. There is no Devanagari font in the repo, so that script still will not render; being fixed at source separately.
Closes: bd-osmk0
Closes: bd-gipr1
🤖 Generated with Claude Code