From 7ff91fcf55907b2f0ed04ee6eaea6b5f74be1873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Wed, 3 Jun 2026 20:03:14 +0200 Subject: [PATCH] refactor(insights): drop the unused baseline-capable-type allowlist The additive HealthKit baselines dispatch via an explicit per-metric type map, so the allowlist helper and its constant had no consumer. --- src/lib/insights/derived/index.ts | 2 -- src/lib/insights/derived/registry.ts | 24 ------------------------ 2 files changed, 26 deletions(-) diff --git a/src/lib/insights/derived/index.ts b/src/lib/insights/derived/index.ts index 3a27a2445..2b699085c 100644 --- a/src/lib/insights/derived/index.ts +++ b/src/lib/insights/derived/index.ts @@ -39,11 +39,9 @@ export type { DeriveCoverageArgs } from "./coverage"; export { DERIVED_METRIC_IDS, VITALS_BASELINE_TYPES, - BASELINE_CAPABLE_TYPES, isDerivedMetricId, getDerivedMetricMeta, isVitalsBaselineType, - isBaselineCapableType, } from "./registry"; export type { DerivedMetricId, diff --git a/src/lib/insights/derived/registry.ts b/src/lib/insights/derived/registry.ts index 493b9fa80..4e27b4193 100644 --- a/src/lib/insights/derived/registry.ts +++ b/src/lib/insights/derived/registry.ts @@ -124,25 +124,6 @@ export const VITALS_BASELINE_TYPES: MeasurementType[] = [ "WEIGHT", ]; -/** - * The full set of measurement types the type-generic baseline engine - * (`computeVitalsBaseline`, median ± k·MAD) can produce a personal band - * for. A superset of `VITALS_BASELINE_TYPES`: it adds the v1.10.3 - * additive HealthKit signals that get an `any-user-baseline` derived - * metric of their own (wrist temperature as a personal-deviation band; - * stair ascent/descent speed as a personal trend band — NO population - * cutoff, since stair pace is geometry-confounded). The engine is - * type-generic; this allowlist is the gate, kept distinct from - * `VITALS_BASELINE_TYPES` so a stair-speed baseline is never mislabelled a - * "vital". - */ -export const BASELINE_CAPABLE_TYPES: MeasurementType[] = [ - ...VITALS_BASELINE_TYPES, - "WRIST_TEMPERATURE", - "STAIR_ASCENT_SPEED", - "STAIR_DESCENT_SPEED", -]; - const REGISTRY: Record = { VITALS_BASELINE: { id: "VITALS_BASELINE", @@ -306,8 +287,3 @@ export function getDerivedMetricMeta( export function isVitalsBaselineType(type: string): boolean { return (VITALS_BASELINE_TYPES as string[]).includes(type); } - -/** `true` when the type-generic baseline engine can band this type. */ -export function isBaselineCapableType(type: string): boolean { - return (BASELINE_CAPABLE_TYPES as string[]).includes(type); -}