[OCaml] High Intensity Training Online
chore Log iteration 3 of the boundary refactor
Record the home/routine DTO migration and the workout view-model design, with the execution plan for wiring the workout view and logbook record list.
RAIL.org
@@ -13,6 +13,22 @@
13
13
:ID: FB3A953A-201F-42C6-84EE-A7BE54F7BF4B
14
14
:END:
15
15
:LOGBOOK:
16
Added:
- [2026-09-09 Wed 15:11] Iteration 3. Migrated home, choose_routine, and
17
Added:
routine to DTOs (View_model.Home/Routine/Routine_choice; commit
18
Added:
b045e35) — those three presenter fns now name no Prescription/Recovery
19
Added:
entity; dead formatters removed, logic moved to controller. Then
20
Added:
designed the Workout DTO tree in view_model.ml (commit 90f5ff2):
21
Added:
module Workout with movement
22
Added:
{name;load_field;reps_field;reps_label;load_value;reps_value}, slot
23
Added:
{index;label;movements;recorded_summary}, t
24
Added:
{name;slots;active_slot;started_at_unix;overridden;all_recorded}. Builds;
25
Added:
243 tests green; arch guard green.
26
Added:
27
Added:
Remaining: only the workout presenter (pages.ml ~lines 726-1105) and the logbook record-list rendering still name entities. Execution plan for iteration 4:
28
Added:
- In handlers.ml (controller), build View_model.Workout.t from Evidence.Workout: for each prescribed slot (Prescription.Workout.stimuli prescription), emit label via the old exercise_label logic (Single -> Exercise.name; Pre_exhaust -> "iso + comp"), and movements: Single -> one {load/reps fields}, Pre_exhaust -> two {iso_load/iso_reps},{comp_load/comp_reps} with reps_label "Reps"/"Reps to failure". recorded_summary via describe_stimulus logic when the slot is filled (Evidence.Workout.performed / first fill per slot), else None. started_at_unix from Recovery.timestamp_to_unix_seconds(started_at); overridden from Recovery.basis(clearance)=Overridden; all_recorded from outstanding=[].
29
Added:
- Rewrite pages.ml workout to consume Workout.t: exercise selector iterates slots (label + done from recorded_summary<>None); active_panel uses slots[active_slot].recorded_summary and .movements; movement_row takes the DTO movement fields; keep extension_select/error rendering/timer/finish/cancel forms (fixed UI). Move describe_stimulus/exercise_label/form_for_stimulus's Prescription match into the controller mapping; the presenter renders movements only.
30
Added:
- Then migrate the logbook record list (Repository.record/Evidence.Workout.completeness/prescription name/stimuli count) to a small record DTO {id; name; stimuli_count; complete:bool}.
31
Added:
- Verify presenter has zero Evidence/Prescription/Repository refs; add an architecture guard test asserting pages.ml names no core entity/repository module. 243 tests must stay green. Build dir _build-agent.
16
32
- [2026-09-09 Wed 15:04] Iteration 2. Two more boundary crossings
17
33
removed from the presenter. (1) Viewer DTO: replaced
18
34
~trainee:Trainee.t on all 9 page signatures + html_page shell with