fix(sleep-score): publish the rhythm floor and name it in the few-nights note

The note hard-coded "of 3" in every locale. SleepScoreValue now carries
rhythmMinNights, and the sheet reads the floor from it.
This commit is contained in:
Marc-André Bombeck committed 2026-10-20 05:14:03 +02:00
1 parent 9fe6f98fdb
commit 248b5dfd6b
11 files changed
+83 -8

No files matched your search

+7 -1
View File
@@ -325,7 +325,7 @@ export const sleepScoreValue = z
.enum(["few_nights", "no_main_sleep"])
.optional()
.describe(
"Only on a null `consistency` / `timing`: why it is withheld. `few_nights` — fewer than three nights in the window have a main sleep on the clock (count in `rhythmNights`); `no_main_sleep` — the latest day had only a daytime nap. Absent otherwise.",
"Only on a null `consistency` / `timing`: why it is withheld. `few_nights` — fewer than `rhythmMinNights` nights in the window have a main sleep on the clock (count in `rhythmNights`); `no_main_sleep` — the latest day had only a daytime nap. Absent otherwise.",
),
}),
)
@@ -337,6 +337,12 @@ export const sleepScoreValue = z
.describe(
"Nights in the window with a main sleep placed on the clock — what consistency and timing are computed from. A daytime nap is not one; a short night is.",
),
rhythmMinNights: z
.number()
.int()
.describe(
'How many `rhythmNights` consistency and timing need before they are scored; below it they carry `gap: "few_nights"`.',
),
series: z
.array(z.number())
.describe(