feat(coach): name a read past the lookback limit on the trail

A read whose readings all lie past the lookback limit was reported on its
step as outside_window, and its fetch entry carried no reason, so a client
could not tell an empty window from data the limit keeps out. The step now
carries reason outside_reach and the fetch entry mirrors it. The method
line and the web trail keep the window sentence; the answer names the
limit as before.
This commit is contained in:
Marc-André Bombeck committed 2026-11-05 14:12:09 +01:00
1 parent 2e28d4ed4c
commit f39598f2e7
17 files changed
+212 -33

No files matched your search

@@ -102,6 +102,14 @@ describe("describeStep", () => {
]);
});
it("keeps the window sentence on a read past the lookback limit", () => {
const reach: CoachStep = { ...SLEEP, reason: "outside_reach" };
expect(describeStep(reach, t, tCount).meta).toEqual([
"last 30 days",
"no readings in this window",
]);
});
it("counts metrics on the snapshot step and rows on labs", () => {
const snapshot: CoachStep = {
id: "s1",