Skip to content
Trazum

0.3.0

No date in the file

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/cli and @trazum/web, with English as the declared source of truth.
  • RuleId is a typed union: adding a rule fails to compile until every catalogue describes it.
  • optimize() and refineWithLlm() accept a locale, and the result carries the locale it was produced in.
  • New matchLocale(), which returns null when 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 whole Accept-Language list, so fr-FR,es;q=0.9 resolves to Spanish rather than defaulting to English.
  • CLI: --locale, then TRAZUM_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 rules now reads its copy from the core catalogue, so it can no longer drift from the report.
  • Web: Accept-Language is negotiated on the server, so first paint already matches the reader; a switcher in the masthead overrides it and the choice is remembered. generateMetadata negotiates 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/optimize no longer returns rule copy: it was locale-blind, and the report carries its own.
  • Sample prompts are examples/sample-prompt.en.txt and examples/sample-prompt.es.txt; the action self-test runs against both.
  • The GitHub Action takes a locale input.
  • 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 test now runs both packages.
  • New ROADMAP.md, VERSIONING.md and CONTRIBUTING.md.