Breaking. buildAdvisories() takes an options object instead of trailing
positional arguments: buildAdvisories(prompt, tokens, usage, { on, count, locale })
replaces buildAdvisories(prompt, tokens, usage, on, count). The Rule
interface no longer carries title or rationale — rules carry an id, and
copy is resolved from the message catalogue with getMessages(locale).rules[id].
OptimizationResult.rules is unchanged, so consumers of the report need no
migration.
The repository is now English end to end — source, comments, tests, documentation, CLI, web and CI. Spanish was not removed; it was moved out of hardcoded prose into a locale, which is the only version of "add a language" that survives a second one.
- Per-locale message catalogues in
@trazum/core,@trazum/cliand@trazum/web, with English as the declared source of truth. RuleIdis a typed union: adding a rule fails to compile until every catalogue describes it.optimize()andrefineWithLlm()accept alocale, and the result carries the locale it was produced in.- New
matchLocale(), which returnsnullwhen its input names no locale we ship — that is what lets a caller fall through to the next configuration source instead of mistaking a fallback for a choice.resolveLocale()now walks a wholeAccept-Languagelist, sofr-FR,es;q=0.9resolves to Spanish rather than defaulting to English. - CLI:
--locale, thenTRAZUM_LOCALE, then the POSIX locale variables. The flag is read straight from argv, so even a bad-argument error is reported in the requested language.trazum rulesnow reads its copy from the core catalogue, so it can no longer drift from the report. - Web:
Accept-Languageis negotiated on the server, so first paint already matches the reader; a switcher in the masthead overrides it and the choice is remembered.generateMetadatanegotiates too, so link previews follow. The API route localises its own errors as well as the report. - The web starter prompt now exists per language, since the phrase dictionaries are per-language and the example exists to show rules firing. Switching language never overwrites a prompt you wrote.
GET /api/optimizeno longer returns rule copy: it was locale-blind, and the report carries its own.- Sample prompts are
examples/sample-prompt.en.txtandexamples/sample-prompt.es.txt; the action self-test runs against both. - The GitHub Action takes a
localeinput. - Tests grow from 47 to 75, adding catalogue-parity coverage so a locale cannot
silently go stale, plus a CLI suite covering locale resolution.
npm testnow runs both packages. - New
ROADMAP.md,VERSIONING.mdandCONTRIBUTING.md.