mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
Wires readBestGranularityRollups into computeSummariesSlice to populate the year-ago 30-day baseline (avg30LastYear) per type. The field was hardcoded null up to v1.4.39 because the 90-day windowed aggregate cannot reach back a year and the live measurements walk over a 395-day per-type window is exactly the cold-path cost the rollup tier was meant to absorb. Coverage-fallback mirrors the W-MOOD posture: per-type calls route through YEAR (skipped for the 395-day window — floor 731 d) -> MONTH -> WEEK -> DAY and return null when no granularity carries any bucket overlapping the [now-395d, now-365d) slice. count / mean compose linearly across any granularity so the derived baseline is mathematically equivalent to the per-row average over the same window. Adds year_over_year_types annotate count alongside the existing slim_summaries path tag so operators can verify the wire-up in production wide-events without redeploying instrumentation.