1
-
Removed:
(** A workout in its two states: {!Prescribed} (this session's plan) and
2
-
Removed:
{!Logged} (what happened). Distinct types with a one-way transition, so a
3
-
Removed:
plan can never be mistaken for a record. *)
1
+
Added:
(** Today's workout: the routine's next plan made concrete, with a target per
2
+
Added:
exercise derived from past evidence.
4
3
4
+
Added:
Still a plan, not a record — performing it produces a
5
+
Added:
{!Hito_core.Logbook.Entry}. Targets come from evidence rather than log
6
+
Added:
entries, which keeps this module independent of the logbook. *)
7
+
Added:
5
8
type item = {
6
-
Removed:
prescription : Routine.Prescription.t;
9
+
Added:
prescription : Prescription.t;
7
10
exercise : Exercise.t;
8
11
(** The prescribed movement, or a chosen substitute. *)
9
12
target : Progression.target Progression.prescribed option;
10
13
(** [None] with no prior evidence. *)
11
14
}
12
-
Removed:
(** One exercise's plan for this session. Shared by both states: {!Prescribed}
13
-
Removed:
produces items, {!Logged} retains them to judge what was performed. *)
14
15
15
-
Removed:
(** The record of a performed session. Defined before {!Prescribed} because a
16
-
Removed:
prescription is calculated from past logs. *)
17
-
Removed:
module Logged : sig
18
-
Removed:
type t
19
-
Removed:
type error = Set_exercise_not_prescribed of Exercise.id | Already_finished
16
+
Added:
type t
17
+
Added:
type error = Not_substitutable of Exercise.error
20
18
21
-
Removed:
val add_group : t -> Set_group.t -> (t, error) result
22
-
Removed:
(** Append a performed group. Each working set's exercise is validated
23
-
Removed:
individually, since a group may span exercises. *)
19
+
Added:
val create :
20
+
Added:
routine:Routine.t ->
21
+
Added:
completed_workouts:int ->
22
+
Added:
substitutions:(Exercise.id * Exercise.t) list ->
23
+
Added:
evidence:(Exercise.id -> Progression.sample list) ->
24
+
Added:
(t, error) result
25
+
Added:
(** Instantiate the routine's next workout, selected by rotation from
26
+
Added:
[completed_workouts]. [evidence] yields an exercise's past performances,
27
+
Added:
from which its target is calculated. *)
24
28
25
-
Removed:
val finish : (module Recovery.CLOCK) -> t -> t
26
-
Removed:
(** Complete the workout and stamp the session's end. *)
29
+
Added:
val routine : t -> Routine.t
30
+
Added:
val plan : t -> Routine.Plan.t
31
+
Added:
val items : t -> item list
27
32
28
-
Removed:
val is_finished : t -> bool
29
-
Removed:
val session : t -> Recovery.session
30
-
Removed:
val items : t -> item list
31
-
Removed:
val groups : t -> Set_group.t list
33
+
Added:
val prescribes : t -> Exercise.id -> bool
34
+
Added:
(** Whether [id] is the movement of one of this workout's items. *)
32
35
33
-
Removed:
val working_sets : t -> Set.Working.t list
34
-
Removed:
(** Every working set performed, in order. *)
36
+
Added:
val recovery : t -> Recovery.duration Progression.prescribed
37
+
Added:
(** The rest window prescribed before the next workout. *)
35
38
36
-
Removed:
val performances : t -> (Exercise.id * Progression.sample) list
37
-
Removed:
(** Each working set's performance, keyed by its own exercise. *)
38
-
Removed:
39
-
Removed:
val guidance : t -> (Exercise.id * Routine.Prescription.guidance) list
40
-
Removed:
(** What was performed, judged against the plan. *)
41
-
Removed:
42
-
Removed:
val unperformed : t -> Exercise.t list
43
-
Removed:
(** Prescribed exercises with no logged working set. *)
44
-
Removed:
45
-
Removed:
(** {1 Metrics} *)
46
-
Removed:
47
-
Removed:
val volume : t -> float
48
-
Removed:
(** Σ (load × reps) across all working sets. Diagnostic, not a target. *)
49
-
Removed:
50
-
Removed:
val duration : t -> Recovery.duration option
51
-
Removed:
(** Wall-clock time, once finished. Heavy Duty prescribes brief workouts, so a
52
-
Removed:
shorter session at equal or better overload is favourable. *)
53
-
Removed:
54
-
Removed:
val pp : Format.formatter -> t -> unit
55
-
Removed:
end
56
-
Removed:
57
-
Removed:
(** This session's plan: a routine instantiated with targets drawn from logs. *)
58
-
Removed:
module Prescribed : sig
59
-
Removed:
type t
60
-
Removed:
type error = Not_substitutable of Exercise.error
61
-
Removed:
62
-
Removed:
val create :
63
-
Removed:
routine:Routine.t ->
64
-
Removed:
substitutions:(Exercise.id * Exercise.t) list ->
65
-
Removed:
logs:(Exercise.id -> Logged.t list) ->
66
-
Removed:
(t, error) result
67
-
Removed:
(** Instantiate [routine] for this session. [logs] yields an exercise's past
68
-
Removed:
workouts, the evidence its target is calculated from. *)
69
-
Removed:
70
-
Removed:
val routine : t -> Routine.t
71
-
Removed:
val items : t -> item list
72
-
Removed:
73
-
Removed:
val recovery : t -> Recovery.duration Progression.prescribed
74
-
Removed:
(** The rest window prescribed before the next session. *)
75
-
Removed:
76
-
Removed:
val start : t -> Recovery.session -> Logged.t
77
-
Removed:
(** Begin logging against this plan. *)
78
-
Removed:
79
-
Removed:
val pp : Format.formatter -> t -> unit
80
-
Removed:
end
39
+
Added:
val pp : Format.formatter -> t -> unit