# Release v1.9.x - Changelog

Released: YYYY-MM-DD

## Overview

MeatSpace Phases 2-5: Complete health tracking with alcohol logging, blood/body/epigenetic panels, nutrition dashboard, lifestyle questionnaire, and dashboard death clock widget.

## Features

### MeatSpace Phase 2 — Alcohol Tracking
- **Drink logger** with quick-add common drinks (beer, wine, spirits) and custom entry form (name, oz, ABV, date)
- **Standard drink calculator** widget: interactive oz x ABV helper showing pure alcohol and standard drink equivalents
- **Rolling averages** with 5-minute cache: today's total, 7-day/30-day/all-time daily averages, weekly total
- **NIAAA risk classification**: low/moderate/high based on weekly total vs sex-specific thresholds (male: 14/week, female: 7/week)
- **Alcohol consumption chart**: Recharts BarChart with 7d/30d/90d views, daily limit reference line, zero-fill for missing dates
- **Drink deletion**: Remove individual drink entries from daily logs
- New API endpoints: `GET /api/meatspace/alcohol`, `GET /api/meatspace/alcohol/daily`, `POST /api/meatspace/alcohol/log`, `DELETE /api/meatspace/alcohol/log/:date/:index`
- 14 new tests for standard drink math and rolling average computation

### MeatSpace Phase 3 — Blood & Body
- **Blood test panels** with reference range highlighting (normal/low/high color coding), categorized by Lipids, CBC, Thyroid, Metabolic Panel
- **Body composition chart**: Recharts dual-axis LineChart with weight (lbs) and body fat % over time
- **Epigenetic age dashboard**: Latest biological vs chronological age, pace of aging, organ-specific scores with color-coded status, test history
- **Eye prescription display**: OD/OD spherical, cylinder, axis values with formatted sign prefixes
- Health API functions: `getBloodTests`, `addBloodTest`, `getBodyHistory`, `addBodyEntry`, `getEpigeneticTests`, `addEpigeneticTest`, `getEyeExams`, `addEyeExam`, `getNutritionSummary`, `getDailyNutrition`
- New API endpoints: `GET/POST /api/meatspace/blood`, `GET/POST /api/meatspace/body`, `GET/POST /api/meatspace/epigenetic`, `GET/POST /api/meatspace/eyes`, `GET /api/meatspace/nutrition`, `GET /api/meatspace/nutrition/daily`
- 17 new tests for nutrition averages, mercury stats, body history extraction, merge, and date sorting

### MeatSpace Phase 4 — Nutrition & Lifestyle
- **Nutrition dashboard**: Daily macro averages (calories, fat, sat/trans/poly/mono, carbs, fiber, sugar) with color-coded display
- **Mercury exposure tracking**: Average daily intake with EPA reference dose context, color-coded risk thresholds
- **Recent nutrition table**: Last 7 days of daily macro breakdown
- **Lifestyle questionnaire form**: Smoking status, exercise minutes/week (slider), sleep hours/night (slider), diet quality, stress level, BMI with auto-classification
- **Impact preview panel**: Real-time calculation of each lifestyle factor's effect on life expectancy (years gained/lost)
- Lifestyle saves trigger death clock recalculation via `PUT /api/meatspace/lifestyle`

### MeatSpace Phase 5 — Polish
- **Dashboard death clock widget**: Compact live countdown on main Dashboard with link to MeatSpace overview, shows life expectancy and percent complete

### Apple Health Integration (Phase 03)
- **Health tab in MeatSpace**: New dedicated Health tab at `/meatspace/health` with four metric cards: Steps, Heart Rate, Sleep, and HRV
- **Time range selector**: 7d/30d/90d/1y buttons filter all health cards consistently via parallel API fetches
- **Steps card**: Daily average hero number + LineChart trend from Apple Health step_count data
- **Heart Rate card**: Average BPM hero + LineChart trend from Apple Health heart_rate data
- **Sleep card**: Average hours hero + stacked horizontal BarChart showing deep/REM/core/awake stage proportions (last 7 days)
- **HRV card**: Average ms hero + LineChart trend from Apple Health heart_rate_variability_sdnn data
- **Alcohol vs HRV correlation**: Dual-axis ComposedChart (Line + Bar) with auto-generated computed text summary comparing HRV on drinking vs sober days
- **Activity vs Blood Work correlation**: 30-day rolling average steps paired with blood marker Lines at blood test dates, with per-test text summary
- **Minimum data threshold**: Both correlation charts show "Need 14+ days" message when insufficient data exists
- Apple Health data ingestion via POST `/api/health/ingest`, daily aggregates at `/api/health/metrics/:name/daily`, correlation at `/api/health/correlation`

### Brain — Headless CLI Args
- **`headlessArgs` provider config**: New per-provider field for extra CLI flags used in lightweight prompt-in/text-out tasks (brain classifier, etc.), avoiding full agent environment overhead
- Brain `callAI` appends `headlessArgs` before model/prompt args for CLI providers
- Provider admin UI shows headless args in provider list and edit form
- Updated `portos-ai-toolkit` to v0.8.0 with `headlessArgs` in schema, `createProvider()`, and sample configs
