refactor Make feedback level relative and ternary

Replace the five-point absolute score (Very_poor..Very_good) with a three-value relative reading: Worse_than_usual, As_usual, Better_than_usual. This matches HD1's own framing — Difficulty is "the weights feel much heavier than usual" — and resists the false precision of a finer scale, in the spirit of HD1's refusal of spurious measurement gradations. Drop level_to_score and level_of_score; a relative reading has no natural 1..5 mapping, and any stable serialization belongs at the persistence boundary, not in the core. Worse_than_usual is the concerning direction for both signals.

Commit
7bd4cfc6bf5dedb282083f9b214024f3a52a4d00
Author
Marius Peter <dev@marius-peter.com>
Author date
Committer
Marius Peter <dev@marius-peter.com>
Committer date
Changed files
lib/core/evidence.ml
index 74d33054..698bc41c 100644..100644
@@ -67,22 +67,12 @@
67 67 end
68 68
69 69 module Feedback = struct
70 Removed: type level = Very_poor | Poor | Fair | Good | Very_good
70 Added: type level = Worse_than_usual | As_usual | Better_than_usual
71 71
72 Removed: let level_to_score = function
73 Removed: | Very_poor -> 1
74 Removed: | Poor -> 2
75 Removed: | Fair -> 3
76 Removed: | Good -> 4
77 Removed: | Very_good -> 5
78 Removed:
79 Removed: let level_of_score = function
80 Removed: | 1 -> Some Very_poor
81 Removed: | 2 -> Some Poor
82 Removed: | 3 -> Some Fair
83 Removed: | 4 -> Some Good
84 Removed: | 5 -> Some Very_good
85 Removed: | _ -> None
72 Added: let pp_level ppf = function
73 Added: | Worse_than_usual -> Format.pp_print_string ppf "worse than usual"
74 Added: | As_usual -> Format.pp_print_string ppf "as usual"
75 Added: | Better_than_usual -> Format.pp_print_string ppf "better than usual"
86 76
87 77 type signal = Motivation of level | Difficulty of level
88 78 type t = { reported_at : Recovery.timestamp; signals : signal list }
lib/core/evidence.mli
index 74ee2fac..03bd9b59 100644..100644
@@ -56,21 +56,17 @@
56 56 (** Typed signals reported at a point in time. *)
57 57 module Feedback : sig
58 58 type level =
59 Removed: | Very_poor
60 Removed: | Poor
61 Removed: | Fair
62 Removed: | Good
63 Removed: | Very_good
64 Removed: (** A five-point subjective score. [Very_poor] is 1, [Very_good] is 5.
65 Removed: These are subjective self-reports, never a measure of the working
66 Removed: set's intensity, which is categorical (0% at rest, 100% at failure).
67 Removed: *)
59 Added: | Worse_than_usual
60 Added: | As_usual
61 Added: | Better_than_usual
62 Added: (** A self-report relative to the trainee's usual baseline, not an
63 Added: absolute score. HD1 frames both signals this way — Difficulty is
64 Added: "the weights feel much heavier than usual". Three values resist the
65 Added: false precision of a finer scale, in the spirit of HD1's refusal of
66 Added: spurious measurement gradations. [Worse_than_usual] is the
67 Added: concerning direction for both signals. *)
68 68
69 Removed: val level_to_score : level -> int
70 Removed: (** The score in 1..5. *)
71 Removed:
72 Removed: val level_of_score : int -> level option
73 Removed: (** [Some] for 1..5, [None] otherwise. *)
69 Added: val pp_level : Format.formatter -> level -> unit
74 70
75 71 type signal =
76 72 | Motivation of level