Skip to main content

Module sleep_analytics

Module sleep_analytics 

Source
Expand description

Transparent sleep analytics for Phase 2 (SLP-01..10).

Non-diagnostic: cumulative sleep debt and weekly heatmap from duration summaries only.

Structs§

SleepDebtReport
SleepHeatmapCell
SleepHeatmapReport
SleepNightSample

Constants§

DEFAULT_TARGET_SLEEP_MIN
Default adult sleep target used for debt (8 hours). UI may override.

Functions§

compute_sleep_debt
Compute cumulative sleep debt: sum of max(0, target - actual) over samples.
compute_weekly_heatmap
Build a 7-cell heatmap from the most recent samples (newest last).
parse_sleep_summary_json
Parse journal sleep summary JSON (duration_min, optional efficiency).