Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/compute/crossday_pipeline.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,17 @@ Map<String, dynamic> buildCrossDayBundle(
final gbInputs = <ana.GlassBoxInput>[];
final gbRmssd = _glassInput('hrv', rmssdList, ana.wHrv, lowerIsBetter: false);
if (gbRmssd != null) gbInputs.add(gbRmssd);
final gbRhr = _glassInput('rhr', rhrList, ana.wRhr, lowerIsBetter: true);
final gbRhr =
_glassInput('rhr', rhrList, ana.wRhr, lowerIsBetter: true, quantum: 1);
if (gbRhr != null) gbInputs.add(gbRhr);
final gbResp = _glassInput('resp', respList, ana.wResp, lowerIsBetter: true);
if (gbResp != null) gbInputs.add(gbResp);
// temp: use absolute z so "further from your baseline" is worse.
// temp: use absolute z so "further from your baseline" is worse. `tempList`
// here is `skin_temp_z` — already a z-score against the raw-ADC baseline
// (onehz_pipeline.dart's `skinTempZ`, which has its OWN quantum:1 guard on
// the raw-ADC dispersion before the z is computed at all). It's continuous,
// not integer-quantized, so no quantum here (unlike readiness_composite's
// `tempInput`, which is fed the raw ADC mean and genuinely needs quantum:1).
final gbTemp = _glassInput(
'temp',
_absList(tempList),
Expand Down Expand Up @@ -795,6 +801,7 @@ ana.GlassBoxInput? _glassInput(
List<double?> series,
double weight, {
required bool lowerIsBetter,
double quantum = 0,
}) {
if (series.isEmpty || series.last == null) return null;
final history = <double>[
Expand All @@ -807,6 +814,7 @@ ana.GlassBoxInput? _glassInput(
history: history,
weight: weight,
lowerIsBetter: lowerIsBetter,
quantum: quantum,
);
}

Expand Down
14 changes: 12 additions & 2 deletions lib/compute/derivation_engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,17 @@ import 'substrate.dart';
// illness_cusum/readiness_composite/event_detection. Without it, a 1bpm rise
// could clear the gate and fire the "both facts point the same way" card on
// nothing. kAnalyticsPin repinned to analytics PR #73's merged main SHA.
const int kAlgoVersion = 94;
//
// 94 → 95 (`glassBoxReadiness` rhr/temp quantum guard, analytics PR #75):
// same gap as #73, but on the stored "readiness_glassbox" narrative/drivers
// key crossday_pipeline still writes — glassBoxReadiness never gated its
// 0.5*scale rhr/temp standardization with dispersionBelowQuantum, so a
// quantized baseline (e.g. alternating 58/59 bpm) could get named a driver
// off rounding noise. edge's `_glassInput` calls now pass `quantum: 1` on
// both channels. kAnalyticsPin repinned to analytics PR #75's merged main
// SHA. This changes the stored drivers list for real users, so it gets a
// version bump despite being narrative-only, not a headline-score change.
const int kAlgoVersion = 95;
/// The sibling SHAs this version was derived against, asserted against
/// pubspec.yaml in test/db_serve_version_and_reads_test.dart.
///
Expand Down Expand Up @@ -1859,7 +1869,7 @@ const int kAlgoVersion = 94;
// picking one single-device SHA over the other. Verified: `1cf8e61` (this
// branch's own pin) IS an ancestor of `fe1464d` — the wearfit protocol
// commit is already folded in, nothing is lost by moving to the tip.
const String kAnalyticsPin = 'eed6dc92375ce1336fc4e31d13a0718f45e163cf';
const String kAnalyticsPin = '01e8b6e02b2370ae42490a678e6a0a4e3569104c';
// Repinned to analytics main's tip, which carries BOTH PR #72 (hrv_freq
// Welch gap guard) and PR #73 (overreachingConjunction rhr quantum guard) —
// the two independent kAlgoVersion bumps above (93 and 94). Verified both
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: eed6dc92375ce1336fc4e31d13a0718f45e163cf
resolved-ref: eed6dc92375ce1336fc4e31d13a0718f45e163cf
ref: "01e8b6e02b2370ae42490a678e6a0a4e3569104c"
resolved-ref: "01e8b6e02b2370ae42490a678e6a0a4e3569104c"
url: "https://github.com/OpenStrap/analytics.git"
source: git
version: "1.0.0"
Expand Down
16 changes: 15 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,21 @@ dependencies:
# rounding noise. Verified:
# `git show eed6dc9:lib/src/onehz/human/overreaching_conjunction.dart |
# grep dispersionBelowQuantum`
ref: eed6dc92375ce1336fc4e31d13a0718f45e163cf
#
# analytics PR #75 (MERGED to main @ 01e8b6e): readiness_glassbox's SWC
# gate had the same gap #73 fixed on overreaching_conjunction --
# glassBoxReadiness does the identical 0.5*scale standardization on the
# same rhr/temp channels edge wires in below (`_glassInput('rhr', ...)`
# / `_glassInput('temp', ...)`), never gated by dispersionBelowQuantum.
# Adds `GlassBoxInput.quantum`. Re-pinned from #75's branch head to main
# now that it's merged. Verified:
# `git show 01e8b6e:lib/src/onehz/human/readiness_glassbox.dart |
# grep dispersionBelowQuantum`
# Changes the stored "readiness_glassbox" drivers list for real users
# (see derivation_engine.dart's 94 -> 95 changelog entry), so this got
# a kAlgoVersion bump despite being narrative-only, not a headline-score
# change.
ref: 01e8b6e02b2370ae42490a678e6a0a4e3569104c

# BLE — flutter_blue_plus is the maintained cross-platform GATT client.
flutter_blue_plus: ^1.36.8
Expand Down
Loading