bvandeusen
666b3a2ec8
refactor(ml): DRY pass — shared sweep helpers + table-driven settings ( #161 )
...
Consolidate duplication accrued across the ML tagging + settings backend,
behavior-preserving (over-DRY guard applied — the three auto-apply sweep
BODIES stay separate; only their shared inner helpers are extracted).
- _sigmoid / _conflict_scores / _insert_presentation_review (heads.py): the
score→prob transform (6 inlined sites), the presentation conflict signal
(2 sites), and the ring-loud PresentationReview insert (2 sites, single-
sourced so the mode column can't drift on the shared composite PK).
- _applied_or_rejected (training_data.py): the per-tag "applied ∪ rejected"
skip-set, byte-identical at 3 sweep sites (heads.py x2, tasks/ml.py ccip).
- ccip sweep divergence fixes: import ccip._FIGURE_KINDS + training_data._l2norm
instead of local copies that silently drift when the canonical changes.
- MLSettings.load / .load_sync classmethods (mirror ImportSettings); route all
8 scalar_one singleton reads through them (the session.get None-path stays).
- GET serializers for MLSettings + ImportSettings are now table-driven off the
same _EDITABLE tuples PATCH writes, so a new field can't be silently absent
from GET (the split that historically dropped fields).
- AUTO_APPLY_THRESHOLD_MIN/MAX constant single-sources the [0.5,0.999] operating
range across the service clamp + the 5 API validators.
- test_ml_dry_helpers.py pins _applied_or_rejected + _sigmoid.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01NsmJSQxnNxGgtM5Yz4GAqi
2026-07-13 21:41:24 -04:00
..
2026-07-03 09:36:54 -04:00
2026-05-14 07:32:17 -04:00
2026-07-02 23:21:52 -04:00
2026-07-02 11:20:45 -04:00
2026-07-03 08:40:11 -04:00
2026-06-12 13:05:58 -04:00
2026-06-01 14:17:52 -04:00
2026-07-04 22:04:20 -04:00
2026-06-03 15:45:59 -04:00
2026-05-28 11:33:05 -04:00
2026-06-26 11:47:48 -04:00
2026-06-29 12:54:35 -04:00
2026-06-04 16:55:20 -04:00
2026-06-17 12:03:48 -04:00
2026-05-30 00:59:05 -04:00
2026-05-28 11:33:05 -04:00
2026-07-04 22:37:50 -04:00
2026-06-23 01:11:42 -04:00
2026-07-05 19:42:59 -04:00
2026-06-28 10:36:25 -04:00
2026-05-28 11:33:05 -04:00
2026-07-06 22:59:00 -04:00
2026-05-28 12:43:08 -04:00
2026-07-10 22:38:25 -04:00
2026-06-01 14:17:52 -04:00
2026-06-11 23:10:30 -04:00
2026-06-14 15:57:42 -04:00
2026-07-10 22:38:25 -04:00
2026-05-28 11:33:05 -04:00
2026-05-30 23:15:07 -04:00
2026-06-17 12:03:48 -04:00
2026-07-10 15:22:51 -04:00
2026-06-10 11:34:42 -04:00
2026-05-28 11:33:05 -04:00
2026-06-30 13:04:31 -04:00
2026-06-30 13:47:55 -04:00
2026-05-28 11:33:05 -04:00
2026-07-06 18:51:39 -04:00
2026-06-01 21:57:29 -04:00
2026-06-06 14:33:24 -04:00
2026-06-16 20:30:31 -04:00
2026-07-04 22:04:20 -04:00
2026-06-01 14:17:52 -04:00
2026-06-03 15:45:59 -04:00
2026-05-19 11:11:07 -04:00
2026-05-26 01:18:38 -04:00
2026-05-26 01:18:07 -04:00
2026-05-19 14:59:04 -04:00
2026-06-01 22:09:02 -04:00
2026-06-10 14:29:17 -04:00
2026-06-26 11:47:48 -04:00
2026-07-06 16:21:38 -04:00
2026-06-16 21:05:26 -04:00
2026-06-24 00:06:49 -04:00
2026-07-06 18:59:00 -04:00
2026-05-21 16:02:36 -04:00
2026-05-26 08:13:53 -04:00
2026-07-03 08:40:11 -04:00
2026-06-02 17:04:27 -04:00
2026-07-02 21:51:51 -04:00
2026-06-29 10:17:05 -04:00
2026-06-09 23:46:01 -04:00
2026-07-03 09:54:18 -04:00
2026-06-30 13:41:25 -04:00
2026-07-03 10:00:14 -04:00
2026-06-06 21:22:32 -04:00
2026-05-28 12:43:08 -04:00
2026-07-13 17:50:07 -04:00
2026-05-15 13:53:42 -04:00
2026-06-16 21:15:49 -04:00
2026-07-02 16:53:08 -04:00
2026-05-29 15:34:20 -04:00
2026-05-20 20:39:17 -04:00
2026-06-03 22:58:46 -04:00
2026-06-17 12:03:48 -04:00
2026-06-04 07:01:07 -04:00
2026-06-03 23:50:19 -04:00
2026-07-12 23:15:59 -04:00
2026-07-13 12:06:22 -04:00
2026-07-02 16:53:08 -04:00
2026-07-02 21:07:21 -04:00
2026-07-06 18:18:46 -04:00
2026-07-06 16:36:30 -04:00
2026-06-29 00:36:58 -04:00
2026-07-06 18:28:25 -04:00
2026-05-28 11:33:05 -04:00
2026-07-06 23:34:18 -04:00
2026-06-14 16:39:58 -04:00
2026-05-19 11:14:49 -04:00
2026-06-21 22:22:03 -04:00
2026-05-18 21:33:55 -04:00
2026-06-15 22:17:36 -04:00
2026-05-25 20:33:44 -04:00
2026-05-25 22:16:26 -04:00
2026-06-01 14:40:28 -04:00
2026-06-01 14:17:52 -04:00
2026-07-02 17:37:21 -04:00
2026-07-09 16:17:56 -04:00
2026-06-14 13:15:36 -04:00
2026-07-07 22:15:33 -04:00
2026-05-26 21:23:12 -04:00
2026-06-30 13:41:25 -04:00
2026-05-15 15:48:29 -04:00
2026-06-01 14:17:52 -04:00
2026-06-01 14:17:52 -04:00
2026-05-19 11:10:53 -04:00
2026-05-20 12:53:34 -04:00
2026-05-20 18:32:52 -04:00
2026-05-20 18:33:14 -04:00
2026-05-20 20:36:19 -04:00
2026-06-12 13:05:58 -04:00
2026-06-30 13:04:31 -04:00
2026-07-13 21:41:24 -04:00
2026-05-15 07:36:17 -04:00
2026-07-10 15:22:51 -04:00
2026-06-03 13:00:08 -04:00
2026-05-14 07:34:29 -04:00
2026-06-07 18:34:11 -04:00
2026-06-14 16:39:58 -04:00
2026-06-17 11:32:28 -04:00
2026-06-15 00:14:52 -04:00
2026-06-17 11:32:28 -04:00
2026-07-06 14:15:19 -04:00
2026-07-04 22:37:50 -04:00
2026-06-05 19:26:57 -04:00
2026-06-30 13:04:31 -04:00
2026-05-17 22:18:07 -04:00
2026-07-04 22:24:25 -04:00
2026-07-03 19:41:29 -04:00
2026-07-03 09:45:14 -04:00
2026-06-17 12:03:48 -04:00
2026-05-20 18:34:02 -04:00
2026-07-07 12:31:46 -04:00
2026-07-12 23:15:59 -04:00
2026-07-06 23:46:09 -04:00
2026-07-13 10:14:38 -04:00
2026-06-15 00:14:52 -04:00
2026-06-21 22:22:03 -04:00
2026-07-13 12:06:22 -04:00
2026-07-02 16:53:08 -04:00
2026-06-29 11:18:28 -04:00
2026-07-06 18:13:37 -04:00
2026-06-06 14:33:24 -04:00
2026-05-25 22:16:26 -04:00
2026-05-19 11:14:49 -04:00
2026-05-30 12:08:43 -04:00
2026-06-11 21:30:01 -04:00
2026-06-11 23:17:14 -04:00
2026-06-11 21:47:58 -04:00
2026-06-07 18:58:18 -04:00
2026-06-11 21:30:01 -04:00
2026-06-11 23:10:30 -04:00
2026-06-11 23:10:30 -04:00
2026-05-15 15:49:25 -04:00
2026-07-04 20:13:53 -04:00
2026-06-14 16:39:58 -04:00
2026-05-14 12:04:05 -04:00
2026-07-04 22:15:38 -04:00
2026-07-04 22:37:50 -04:00
2026-06-28 11:20:11 -04:00
2026-07-03 08:34:16 -04:00
2026-06-26 00:51:56 -04:00
2026-06-30 13:04:31 -04:00
2026-06-06 23:57:06 -04:00
2026-05-26 21:00:12 -04:00
2026-07-06 19:03:51 -04:00
2026-05-15 07:39:33 -04:00
2026-06-06 17:39:54 -04:00
2026-05-24 21:22:42 -04:00
2026-06-16 08:31:50 -04:00
2026-06-10 14:29:17 -04:00
2026-06-07 00:08:19 -04:00
2026-07-02 16:53:08 -04:00
2026-05-27 22:45:11 -04:00
2026-05-21 18:53:35 -04:00
2026-05-14 12:05:19 -04:00
2026-05-21 16:01:59 -04:00
2026-07-02 23:19:41 -04:00
2026-07-10 22:38:25 -04:00
2026-07-10 22:38:25 -04:00
2026-05-19 18:15:59 -04:00
2026-07-13 10:14:38 -04:00
2026-07-13 10:14:38 -04:00