mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
fix(coach): compose deterministic memory facts in English by default
The deterministic fact-pattern pass fell back to German when no locale was passed, the same de-default polarity the narrative surface just lost. Fact text is model-facing memory, so English is the fallback for every locale without a reviewed body; German stays for German readers. Also correct the InsightNarrative.locale doc comment — the column holds any shipped UI locale, not just de/en. Comment only, no SQL change.
This commit is contained in:
1 parent
93738ae968
commit
d6692e3a4b
2 files changed
+6
-2
No files matched your search
@@ -5226,7 +5226,8 @@ model InsightNarrative {
|
||||
userId String @map("user_id")
|
||||
/// "week" | "month".
|
||||
period String
|
||||
/// Resolved UI locale of the prose ("de" | "en").
|
||||
/// Resolved UI locale of the prose — any shipped UI locale, not just de/en:
|
||||
/// the prose is generated per locale, so the row is keyed by it.
|
||||
locale String
|
||||
/// UTC YYYY-MM-DD boundary the narrative was generated for.
|
||||
dateKey String @map("date_key")
|
||||
|
||||
@@ -558,7 +558,10 @@ function deterministicFactText(
|
||||
subject: string,
|
||||
locale: string | undefined,
|
||||
): string {
|
||||
const de = locale?.toLowerCase().startsWith("de") ?? true;
|
||||
// German only for a German reader; every other locale — and an absent one —
|
||||
// composes ENGLISH. The fact text is model-facing memory, so English is the
|
||||
// fallback body; the previous `?? true` made an unknown locale German.
|
||||
const de = locale?.toLowerCase().startsWith("de") ?? false;
|
||||
switch (kind) {
|
||||
case "allergy":
|
||||
return de
|
||||
|
||||
Reference in new issue
Block a user