Repository navigation
fix(i18n): a key SahajCloud lacks renders the English mirror, not its key path - #300
sydevs-bot wants to merge 12 commits into
Conversation
`pnpm sync:translations` against https://cloud.sydevelopers.com, the first run since the mirror took hand edits. Its key diff against the committed file: - `lecture.a11y.untitled_heading`: "Untitled talk" -> "Untitled Lecture", the live English. - `common.a11y.opens_in_new_tab` goes. Nothing reads it; the site uses `opens_in_new_tab_suffix`, and the generated type no longer declares it. - `common.a11y.menu` ("Menu") arrives, declared by SahajCloud#1216. - Three hand-added lines (`footer_navigation`, `primary_navigation`, `skip_to_main`) regain the generator's indentation. Values unchanged. The sync also dropped `blocks.general.wisdom_sidetext`, because sydevs/SahajCloud#1218, which declares it, is still open. That one entry is restored by hand, byte for byte as #269 added it, the same way #292 re-types it in `server/payload-types.ts`: `OrnateTextBox` reads it, and the mirror is what renders it until the key exists upstream. The next sync drops it again unless #1218 has merged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
… path The deployed `/heart-chakra` prints `blocks.general.wisdom_sidetext` in its ornate text box: the live `wm-web-translations` global lacks the key until sydevs/SahajCloud#1218 merges, and `createT` answered any miss with the key path, on the theory that a visible gap gets fixed. A visitor reads it as a broken page. `createT` now answers a key the locale's own strings lack from the committed English mirror, pluralised by English rules (Russian files 21 under `one`, English does not). A key the mirror lacks too renders as nothing in production, and as its key path in development, where a gap should be loud. `t.rich` goes through the same lookup. Every miss goes to a reporter that `lib/` takes by injection, since it ships to the browser and cannot import a Sentry SDK. `server/site-context.ts` installs one on import, which every route's `+onBeforeRender` performs before the first lookup; it sends one Sentry warning per key per isolate, tagged with whether the mirror filled the gap. The browser installs none, so the client build drops the call. The translation-keys guard asked the accessor whether a key resolves by comparing against the key path, which is now only the development answer; it treats `''` as unresolved too. Three comments that stated the old rule (the module's own, `getWebTranslations`, `RequiredGroups`) now state the new one. Verified with `pnpm build` and `wrangler dev` on the built Worker against live SahajCloud: `/heart-chakra` renders "Ancient Wisdom" and no key path. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
…red locales
`loadTranslations` sent a Sentry warning on every render that degraded to
the English snapshot, which server/AGENTS.md forbids for a hot-path read.
Nine of the nineteen locales SahajCloud defines (ro, el, hy, pl, fa, tr,
en-AU, hu, nl) read as `{}` today, and the site offers only `en`, so every
crawler hit on `/nl/...` billed two events: one from `data()`, which then
404s, and one from the error page, which vike renders from a forked
`pageContext` and so reads the global again.
The read now returns why it degraded instead of reporting it, and the report
happens where the site's `availableLocales` is known:
- `loadSiteContext` reports after its locale check, only for a locale the
site offers, preview or not.
- A render that reads no config (an embed, the error page) reports only for
a locale this isolate's last config read offered, and nothing before the
first such read.
Each report is bounded to one event per (locale, reason) per isolate, the
same bound as `reportedConfigGaps`. The `console.warn` still fires on every
degraded request, and the event messages, level and tags are unchanged, so
existing Sentry issues keep grouping.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
Three comments the review flagged no longer described the code. RequiredGroups said a key nobody has translated resolves from the English mirror. The mirror is synced from live English, so such a key is missing there as well: createT renders nothing in production and the key path in development. The site-context test said an empty global would print every key path. With the mirror fallback it would instead report every key as missing, which is the reason the snapshot degrade still stands. site-context gave "a request in any other locale 404s" as the reason an unoffered locale is not reported. That holds for chromed routes only: an embed never reads the config and renders any known locale. The reason is now that the locale is not offered. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | 53331ae | Commit Preview URL Branch Preview URL |
Nov 24 2026, 01:42 AM |
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
main's #283 landed the mirror re-sync this branch also carried, and went further: it dropped `blocks.general.wisdom_sidetext` from `lib/translations.en.json` and removed `OrnateTextBox`'s default for it, because SahajCloud holds no English for the key (sydevs/SahajCloud#1218). This resolution takes main's mirror whole. Re-adding the entry by hand would mirror a string upstream does not have, against main's committed decision to restore the default once the key answers. `lib/i18n.ts` keeps this branch's `resolve` extraction and mirror fallback, and main's `pageContextT`, `DEFAULT_LOCALE` import and formatting. Git mis-aligned the hunk onto the plural block the extraction moved into `resolve`, which already carries main's spacing. The three specs that used `wisdom_sidetext` as their missing-key fixture now use `blocks.general.minutes`: the fixture only needs a key the mirror holds and the live object lacks. `OrnateTextBox.locale.test.tsx` goes, because the component reads no translation key for `sidetext` any more, so it has nothing to miss. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYYhXii23gYGGrv3LS
|
Merged
Tests — three specs used that key as their missing-key fixture, and now use The body's Summary and F3c still describe the hand-restored entry. Lean gate on the merge: lint and 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | 53331ae | Commit Preview URL Branch Preview URL |
Nov 24 2026, 01:42 AM |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
F3a earns its diff. Rendering the English mirror for a key the locale lacks is the right fix, in 40 lines of lib/i18n.ts. F9a is the other half, and it is where I push back. Bounding the Sentry volume adds seven bespoke pieces — two types, two Sets, a module-global, a reporter function and a split read — where warnOnce in server/error-utils.ts already does the job and server/AGENTS.md:86 already names it as the bound for a new warning. Counted, the exposure warnOnce alone leaves is 38 events per isolate ever, being 19 locales times two reasons. The gate on unoffered locales buys the last 36, and pays in cross-request state that suppresses a real degrade until an isolate's first chromed render.
No contract is crossed. server/payload-types.ts is untouched, no key is added, and the mirror is left to pnpm sync:translations. No preview link is checkable: .claude/workflow.json sets no previewUrl.
Findings
should-fix—server/site-context.ts:36: the degrade dedupe is hand-rolled where the repo states a helper.should-fix—server/site-context.ts:64:lastOfferedLocalesis cross-request isolate state, and it loses real signal.should-fix—lib/i18n.ts:175: the reporter-injection layer rests on a premise the repo contradicts.
Second opinion on the question thread: A, the built option. Resolved.
What was checked
- Read whole on the branch:
lib/i18n.ts,server/site-context.ts,pages/+onBeforeRender.ts,server/error-utils.ts,server/AGENTS.md, the key guard. - Ladder: 14 new pieces walked, 4 kept.
''in production needs a key the mirror also lacks, andtests/guards/translation-keys.test.tsfails CI on that. Holds.lastOfferedLocalesis assigned before the 404throw, which is what stops the error page double-reporting. Load-bearing order, uncommented.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
…orter `lib/` can import `server/error-utils`: `lib/error-keys.ts` and `ErrorFallback` already do, and that module imports `@sentry/react` precisely so browser code can. So `createT` calls `warnOnce` itself, with the same message and tags, and the reporter-injection layer goes — `MissingTranslation`, `reportMissing`, `setMissingTranslationReporter` and the install in `site-context.ts`. `import.meta.env.SSR` guards the call. The browser has no isolate to bound the volume, so a standing gap there would bill one event per page view. The once-per-key-per-isolate test moves to `lib/i18n.test.ts`, where the report now lives, and `forgetReportedWarnings` makes each case independent. Addresses #300 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYKHsXoXjx7sjGsYM8
`lastOfferedLocales` was cross-request isolate state whose only job was to suppress a warning, and it suppressed real ones: an embed-only isolate stayed silent through a genuine degrade until its first chromed render. The report now happens in the branch that discovers the degrade, as `main` does. What the gate bought is bounded without it — 19 locales times two reasons is 38 events per isolate ever — and `loadTranslations` becomes the memoised read itself, so `TranslationsRead` and the split go with it. Addresses #300 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYKHsXoXjx7sjGsYM8
`server/AGENTS.md` names `warnOnce` as the bound for a new warning on a hot-path read, and it keys on `[message, signature]` — which is the same once-per-locale-and-reason dedupe, because each reason has its own message. So `Degrade`, `reportedDegrades` and `reportDegrade` go, and with them this module's `@sentry/cloudflare` import: the report rides on `error-utils` instead. The tests reset the memo with `forgetReportedWarnings` rather than giving every case a locale of its own. Addresses #300 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYKHsXoXjx7sjGsYM8
|
Adopted all three Streamline findings, one commit each, pushed as
About 90 lines go, and Security review found no HIGH or MEDIUM: Body refreshed: Summary, F3a, F9a, Test results. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
Four of the five conflicts are mechanical. The fifth is a contract change, so I pushed nothing. #327 made
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
@sydevs-bot revise 1A |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Second look, on @sydevs-bot revise 1A. F3a still earns its diff; the ground under it moved. The merge-base is e370a55, origin/main is 45a50ac, and the PR is dirty: #327 moved every file this diff touches and closed lib/** → server/** both ways, so lib/i18n.ts:20 errors twice over. revise 1A settles that mechanism, and this review does not reopen it.
My one new push is on what 1A is about to pay for. F9a spends ~90 lines bounding one Sentry channel at 38 events per isolate. F3a opens a second, keyed per translation key, whose traffic is fallback=mirror — the designed outcome for most of the 19 locales, not a fault. A fresh streamliner, blind to the thread, independently recommended dropping that report. That is near the option you declined, so it stays yours — but settle it before the reporter layer goes back in, because dropping the report is also what removes the server/ import forcing 1A.
Findings
blocker—lib/i18n.ts:20: theserver/import cannot survive the merge.should-fix—lib/i18n.ts:229: the per-key report bills the expected path.consider—lib/i18n.ts:242: a dev-only render mode, documented three times.
What was checked
- Read whole on the branch:
lib/i18n.ts,server/site-context.ts,server/error-utils.ts, both specs, the key guard. Onmain:eslint.config.js,server/error-utils.ts(now@sentry/cloudflare), thelib/tree. - No contract crossed:
payload-types.tsuntouched, no key added. - Ladder and streamliner: 2 pieces, 2 kept.
resolvehas two callers by construction. - Counted the mirror: 13 groups, 102 leaf keys.
- All 4 threads resolved, so no second opinion was due.
- Previews not fetched.
.claude/workflow.jsonsets nopreviewUrl, so all three readOFF_HOST; the Cloudflare bot names the same host, so nothing is raised.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
#327 moved every file this branch touches and closed `lib/** <-> server/**` both ways. Four of the five conflicts are mechanical renames. The fifth is the mechanism: `createT` can no longer call `warnOnce`, because ESLint refuses `lib/**` an `@/server/*` import and `error-utils` now reports through `@sentry/cloudflare`, which no browser bundle can take. Resolved as option 1A, the reviewer's answer on #300: the injected reporter comes back. `lib/i18n/i18n.ts` holds `MissingTranslation`, `reportMissing` and `setMissingTranslationReporter` again, and `server/site-context.ts` installs one that calls `warnOnce`. The boundary holds, the dedupe stays `warnOnce`'s, and the Sentry message, tags and extra are unchanged. The volume-bound test moves back beside the install, in `server/site-context.test.ts`. `lib/i18n/i18n.test.ts` asserts what the accessor hands the reporter, which is all it now decides. The other four: paths and aliases, `WebTranslations` split into `SahajCloudWebTranslations` for a mocked raw read, the `RequiredGroups` doc moved with the type to `lib/i18n/web-translations.ts`, and the `getWebTranslations` doc moved to `server/sahajcloud/web-translations.ts`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVCjeMfw9AMwXe1FJb
A non-English locale rendering English for one key is SahajCloud #705's designed outcome: the fill reaches only inside a group the locale's document already carries, so most of the 19 locales miss keys by design. An event for that bills the expected path, and the per-key channel carried almost nothing else. What is left is a fault either way: English itself missing a key the mirror holds, which means the mirror trails live English, or no source holding it at all, which renders nothing in production. The gate sits in the installed reporter, so `lib/i18n` still hands over every miss and keeps no Sentry policy of its own. Addresses #300 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVCjeMfw9AMwXe1FJb
The rule had four statements: `createT`'s JSDoc, the `RequiredGroups` doc, the key guard's header, and `resolves`'s own. Three of them restate what `createT` already documents, so a later change to the rule has three chances to leave a stale copy behind. `createT`'s JSDoc keeps it. The type now points at `createT` instead of answering for it, and the guard's header says only what a visitor gets. `resolves` keeps a clause of its own, because it explains why the code below compares against two values. Addresses #300 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVCjeMfw9AMwXe1FJb
The root guide gave the mirror one job, the last resort when the whole SahajCloud read fails. It now also answers any one key the live locale lacks, which is what stops a visitor reading a key path. Records what the injected reporter cannot see: the oembed and manifest routes build an accessor without importing `site-context`, so a miss on those two reports nothing. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVCjeMfw9AMwXe1FJb
|
Merged The merge was the work. #327 closed
New limit in Notes for reviewer: the oembed and manifest routes install no reporter. Gate green on the pushed head: 173 files, 1776 tests. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
/nl/...request sends two warnings, one fromdata()and one from the error-page fork; with this change the pair is one event, and the whole 19 locales times two reasons is 38 per isolate ever.console.warnstill fires on every degraded read.lib/i18n/translations.en.jsonis untouched here — feat(components): add a mobile menu, and make the compact bar the phone's header #283 landed the same re-sync on main first.Change outline
createT(lib/i18n/i18n.ts) resolves a key from the locale first, then fromEN_TRANSLATIONSusing English plural rules. Otherwise
''in production, the key path underimport.meta.env.DEV.t.richgoes through the same lookup, and the plural-family walk isextracted into
resolveso both sources use one path.Every miss reaches an injected reporter.
lib/cannot report for itself: ESLint refuses it an@/server/*import, andserver/error-utils.tsreaches Sentry through@sentry/cloudflare,which no browser bundle can take. So
server/site-context.tsinstalls one on import, and thebrowser installs none. That reporter is the one place deciding what is worth an event, and it
calls
warnOnce, so the dedupe is the repo's and not aSetof ours.loadTranslations' own two degrade branches move towarnOnceas well, each keyed on thelocale, which drops this module's
@sentry/cloudflareimport.Preview
The preview offers only
en, andenresolves every key the code reads, so the English fallback has nothing to fill on screen. Each link should look as it does onmain, with no key path anywhere in the page. The fallback and the Sentry rules are shown by the tests only.blocks.general.*text.404with "Content Not Found", and one translations-degrade warning in Sentry across the 404 and its error page, where main sends two per request.loadTranslationsand never reads the config.Findings addressed
/heart-chakraHTML containedblocks.general.wisdom_sidetextonce, and livewm-web-translationshas no such key inblocks.general. Any other untranslated key read the same way. That page's own key path is already gone from main — feat(components): add a mobile menu, and make the compact bar the phone's header #283 droppedOrnateTextBox's default for the untranslated key instead — but every other call site still had it.lib/i18n/i18n.ts, reported fromserver/site-context.ts. See Change outline.lib/i18n/i18n.test.ts > createT > a key the locale lackshas 7 cases — mirror fill, blank-key fill, English plural rules forruat count 21,''and[]with DEV off, the key path with DEV on, what the accessor hands the reporter, and no report for a resolved key. With main'slib/i18n/i18n.tsthese fail.server/site-context.test.ts > a translation key SahajCloud lacksholds what reaches Sentry, because the install is what decides it.tests/guards/translation-keys.test.tsnow treats''as unresolved too, so a key the mirror lacks still fails CI rather than shipping as a blank.lib/i18n/translations.en.jsonbefore this branch merged main in, and also droppedOrnateTextBox's default forblocks.general.wisdom_sidetext, because SahajCloud holds no English for it (feat(translations): declare a key's English in the schema, reconciled on boot SahajCloud#1218). This branch no longer changes the mirror at all. The question thread that asked about restoringwisdom_sidetextby hand closed on option A: CLAUDE.md makeslib/i18n/translations.en.jsongenerated, never a place to add a string by hand.{}live, and the site offers onlyen.server/site-context.ts.loadTranslationsis the memoised read itself, and each degrade branch reports throughwarnOncekeyed on the locale, which dedupes by (locale, message) per isolate — one key per reason, because each reason has its own message. The message, level, tags and extra are unchanged, so existing Sentry issues keep grouping.server/site-context.test.ts > translations degrade reportinghas 4 cases, reset withforgetReportedWarnings. With main's code the first sees 3 calls where the test expects 1, and the 404 case sees 2 where it expects 1.Review follow-ups (this push)
main's #327 moved every file this diff touches and closed
lib/** <-> server/**both ways, sothe branch was
dirtyand the mechanism the last push adopted no longer compiled.revise 1A. Four conflicts are mechanical renames.The fifth is the report:
createTcan no longer callwarnOnce, so the injected reporter comesback —
MissingTranslation,reportMissing,setMissingTranslationReporter, and the installin
site-context.ts. The boundary holds and the dedupe stayswarnOnce's, so what came back isthe ~25 lines of the crossing, not the ~90 lines of machinery the first review cut. The
volume-bound test moves beside the install;
lib/i18n/i18n.test.tsasserts only what theaccessor hands over.
locale's document already carries, so most of the 19 locales render English for some keys by
design, and an event for that billed the expected path. The gate sits in the installed reporter,
so
lib/i18nkeeps no Sentry policy of its own.createT's JSDoc, theRequiredGroupsdoc, the key guard's header andresolves's own.createTkeeps it; the otherthree say only what they need. The mode itself stays:
mainrenders the key path in everybuild, so dropping it would make development quieter than main.
Earlier review commits still stand, re-homed by the merge:
lib/i18n/web-translations.ts(
RequiredGroups) says a key nobody has translated is missing from the mirror too, andserver/site-context.test.tssays an empty global would report every key as missing rather thanprint every key path.
Not in this PR
hooks/useT.tsis unchanged. It gets the new rule throughgetT, and feat(seo): share metadata and JSON-LD at parity with the old site #282 rewrites its body.@sentry/cloudflare, which is whatwarnOncereports through.createWarnOncehelper from feat(components): a MeditationLibrary for the meditations index block #293 is not used, because it is not on main. Nothing here needs it: both reports go throughwarnOnce, which is on main already.Reconciled with open PRs
I dry-merged this branch (
git merge-tree) against every open PR. Eleven of the twelve mergeclean. #317 conflicts, but it conflicts with
mainthe same way and in thesame files —
components/molecules/**, which this branch does not touch — so that one is#317's to resolve, not this branch's.
#293 (mood finder) no longer conflicts: this branch leaves
lib/i18n/translations.en.jsonalone, and adds no dedupeSetof its own for #293'screateWarnOnceto absorb.Test results
.claude/skills/pr-prep/check.shon the pushed head:eslint . --max-warnings 0 && prettier --check .): clean.tsc --noEmit: clean.vitest run: 173 files, 1776 / 1776 tests passed./security-reviewoverorigin/main...HEAD: no HIGH or MEDIUM finding. The Sentry payload istwo literal tags plus
{ key, locale };keycomes from a compile-time-fixed set (no templateor concatenated key exists at any call site) and
localeis narrowed to the 19-memberKNOWN_LOCALESallowlist, so nothing from a URL, a header or a SahajCloud document reaches it.''is safer than the old key path at every URL sink —isSafeLinkHrefalready rejects it — andno
t()value reaches a raw-HTML sink.pnpm buildhas not run since the merge. The last--fullpass was3fe75d1, before main'sreorganisation, so CI's build is the first one covering these paths.
Notes for reviewer
getTwithoutimporting
server/site-context.ts, so the reporter is not installed on those two Worker routesand a miss there is silent. That is the cost of the injected layer 1A restores; a
shortcut:line beside the install records it and when to move it.
review raised dropping the per-key report entirely. That is option C, which
revise 1Apassedover, so the report stays and only the designed-path traffic goes.
https://claude.ai/code/session_01Mg9rjVCjeMfw9AMwXe1FJb
Generated by Claude Code