Merge branch 'pr-1322' into review/pr-1322

This commit is contained in:
Marc-André Bombeck committed 2026-11-03 23:37:22 +01:00
commit 3e2e2ad56b
58 files changed
+14939 -25

No files matched your search

@@ -1,7 +1,7 @@
{
"$comment": "Production files over 800 lines and their length. Maintained by src/__tests__/source-size-ratchet.test.ts.",
"count": 84,
"total": 94292,
"total": 94309,
"entries": {
"app/medications/page-client.tsx": 839,
"components/charts/mood-chart.tsx": 1166,
@@ -22,14 +22,14 @@
"components/timeline/timeline-geometry.ts": 1288,
"lib/ai/anthropic-client.ts": 804,
"lib/ai/coach/about-me.ts": 1012,
"lib/ai/coach/coach-prose-grounding.ts": 1079,
"lib/ai/coach/coach-prose-grounding.ts": 1091,
"lib/ai/coach/persistence.ts": 1218,
"lib/ai/coach/results/metric-table-tool.ts": 1102,
"lib/ai/coach/snapshot.ts": 1346,
"lib/ai/coach/stream-events.ts": 817,
"lib/ai/coach/types.ts": 1011,
"lib/ai/codex-client.ts": 907,
"lib/ai/prompts/insight-generator.ts": 1110,
"lib/ai/prompts/insight-generator.ts": 1115,
"lib/ai/provider.ts": 1628,
"lib/analytics/score/reader.ts": 998,
"lib/analytics/sleep-night.ts": 1345,
@@ -166,7 +166,7 @@ describe("dynamic-key exhaustiveness (enum-derived)", () => {
expect(LOCALES.length).toBeGreaterThanOrEqual(6);
});
it("discovers all nine shipped locales", () => {
it("discovers all ten shipped locales", () => {
expect(LOCALES.map((l) => l.locale).sort()).toEqual([
"de",
"en",
@@ -177,6 +177,7 @@ describe("dynamic-key exhaustiveness (enum-derived)", () => {
"nl",
"pl",
"pt-BR",
"ru",
]);
});
+15 -1
View File
@@ -30,6 +30,14 @@ const hasSeparator = (value: string) =>
/** Key path -> why the separator is right there. Empty by intent. */
const ALLOWED: Record<string, string> = {};
/**
* Bundles where a spaced dash is punctuation the language requires rather than
* a fragment join. Russian uses the dash where English puts a comma or a full
* stop ("Сводка за неделю — всё спокойно"), so the ru bundle is exempt from
* the dash rule; the middle dot is still flagged there.
*/
const DASH_EXEMPT_BUNDLES = new Set(["ru.json"]);
function flatten(
obj: unknown,
prefix: string,
@@ -66,7 +74,13 @@ describe("message bundles carry no ' · ', ' — ' or ' – ' separator", () =>
it(`${file} has no dot or dash separator outside the allowlist`, () => {
const offenders = [...values]
.filter(([key, value]) => hasSeparator(value) && !(key in ALLOWED))
.filter(([key, value]) => {
if (!hasSeparator(value) || key in ALLOWED) return false;
if (DASH_EXEMPT_BUNDLES.has(file) && !value.includes(" · ")) {
return false;
}
return true;
})
.map(([key, value]) => `${key} = ${JSON.stringify(value)}`);
expect(offenders).toEqual([]);
});