Expand description
Transparent sleep analytics for Phase 2 (SLP-01..10).
Non-diagnostic: cumulative sleep debt and weekly heatmap from duration summaries only.
Structs§
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, optionalefficiency).