Files
Gaurav Dubey d5637d5ba3 fix(mastery): keep language-course content in its target language (#2934)
* fix(mastery): keep language-course content in its target language

The reply-language directive is the last thing in every system prompt and
tells the model to write quiz stems and options in the reply language and
never switch. For a course whose subject is itself a language, the model
obeyed literally: an "Antonyms" objective in an English course, studied with
Chinese as the reply language, was drafted as 反义词 and taught in a later
session as Chinese antonyms.

- language_directive now says the reply language governs the explanation,
  not the subject: a studied language keeps its own words, sentences and
  exercise items.
- Route generation and the tutor's outline drafting name the target
  language in every module and knowledge point ("English antonyms").
- The tutor playbook keeps an existing language course on its target
  language even when an objective name does not repeat it.

Closes #2933

Co-Authored-By: Claude <noreply@anthropic.com>

* test(mastery): check the composed prompts keep a language course's target language

The strict reply-language directive is appended last, after the route and
tutor instructions. Assert the carve-out survives in the prompts the model
actually receives: zh route generation, and the zh tutor playbook rendered
with a fixed reply language.

Related to #2933

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 18:24:23 +08:00
..