mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 05:12:14 +00:00
fix(cycle): scope symptothermal to the current cycle, unify luteal clamp, widen fertile + crosstab coverage
The symptothermal layer ran against the full day-log history: detectTempShift returned the earliest 3-over-6 rise and detectMucusPeak the last egg-white day across all cycles, so a multi-cycle user with historical BBT confirmed a months-old ovulation and the predicted next-period start landed in the past. Scope the temperature/mucus detectors to the current cycle window [lastConfirmedStart − BBT_WINDOW, today], take the latest qualifying temp shift, and reject any confirmation whose next-start is already in the past. Resolve luteal length through a single clamp. The predictor clamped to [10,16] while the calendar adapter and phase mapper used the raw stored value, so the ovulation dot and the OVULATORY band could land on different days for an out-of-clamp profile. Export resolveLuteal/clampLuteal, route buildCalendar, buildPhaseCycles and phaseForDay through it, and tighten the profile-prefs Zod bound to the same [10,16] range. Show the fertile window for AVOID_PREGNANCY as well as TRYING_TO_CONCEIVE per the algorithm spec; it stays hidden for GENERAL_HEALTH/PERIMENOPAUSE. Bound the day-log reads on the calendar and insights routes to the rendered span plus the symptothermal lookback instead of the full history; cycle-length stats already run off the MenstrualCycle rows. Add mood and blood glucose as phase-crosstab outcome metrics under the same FDR and per-group day floors. Mood is read from MoodEntry and injected as a synthetic channel since it is not a measurement row. Add multi-cycle, luteal-clamp and fertile-window fixtures. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ac13dd28ed
commit
15bece9849
13 files changed
+354
-36
No files matched your search
@@ -703,8 +703,8 @@ paths:
|
||||
lutealPhaseLength:
|
||||
anyOf:
|
||||
- type: integer
|
||||
minimum: 8
|
||||
maximum: 20
|
||||
minimum: 10
|
||||
maximum: 16
|
||||
- type: "null"
|
||||
responses:
|
||||
"200":
|
||||
|
||||
Reference in new issue
Block a user