Skip to main content
Synced from the repo — do not edit here

Canonical source: docs/claude/one-source-defaults-ledger.md. This page is generated by docs/scripts/sync-handbook.mjs. Edit the source file in the repo; changes appear here on the next build.

One-source — every default decision (for review)

All defaults set during the one-source epic. VERIFIED = checked against real data / the stored unit field. ASSUMED = my judgment, please confirm/correct. Flag anything wrong.

Units — wearables (digest fields)

FieldCanonical unitStatus
weightkgVERIFIED (hs unit=kg)
waterMlmLVERIFIED (hs unit=mL)
sleep/exercise/mindfulness/fasting/zone*MinutesminutesVERIFIED (hs unit=minute) — encoders wanting seconds ×60
activeCalories / dietaryCalories / calorieskcalVERIFIED
vo2Maxml/kg/minVERIFIED (hs unit)
rhr / maxHrbpm · hrvSdnn/Rmssdms · spo2
glucose (digest)mg/dLASSUMED — confirm (vs mmol/L)
gripStrengthLeft / gripStrengthRightlbs, two separate metricsCONFIRMED by George
deadHangsecondsCONFIRMED by George
bodyFatPct%CONFIRMED by George

Units — labs

DecisionStatus
Canonical target = US conventional (mg/dL, mIU/L, ng/mL…) via lab_unit_conversions.jsonASSUMED — confirm this is the platform's target (esp. glucose/lipids mg/dL not mmol/L)
Core-panel range VALUES (46 labs) = Mayo-aligned adult rangesASSUMED — needs-clinical-signoff before patient-facing
Verdict is BINARY: in_range / out_of_range (no "optimal" tier)ASSUMED — optimal tier is a benchmark-layer add-on (#272)
Verdict population default = adult; sex-specific where clinicalASSUMED
Unknown-sex + sex-specific range → conservative union (widest) so never false-flagASSUMED (safe-by-design)
Unit can't be confirmed to match range → verdict unknown (never a wrong flag)design safety

Timezone / date

DecisionStatus
localDate = YYYY-MM-DD, device-local day (from summary start + tzOffset) — the day-key everywhereexisting convention
Lab collectedAt = noon UTC of the report date (avoids ±1-day shift for UTC-offset users)existing (CLAUDE.md rule) — but SEE RISK below
Wearable HR sample timestamps parsed as UTC (they end in Z)VERIFIED (fixed a bug where naive parse zeroed zones)
"Latest value" = most recent localDate (date-deterministic, never highest-ever / first-seen)design (the #394 read bug)
Resolution recency tiebreak = updatedAtingestedAtstart epochdesign
⚠️ RISK: if the 3 lab surfaces derive the day-key differently (manual=local date, Junction=UTC), the SAME lab can land on different graph days → split trendFLAGGED — must standardize (below)

Resolution / source precedence (wearables)

DecisionStatus
Strength-default per metric (Oura→rhr/hrv/sleep · Apple Watch→steps/zones/maxHr · manual→weight/BP · CGM→glucose)DECIDED (you approved)
Recency breaks ties only WITHIN a tierDECIDED
Vendor-collapse: Oura-via-Terra + Oura-via-AppleHealth → one; prefer Terra-directDECIDED
Legacy devicePreferences NOT trusted (uncurated); strength-default is authorityDECIDED
Gender stored as string "m"/"f" (George = "m") → male/femaleVERIFIED for George; enum 1=male/2=female kept as defensive fallback (ASSUMED, may not exist)
maxHR = 220 − age, clamp(100,210), fallback 185VERIFIED (matches Dart)
HR zones stay app-owned (not server-computed)DECIDED (2026-07-16)

The ones I most want you to confirm

  1. Lab canonical unit = US conventional (mg/dL etc.) — right target for the platform?
  2. Gender enum 1=male / 2=female — correct mapping? (wrong → sex-specific ranges flip)
  3. Core-panel range values — need a clinician signoff before any patient sees a verdict.
  4. Binary verdict (no optimal tier) for now — acceptable, or is "optimal" needed at write?