mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 05:42:19 +00:00
8.5 KiB
8.5 KiB
Changelog
[1.2.1] — 2026-04-27
Fixed
- Onboarding: Medications added during onboarding are now actually persisted (closes #87). The wizard previously sent an empty
schedules: []array, the server-side validation rejected it with a 422, the client never checkedresponse.ok, and the user was redirected to the dashboard as if everything had worked. Onboarding now wraps each step intry/catch, surfaces failures via toast, and attaches a default reminder window (08:00–09:00 daily) so the medication actually persists. A hint under the medication list explains the default. - Docker setup (closes #88):
docker-compose.ymlnow usesports: "3000:3000"(wasexpose: "3000", which made the app unreachable from the host).POSTGRES_PASSWORDis a single env var that both the Postgres service andDATABASE_URLinterpolate, so they cannot drift apart..env.examplenow points at the in-container hostnamedb:5432(waslocalhost:5432, which never resolves inside the app container).
- Documentation:
package.jsonsynced to 1.2.0 (was lagging on 1.1.0).CLAUDE.mdandAGENTS.mdcorrected to 23 models (theFeedbackmodel added in v1.2 was missing from the count).README.mdQuick Start gives a realistic time estimate, generates the four secrets in one block straight into.env, and points reverse-proxy users at the docs.
Added — Tooling & Supply Chain
- Pre-built multi-arch images on GHCR:
.github/workflows/docker-publish.ymlnow buildslinux/amd64+linux/arm64images on every push tomainand on everyv*tag, publishing toghcr.io/mbombeck/healthlog. Self-hosters no longer need a build toolchain —docker compose pull && docker compose up -dis enough. The bundleddocker-compose.ymlreferences the published image with abuild:block as fallback for contributors. - Supply-chain attestations: each published image carries a SLSA build provenance statement and a Software Bill of Materials.
SECURITY.mddocuments how to verify them and how to pin a specific version. - Documentation single source of truth:
getting-started/installation.mdxis now the canonical setup guide (mirrors the bundleddocker-compose.yml);self-hosting/docker.mdxslimmed to image internals + ops notes only. The landing page's Quick Start terminal block now includes the secrets-generation step (was missing).
Notes
This is a patch release that closes the install/onboarding friction reported in #87 and #88. The bigger user-facing changes (additional measurement types like total body water and bone mass per #89, full onboarding redesign, typed API client) are tracked for 1.3.0.
[1.2.0] — 2026-04-18
Added — Personalization, Glucose & Multi-Provider AI
- Per-user custom thresholds: Override the computed default ranges (BP, BMI, glucose, pulse) with values from your clinician. Audit-logged with previous/new values and timestamps. Doctor Report PDF flags custom ranges and prints both your target and the standard guideline value.
- Blood glucose tracking: New metric with
fasting,postprandial,random, andbedtimecontexts. Display unit switch between mg/dL and mmol/L (lossless conversion). Context-aware classification per ADA 2024 / DGIM. Per-context charting on dashboard and Doctor Report PDF. - Dashboard customization: Show/hide and drag-to-reorder every dashboard widget. Per-user preference, reset-to-defaults button. Layout persists across the same user on the same device.
- Built-in feedback system: New in-app Send Feedback flow (Bug / Feature / Question / Other) with anonymized system info attachment. Stored in HealthLog's own database — no GitHub config required. Optional
Escalate to GitHubbutton for admins who configure a PAT. - Multi-provider AI insights: Provider abstraction extended with Anthropic Claude and local OpenAI-compatible endpoints (Ollama, LM Studio, vLLM, LiteLLM) alongside OpenAI. Per-user provider selection. Local endpoints keep all health data on your network.
- Locale-aware UI polish (English-first): Numbers, dates, glucose units, BP, weight, and BMI all formatted via
useFormatters()from the active locale. Doctor Report PDF and AI insight prompts now respect locale end-to-end (no hand-rolledIntl.*with fixed locales).
Changed
- Reference range computation extracted into a dedicated
src/lib/health/thresholds.tsmodule with computed defaults and override resolution. - AI provider routing reworked to dispatch by
providerfield on the user record; OpenAI remains the default for legacy users. - Dashboard route renders widgets from
UserDashboardLayoutmodel when present, otherwise falls back to the default order. - Doctor Report PDF: locale-aware headers, glucose section, custom-range badges.
Security
- GitHub PAT for feedback escalation stored AES-256-GCM encrypted in the database (never as env var).
- Local AI endpoint URLs validated against SSRF (no localhost/RFC1918 unless explicitly allowed by admin).
- Custom threshold writes rate-limited and audit-logged with IP.
[1.1.0] — 2026-04-06
Added — AI Insights Overhaul
- ChatGPT Proxy Integration: Insights now run through a local openai-oauth proxy using your ChatGPT subscription — no separate API billing required
- Admin AI Fallback: Admins can configure a global API key (OpenAI/OpenRouter) as fallback for users without their own connection
- Provider Abstraction: New
src/lib/ai/module with pluggable providers (Codex OAuth, Admin Key, None) and automatic failover - Medical Insight Prompts: 7 specialized prompts based on ESC/ESH 2023, WHO, DGE, and DEGAM guidelines
- Blood Pressure: ESC/ESH classification, morning risk ladder (J-HOP), pulse pressure, seasonal variation
- Weight: 5%/10% milestone recognition, plateau detection, body composition divergence
- Pulse: Fitness interpretation ladder, 80-100 bpm elevated-risk band, rate-pressure product
- BMI: Age-adjusted DEGAM classification for 65+
- Medication Compliance: Chronotherapy hints, mood-adherence risk prediction, 90-day tracking
- General Status: Cross-domain synthesis with cardiovascular risk stratification
- Mood: Bidirectional correlations with vitals and adherence
- Enriched Feature Extraction:
- Sleep duration and activity steps (previously ignored)
- Rate-Pressure Product (pulse × systolic BP, myocardial demand indicator)
- Body composition divergence flag (weight stable + body fat rising)
- Mood-adherence risk predictor
- Seasonal BP variation (winter vs summer, requires >180 days data)
- BP standard deviation (sdSys30/sdDia30) as variability risk marker
- Pulse pressure (arterial stiffness marker)
- 5 cross-metric Pearson correlations (weight↔BP, pulse↔BP, mood↔pulse, mood↔BP, mood↔weight)
- 90-day averages and all-time statistics for all metrics
- Historical comparison (current 7d vs previous 30d baseline)
- New UI Components:
InsightStatusCard: Compact per-metric status card with classification indicator and fade-in animationInsightAdvisorCard: Premium structured card with findings, correlations, recommendations (ready for integration)
- OAuth Routes:
/api/auth/codex/authorize,/callback,/disconnectfor ChatGPT connection - Admin AI Settings:
/api/admin/ai-settingsfor global API key management
Changed
- Insight prompts now use personal advisor tone ("dein Blutdruck") with positive-first pattern
- Reasoning scaffold in system prompt (What changed? → Why? → What to do?)
- Conditional correlation instructions (only mention when |r| > 0.4)
- InsightResult schema enriched with
insightType,primaryRecommendation,classificationLabel - BP target calculation now uses paired readings (both sys AND dia must be in range simultaneously)
- Medication streak tracking extended from 7-day to 30-day window
- CSP updated to allow
chatgpt.comfor OAuth flow
Security
- Rate limiting on all OAuth and admin endpoints
- PKCE (S256) + state parameter for OAuth CSRF protection
- Encrypted token storage at rest (AES-256-GCM)
- Error messages truncated to prevent upstream response body leaks
- Admin key preview shows last 4 chars of decrypted key (not ciphertext prefix)
prefers-reduced-motionsupport for insight card animations
Removed
openaiKeyEncryptedfield from User model (replaced by provider abstraction)- Direct OpenAI API calls from insight generators (now routed through provider)
- Legacy API key input in settings UI (replaced by ChatGPT connect button)