Skip to content

fix(i18n): a key SahajCloud lacks renders the English mirror, not its key path - #300

Open
sydevs-bot wants to merge 12 commits into
mainfrom
claude/fix-i18n-english-fallback
Open

sydevs-bot wants to merge 12 commits into
mainfrom
claude/fix-i18n-english-fallback

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Visitors no longer see raw key paths. A key the live locale lacks now renders the committed English mirror's value, wherever the gap falls. If the mirror lacks the key too, the page renders nothing in production. Development still shows the key path.
  • Developers and editors get a Sentry warning for a key gap that is a fault — English itself missing it, or no source holding it at all. A non-English locale filled from the mirror is SahajCloud #705's designed outcome and sends nothing.
  • Sentry volume from the translations-degrade warnings now has a limit. A degraded read sends one event per (locale, reason) per isolate, where before it sent one per request. Today a /nl/... request sends two warnings, one from data() 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.warn still fires on every degraded read.
  • Mirror: nothing. lib/i18n/translations.en.json is 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 from EN_TRANSLATIONS
using English plural rules. Otherwise '' in production, the key path under
import.meta.env.DEV. t.rich goes through the same lookup, and the plural-family walk is
extracted into resolve so both sources use one path.

Every miss reaches an injected reporter. lib/ cannot report for itself: ESLint refuses it an
@/server/* import, and server/error-utils.ts reaches Sentry through @sentry/cloudflare,
which no browser bundle can take. So server/site-context.ts installs one on import, and the
browser 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 a Set of ours.

loadTranslations' own two degrade branches move to warnOnce as well, each keyed on the
locale, which drops this module's @sentry/cloudflare import.

Preview

The preview offers only en, and en resolves every key the code reads, so the English fallback has nothing to fill on screen. Each link should look as it does on main, with no key path anywhere in the page. The fallback and the Sentry rules are shown by the tests only.

  • /heart-chakra — the page F3a found the key path on. Its wisdom text boxes render with no blocks.general.* text.
  • /nl/x — a locale the site does not offer: 404 with "Content Not Found", and one translations-degrade warning in Sentry across the 404 and its error page, where main sends two per request.
  • /meditations/142/embed — an embed, which reads translations through the public loadTranslations and never reads the config.

Findings addressed

  • F3a: a missing key rendered its key path.
    • Evidence: the deployed Worker's /heart-chakra HTML contained blocks.general.wisdom_sidetext once, and live wm-web-translations has no such key in blocks.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 dropped OrnateTextBox's default for the untranslated key instead — but every other call site still had it.
    • Fix in lib/i18n/i18n.ts, reported from server/site-context.ts. See Change outline.
    • Tests: lib/i18n/i18n.test.ts > createT > a key the locale lacks has 7 cases — mirror fill, blank-key fill, English plural rules for ru at 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's lib/i18n/i18n.ts these fail. server/site-context.test.ts > a translation key SahajCloud lacks holds what reaches Sentry, because the install is what decides it.
    • tests/guards/translation-keys.test.ts now treats '' as unresolved too, so a key the mirror lacks still fails CI rather than shipping as a blank.
  • F3c: the mirror trailed live English — landed on main instead. feat(components): add a mobile menu, and make the compact bar the phone's header #283 re-synced lib/i18n/translations.en.json before this branch merged main in, and also dropped OrnateTextBox's default for blocks.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 restoring wisdom_sidetext by hand closed on option A: CLAUDE.md makes lib/i18n/translations.en.json generated, never a place to add a string by hand.
  • F9a: Sentry received one degrade warning per request, including for unoffered locales.
    • Evidence: 9 of 19 locales (ro, el, hy, pl, fa, tr, en-AU, hu, nl) read as {} live, and the site offers only en.
    • Fix in server/site-context.ts. loadTranslations is the memoised read itself, and each degrade branch reports through warnOnce keyed 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.
    • Tests: server/site-context.test.ts > translations degrade reporting has 4 cases, reset with forgetReportedWarnings. 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, so
the branch was dirty and the mechanism the last push adopted no longer compiled.

  • The merge, resolved as the reviewer's revise 1A. Four conflicts are mechanical renames.
    The fifth is the report: createT can no longer call warnOnce, so the injected reporter comes
    back — MissingTranslation, reportMissing, setMissingTranslationReporter, and the install
    in site-context.ts. The boundary holds and the dedupe stays warnOnce's, so what came back is
    the ~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.ts asserts only what the
    accessor hands over.
  • The per-key report is narrowed to a fault. SahajCloud #705 fills only inside a group a
    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/i18n keeps no Sentry policy of its own.
  • The development key path is stated once. It had four statements — createT's JSDoc, the
    RequiredGroups doc, the key guard's header and resolves's own. createT keeps it; the other
    three say only what they need. The mode itself stays: main renders the key path in every
    build, 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, and
server/site-context.test.ts says an empty global would report every key as missing rather than
print every key path.

Not in this PR

  • hooks/useT.ts is unchanged. It gets the new rule through getT, and feat(seo): share metadata and JSON-LD at parity with the old site #282 rewrites its body.
  • Telling an offered locale from an unoffered one in a render that reads no config. The gate that tried it is gone: it needed cross-request isolate state, and it silenced a real degrade in an embed-only isolate. A degrade is now reported wherever it is found.
  • No real Sentry events were observed (no DSN in the sandbox). Event counts and payloads are checked against a mocked @sentry/cloudflare, which is what warnOnce reports through.
  • The createWarnOnce helper 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 through warnOnce, which is on main already.
  • No new translation keys are needed.

Reconciled with open PRs

I dry-merged this branch (git merge-tree) against every open PR. Eleven of the twelve merge
clean. #317 conflicts, but it conflicts with main the same way and in the
same 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.json alone, and adds no dedupe Set of its own for #293's
createWarnOnce to absorb.

Test results

.claude/skills/pr-prep/check.sh on the pushed head:

  • Lint (eslint . --max-warnings 0 && prettier --check .): clean.
  • tsc --noEmit: clean.
  • vitest run: 173 files, 1776 / 1776 tests passed.

/security-review over origin/main...HEAD: no HIGH or MEDIUM finding. The Sentry payload is
two literal tags plus { key, locale }; key comes from a compile-time-fixed set (no template
or concatenated key exists at any call site) and locale is narrowed to the 19-member
KNOWN_LOCALES allowlist, so nothing from a URL, a header or a SahajCloud document reaches it.
'' is safer than the old key path at every URL sink — isSafeLinkHref already rejects it — and
no t() value reaches a raw-HTML sink.

pnpm build has not run since the merge. The last --full pass was 3fe75d1, before main's
reorganisation, so CI's build is the first one covering these paths.

Notes for reviewer

  • The oembed and manifest routes report nothing. Both build an accessor with getT without
    importing server/site-context.ts, so the reporter is not installed on those two Worker routes
    and 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.
  • A mirror fill for a non-English locale is now invisible to Sentry, by design. The adversarial
    review raised dropping the per-key report entirely. That is option C, which revise 1A passed
    over, so the report stays and only the designed-path traffic goes.

https://claude.ai/code/session_01Mg9rjVCjeMfw9AMwXe1FJb


Generated by Claude Code

`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
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@sydevs-bot

sydevs-bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 01:28Z address-review · attempt 1 · session · done
  • 01:28Z address-review · attempt 1 · session
  • 01:19Z review-pr · attempt 1 · session · done
  • 01:19Z review-pr · attempt 1 · session
  • 17:47Z resolve-conflicts · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 21, 2026
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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged main in. One conflict, plus one clash the merge did not flag.

lib/i18n.ts — git aligned the hunk onto the plural block this branch's resolve extraction had moved. Kept both sides: the extraction, and main's pageContextT, import and spacing.

lib/translations.en.json — #283 landed the same re-sync, then went further: it dropped blocks.general.wisdom_sidetext and OrnateTextBox's default for it, because SahajCloud holds no English for the key (sydevs/SahajCloud#1218). I took main's mirror whole. Re-adding the entry would mirror a string upstream lacks, against main's decision to wait for the key. This branch no longer touches the mirror, so F3c is already on main.

Tests — three specs used that key as their missing-key fixture, and now use blocks.general.minutes. OrnateTextBox.locale.test.tsx is deleted: the component reads no key for sidetext any more. Question thread on the line.

The body's Summary and F3c still describe the hand-restored entry.

Lean gate on the merge: lint and tsc clean, 1702 tests pass.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 question for the reviewer, one per thread.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread lib/i18n/i18n.test.ts Resolved
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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 sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 21, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 21, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 21, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 21, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 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: lastOfferedLocales is 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, and tests/guards/translation-keys.test.ts fails CI on that. Holds.
  • lastOfferedLocales is assigned before the 404 throw, 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

Comment thread server/site-context.ts Resolved
Comment thread server/site-context.ts Resolved
Comment thread lib/i18n.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 21, 2026
…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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Adopted all three Streamline findings, one commit each, pushed as b602cd8. Lean gate green: lint, tsc, 1703 tests.

About 90 lines go, and site-context.ts imports no Sentry SDK. Nothing rebutted.

Security review found no HIGH or MEDIUM: extra: { key, locale } comes from closed sets, import.meta.env?.SSR evaluates false in the client build, and load() is byte-identical to main, so the 404 and the preview exemption are unchanged.

Body refreshed: Summary, F3a, F9a, Test results.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 21, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 21, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 22, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 22, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Four of the five conflicts are mechanical. The fifth is a contract change, so I pushed nothing.

#327 made server/ server-only. ESLint now errors on any @/server/* import from lib/**, and error-utils.ts moved from @sentry/react to @sentry/cloudflare. So createT cannot call warnOnce any more: the Streamline ask behind c2af51c rested on a premise main has removed. eslint lib/i18n/i18n.ts returns server/ is server-only.

  • 1. How is a missing key reported now?
    • A — Restore the injected reporter (recommended): revert c2af51c, and site-context.ts installs warnOnce. Keeps the boundary and the @sentry/cloudflare report. Costs the ~90 lines the review asked to drop.
    • B — Move a browser-safe warnOnce into lib/: what the ESLint message prescribes. It would report through @sentry/react, which refactor: reorganise folders by topic, import through @/, and keep server/ server-only #327 just moved server reporting off, so whether a server report arrives is unverified.
    • C — Drop the report: keep the mirror fallback alone. A missing key goes invisible to developers again.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 22, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 22, 2026
@Ardnived

Copy link
Copy Markdown
Contributor

Four of the five conflicts are mechanical. The fifth is a contract change, so I pushed nothing.

#327 made server/ server-only. ESLint now errors on any @/server/* import from lib/**, and error-utils.ts moved from @sentry/react to @sentry/cloudflare. So createT cannot call warnOnce any more: the Streamline ask behind c2af51c rested on a premise main has removed. eslint lib/i18n/i18n.ts returns server/ is server-only.

    • 1. How is a missing key reported now?

      • A — Restore the injected reporter (recommended): revert c2af51c, and site-context.ts installs warnOnce. Keeps the boundary and the @sentry/cloudflare report. Costs the ~90 lines the review asked to drop.* B — Move a browser-safe warnOnce into lib/: what the ESLint message prescribes. It would report through @sentry/react, which refactor: reorganise folders by topic, import through @/, and keep server/ server-only #327 just moved server reporting off, so whether a server report arrives is unverified.* C — Drop the report: keep the mirror fallback alone. A missing key goes invisible to developers again.

🤖 Written by the sydevs autonomous loop — see what this is

Generated by Claude Code

@sydevs-bot revise 1A

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 24, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 24, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 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: the server/ 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. On main: eslint.config.js, server/error-utils.ts (now @sentry/cloudflare), the lib/ tree.
  • No contract crossed: payload-types.ts untouched, no key added.
  • Ladder and streamliner: 2 pieces, 2 kept. resolve has 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.json sets no previewUrl, so all three read OFF_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

Comment thread lib/i18n.ts Resolved
Comment thread lib/i18n.ts Resolved
Comment thread lib/i18n/i18n.ts Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 24, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 24, 2026
#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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged origin/main and answered all three threads. Pushed as 53331ae.

The merge was the work. #327 closed lib/** ↔ server/**, so createT could no longer call warnOnce. Resolved as revise 1A: the injected reporter is back, and only the ~25-line boundary hop returned.

  • The server/ import — adopted, c22ce10.
  • The per-key report — adopted narrowed, 2cc624f. A mirror fill outside English sends nothing; English's own gap still does. Dropping it outright is option C.
  • The development key path — docs adopted, 0f936f8; the mode stays, because main shows the key path in every build.

New limit in Notes for reviewer: the oembed and manifest routes install no reporter.

Gate green on the pushed head: 173 files, 1776 tests. /security-review: nothing HIGH or MEDIUM. pnpm build has not run since the merge.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 24, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants