mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
A stored positive ovulation test (LH surge) was ignored by the predictor. Wire it in as a Marquette/Fehring anchor: a positive surge predicts ovulation ~24-36h later, so the estimated ovulation is set one day after the last positive LH test in the current window, sharpening the estimate over the calendar back-calculation — most valuable in the thin-data (<3 cycle) case where the median/luteal back-calc is weak. The LH surge is a SIGNAL that refines, never a sole assertion: it re-anchors the still-estimated ovulation but never flips `ovulationConfirmed` (a single indicator is not the symptothermal double-check), and a confirmed symptothermal/temperature-trend ovulation always wins over it. The still-learning gate and the un-confirmed status are preserved. A stale prior-cycle surge whose next-start lands in the past is rejected. Citation: Fehring R.J. — Marquette Method; urinary LH peaks ~1 day before ovulation.
27 lines
672 B
TypeScript
27 lines
672 B
TypeScript
/**
|
|
* Cycle prediction + phase engine — public surface.
|
|
*
|
|
* Pure, deterministic, DB-free. The iOS team re-implements this 1:1 in Swift
|
|
* from `.planning/v1.15-cycle/algorithm.md`; the unit-test fixtures under
|
|
* `__tests__/` are the shared parity contract.
|
|
*/
|
|
|
|
export * from "./types";
|
|
export * from "./day-math";
|
|
export {
|
|
predictCycle,
|
|
estimateCycleLength,
|
|
estimatePeriodLength,
|
|
observedPeriodLength,
|
|
detectTempShift,
|
|
detectMucusPeak,
|
|
confirmSymptothermal,
|
|
detectTemperatureTrend,
|
|
detectLhSurgeOvulation,
|
|
median,
|
|
mad,
|
|
resolveLuteal,
|
|
clampLuteal,
|
|
} from "./prediction";
|
|
export { phaseForDay, phaseSeries, type PhaseCycle } from "./phase";
|