## Phase 29: Demeter - Comprehensive Home Gardening Platform

> **Domain Purpose:** State-of-the-art home gardening platform combining
> traditional horticultural knowledge with modern IoT, AI/ML, and data-driven
> insights. Named after the Greek goddess of harvest, agriculture, and
> fertility.

### 29.1 Foundation & Core Infrastructure

#### 29.1.1 Domain Setup

- [x] **29.1.1.1** Create libs/demeter/ directory structure
- [x] **29.1.1.2** Create libs/demeter/core/ library scaffold
- [x] **29.1.1.3** Create libs/demeter/core/project.json with Nx configuration
- [x] **29.1.1.4** Create libs/demeter/core/package.json with @demeter/core name
- [x] **29.1.1.5** Create libs/demeter/core/tsconfig.json extending base config
- [x] **29.1.1.6** Create libs/demeter/core/tsconfig.lib.json for library builds
- [x] **29.1.1.7** Create libs/demeter/core/tsconfig.spec.json for tests
- [x] **29.1.1.8** Create libs/demeter/core/vite.config.ts for Vitest
- [x] **29.1.1.9** Add @demeter/core path mapping to tsconfig.base.json
- [x] **29.1.1.10** Verify @demeter/core builds successfully

#### 29.1.2 Core Domain Models

- [x] **29.1.2.1** Create Garden entity with id, name, location, climate zone,
      area, type
- [x] **29.1.2.2** Create GardenBed entity with dimensions, soil type, sun
      exposure, irrigation
- [x] **29.1.2.3** Create Plant entity linking to encyclopedia with planting
      date, location, status
- [x] **29.1.2.4** Create Planting entity tracking individual plant instances in
      garden
- [x] **29.1.2.5** Create Harvest entity with yield, quality, date, plant
      reference
- [x] **29.1.2.6** Create Task entity with type, due date, recurrence,
      completion status
- [x] **29.1.2.7** Create Observation entity for journal entries with photos,
      notes, metrics
- [x] **29.1.2.8** Create Sensor entity with type, location, calibration,
      readings
- [x] **29.1.2.9** Create Alert entity for notifications, warnings, reminders
- [x] **29.1.2.10** Create User entity with preferences, location, experience
      level

#### 29.1.3 Core Value Objects

- [x] **29.1.3.1** Create ClimateZone value object (USDA, Köppen, custom zones)
- [x] **29.1.3.2** Create GeoLocation value object with lat/lng, elevation,
      aspect
- [x] **29.1.3.3** Create SoilComposition value object with type, pH, NPK,
      organic matter
- [x] **29.1.3.4** Create SunExposure value object (full sun, partial, shade,
      hours)
- [x] **29.1.3.5** Create WaterRequirement value object with frequency, amount,
      method
- [x] **29.1.3.6** Create GrowingConditions value object combining soil, sun,
      water, temp
- [x] **29.1.3.7** Create PlantSpacing value object with row spacing, plant
      spacing, depth
- [x] **29.1.3.8** Create HarvestWindow value object with start date, end date,
      peak
- [x] **29.1.3.9** Create NutrientProfile value object for fertilizer
      requirements
- [x] **29.1.3.10** Create TemperatureRange value object with min, max, optimal

#### 29.1.4 Core Enumerations

- [x] **29.1.4.1** Create PlantType enum (vegetable, fruit, herb, flower, tree,
      shrub, vine, grass)
- [x] **29.1.4.2** Create PlantLifecycle enum (annual, biennial, perennial)
- [x] **29.1.4.3** Create GrowthStage enum (seed, germination, seedling,
      vegetative, flowering, fruiting, harvest, dormant)
- [x] **29.1.4.4** Create SoilType enum (clay, sandy, loamy, silty, peaty,
      chalky)
- [x] **29.1.4.5** Create TaskType enum (water, fertilize, prune, harvest, weed,
      pest-control, plant, transplant)
- [x] **29.1.4.6** Create SensorType enum (moisture, temperature, humidity,
      light, pH, EC, flow)
- [x] **29.1.4.7** Create IrrigationType enum (drip, sprinkler, soaker, manual,
      flood)
- [x] **29.1.4.8** Create GardenType enum (in-ground, raised-bed, container,
      vertical, greenhouse, indoor)
- [x] **29.1.4.9** Create PestType enum (insect, mammal, bird, fungal,
      bacterial, viral)
- [x] **29.1.4.10** Create TreatmentType enum (organic, chemical, biological,
      mechanical, cultural)

#### 29.1.5 Core Services

- [x] **29.1.5.1** Create GardenService for CRUD operations on gardens
- [x] **29.1.5.2** Create PlantingService for managing plant instances
- [x] **29.1.5.3** Create TaskService for task scheduling and management
- [x] **29.1.5.4** Create HarvestService for tracking yields and quality
- [x] **29.1.5.5** Create ObservationService for journal entries
- [x] **29.1.5.6** Create AlertService for notifications and warnings
- [x] **29.1.5.7** Create SensorService for sensor data management
- [x] **29.1.5.8** Create CalendarService for date/time calculations
- [x] **29.1.5.9** Create UnitConversionService for metric/imperial conversions
- [x] **29.1.5.10** Create ValidationService for input validation

#### 29.1.6 Database Schema

- [x] **29.1.6.1** Create demeter database in PostgreSQL
- [x] **29.1.6.2** Create gardens table with all garden fields
- [x] **29.1.6.3** Create garden_beds table with dimensions and properties
- [x] **29.1.6.4** Create plantings table linking plants to beds
- [x] **29.1.6.5** Create harvests table for yield tracking
- [x] **29.1.6.6** Create tasks table with recurrence support
- [x] **29.1.6.7** Create observations table with JSONB for flexible data
- [x] **29.1.6.8** Create sensors table for IoT device registry
- [x] **29.1.6.9** Create sensor_readings table with TimescaleDB hypertable
- [x] **29.1.6.10** Create alerts table for notification history
- [x] **29.1.6.11** Create proper indexes for all query patterns
- [x] **29.1.6.12** Create database migrations using Drizzle ORM
- [x] **29.1.6.13** Create seed data for development and testing
- [x] **29.1.6.14** Implement soft delete for all entities
- [x] **29.1.6.15** Add audit columns (created_at, updated_at, created_by)

#### 29.1.7 Core Tests

- [x] **29.1.7.1** Write unit tests for all domain entities
- [x] **29.1.7.2** Write unit tests for all value objects
- [x] **29.1.7.3** Write unit tests for all enumerations
- [x] **29.1.7.4** Write unit tests for GardenService
- [x] **29.1.7.5** Write unit tests for PlantingService
- [x] **29.1.7.6** Write unit tests for TaskService
- [x] **29.1.7.7** Write unit tests for HarvestService
- [x] **29.1.7.8** Write unit tests for CalendarService
- [x] **29.1.7.9** Write unit tests for UnitConversionService
- [x] **29.1.7.10** Achieve 90%+ code coverage on @demeter/core

---

### 29.2 Plant Encyclopedia & Knowledge Base

#### 29.2.1 Encyclopedia Library Setup

- [x] **29.2.1.1** Create libs/demeter/plants/ directory structure
- [x] **29.2.1.2** Create libs/demeter/plants/project.json
- [x] **29.2.1.3** Create libs/demeter/plants/package.json as @demeter/plants
- [x] **29.2.1.4** Configure TypeScript and Vitest for plants library
- [x] **29.2.1.5** Add @demeter/plants path mapping to tsconfig.base.json
- [x] **29.2.1.6** Verify @demeter/plants builds successfully

#### 29.2.2 Plant Data Models

- [x] **29.2.2.1** Create PlantSpecies entity with botanical name, common names,
      family
- [x] **29.2.2.2** Create PlantVariety entity with cultivar info, hybrid status
- [x] **29.2.2.3** Create PlantTaxonomy entity with kingdom, phylum, class,
      order, family, genus
- [x] **29.2.2.4** Create GrowingRequirements entity with soil, sun, water,
      temperature needs
- [x] **29.2.2.5** Create PlantingInstructions entity with depth, spacing,
      timing
- [x] **29.2.2.6** Create CareGuide entity with watering, fertilizing, pruning
      schedules
- [x] **29.2.2.7** Create HarvestInfo entity with days to maturity, harvest
      signs, storage
- [x] **29.2.2.8** Create NutritionalInfo entity with vitamins, minerals,
      calories
- [x] **29.2.2.9** Create CulinaryUses entity with cooking methods, flavor
      profiles
- [x] **29.2.2.10** Create MedicinalUses entity with traditional and documented
      uses

#### 29.2.3 Companion Planting System

- [x] **29.2.3.1** Create CompanionRelationship entity with plant pairs and
      relationship type
- [x] **29.2.3.2** Implement beneficial companion matching algorithm
- [x] **29.2.3.3** Implement antagonistic plant detection
- [x] **29.2.3.4** Create trap cropping recommendations
- [x] **29.2.3.5** Create nurse plant relationships
- [x] **29.2.3.6** Implement Three Sisters planting patterns
- [x] **29.2.3.7** Create allelopathy warnings database
- [x] **29.2.3.8** Implement companion scoring algorithm
- [x] **29.2.3.9** Create guild planting recommendations (permaculture)
- [x] **29.2.3.10** Generate companion planting visualization charts

#### 29.2.4 Pest & Disease Database

- [x] **29.2.4.1** Create Pest entity with identification, lifecycle, damage
      patterns
- [x] **29.2.4.2** Create Disease entity with symptoms, causes, spread patterns
- [x] **29.2.4.3** Create Treatment entity with organic and chemical options
- [x] **29.2.4.4** Create Prevention entity with cultural practices
- [x] **29.2.4.5** Map pests to susceptible plants
- [x] **29.2.4.6** Map diseases to susceptible plants
- [x] **29.2.4.7** Create beneficial insect database
- [x] **29.2.4.8** Create biological control relationships
- [x] **29.2.4.9** Implement IPM (Integrated Pest Management) recommendations
- [x] **29.2.4.10** Create regional pest prevalence data

#### 29.2.5 Climate Zone System

- [x] **29.2.5.1** Implement USDA Plant Hardiness Zones (1a-13b)
- [x] **29.2.5.2** Implement Köppen climate classification
- [x] **29.2.5.3** Implement Sunset climate zones (Western US)
- [x] **29.2.5.4** Implement AHS Heat Zones
- [x] **29.2.5.5** Create first/last frost date database by location
- [x] **29.2.5.6** Create growing season length calculator
- [x] **29.2.5.7** Implement Growing Degree Days (GDD) calculator
- [x] **29.2.5.8** Create chill hours calculator for fruit trees
- [x] **29.2.5.9** Implement microclimate detection and adjustment
- [x] **29.2.5.10** Create zone-appropriate plant filtering

#### 29.2.6 Seasonal Calendar System

- [x] **29.2.6.1** Create planting calendar by zone and plant
- [x] **29.2.6.2** Create indoor seed starting schedule
- [x] **29.2.6.3** Create transplanting timeline calculator
- [x] **29.2.6.4** Create succession planting scheduler
- [x] **29.2.6.5** Create fall/winter planting calendar
- [x] **29.2.6.6** Create perennial care calendar (pruning, division)
- [x] **29.2.6.7** Create fruit tree care calendar
- [x] **29.2.6.8** Create lawn care calendar
- [x] **29.2.6.9** Create moon phase planting calendar (biodynamic)
- [x] **29.2.6.10** Generate printable seasonal calendars

#### 29.2.7 Plant Database Population

- [x] **29.2.7.1** Import vegetable database (500+ varieties)
- [x] **29.2.7.2** Import fruit database (300+ varieties)
- [x] **29.2.7.3** Import herb database (200+ varieties)
- [x] **29.2.7.4** Import flower database (1000+ varieties)
- [x] **29.2.7.5** Import tree database (500+ species)
- [x] **29.2.7.6** Import shrub database (400+ species)
- [x] **29.2.7.7** Import grass/groundcover database (200+ species)
- [x] **29.2.7.8** Import houseplant database (500+ species)
- [x] **29.2.7.9** Import native plant databases by region
- [x] **29.2.7.10** Validate all plant data for accuracy

#### 29.2.8 Search & Discovery

- [x] **29.2.8.1** Implement full-text search on plant names
- [x] **29.2.8.2** Implement faceted search (type, zone, sun, water)
- [x] **29.2.8.3** Create plant recommendation engine
- [x] **29.2.8.4** Implement "plants like this" similarity search
- [x] **29.2.8.5** Create beginner-friendly plant suggestions
- [x] **29.2.8.6** Create problem-solver search (shade, drought, deer-resistant)
- [x] **29.2.8.7** Implement search by harvest time
- [x] **29.2.8.8** Create pollinator-friendly plant filter
- [x] **29.2.8.9** Implement edible landscaping suggestions
- [x] **29.2.8.10** Create search history and favorites

#### 29.2.9 Encyclopedia Tests

- [x] **29.2.9.1** Write unit tests for PlantSpecies entity
- [x] **29.2.9.2** Write unit tests for companion planting algorithm
- [x] **29.2.9.3** Write unit tests for climate zone calculations
- [x] **29.2.9.4** Write unit tests for seasonal calendar
- [x] **29.2.9.5** Write unit tests for GDD calculator
- [x] **29.2.9.6** Write unit tests for search functionality
- [x] **29.2.9.7** Write integration tests for plant database queries
- [x] **29.2.9.8** Write tests for pest/disease matching
- [x] **29.2.9.9** Write tests for recommendation engine
- [x] **29.2.9.10** Achieve 90%+ code coverage on @demeter/plants

---

### 29.3 Garden Planning & Design

#### 29.3.1 Planner Library Setup

- [x] **29.3.1.1** Create libs/demeter/planner/ directory structure
- [x] **29.3.1.2** Create libs/demeter/planner/project.json
- [x] **29.3.1.3** Create libs/demeter/planner/package.json as @demeter/planner
- [x] **29.3.1.4** Configure TypeScript and Vitest for planner library
- [x] **29.3.1.5** Add @demeter/planner path mapping to tsconfig.base.json
- [x] **29.3.1.6** Verify @demeter/planner builds successfully

#### 29.3.2 Garden Layout Engine

- [x] **29.3.2.1** Create GardenCanvas entity with dimensions, scale, grid
- [x] **29.3.2.2** Create BedShape entity supporting rectangle, circle, polygon,
      L-shape
- [x] **29.3.2.3** Create PathElement entity for walkways and borders
- [x] **29.3.2.4** Create StructureElement entity for sheds, greenhouses, fences
- [x] **29.3.2.5** Create WaterFeature entity for irrigation, ponds, rain
      barrels
- [x] **29.3.2.6** Implement drag-and-drop placement system
- [x] **29.3.2.7** Implement snap-to-grid functionality
- [x] **29.3.2.8** Implement copy/paste for garden elements
- [x] **29.3.2.9** Implement undo/redo history (50 steps)
- [x] **29.3.2.10** Create layer system (beds, plants, structures, irrigation)

#### 29.3.3 Plant Placement System

- [x] **29.3.3.1** Implement square foot gardening grid overlay
- [x] **29.3.3.2** Implement row planting mode
- [x] **29.3.3.3** Implement broadcast/scatter planting visualization
- [x] **29.3.3.4** Calculate plants per square foot automatically
- [x] **29.3.3.5** Validate spacing requirements
- [x] **29.3.3.6** Show companion planting suggestions in context
- [x] **29.3.3.7** Warn on antagonistic plant placements
- [x] **29.3.3.8** Calculate total plants needed for bed
- [x] **29.3.3.9** Show mature plant size preview
- [x] **29.3.3.10** Implement vertical space planning (trellises, cages)

#### 29.3.4 Sun & Shadow Analysis

- [x] **29.3.4.1** Implement sun path calculation by latitude/date
- [x] **29.3.4.2** Create shadow casting from structures
- [x] **29.3.4.3** Create shadow casting from trees
- [x] **29.3.4.4** Calculate daily light integral (DLI) per zone
- [x] **29.3.4.5** Create seasonal sun exposure animation
- [x] **29.3.4.6** Identify full sun, partial shade, full shade zones
- [x] **29.3.4.7** Recommend plants based on light analysis
- [x] **29.3.4.8** Suggest optimal bed placement
- [x] **29.3.4.9** Account for building shadows
- [x] **29.3.4.10** Create sun hours heatmap visualization

#### 29.3.5 3D Visualization

- [x] **29.3.5.1** Create 3D garden renderer using Three.js
- [x] **29.3.5.2** Model raised beds in 3D
- [x] **29.3.5.3** Model plants with growth stages
- [x] **29.3.5.4** Model structures (greenhouse, shed, arbor)
- [x] **29.3.5.5** Implement camera controls (orbit, pan, zoom)
- [x] **29.3.5.6** Create walk-through mode
- [x] **29.3.5.7** Show seasonal growth animation
- [x] **29.3.5.8** Render realistic plant textures
- [x] **29.3.5.9** Add time-of-day lighting
- [x] **29.3.5.10** Export 3D renders as images/video

#### 29.3.6 Crop Rotation Planning

- [x] **29.3.6.1** Create PlantFamily groupings for rotation
- [x] **29.3.6.2** Track bed history by year
- [x] **29.3.6.3** Implement 4-year rotation calculator
- [x] **29.3.6.4** Warn on rotation violations
- [x] **29.3.6.5** Suggest rotation sequences
- [x] **29.3.6.6** Track nitrogen fixers vs heavy feeders
- [x] **29.3.6.7** Plan cover crop rotations
- [x] **29.3.6.8** Visualize multi-year rotation plan
- [x] **29.3.6.9** Account for perennials in rotation
- [x] **29.3.6.10** Generate printable rotation schedule

#### 29.3.7 Succession Planting

- [x] **29.3.7.1** Create succession planting calculator
- [x] **29.3.7.2** Calculate planting intervals for continuous harvest
- [x] **29.3.7.3** Schedule multiple sowings automatically
- [x] **29.3.7.4** Account for days to maturity variations
- [x] **29.3.7.5** Plan fall succession plantings
- [x] **29.3.7.6** Integrate with task scheduler
- [x] **29.3.7.7** Visualize harvest timeline
- [x] **29.3.7.8** Calculate seed quantities needed
- [x] **29.3.7.9** Track actual vs planned succession
- [x] **29.3.7.10** Suggest succession crops by space availability

#### 29.3.8 Garden Templates

- [x] **29.3.8.1** Create beginner vegetable garden template
- [x] **29.3.8.2** Create salsa garden template
- [x] **29.3.8.3** Create pizza garden template
- [x] **29.3.8.4** Create herb spiral template
- [x] **29.3.8.5** Create cutting flower garden template
- [x] **29.3.8.6** Create pollinator garden template
- [x] **29.3.8.7** Create permaculture guild templates
- [x] **29.3.8.8** Create raised bed configurations (4x4, 4x8, etc.)
- [x] **29.3.8.9** Create container garden templates
- [x] **29.3.8.10** Allow users to save/share custom templates

#### 29.3.9 Export & Printing

- [x] **29.3.9.1** Export garden plan as PDF
- [x] **29.3.9.2** Export garden plan as PNG/SVG
- [x] **29.3.9.3** Generate plant shopping list
- [x] **29.3.9.4** Generate seed order list with quantities
- [x] **29.3.9.5** Generate materials list (soil, amendments)
- [x] **29.3.9.6** Create printable bed labels
- [x] **29.3.9.7** Create printable row markers
- [x] **29.3.9.8** Export to common garden planning formats
- [x] **29.3.9.9** Generate planting calendar from plan
- [x] **29.3.9.10** Share plans via link

#### 29.3.10 Planner Tests

- [x] **29.3.10.1** Write unit tests for GardenCanvas
- [x] **29.3.10.2** Write unit tests for plant placement validation
- [x] **29.3.10.3** Write unit tests for sun path calculations
- [x] **29.3.10.4** Write unit tests for crop rotation logic
- [x] **29.3.10.5** Write unit tests for succession calculator
- [x] **29.3.10.6** Write integration tests for garden saving/loading
- [x] **29.3.10.7** Write visual regression tests for 2D rendering
- [x] **29.3.10.8** Write tests for export functionality
- [x] **29.3.10.9** Write tests for template system
- [x] **29.3.10.10** Achieve 90%+ code coverage on @demeter/planner

---

### 29.4 Task & Schedule Management

#### 29.4.1 Tasks Library Setup

- [x] **29.4.1.1** Create libs/demeter/tasks/ directory structure
- [x] **29.4.1.2** Create libs/demeter/tasks/project.json
- [x] **29.4.1.3** Create libs/demeter/tasks/package.json as @demeter/tasks
- [x] **29.4.1.4** Configure TypeScript and Vitest for tasks library
- [x] **29.4.1.5** Add @demeter/tasks path mapping to tsconfig.base.json
- [x] **29.4.1.6** Verify @demeter/tasks builds successfully

#### 29.4.2 Task Scheduling Engine

- [x] **29.4.2.1** Create TaskTemplate entity for reusable task patterns
- [x] **29.4.2.2** Create ScheduledTask entity with due date, recurrence
- [x] **29.4.2.3** Create TaskCompletion entity tracking task execution
- [x] **29.4.2.4** Implement daily recurrence patterns
- [x] **29.4.2.5** Implement weekly recurrence with day selection
- [x] **29.4.2.6** Implement monthly recurrence (day of month, week of month)
- [x] **29.4.2.7** Implement seasonal recurrence (spring, summer, fall, winter)
- [x] **29.4.2.8** Implement growth-stage-based task triggers
- [x] **29.4.2.9** Implement weather-based task adjustment
- [x] **29.4.2.10** Implement dependency chains between tasks

#### 29.4.3 Automated Task Generation

- [x] **29.4.3.1** Generate watering tasks based on plant needs and weather
- [x] **29.4.3.2** Generate fertilizing tasks based on plant schedules
- [x] **29.4.3.3** Generate pruning tasks based on plant type and season
- [x] **29.4.3.4** Generate harvest tasks based on maturity predictions
- [x] **29.4.3.5** Generate pest inspection tasks seasonally
- [x] **29.4.3.6** Generate soil testing reminders
- [x] **29.4.3.7** Generate seed starting tasks from planting calendar
- [x] **29.4.3.8** Generate transplanting tasks based on seedling age
- [x] **29.4.3.9** Generate winterization tasks before frost
- [x] **29.4.3.10** Generate spring preparation tasks

#### 29.4.4 Task Prioritization

- [x] **29.4.4.1** Implement urgency scoring based on due date
- [x] **29.4.4.2** Implement importance scoring based on task type
- [x] **29.4.4.3** Implement weather-adjusted priorities
- [x] **29.4.4.4** Implement plant health impact scoring
- [x] **29.4.4.5** Create "today's tasks" smart list
- [x] **29.4.4.6** Create "this week" task view
- [x] **29.4.4.7** Create overdue task handling
- [x] **29.4.4.8** Implement task batching by garden zone
- [x] **29.4.4.9** Implement task batching by task type
- [x] **29.4.4.10** Create quick-task suggestions based on available time

#### 29.4.5 Calendar Integration

- [x] **29.4.5.1** Export tasks to iCal format
- [x] **29.4.5.2** Sync with Google Calendar
- [x] **29.4.5.3** Sync with Apple Calendar
- [x] **29.4.5.4** Sync with Outlook Calendar
- [x] **29.4.5.5** Create calendar subscription feed
- [x] **29.4.5.6** Import events from external calendars
- [x] **29.4.5.7** Handle calendar conflicts
- [x] **29.4.5.8** Set task reminders via calendar
- [x] **29.4.5.9** Block time for garden tasks
- [x] **29.4.5.10** Integrate sunrise/sunset times

#### 29.4.6 Notification System

- [x] **29.4.6.1** Implement push notifications for mobile
- [x] **29.4.6.2** Implement email notifications
- [x] **29.4.6.3** Implement SMS notifications
- [x] **29.4.6.4** Create notification preferences per task type
- [x] **29.4.6.5** Create quiet hours configuration
- [x] **29.4.6.6** Implement notification snoozing
- [x] **29.4.6.7** Create digest notifications (daily/weekly summary)
- [x] **29.4.6.8** Implement critical alert override (frost warning)
- [x] **29.4.6.9** Create notification history log
- [x] **29.4.6.10** Implement read/acknowledged tracking

#### 29.4.7 Task Analytics

- [x] **29.4.7.1** Track task completion rates
- [x] **29.4.7.2** Track average time to complete by task type
- [x] **29.4.7.3** Identify frequently skipped tasks
- [x] **29.4.7.4** Calculate gardening time investment
- [x] **29.4.7.5** Track seasonal workload patterns
- [x] **29.4.7.6** Identify peak activity periods
- [x] **29.4.7.7** Generate productivity reports
- [x] **29.4.7.8** Compare planned vs actual task completion
- [x] **29.4.7.9** Predict future workload
- [x] **29.4.7.10** Suggest workload optimization

#### 29.4.8 Tasks Tests

- [x] **29.4.8.1** Write unit tests for recurrence patterns
- [x] **29.4.8.2** Write unit tests for task generation
- [x] **29.4.8.3** Write unit tests for prioritization algorithm
- [x] **29.4.8.4** Write unit tests for calendar export
- [x] **29.4.8.5** Write unit tests for notification scheduling
- [x] **29.4.8.6** Write integration tests for task persistence
- [x] **29.4.8.7** Write tests for weather-based adjustments
- [x] **29.4.8.8** Write tests for task analytics
- [x] **29.4.8.9** Write tests for dependency chains
- [x] **29.4.8.10** Achieve 90%+ code coverage on @demeter/tasks

---

### 29.5 Seed & Inventory Management

#### 29.5.1 Inventory Library Setup

- [x] **29.5.1.1** Create libs/demeter/inventory/ directory structure
- [x] **29.5.1.2** Create libs/demeter/inventory/project.json
- [x] **29.5.1.3** Create libs/demeter/inventory/package.json as
      @demeter/inventory
- [x] **29.5.1.4** Configure TypeScript and Vitest for inventory library
- [x] **29.5.1.5** Add @demeter/inventory path mapping to tsconfig.base.json
- [x] **29.5.1.6** Verify @demeter/inventory builds successfully

#### 29.5.2 Seed Inventory System

- [x] **29.5.2.1** Create SeedLot entity with variety, quantity, source, date
- [x] **29.5.2.2** Create SeedPacket entity with packet info, seed count
- [x] **29.5.2.3** Track seed viability by age and storage conditions
- [x] **29.5.2.4** Calculate germination rate estimates
- [x] **29.5.2.5** Track seed storage location
- [x] **29.5.2.6** Implement barcode/QR scanning for seed packets
- [x] **29.5.2.7** Track seeds used vs remaining
- [x] **29.5.2.8** Calculate seeds needed for garden plan
- [x] **29.5.2.9** Generate seed shopping list from gaps
- [x] **29.5.2.10** Track seed cost and value

#### 29.5.3 Seed Source Tracking

- [x] **29.5.3.1** Create SeedSupplier entity with company info, ratings
- [x] **29.5.3.2** Track supplier reliability ratings
- [x] **29.5.3.3** Track germination rates by supplier
- [x] **29.5.3.4** Store supplier catalogs and pricing
- [x] **29.5.3.5** Compare prices across suppliers
- [x] **29.5.3.6** Track organic/heirloom/hybrid certification
- [x] **29.5.3.7** Integrate with online seed catalogs
- [x] **29.5.3.8** Create wishlist functionality
- [x] **29.5.3.9** Track order history by supplier
- [x] **29.5.3.10** Set reorder alerts for favorite varieties

#### 29.5.4 Seed Saving System

- [x] **29.5.4.1** Create SeedSaving entity tracking saved seed batches
- [x] **29.5.4.2** Guide proper seed saving techniques by plant
- [x] **29.5.4.3** Track isolation distances for seed purity
- [x] **29.5.4.4** Calculate minimum population for genetic diversity
- [x] **29.5.4.5** Track seed drying and processing
- [x] **29.5.4.6** Generate seed saving calendar
- [x] **29.5.4.7** Track seed trades/gifts
- [x] **29.5.4.8** Calculate seed saving success rates
- [x] **29.5.4.9** Create seed saving guides by plant family
- [x] **29.5.4.10** Track generational seed lineage

#### 29.5.5 Plant Inventory

- [x] **29.5.5.1** Create PlantInventory entity for live plants
- [x] **29.5.5.2** Track potted plants awaiting transplant
- [x] **29.5.5.3** Track nursery purchases
- [x] **29.5.5.4** Track plant divisions and propagations
- [x] **29.5.5.5** Track plant gifts/trades
- [x] **29.5.5.6** Calculate nursery plant costs
- [x] **29.5.5.7** Track plant source reliability
- [x] **29.5.5.8** Manage hardening-off schedules
- [x] **29.5.5.9** Track plant health at acquisition
- [x] **29.5.5.10** Generate planting reminders for inventory

#### 29.5.6 Supply & Tool Inventory

- [x] **29.5.6.1** Create Supply entity for consumables (fertilizer, amendments)
- [x] **29.5.6.2** Create Tool entity for garden tools
- [x] **29.5.6.3** Track supply quantities and reorder points
- [x] **29.5.6.4** Track tool maintenance schedules
- [x] **29.5.6.5** Calculate supply usage rates
- [x] **29.5.6.6** Generate supply shopping lists
- [x] **29.5.6.7** Track tool lending/borrowing
- [x] **29.5.6.8** Store tool manuals and warranty info
- [x] **29.5.6.9** Track supply costs and budgeting
- [x] **29.5.6.10** Integrate with shopping platforms

#### 29.5.7 Inventory Tests

- [x] **29.5.7.1** Write unit tests for SeedLot entity
- [x] **29.5.7.2** Write unit tests for viability calculations
- [x] **29.5.7.3** Write unit tests for inventory tracking
- [x] **29.5.7.4** Write unit tests for shopping list generation
- [x] **29.5.7.5** Write unit tests for seed saving guides
- [x] **29.5.7.6** Write integration tests for barcode scanning
- [x] **29.5.7.7** Write tests for supplier integration
- [x] **29.5.7.8** Write tests for cost calculations
- [x] **29.5.7.9** Write tests for reorder alerts
- [x] **29.5.7.10** Achieve 90%+ code coverage on @demeter/inventory

---

### 29.6 Journal & Observation System

#### 29.6.1 Journal Library Setup

- [x] **29.6.1.1** Create libs/demeter/journal/ directory structure
- [x] **29.6.1.2** Create libs/demeter/journal/project.json
- [x] **29.6.1.3** Create libs/demeter/journal/package.json as @demeter/journal
- [x] **29.6.1.4** Configure TypeScript and Vitest for journal library
- [x] **29.6.1.5** Add @demeter/journal path mapping to tsconfig.base.json
- [x] **29.6.1.6** Verify @demeter/journal builds successfully

#### 29.6.2 Observation Data Model

- [x] **29.6.2.1** Create JournalEntry entity with date, type, content
- [x] **29.6.2.2** Create PlantObservation entity linked to specific plants
- [x] **29.6.2.3** Create WeatherObservation entity for daily conditions
- [x] **29.6.2.4** Create PestSighting entity with identification, location
- [x] **29.6.2.5** Create HarvestEntry entity with yield, quality notes
- [x] **29.6.2.6** Create PhotoEntry entity with image, tags, location
- [x] **29.6.2.7** Create MeasurementEntry for numeric observations
- [x] **29.6.2.8** Support rich text formatting (markdown)
- [x] **29.6.2.9** Support voice-to-text entry
- [x] **29.6.2.10** Support tagging and categorization

#### 29.6.3 Photo Management

- [x] **29.6.3.1** Implement photo capture from device camera
- [x] **29.6.3.2** Implement photo import from gallery
- [x] **29.6.3.3** Auto-extract EXIF data (date, location, camera)
- [x] **29.6.3.4** Implement photo compression and optimization
- [x] **29.6.3.5** Create photo timeline view
- [x] **29.6.3.6** Create photo gallery by plant
- [x] **29.6.3.7** Create photo gallery by location
- [x] **29.6.3.8** Implement photo comparison (before/after)
- [x] **29.6.3.9** Create timelapse generation from photos
- [x] **29.6.3.10** Implement AI-powered photo tagging

#### 29.6.4 Growth Tracking

- [x] **29.6.4.1** Track plant height over time
- [x] **29.6.4.2** Track leaf count/size
- [x] **29.6.4.3** Track flowering/fruiting stages
- [x] **29.6.4.4** Track color changes
- [x] **29.6.4.5** Create growth charts and visualizations
- [x] **29.6.4.6** Compare growth to expected patterns
- [x] **29.6.4.7** Identify growth anomalies
- [x] **29.6.4.8** Track days to germination
- [x] **29.6.4.9** Track days to first harvest
- [x] **29.6.4.10** Generate growth reports

#### 29.6.5 Harvest Logging

- [x] **29.6.5.1** Log harvest weight/count by plant
- [x] **29.6.5.2** Log harvest quality rating
- [x] **29.6.5.3** Log harvest destination (eaten, preserved, shared, sold)
- [x] **29.6.5.4** Calculate cumulative yields
- [x] **29.6.5.5** Compare yields year-over-year
- [x] **29.6.5.6** Calculate yield per plant
- [x] **29.6.5.7** Calculate yield per square foot
- [x] **29.6.5.8** Track peak harvest periods
- [x] **29.6.5.9** Estimate harvest value (vs store prices)
- [x] **29.6.5.10** Generate harvest summary reports

#### 29.6.6 Search & Discovery

- [x] **29.6.6.1** Full-text search across journal entries
- [x] **29.6.6.2** Filter by date range
- [x] **29.6.6.3** Filter by plant/garden/bed
- [x] **29.6.6.4** Filter by entry type
- [x] **29.6.6.5** Filter by tags
- [x] **29.6.6.6** Create "on this day" historical view
- [x] **29.6.6.7** Create timeline visualization
- [x] **29.6.6.8** Export journal to PDF
- [x] **29.6.6.9** Export journal to markdown
- [x] **29.6.6.10** Backup/restore journal data

#### 29.6.7 AI-Powered Insights

- [x] **29.6.7.1** Analyze observations for patterns
- [x] **29.6.7.2** Correlate observations with weather
- [x] **29.6.7.3** Identify potential problems from descriptions
- [x] **29.6.7.4** Suggest journal prompts
- [x] **29.6.7.5** Generate weekly summaries
- [x] **29.6.7.6** Highlight notable achievements
- [x] **29.6.7.7** Remind about incomplete observations
- [x] **29.6.7.8** Learn from past observations
- [x] **29.6.7.9** Predict future based on patterns
- [x] **29.6.7.10** Generate year-end garden retrospective

#### 29.6.8 Journal Tests

- [x] **29.6.8.1** Write unit tests for JournalEntry entity
- [x] **29.6.8.2** Write unit tests for observation types
- [x] **29.6.8.3** Write unit tests for photo processing
- [x] **29.6.8.4** Write unit tests for growth tracking
- [x] **29.6.8.5** Write unit tests for harvest calculations
- [x] **29.6.8.6** Write unit tests for search functionality
- [x] **29.6.8.7** Write integration tests for photo storage
- [x] **29.6.8.8** Write tests for AI insights
- [x] **29.6.8.9** Write tests for export functionality
- [x] **29.6.8.10** Achieve 90%+ code coverage on @demeter/journal

---

### 29.7 IoT & Sensor Integration

#### 29.7.1 Sensors Library Setup

- [x] **29.7.1.1** Create libs/demeter/sensors/ directory structure
- [x] **29.7.1.2** Create libs/demeter/sensors/project.json
- [x] **29.7.1.3** Create libs/demeter/sensors/package.json as @demeter/sensors
- [x] **29.7.1.4** Configure TypeScript and Vitest for sensors library
- [x] **29.7.1.5** Add @demeter/sensors path mapping to tsconfig.base.json
- [x] **29.7.1.6** Verify @demeter/sensors builds successfully

#### 29.7.2 Device Management

- [x] **29.7.2.1** Create Device entity with id, type, name, location, status
- [x] **29.7.2.2** Create DeviceCapability entity describing sensor/actuator
      functions
- [x] **29.7.2.3** Create DeviceConfiguration entity for settings
- [x] **29.7.2.4** Implement device discovery protocols
- [x] **29.7.2.5** Implement device pairing workflow
- [x] **29.7.2.6** Implement device naming and organization
- [x] **29.7.2.7** Track device battery levels
- [x] **29.7.2.8** Track device connectivity status
- [x] **29.7.2.9** Implement device firmware updates
- [x] **29.7.2.10** Handle device replacement/migration

#### 29.7.3 Protocol Adapters

- [x] **29.7.3.1** Implement MQTT protocol adapter
- [x] **29.7.3.2** Implement Zigbee protocol adapter (via zigbee2mqtt)
- [x] **29.7.3.3** Implement Z-Wave protocol adapter
- [x] **29.7.3.4** Implement Matter protocol adapter
- [x] **29.7.3.5** Implement Thread protocol adapter
- [x] **29.7.3.6** Implement WiFi direct device adapter
- [x] **29.7.3.7** Implement Bluetooth/BLE adapter
- [x] **29.7.3.8** Implement LoRa/LoRaWAN adapter
- [x] **29.7.3.9** Create protocol-agnostic device interface
- [x] **29.7.3.10** Handle protocol bridging between networks

#### 29.7.4 Sensor Data Collection

- [x] **29.7.4.1** Create SensorReading entity with timestamp, value, unit
- [x] **29.7.4.2** Implement soil moisture sensor support
- [x] **29.7.4.3** Implement soil temperature sensor support
- [x] **29.7.4.4** Implement soil pH sensor support
- [x] **29.7.4.5** Implement soil EC/conductivity sensor support
- [x] **29.7.4.6** Implement air temperature sensor support
- [x] **29.7.4.7** Implement humidity sensor support
- [x] **29.7.4.8** Implement light level (lux/PAR) sensor support
- [x] **29.7.4.9** Implement rain gauge sensor support
- [x] **29.7.4.10** Implement wind speed/direction sensor support

#### 29.7.5 Time-Series Data Storage

- [x] **29.7.5.1** Configure TimescaleDB hypertable for sensor data
- [x] **29.7.5.2** Implement data retention policies
- [x] **29.7.5.3** Implement data aggregation (hourly, daily, weekly)
- [x] **29.7.5.4** Implement data compression for old data
- [x] **29.7.5.5** Create efficient query patterns for time ranges
- [x] **29.7.5.6** Implement real-time data streaming
- [x] **29.7.5.7** Handle out-of-order data arrival
- [x] **29.7.5.8** Implement data validation and outlier detection
- [x] **29.7.5.9** Create data export functionality
- [x] **29.7.5.10** Implement data backup and recovery

#### 29.7.6 Sensor Calibration

- [x] **29.7.6.1** Create calibration workflow for each sensor type
- [x] **29.7.6.2** Implement soil moisture calibration (wet/dry points)
- [x] **29.7.6.3** Implement pH meter calibration (buffer solutions)
- [x] **29.7.6.4** Implement EC meter calibration
- [x] **29.7.6.5** Implement light sensor calibration
- [x] **29.7.6.6** Track calibration history
- [x] **29.7.6.7** Set calibration reminders
- [x] **29.7.6.8** Apply calibration offsets to readings
- [x] **29.7.6.9** Validate calibration accuracy
- [x] **29.7.6.10** Handle sensor drift over time

#### 29.7.7 Commercial Device Integration

- [x] **29.7.7.1** Integrate Gardena Smart System
- [x] **29.7.7.2** Integrate Rachio smart irrigation
- [x] **29.7.7.3** Integrate Orbit B-hyve
- [x] **29.7.7.4** Integrate Hunter Hydrawise
- [x] **29.7.7.5** Integrate PlantLink sensors
- [x] **29.7.7.6** Integrate Parrot Flower Power (legacy)
- [x] **29.7.7.7** Integrate Ecowitt weather stations
- [x] **29.7.7.8** Integrate Ambient Weather stations
- [x] **29.7.7.9** Integrate Davis Instruments weather stations
- [x] **29.7.7.10** Create integration SDK for third parties

#### 29.7.8 DIY Sensor Support

- [x] **29.7.8.1** Create ESP32/ESP8266 firmware templates
- [x] **29.7.8.2** Support capacitive soil moisture sensors
- [x] **29.7.8.3** Support DS18B20 temperature sensors
- [x] **29.7.8.4** Support DHT22/BME280 environment sensors
- [x] **29.7.8.5** Support BH1750 light sensors
- [x] **29.7.8.6** Support tipping bucket rain gauges
- [x] **29.7.8.7** Create wiring diagrams and guides
- [x] **29.7.8.8** Create 3D printable enclosure designs
- [x] **29.7.8.9** Support solar-powered sensor nodes
- [x] **29.7.8.10** Create sensor node assembly guides

#### 29.7.9 Smart Home Integration

- [x] **29.7.9.1** Create Home Assistant integration
- [x] **29.7.9.2** Create OpenHAB integration
- [x] **29.7.9.3** Create Hubitat integration
- [x] **29.7.9.4** Create SmartThings integration
- [x] **29.7.9.5** Create Apple HomeKit bridge
- [x] **29.7.9.6** Create Google Home integration
- [x] **29.7.9.7** Create Amazon Alexa integration
- [x] **29.7.9.8** Export sensor data to home automation
- [x] **29.7.9.9** Import external sensor data
- [x] **29.7.9.10** Sync automations bidirectionally

#### 29.7.10 Sensors Tests

- [x] **29.7.10.1** Write unit tests for Device entity
- [x] **29.7.10.2** Write unit tests for protocol adapters
- [x] **29.7.10.3** Write unit tests for SensorReading entity
- [x] **29.7.10.4** Write unit tests for calibration logic
- [x] **29.7.10.5** Write unit tests for data aggregation
- [x] **29.7.10.6** Write integration tests for MQTT
- [x] **29.7.10.7** Write integration tests for TimescaleDB
- [x] **29.7.10.8** Write tests for commercial integrations
- [x] **29.7.10.9** Write tests for home automation sync
- [x] **29.7.10.10** Achieve 90%+ code coverage on @demeter/sensors

---

### 29.8 Automation & Rules Engine

#### 29.8.1 Automation Library Setup

- [x] **29.8.1.1** Create libs/demeter/automation/ directory structure
- [x] **29.8.1.2** Create libs/demeter/automation/project.json
- [x] **29.8.1.3** Create libs/demeter/automation/package.json as
      @demeter/automation
- [x] **29.8.1.4** Configure TypeScript and Vitest for automation library
- [x] **29.8.1.5** Add @demeter/automation path mapping to tsconfig.base.json
- [x] **29.8.1.6** Verify @demeter/automation builds successfully

#### 29.8.2 Rules Engine Core

- [x] **29.8.2.1** Create Rule entity with conditions, actions, enabled state
- [x] **29.8.2.2** Create Condition entity with sensor, operator, threshold
- [x] **29.8.2.3** Create Action entity with device, command, parameters
- [x] **29.8.2.4** Implement AND/OR condition grouping
- [x] **29.8.2.5** Implement NOT condition negation
- [x] **29.8.2.6** Implement time-based conditions (time of day, day of week)
- [x] **29.8.2.7** Implement weather-based conditions
- [x] **29.8.2.8** Implement sensor threshold conditions
- [x] **29.8.2.9** Implement rate-of-change conditions
- [x] **29.8.2.10** Implement cooldown/debounce for rules

#### 29.8.3 Irrigation Automation

- [x] **29.8.3.1** Create IrrigationZone entity with valves, plants, sensors
- [x] **29.8.3.2** Implement moisture-based watering triggers
- [x] **29.8.3.3** Implement weather-adjusted watering (skip if rain)
- [x] **29.8.3.4** Implement ET-based watering calculations
- [x] **29.8.3.5** Implement cycle-and-soak for clay soils
- [x] **29.8.3.6** Implement seasonal watering adjustments
- [x] **29.8.3.7** Implement plant growth stage adjustments
- [x] **29.8.3.8** Create watering schedules by zone
- [x] **29.8.3.9** Track water usage per zone
- [x] **29.8.3.10** Implement water budget management

#### 29.8.4 Climate Control Automation

- [x] **29.8.4.1** Create Greenhouse entity with climate controls
- [x] **29.8.4.2** Implement temperature-triggered vent control
- [x] **29.8.4.3** Implement humidity-triggered fan control
- [x] **29.8.4.4** Implement shade cloth automation
- [x] **29.8.4.5** Implement heater control for frost protection
- [x] **29.8.4.6** Implement grow light scheduling
- [x] **29.8.4.7** Implement DLI-based supplemental lighting
- [x] **29.8.4.8** Create climate profiles by crop type
- [x] **29.8.4.9** Implement night/day mode transitions
- [x] **29.8.4.10** Track energy usage for climate control

#### 29.8.5 Alert Automation

- [x] **29.8.5.1** Create AlertRule entity for notification triggers
- [x] **29.8.5.2** Implement frost warning alerts
- [x] **29.8.5.3** Implement drought condition alerts
- [x] **29.8.5.4** Implement overwatering alerts
- [x] **29.8.5.5** Implement sensor malfunction alerts
- [x] **29.8.5.6** Implement device offline alerts
- [x] **29.8.5.7** Implement unusual reading alerts
- [x] **29.8.5.8** Implement scheduled check-in reminders
- [x] **29.8.5.9** Configure alert severity levels
- [x] **29.8.5.10** Implement alert escalation paths

#### 29.8.6 Scene Management

- [x] **29.8.6.1** Create Scene entity grouping multiple actions
- [x] **29.8.6.2** Implement "Morning Routine" scene template
- [x] **29.8.6.3** Implement "Evening Shutdown" scene template
- [x] **29.8.6.4** Implement "Vacation Mode" scene
- [x] **29.8.6.5** Implement "Storm Preparation" scene
- [x] **29.8.6.6** Implement "Frost Protection" scene
- [x] **29.8.6.7** Allow custom scene creation
- [x] **29.8.6.8** Implement scene scheduling
- [x] **29.8.6.9** Implement scene triggers from voice assistants
- [x] **29.8.6.10** Track scene execution history

#### 29.8.7 Automation History & Analytics

- [x] **29.8.7.1** Log all rule executions with context
- [x] **29.8.7.2** Log all actions taken with results
- [x] **29.8.7.3** Track automation success/failure rates
- [x] **29.8.7.4** Calculate water savings from smart irrigation
- [x] **29.8.7.5** Calculate energy usage from automations
- [x] **29.8.7.6** Identify underperforming rules
- [x] **29.8.7.7** Suggest rule optimizations
- [x] **29.8.7.8** Generate automation reports
- [x] **29.8.7.9** Compare manual vs automated performance
- [x] **29.8.7.10** Predict automation impact

#### 29.8.8 Automation Tests

- [x] **29.8.8.1** Write unit tests for Rule entity
- [x] **29.8.8.2** Write unit tests for condition evaluation
- [x] **29.8.8.3** Write unit tests for action execution
- [x] **29.8.8.4** Write unit tests for irrigation calculations
- [x] **29.8.8.5** Write unit tests for climate control
- [x] **29.8.8.6** Write unit tests for alert triggers
- [x] **29.8.8.7** Write integration tests for rule engine
- [x] **29.8.8.8** Write tests for scene management
- [x] **29.8.8.9** Write tests for history logging
- [x] **29.8.8.10** Achieve 90%+ code coverage on @demeter/automation

---

### 29.9 AI/ML Intelligence

#### 29.9.1 Intelligence Library Setup

- [x] **29.9.1.1** Create libs/demeter/intelligence/ directory structure
- [x] **29.9.1.2** Create libs/demeter/intelligence/project.json
- [x] **29.9.1.3** Create libs/demeter/intelligence/package.json as
      @demeter/intelligence
- [x] **29.9.1.4** Configure TypeScript and Vitest for intelligence library
- [x] **29.9.1.5** Add @demeter/intelligence path mapping to tsconfig.base.json
- [x] **29.9.1.6** Verify @demeter/intelligence builds successfully

#### 29.9.2 Plant Identification

- [x] **29.9.2.1** Integrate plant identification model (PlantNet API)
- [x] **29.9.2.2** Integrate Google Cloud Vision for plant ID
- [x] **29.9.2.3** Implement on-device plant ID (TensorFlow Lite)
- [x] **29.9.2.4** Support identification from leaf photos
- [x] **29.9.2.5** Support identification from flower photos
- [x] **29.9.2.6** Support identification from fruit photos
- [x] **29.9.2.7** Support identification from bark/stem photos
- [x] **29.9.2.8** Return confidence scores for identifications
- [x] **29.9.2.9** Link identifications to plant encyclopedia
- [x] **29.9.2.10** Allow user correction of identifications

#### 29.9.3 Disease Detection

- [x] **29.9.3.1** Train/integrate leaf disease detection model
- [x] **29.9.3.2** Support detection of fungal diseases
- [x] **29.9.3.3** Support detection of bacterial diseases
- [x] **29.9.3.4** Support detection of viral diseases
- [x] **29.9.3.5** Support detection of nutrient deficiencies
- [x] **29.9.3.6** Support detection of environmental stress
- [x] **29.9.3.7** Provide severity assessments
- [x] **29.9.3.8** Link to treatment recommendations
- [x] **29.9.3.9** Track disease spread over time
- [x] **29.9.3.10** Generate disease reports

#### 29.9.4 Pest Identification

- [x] **29.9.4.1** Train/integrate pest identification model
- [x] **29.9.4.2** Identify common garden insects
- [x] **29.9.4.3** Distinguish beneficial vs harmful insects
- [x] **29.9.4.4** Identify pest damage patterns
- [x] **29.9.4.5** Identify rodent/mammal damage
- [x] **29.9.4.6** Identify bird damage
- [x] **29.9.4.7** Link to treatment recommendations
- [x] **29.9.4.8** Track pest populations over time
- [x] **29.9.4.9** Predict pest outbreaks
- [x] **29.9.4.10** Generate pest reports

#### 29.9.5 Growth Prediction

- [x] **29.9.5.1** Create growth prediction model architecture
- [x] **29.9.5.2** Train on historical growth data
- [x] **29.9.5.3** Incorporate weather forecasts
- [x] **29.9.5.4** Incorporate soil sensor data
- [x] **29.9.5.5** Predict days to germination
- [x] **29.9.5.6** Predict days to harvest
- [x] **29.9.5.7** Predict yield amounts
- [x] **29.9.5.8** Predict flowering dates
- [x] **29.9.5.9** Account for variety-specific patterns
- [x] **29.9.5.10** Continuously improve with user data

#### 29.9.6 Personalized Recommendations

- [x] **29.9.6.1** Create recommendation engine architecture
- [x] **29.9.6.2** Analyze user's garden conditions
- [x] **29.9.6.3** Analyze user's experience level
- [x] **29.9.6.4** Analyze user's goals and preferences
- [x] **29.9.6.5** Recommend plants to grow
- [x] **29.9.6.6** Recommend optimal planting times
- [x] **29.9.6.7** Recommend care actions
- [x] **29.9.6.8** Recommend garden improvements
- [x] **29.9.6.9** Learn from user feedback
- [x] **29.9.6.10** Explain recommendation reasoning

#### 29.9.7 Anomaly Detection

- [x] **29.9.7.1** Create anomaly detection for sensor data
- [x] **29.9.7.2** Detect unusual moisture patterns
- [x] **29.9.7.3** Detect unusual temperature patterns
- [x] **29.9.7.4** Detect sensor malfunctions
- [x] **29.9.7.5** Detect irrigation system issues
- [x] **29.9.7.6** Detect plant stress early
- [x] **29.9.7.7** Alert on detected anomalies
- [x] **29.9.7.8** Learn normal patterns per location
- [x] **29.9.7.9** Reduce false positives over time
- [x] **29.9.7.10** Explain anomaly context

#### 29.9.8 Natural Language Interface

- [x] **29.9.8.1** Integrate LLM for garden assistant
- [x] **29.9.8.2** Answer gardening questions
- [x] **29.9.8.3** Provide plant care advice
- [x] **29.9.8.4** Diagnose problems from descriptions
- [x] **29.9.8.5** Generate planting plans from requests
- [x] **29.9.8.6** Create tasks from natural language
- [x] **29.9.8.7** Summarize garden status
- [x] **29.9.8.8** Support voice interaction
- [x] **29.9.8.9** Maintain conversation context
- [x] **29.9.8.10** Learn user preferences

#### 29.9.9 Model Management

- [x] **29.9.9.1** Implement model versioning
- [x] **29.9.9.2** Implement A/B testing for models
- [x] **29.9.9.3** Track model performance metrics
- [x] **29.9.9.4** Implement model updates
- [x] **29.9.9.5** Support offline model inference
- [x] **29.9.9.6** Optimize model size for mobile
- [x] **29.9.9.7** Implement model caching
- [x] **29.9.9.8** Handle graceful degradation
- [x] **29.9.9.9** Monitor inference latency
- [x] **29.9.9.10** Track API costs for cloud models

#### 29.9.10 Intelligence Tests

- [x] **29.9.10.1** Write unit tests for plant identification
- [x] **29.9.10.2** Write unit tests for disease detection
- [x] **29.9.10.3** Write unit tests for pest identification
- [x] **29.9.10.4** Write unit tests for growth prediction
- [x] **29.9.10.5** Write unit tests for recommendation engine
- [x] **29.9.10.6** Write unit tests for anomaly detection
- [x] **29.9.10.7** Write integration tests for LLM interface
- [x] **29.9.10.8** Write accuracy benchmarks for models
- [x] **29.9.10.9** Write performance tests for inference
- [x] **29.9.10.10** Achieve 90%+ code coverage on @demeter/intelligence

---

### 29.10 Weather Integration

#### 29.10.1 Weather Library Setup

- [x] **29.10.1.1** Create libs/demeter/weather/ directory structure
- [x] **29.10.1.2** Create libs/demeter/weather/project.json
- [x] **29.10.1.3** Create libs/demeter/weather/package.json as @demeter/weather
- [x] **29.10.1.4** Configure TypeScript and Vitest for weather library
- [x] **29.10.1.5** Add @demeter/weather path mapping to tsconfig.base.json
- [x] **29.10.1.6** Verify @demeter/weather builds successfully

#### 29.10.2 Weather Data Sources

- [x] **29.10.2.1** Integrate OpenWeatherMap API
- [x] **29.10.2.2** Integrate Weather.gov API (US)
- [x] **29.10.2.3** Integrate Tomorrow.io API
- [x] **29.10.2.4** Integrate Visual Crossing API
- [x] **29.10.2.5** Integrate local weather station data
- [x] **29.10.2.6** Create unified weather data model
- [x] **29.10.2.7** Implement data source fallback
- [x] **29.10.2.8** Cache weather data appropriately
- [x] **29.10.2.9** Handle API rate limits
- [x] **29.10.2.10** Normalize data across sources

#### 29.10.3 Current Conditions

- [x] **29.10.3.1** Fetch current temperature
- [x] **29.10.3.2** Fetch current humidity
- [x] **29.10.3.3** Fetch current wind speed/direction
- [x] **29.10.3.4** Fetch current precipitation
- [x] **29.10.3.5** Fetch current cloud cover
- [x] **29.10.3.6** Fetch current UV index
- [x] **29.10.3.7** Fetch current barometric pressure
- [x] **29.10.3.8** Calculate feels-like temperature
- [x] **29.10.3.9** Calculate dew point
- [x] **29.10.3.10** Display current conditions widget

#### 29.10.4 Forecasting

- [x] **29.10.4.1** Fetch hourly forecast (48 hours)
- [x] **29.10.4.2** Fetch daily forecast (14 days)
- [x] **29.10.4.3** Fetch extended outlook (30 days)
- [x] **29.10.4.4** Calculate precipitation probability
- [x] **29.10.4.5** Calculate frost probability
- [x] **29.10.4.6** Calculate high/low temperatures
- [x] **29.10.4.7** Create gardening-focused forecast summary
- [x] **29.10.4.8** Identify optimal planting windows
- [x] **29.10.4.9** Identify optimal spraying windows
- [x] **29.10.4.10** Predict soil temperature from air temp

#### 29.10.5 Weather Alerts

- [x] **29.10.5.1** Fetch NWS weather alerts (US)
- [x] **29.10.5.2** Implement frost/freeze warnings
- [x] **29.10.5.3** Implement heat advisory warnings
- [x] **29.10.5.4** Implement severe storm warnings
- [x] **29.10.5.5** Implement flood warnings
- [x] **29.10.5.6** Implement drought monitoring
- [x] **29.10.5.7** Implement wind advisories
- [x] **29.10.5.8** Create custom alert thresholds
- [x] **29.10.5.9** Deliver alerts via notifications
- [x] **29.10.5.10** Suggest protective actions

#### 29.10.6 Historical Weather

- [x] **29.10.6.1** Store historical weather data
- [x] **29.10.6.2** Fetch historical data for location
- [x] **29.10.6.3** Calculate historical averages
- [x] **29.10.6.4** Calculate first/last frost dates
- [x] **29.10.6.5** Calculate growing season length
- [x] **29.10.6.6** Calculate average rainfall by month
- [x] **29.10.6.7** Compare current year to averages
- [x] **29.10.6.8** Identify weather trends
- [x] **29.10.6.9** Generate historical weather reports
- [x] **29.10.6.10** Use historical data for predictions

#### 29.10.7 Growing Degree Days

- [x] **29.10.7.1** Calculate GDD from weather data
- [x] **29.10.7.2** Support multiple base temperatures
- [x] **29.10.7.3** Track cumulative GDD by season
- [x] **29.10.7.4** Predict plant development stages
- [x] **29.10.7.5** Predict pest emergence
- [x] **29.10.7.6** Predict harvest timing
- [x] **29.10.7.7** Compare GDD to plant requirements
- [x] **29.10.7.8** Visualize GDD accumulation
- [x] **29.10.7.9** Alert on GDD milestones
- [x] **29.10.7.10** Generate GDD reports

#### 29.10.8 Weather Tests

- [x] **29.10.8.1** Write unit tests for weather data model
- [x] **29.10.8.2** Write unit tests for API integrations
- [x] **29.10.8.3** Write unit tests for forecast processing
- [x] **29.10.8.4** Write unit tests for alert handling
- [x] **29.10.8.5** Write unit tests for GDD calculations
- [x] **29.10.8.6** Write unit tests for historical analysis
- [x] **29.10.8.7** Write integration tests for weather fetching
- [x] **29.10.8.8** Write tests for caching behavior
- [x] **29.10.8.9** Write tests for fallback logic
- [x] **29.10.8.10** Achieve 90%+ code coverage on @demeter/weather

---

### 29.11 Community & Social Features

#### 29.11.1 Community Library Setup

- [x] **29.11.1.1** Create libs/demeter/community/ directory structure
- [x] **29.11.1.2** Create libs/demeter/community/project.json
- [x] **29.11.1.3** Create libs/demeter/community/package.json as
      @demeter/community
- [x] **29.11.1.4** Configure TypeScript and Vitest for community library
- [x] **29.11.1.5** Add @demeter/community path mapping to tsconfig.base.json
- [x] **29.11.1.6** Verify @demeter/community builds successfully

#### 29.11.2 User Profiles

- [x] **29.11.2.1** Create GardenerProfile entity with bio, location, experience
- [x] **29.11.2.2** Implement profile photo upload
- [x] **29.11.2.3** Display gardening achievements/badges
- [x] **29.11.2.4** Show garden statistics (plants, harvests, etc.)
- [x] **29.11.2.5** Implement privacy controls for profile data
- [x] **29.11.2.6** Create public profile view
- [x] **29.11.2.7** Implement follow/follower system
- [x] **29.11.2.8** Create activity feed
- [x] **29.11.2.9** Track gardening milestones
- [x] **29.11.2.10** Create gardener search/discovery

#### 29.11.3 Seed & Plant Exchange

- [x] **29.11.3.1** Create ExchangeListing entity for offers/wants
- [x] **29.11.3.2** Implement seed swap listings
- [x] **29.11.3.3** Implement plant division offers
- [x] **29.11.3.4** Implement produce sharing
- [x] **29.11.3.5** Create messaging system for exchanges
- [x] **29.11.3.6** Implement location-based search
- [x] **29.11.3.7** Track exchange history
- [x] **29.11.3.8** Implement reputation/rating system
- [x] **29.11.3.9** Create wishlist matching notifications
- [x] **29.11.3.10** Generate exchange activity reports

#### 29.11.4 Local Groups

- [x] **29.11.4.1** Create GardenGroup entity for communities
- [x] **29.11.4.2** Implement group creation and management
- [x] **29.11.4.3** Implement group membership (public/private)
- [x] **29.11.4.4** Create group discussion boards
- [x] **29.11.4.5** Create group events calendar
- [x] **29.11.4.6** Implement group resource sharing
- [x] **29.11.4.7** Create community garden management features
- [x] **29.11.4.8** Implement group polls/voting
- [x] **29.11.4.9** Create group photo galleries
- [x] **29.11.4.10** Implement group announcements

#### 29.11.5 Expert Network

- [x] **29.11.5.1** Create ExpertProfile entity for verified experts
- [x] **29.11.5.2** Implement master gardener verification
- [x] **29.11.5.3** Implement extension agent profiles
- [x] **29.11.5.4** Create Q&A system for expert answers
- [x] **29.11.5.5** Implement expert consultation scheduling
- [x] **29.11.5.6** Create expert-led workshops/webinars
- [x] **29.11.5.7** Implement expert article publishing
- [x] **29.11.5.8** Create expert ratings and reviews
- [x] **29.11.5.9** Track expert response metrics
- [x] **29.11.5.10** Implement expert matchmaking

#### 29.11.6 Content Sharing

- [x] **29.11.6.1** Implement garden progress sharing
- [x] **29.11.6.2** Implement harvest photo sharing
- [x] **29.11.6.3** Implement garden plan sharing
- [x] **29.11.6.4** Create social media integration (share to)
- [x] **29.11.6.5** Implement garden tours/walkthroughs
- [x] **29.11.6.6** Create tip/trick sharing
- [x] **29.11.6.7** Implement success story features
- [x] **29.11.6.8** Create challenge/competition system
- [x] **29.11.6.9** Implement content moderation
- [x] **29.11.6.10** Create featured content curation

#### 29.11.7 Local Resources

- [x] **29.11.7.1** Create business directory for nurseries
- [x] **29.11.7.2** Create directory for farmers markets
- [x] **29.11.7.3** Create directory for garden centers
- [x] **29.11.7.4** Create directory for landscapers
- [x] **29.11.7.5** Create directory for extension offices
- [x] **29.11.7.6** Implement business reviews
- [x] **29.11.7.7** Track business inventory/availability
- [x] **29.11.7.8** Create deals/promotions system
- [x] **29.11.7.9** Implement business claiming/verification
- [x] **29.11.7.10** Create local events calendar

#### 29.11.8 Community Tests

- [x] **29.11.8.1** Write unit tests for GardenerProfile
- [x] **29.11.8.2** Write unit tests for exchange system
- [x] **29.11.8.3** Write unit tests for groups
- [x] **29.11.8.4** Write unit tests for expert network
- [x] **29.11.8.5** Write unit tests for content sharing
- [x] **29.11.8.6** Write integration tests for messaging
- [x] **29.11.8.7** Write tests for moderation
- [x] **29.11.8.8** Write tests for privacy controls
- [x] **29.11.8.9** Write tests for search/discovery
- [x] **29.11.8.10** Achieve 90%+ code coverage on @demeter/community

---

### 29.12 Hydroponics & Advanced Growing Systems

#### 29.12.1 Hydroponics Library Setup

- [x] **29.12.1.1** Create libs/demeter/hydroponics/ directory structure
- [x] **29.12.1.2** Create libs/demeter/hydroponics/project.json
- [x] **29.12.1.3** Create libs/demeter/hydroponics/package.json as
      @demeter/hydroponics
- [x] **29.12.1.4** Configure TypeScript and Vitest for hydroponics library
- [x] **29.12.1.5** Add @demeter/hydroponics path mapping to tsconfig.base.json
- [x] **29.12.1.6** Verify @demeter/hydroponics builds successfully

#### 29.12.2 Hydroponic System Management

- [x] **29.12.2.1** Create HydroponicSystem entity with type, capacity, plants
- [x] **29.12.2.2** Support NFT (Nutrient Film Technique) systems
- [x] **29.12.2.3** Support DWC (Deep Water Culture) systems
- [x] **29.12.2.4** Support Ebb and Flow systems
- [x] **29.12.2.5** Support Drip systems
- [x] **29.12.2.6** Support Aeroponic systems
- [x] **29.12.2.7** Support Kratky method (passive)
- [x] **29.12.2.8** Support Wick systems
- [x] **29.12.2.9** Track system components and maintenance
- [x] **29.12.2.10** Create system setup guides

#### 29.12.3 Nutrient Management

- [x] **29.12.3.1** Create NutrientSolution entity with composition
- [x] **29.12.3.2** Track EC (electrical conductivity) levels
- [x] **29.12.3.3** Track pH levels
- [x] **29.12.3.4** Track TDS (total dissolved solids)
- [x] **29.12.3.5** Create nutrient mixing calculators
- [x] **29.12.3.6** Schedule nutrient solution changes
- [x] **29.12.3.7** Track nutrient consumption rates
- [x] **29.12.3.8** Create plant-specific nutrient profiles
- [x] **29.12.3.9** Implement deficiency detection from EC/pH
- [x] **29.12.3.10** Generate nutrient purchase lists

#### 29.12.4 Reservoir Management

- [x] **29.12.4.1** Create Reservoir entity with capacity, sensors
- [x] **29.12.4.2** Track water level
- [x] **29.12.4.3** Track water temperature
- [x] **29.12.4.4** Implement auto-dosing integration
- [x] **29.12.4.5** Implement auto-pH adjustment
- [x] **29.12.4.6** Schedule reservoir cleaning
- [x] **29.12.4.7** Track water usage
- [x] **29.12.4.8** Implement reservoir heater/chiller control
- [x] **29.12.4.9** Create reservoir maintenance reminders
- [x] **29.12.4.10** Track reservoir history

#### 29.12.5 Aquaponics Integration

- [x] **29.12.5.1** Create AquaponicSystem entity linking fish and plants
- [x] **29.12.5.2** Create FishTank entity with species, count
- [x] **29.12.5.3** Track fish feeding schedules
- [x] **29.12.5.4** Track ammonia/nitrite/nitrate cycling
- [x] **29.12.5.5** Balance fish load to plant capacity
- [x] **29.12.5.6** Track fish growth and harvests
- [x] **29.12.5.7** Create fish species database
- [x] **29.12.5.8** Monitor water quality for fish health
- [x] **29.12.5.9** Implement fish disease tracking
- [x] **29.12.5.10** Generate aquaponics balance reports

#### 29.12.6 Indoor Growing

- [x] **29.12.6.1** Create GrowRoom entity with dimensions, equipment
- [x] **29.12.6.2** Create GrowTent entity for smaller setups
- [x] **29.12.6.3** Track grow light specifications (wattage, spectrum, PPFD)
- [x] **29.12.6.4** Calculate DLI from light setup
- [x] **29.12.6.5** Schedule light cycles (photoperiod)
- [x] **29.12.6.6** Track VPD (vapor pressure deficit)
- [x] **29.12.6.7** Manage CO2 supplementation
- [x] **29.12.6.8** Track electricity costs
- [x] **29.12.6.9** Implement environment controller integration
- [x] **29.12.6.10** Create indoor growing guides

#### 29.12.7 Microgreens & Sprouts

- [x] **29.12.7.1** Create MicrogreenTray entity with variety, stage
- [x] **29.12.7.2** Track seeding density calculations
- [x] **29.12.7.3** Track germination rates
- [x] **29.12.7.4** Schedule watering/misting
- [x] **29.12.7.5** Track harvest weights
- [x] **29.12.7.6** Calculate turnaround times
- [x] **29.12.7.7** Create variety-specific growing guides
- [x] **29.12.7.8** Track profitability per tray
- [x] **29.12.7.9** Schedule tray rotations
- [x] **29.12.7.10** Generate production reports

#### 29.12.8 Mushroom Cultivation

- [x] **29.12.8.1** Create MushroomGrow entity with species, substrate
- [x] **29.12.8.2** Support oyster mushroom cultivation
- [x] **29.12.8.3** Support shiitake cultivation
- [x] **29.12.8.4** Support lion's mane cultivation
- [x] **29.12.8.5** Track substrate preparation
- [x] **29.12.8.6** Track inoculation dates
- [x] **29.12.8.7** Monitor fruiting conditions (temp, humidity, FAE)
- [x] **29.12.8.8** Track flush cycles and yields
- [x] **29.12.8.9** Detect contamination risks
- [x] **29.12.8.10** Create mushroom growing guides

#### 29.12.9 Hydroponics Tests

- [x] **29.12.9.1** Write unit tests for HydroponicSystem
- [x] **29.12.9.2** Write unit tests for nutrient calculations
- [x] **29.12.9.3** Write unit tests for reservoir management
- [x] **29.12.9.4** Write unit tests for aquaponics balance
- [x] **29.12.9.5** Write unit tests for DLI calculations
- [x] **29.12.9.6** Write unit tests for microgreen tracking
- [x] **29.12.9.7** Write unit tests for mushroom cultivation
- [x] **29.12.9.8** Write integration tests for sensor data
- [x] **29.12.9.9** Write tests for automation rules
- [x] **29.12.9.10** Achieve 90%+ code coverage on @demeter/hydroponics

---

### 29.13 Preservation & Post-Harvest

#### 29.13.1 Preservation Library Setup

- [x] **29.13.1.1** Create libs/demeter/preservation/ directory structure
- [x] **29.13.1.2** Create libs/demeter/preservation/project.json
- [x] **29.13.1.3** Create libs/demeter/preservation/package.json as
      @demeter/preservation
- [x] **29.13.1.4** Configure TypeScript and Vitest for preservation library
- [x] **29.13.1.5** Add @demeter/preservation path mapping to tsconfig.base.json
- [x] **29.13.1.6** Verify @demeter/preservation builds successfully

#### 29.13.2 Harvest Planning

- [x] **29.13.2.1** Create HarvestForecast entity predicting upcoming harvests
- [x] **29.13.2.2** Calculate expected harvest quantities
- [x] **29.13.2.3** Predict peak harvest dates
- [x] **29.13.2.4** Identify preservation needs in advance
- [x] **29.13.2.5** Schedule preservation sessions
- [x] **29.13.2.6** Calculate storage container needs
- [x] **29.13.2.7** Generate harvest preparation checklists
- [x] **29.13.2.8** Track fresh eating vs preservation allocation
- [x] **29.13.2.9** Plan for surplus sharing/selling
- [x] **29.13.2.10** Generate harvest calendars

#### 29.13.3 Canning & Preserving

- [x] **29.13.3.1** Create CanningRecipe entity with USDA-approved recipes
- [x] **29.13.3.2** Create CanningBatch entity tracking preserved items
- [x] **29.13.3.3** Calculate processing times by altitude
- [x] **29.13.3.4** Support water bath canning recipes
- [x] **29.13.3.5** Support pressure canning recipes
- [x] **29.13.3.6** Track canning jar inventory
- [x] **29.13.3.7** Track lid/band inventory
- [x] **29.13.3.8** Calculate recipe scaling
- [x] **29.13.3.9** Track canning safety (pH, processing)
- [x] **29.13.3.10** Generate canning labels

#### 29.13.4 Freezing

- [x] **29.13.4.1** Create FreezingGuide entity with blanching times
- [x] **29.13.4.2** Create FreezerInventory entity tracking frozen items
- [x] **29.13.4.3** Track freezer space utilization
- [x] **29.13.4.4** Calculate storage durations
- [x] **29.13.4.5** Implement FIFO tracking
- [x] **29.13.4.6** Set use-by reminders
- [x] **29.13.4.7** Track multiple freezers
- [x] **29.13.4.8** Calculate energy costs
- [x] **29.13.4.9** Generate freezer maps
- [x] **29.13.4.10** Alert on approaching expiration

#### 29.13.5 Dehydrating

- [x] **29.13.5.1** Create DehydratingGuide entity with temps and times
- [x] **29.13.5.2** Create DehydratedBatch entity tracking dried items
- [x] **29.13.5.3** Support fruit leather recipes
- [x] **29.13.5.4** Support jerky recipes
- [x] **29.13.5.5** Support herb drying guides
- [x] **29.13.5.6** Track dehydrator tray rotations
- [x] **29.13.5.7** Calculate reconstitution ratios
- [x] **29.13.5.8** Track storage conditions
- [x] **29.13.5.9** Calculate shelf life
- [x] **29.13.5.10** Generate drying logs

#### 29.13.6 Fermentation

- [x] **29.13.6.1** Create FermentationRecipe entity for fermented foods
- [x] **29.13.6.2** Create FermentBatch entity tracking active ferments
- [x] **29.13.6.3** Support sauerkraut/kimchi recipes
- [x] **29.13.6.4** Support pickle fermentation
- [x] **29.13.6.5** Support hot sauce fermentation
- [x] **29.13.6.6** Support kombucha brewing
- [x] **29.13.6.7** Track fermentation temperature
- [x] **29.13.6.8** Track fermentation duration
- [x] **29.13.6.9** Set taste-testing reminders
- [x] **29.13.6.10** Track fermentation pH/salt levels

#### 29.13.7 Root Cellar & Storage

- [x] **29.13.7.1** Create StorageLocation entity with conditions
- [x] **29.13.7.2** Track root cellar temperature/humidity
- [x] **29.13.7.3** Map optimal storage conditions by crop
- [x] **29.13.7.4** Track stored produce inventory
- [x] **29.13.7.5** Monitor for spoilage
- [x] **29.13.7.6** Calculate storage durations
- [x] **29.13.7.7** Implement rotation schedules
- [x] **29.13.7.8** Track storage losses
- [x] **29.13.7.9** Generate storage reports
- [x] **29.13.7.10** Alert on condition changes

#### 29.13.8 Recipe Integration

- [x] **29.13.8.1** Link harvests to recipes
- [x] **29.13.8.2** Suggest recipes based on current harvest
- [x] **29.13.8.3** Calculate quantities for recipes
- [x] **29.13.8.4** Track favorite preservation recipes
- [x] **29.13.8.5** Import recipes from external sources
- [x] **29.13.8.6** Share recipes with community
- [x] **29.13.8.7** Scale recipes to harvest quantity
- [x] **29.13.8.8** Generate shopping lists for recipes
- [x] **29.13.8.9** Create meal planning integration
- [x] **29.13.8.10** Track recipe success rates

#### 29.13.9 Preservation Tests

- [x] **29.13.9.1** Write unit tests for harvest forecasting
- [x] **29.13.9.2** Write unit tests for canning calculations
- [x] **29.13.9.3** Write unit tests for freezer tracking
- [x] **29.13.9.4** Write unit tests for dehydrating guides
- [x] **29.13.9.5** Write unit tests for fermentation tracking
- [x] **29.13.9.6** Write unit tests for storage conditions
- [x] **29.13.9.7** Write unit tests for recipe scaling
- [x] **29.13.9.8** Write integration tests for inventory
- [x] **29.13.9.9** Write tests for expiration alerts
- [x] **29.13.9.10** Achieve 90%+ code coverage on @demeter/preservation

---

### 29.14 Analytics & Insights

#### 29.14.1 Analytics Library Setup

- [x] **29.14.1.1** Create libs/demeter/analytics/ directory structure
- [x] **29.14.1.2** Create libs/demeter/analytics/project.json
- [x] **29.14.1.3** Create libs/demeter/analytics/package.json as
      @demeter/analytics
- [x] **29.14.1.4** Configure TypeScript and Vitest for analytics library
- [x] **29.14.1.5** Add @demeter/analytics path mapping to tsconfig.base.json
- [x] **29.14.1.6** Verify @demeter/analytics builds successfully

#### 29.14.2 Yield Analytics

- [x] **29.14.2.1** Calculate total yield by plant
- [x] **29.14.2.2** Calculate yield per square foot
- [x] **29.14.2.3** Calculate yield per plant
- [x] **29.14.2.4** Compare yields year-over-year
- [x] **29.14.2.5** Compare yields to regional averages
- [x] **29.14.2.6** Identify high/low performing varieties
- [x] **29.14.2.7** Correlate yields with conditions
- [x] **29.14.2.8** Predict future yields
- [x] **29.14.2.9** Generate yield reports
- [x] **29.14.2.10** Create yield visualization charts

#### 29.14.3 Cost & ROI Analysis

- [x] **29.14.3.1** Track all garden input costs
- [x] **29.14.3.2** Calculate cost per pound harvested
- [x] **29.14.3.3** Compare homegrown to store prices
- [x] **29.14.3.4** Calculate savings from gardening
- [x] **29.14.3.5** Track water costs
- [x] **29.14.3.6** Track energy costs (irrigation, lighting)
- [x] **29.14.3.7** Amortize infrastructure costs
- [x] **29.14.3.8** Calculate break-even points
- [x] **29.14.3.9** Generate financial reports
- [x] **29.14.3.10** Optimize for cost efficiency

#### 29.14.4 Resource Analytics

- [x] **29.14.4.1** Track water usage per plant/bed
- [x] **29.14.4.2** Track fertilizer usage
- [x] **29.14.4.3** Track amendment usage
- [x] **29.14.4.4** Calculate resource efficiency
- [x] **29.14.4.5** Compare to benchmarks
- [x] **29.14.4.6** Identify waste/inefficiency
- [x] **29.14.4.7** Suggest resource optimization
- [x] **29.14.4.8** Track resource costs over time
- [x] **29.14.4.9** Generate resource reports
- [x] **29.14.4.10** Predict future resource needs

#### 29.14.5 Environmental Impact

- [x] **29.14.5.1** Calculate carbon sequestration
- [x] **29.14.5.2** Calculate food miles saved
- [x] **29.14.5.3** Calculate water footprint
- [x] **29.14.5.4** Track organic matter added to soil
- [x] **29.14.5.5** Calculate pollinator support
- [x] **29.14.5.6** Track biodiversity metrics
- [x] **29.14.5.7** Calculate plastic saved (vs store packaging)
- [x] **29.14.5.8** Generate sustainability reports
- [x] **29.14.5.9** Compare to conventional agriculture
- [x] **29.14.5.10** Set sustainability goals

#### 29.14.6 Time Analytics

- [x] **29.14.6.1** Track time spent on garden tasks
- [x] **29.14.6.2** Calculate time per pound harvested
- [x] **29.14.6.3** Identify time-intensive tasks
- [x] **29.14.6.4** Compare time investment by crop
- [x] **29.14.6.5** Track seasonal workload patterns
- [x] **29.14.6.6** Identify efficiency opportunities
- [x] **29.14.6.7** Calculate effective hourly rate
- [x] **29.14.6.8** Generate time reports
- [x] **29.14.6.9** Optimize for time efficiency
- [x] **29.14.6.10** Predict future time needs

#### 29.14.7 Success Metrics

- [x] **29.14.7.1** Track germination success rates
- [x] **29.14.7.2** Track transplant survival rates
- [x] **29.14.7.3** Track pest/disease incidents
- [x] **29.14.7.4** Track task completion rates
- [x] **29.14.7.5** Calculate overall garden health score
- [x] **29.14.7.6** Track improvement over time
- [x] **29.14.7.7** Identify success factors
- [x] **29.14.7.8** Generate achievement badges
- [x] **29.14.7.9** Create gardener skill assessment
- [x] **29.14.7.10** Generate success reports

#### 29.14.8 Dashboard & Reporting

- [x] **29.14.8.1** Create garden overview dashboard
- [x] **29.14.8.2** Create seasonal summary reports
- [x] **29.14.8.3** Create year-end retrospective
- [x] **29.14.8.4** Create comparison reports (year/year, bed/bed)
- [x] **29.14.8.5** Create custom report builder
- [x] **29.14.8.6** Export reports to PDF
- [x] **29.14.8.7** Export data to CSV/Excel
- [x] **29.14.8.8** Schedule automated reports
- [x] **29.14.8.9** Share reports with others
- [x] **29.14.8.10** Create data visualization library

#### 29.14.9 Analytics Tests

- [x] **29.14.9.1** Write unit tests for yield calculations
- [x] **29.14.9.2** Write unit tests for cost analysis
- [x] **29.14.9.3** Write unit tests for resource tracking
- [x] **29.14.9.4** Write unit tests for environmental metrics
- [x] **29.14.9.5** Write unit tests for time analytics
- [x] **29.14.9.6** Write unit tests for success metrics
- [x] **29.14.9.7** Write unit tests for report generation
- [x] **29.14.9.8** Write integration tests for dashboard
- [x] **29.14.9.9** Write tests for data export
- [x] **29.14.9.10** Achieve 90%+ code coverage on @demeter/analytics

---

### 29.15 API Backend

#### 29.15.1 API Application Setup

- [x] **29.15.1.1** Create apps/demeter/api/ directory structure
- [x] **29.15.1.2** Initialize Fastify application (monorepo convention, not
      NestJS)
- [x] **29.15.1.3** Create apps/demeter/api/project.json
- [x] **29.15.1.4** Configure TypeScript for API
- [x] **29.15.1.5** Set up environment configuration
- [x] **29.15.1.6** Configure CORS for frontend clients
- [x] **29.15.1.7** Set up request validation (Zod)
- [x] **29.15.1.8** Configure logging (Pino)
- [x] **29.15.1.9** Set up health check endpoints
- [x] **29.15.1.10** Verify API starts and responds

#### 29.15.2 Authentication & Authorization

- [x] **29.15.2.1** Implement JWT authentication
- [x] **29.15.2.2** Implement refresh token rotation
- [x] **29.15.2.3** Implement OAuth2 (Google, Apple, Facebook)
- [x] **29.15.2.4** Implement magic link authentication
- [x] **29.15.2.5** Implement role-based access control
- [x] **29.15.2.6** Implement resource ownership validation
- [x] **29.15.2.7** Implement API key authentication (for IoT)
- [x] **29.15.2.8** Implement rate limiting
- [x] **29.15.2.9** Implement session management
- [x] **29.15.2.10** Create auth middleware tests

#### 29.15.3 Garden API Endpoints

- [x] **29.15.3.1** Create POST /gardens endpoint
- [x] **29.15.3.2** Create GET /gardens endpoint (list)
- [x] **29.15.3.3** Create GET /gardens/:id endpoint
- [x] **29.15.3.4** Create PUT /gardens/:id endpoint
- [x] **29.15.3.5** Create DELETE /gardens/:id endpoint
- [x] **29.15.3.6** Create POST /gardens/:id/beds endpoint
- [x] **29.15.3.7** Create garden bed CRUD endpoints
- [x] **29.15.3.8** Create POST /gardens/:id/plantings endpoint
- [x] **29.15.3.9** Create planting CRUD endpoints
- [x] **29.15.3.10** Implement garden sharing endpoints

#### 29.15.4 Plant Encyclopedia API

- [x] **29.15.4.1** Create GET /plants endpoint (search)
- [x] **29.15.4.2** Create GET /plants/:id endpoint
- [x] **29.15.4.3** Create GET /plants/:id/care endpoint
- [x] **29.15.4.4** Create GET /plants/:id/companions endpoint
- [x] **29.15.4.5** Create GET /plants/:id/pests endpoint
- [x] **29.15.4.6** Create GET /plants/:id/diseases endpoint
- [x] **29.15.4.7** Create GET /pests endpoint (search)
- [x] **29.15.4.8** Create GET /diseases endpoint (search)
- [x] **29.15.4.9** Implement faceted search filters
- [x] **29.15.4.10** Implement plant recommendation endpoint

#### 29.15.5 Task API Endpoints

- [x] **29.15.5.1** Create POST /tasks endpoint
- [x] **29.15.5.2** Create GET /tasks endpoint (list with filters)
- [x] **29.15.5.3** Create GET /tasks/:id endpoint
- [x] **29.15.5.4** Create PUT /tasks/:id endpoint
- [x] **29.15.5.5** Create DELETE /tasks/:id endpoint
- [x] **29.15.5.6** Create POST /tasks/:id/complete endpoint
- [x] **29.15.5.7** Create GET /tasks/today endpoint
- [x] **29.15.5.8** Create GET /tasks/upcoming endpoint
- [x] **29.15.5.9** Create GET /tasks/overdue endpoint
- [x] **29.15.5.10** Implement task generation endpoints

#### 29.15.6 Sensor & IoT API

- [x] **29.15.6.1** Create POST /devices endpoint (register)
- [x] **29.15.6.2** Create GET /devices endpoint (list)
- [x] **29.15.6.3** Create GET /devices/:id endpoint
- [x] **29.15.6.4** Create PUT /devices/:id endpoint
- [x] **29.15.6.5** Create DELETE /devices/:id endpoint
- [x] **29.15.6.6** Create POST /devices/:id/readings endpoint (batch)
- [x] **29.15.6.7** Create GET /devices/:id/readings endpoint (time range)
- [x] **29.15.6.8** Create WebSocket endpoint for real-time data
- [x] **29.15.6.9** Create MQTT broker integration
- [x] **29.15.6.10** Implement device command endpoints

#### 29.15.7 Weather API

- [x] **29.15.7.1** Create GET /weather/current endpoint
- [x] **29.15.7.2** Create GET /weather/forecast endpoint
- [x] **29.15.7.3** Create GET /weather/alerts endpoint
- [x] **29.15.7.4** Create GET /weather/historical endpoint
- [x] **29.15.7.5** Create GET /weather/gdd endpoint
- [x] **29.15.7.6** Create GET /climate-zone endpoint
- [x] **29.15.7.7** Create GET /frost-dates endpoint
- [x] **29.15.7.8** Implement weather caching
- [x] **29.15.7.9** Implement location-based routing
- [x] **29.15.7.10** Create weather webhook for alerts

#### 29.15.8 AI/ML API

- [x] **29.15.8.1** Create POST /identify/plant endpoint (image)
- [x] **29.15.8.2** Create POST /identify/disease endpoint (image)
- [x] **29.15.8.3** Create POST /identify/pest endpoint (image)
- [x] **29.15.8.4** Create GET /recommendations endpoint
- [x] **29.15.8.5** Create POST /chat endpoint (garden assistant)
- [x] **29.15.8.6** Create GET /predictions/growth endpoint
- [x] **29.15.8.7** Create GET /predictions/harvest endpoint
- [x] **29.15.8.8** Implement async processing for heavy tasks
- [x] **29.15.8.9** Implement result caching
- [x] **29.15.8.10** Track API usage and costs

#### 29.15.9 Community API

- [x] **29.15.9.1** Create profile CRUD endpoints
- [x] **29.15.9.2** Create exchange listing endpoints
- [x] **29.15.9.3** Create messaging endpoints
- [x] **29.15.9.4** Create group endpoints
- [x] **29.15.9.5** Create follow/unfollow endpoints
- [x] **29.15.9.6** Create content sharing endpoints
- [x] **29.15.9.7** Create search endpoints
- [x] **29.15.9.8** Create notification endpoints
- [x] **29.15.9.9** Implement content moderation endpoints
- [x] **29.15.9.10** Create reporting endpoints

#### 29.15.10 API Documentation & Testing

- [x] **29.15.10.1** Generate OpenAPI/Swagger documentation
- [x] **29.15.10.2** Create Postman collection
- [x] **29.15.10.3** Write API integration tests
- [x] **29.15.10.4** Write load testing scripts
- [x] **29.15.10.5** Implement API versioning
- [x] **29.15.10.6** Create API changelog
- [x] **29.15.10.7** Write rate limiting tests
- [x] **29.15.10.8** Write auth flow tests
- [x] **29.15.10.9** Write error handling tests
- [x] **29.15.10.10** Achieve 90%+ API test coverage

---

### 29.16 Mobile Application (React Native)

#### 29.16.1 Mobile App Setup

- [x] **29.16.1.1** Create apps/demeter/mobile/ directory structure
- [x] **29.16.1.2** Initialize React Native with Expo
- [x] **29.16.1.3** Create apps/demeter/mobile/project.json
- [x] **29.16.1.4** Configure TypeScript for mobile
- [x] **29.16.1.5** Set up navigation (React Navigation)
- [x] **29.16.1.6** Set up state management (Zustand/TanStack Query)
- [x] **29.16.1.7** Configure API client
- [x] **29.16.1.8** Set up authentication flow
- [x] **29.16.1.9** Configure push notifications (Expo)
- [x] **29.16.1.10** Verify app builds for iOS and Android

#### 29.16.2 Design System

- [x] **29.16.2.1** Create color palette (light/dark themes)
- [x] **29.16.2.2** Create typography system
- [x] **29.16.2.3** Create spacing/layout system
- [x] **29.16.2.4** Create button components
- [x] **29.16.2.5** Create input components
- [x] **29.16.2.6** Create card components
- [x] **29.16.2.7** Create list components
- [x] **29.16.2.8** Create modal/sheet components
- [x] **29.16.2.9** Create icon library
- [x] **29.16.2.10** Create animation library

#### 29.16.3 Garden Management Screens

- [x] **29.16.3.1** Create garden list/dashboard screen
- [x] **29.16.3.2** Create garden detail screen
- [x] **29.16.3.3** Create bed detail screen
- [x] **29.16.3.4** Create planting detail screen
- [x] **29.16.3.5** Create add/edit garden flow
- [x] **29.16.3.6** Create add/edit bed flow
- [x] **29.16.3.7** Create add planting flow
- [x] **29.16.3.8** Create garden map view
- [x] **29.16.3.9** Create quick actions (water, harvest)
- [x] **29.16.3.10** Write garden screen tests

#### 29.16.4 Plant Encyclopedia Screens

- [x] **29.16.4.1** Create plant search screen
- [x] **29.16.4.2** Create plant detail screen
- [x] **29.16.4.3** Create care guide tab
- [x] **29.16.4.4** Create planting info tab
- [x] **29.16.4.5** Create companion plants tab
- [x] **29.16.4.6** Create pest/disease tab
- [x] **29.16.4.7** Create add to garden flow
- [x] **29.16.4.8** Create favorites/saved plants
- [x] **29.16.4.9** Create recently viewed
- [x] **29.16.4.10** Write plant screen tests

#### 29.16.5 Task Management Screens

- [x] **29.16.5.1** Create today's tasks screen
- [x] **29.16.5.2** Create task calendar view
- [x] **29.16.5.3** Create task list view (filterable)
- [x] **29.16.5.4** Create task detail screen
- [x] **29.16.5.5** Create add/edit task flow
- [x] **29.16.5.6** Create task completion flow
- [x] **29.16.5.7** Create task notifications
- [x] **29.16.5.8** Create recurring task management
- [x] **29.16.5.9** Create task analytics view
- [x] **29.16.5.10** Write task screen tests

#### 29.16.6 Journal & Observation Screens

- [x] **29.16.6.1** Create journal timeline screen
- [x] **29.16.6.2** Create observation entry screen
- [x] **29.16.6.3** Create photo capture/import
- [x] **29.16.6.4** Create voice note recording
- [x] **29.16.6.5** Create measurement logging
- [x] **29.16.6.6** Create harvest logging screen
- [x] **29.16.6.7** Create journal search
- [x] **29.16.6.8** Create photo gallery
- [x] **29.16.6.9** Create "on this day" feature
- [x] **29.16.6.10** Write journal screen tests

#### 29.16.7 IoT & Sensor Screens

- [x] **29.16.7.1** Create device dashboard screen
- [x] **29.16.7.2** Create device detail screen
- [x] **29.16.7.3** Create sensor reading charts
- [x] **29.16.7.4** Create device pairing flow
- [x] **29.16.7.5** Create device settings screen
- [x] **29.16.7.6** Create automation rules screen
- [x] **29.16.7.7** Create alerts configuration
- [x] **29.16.7.8** Create real-time data view
- [x] **29.16.7.9** Create device offline handling
- [x] **29.16.7.10** Write IoT screen tests

#### 29.16.8 AI Features

- [x] **29.16.8.1** Create plant identification camera screen
- [x] **29.16.8.2** Create disease detection camera screen
- [x] **29.16.8.3** Create pest identification screen
- [x] **29.16.8.4** Create AI garden assistant chat
- [x] **29.16.8.5** Create recommendations feed
- [x] **29.16.8.6** Create growth predictions view
- [x] **29.16.8.7** Handle AI loading states
- [x] **29.16.8.8** Handle AI error states
- [x] **29.16.8.9** Create identification history
- [x] **29.16.8.10** Write AI feature tests

#### 29.16.9 Weather & Calendar

- [x] **29.16.9.1** Create weather dashboard widget
- [x] **29.16.9.2** Create detailed forecast screen
- [x] **29.16.9.3** Create weather alerts screen
- [x] **29.16.9.4** Create planting calendar screen
- [x] **29.16.9.5** Create frost date display
- [x] **29.16.9.6** Create GDD tracking view
- [x] **29.16.9.7** Create seasonal overview
- [x] **29.16.9.8** Create weather notification settings
- [x] **29.16.9.9** Create location management
- [x] **29.16.9.10** Write weather screen tests

#### 29.16.10 Community Features

- [x] **29.16.10.1** Create community feed screen
- [x] **29.16.10.2** Create profile screen
- [x] **29.16.10.3** Create exchange listings screen
- [x] **29.16.10.4** Create messaging screen
- [x] **29.16.10.5** Create groups screen
- [x] **29.16.10.6** Create local gardeners map
- [x] **29.16.10.7** Create content sharing flow
- [x] **29.16.10.8** Create follow/follower lists
- [x] **29.16.10.9** Create notifications screen
- [x] **29.16.10.10** Write community screen tests

#### 29.16.11 Settings & Utilities

- [x] **29.16.11.1** Create settings screen
- [x] **29.16.11.2** Create profile editing screen
- [x] **29.16.11.3** Create notification preferences
- [x] **29.16.11.4** Create unit preferences (metric/imperial)
- [x] **29.16.11.5** Create theme settings (light/dark/system)
- [x] **29.16.11.6** Create data export screen
- [x] **29.16.11.7** Create backup/restore functionality
- [x] **29.16.11.8** Create help/support screen
- [x] **29.16.11.9** Create about screen
- [x] **29.16.11.10** Write settings tests

#### 29.16.12 Offline Support

- [x] **29.16.12.1** Implement offline data storage (AsyncStorage-based)
- [x] **29.16.12.2** Implement sync engine
- [x] **29.16.12.3** Handle conflict resolution
- [x] **29.16.12.4** Cache plant encyclopedia data
- [x] **29.16.12.5** Cache weather forecasts
- [x] **29.16.12.6** Queue actions when offline
- [x] **29.16.12.7** Sync sensor data when online
- [x] **29.16.12.8** Display offline indicators
- [x] **29.16.12.9** Handle photos when offline
- [x] **29.16.12.10** Write offline sync tests

#### 29.16.13 Widgets & Quick Actions

- [x] **29.16.13.1** Create iOS Today widget
- [x] **29.16.13.2** Create iOS Lock Screen widget
- [x] **29.16.13.3** Create Android home screen widget
- [x] **29.16.13.4** Create quick action shortcuts
- [x] **29.16.13.5** Create Siri Shortcuts integration
- [x] **29.16.13.6** Create Google Assistant actions
- [x] **29.16.13.7** Create Apple Watch companion app
- [x] **29.16.13.8** Create Wear OS companion app
- [x] **29.16.13.9** Create notification actions
- [x] **29.16.13.10** Write widget tests

---

### 29.17 Web Dashboard (React)

#### 29.17.1 Web App Setup

- [x] **29.17.1.1** Create apps/demeter/web/ directory structure
- [x] **29.17.1.2** Initialize React + Vite project
- [x] **29.17.1.3** Create apps/demeter/web/project.json
- [x] **29.17.1.4** Configure TypeScript
- [x] **29.17.1.5** Set up routing (React Router)
- [x] **29.17.1.6** Set up state management (Zustand/TanStack Query)
- [x] **29.17.1.7** Set up API client
- [x] **29.17.1.8** Set up authentication
- [x] **29.17.1.9** Configure Tailwind CSS
- [x] **29.17.1.10** Verify web app builds

#### 29.17.2 Web Design System

- [x] **29.17.2.1** Create shared component library
- [x] **29.17.2.2** Create responsive layouts
- [x] **29.17.2.3** Create chart components (recharts/visx)
- [x] **29.17.2.4** Create table components
- [x] **29.17.2.5** Create form components
- [x] **29.17.2.6** Create modal system
- [x] **29.17.2.7** Create notification system
- [x] **29.17.2.8** Create dark mode support
- [x] **29.17.2.9** Create keyboard shortcuts
- [x] **29.17.2.10** Write component tests

#### 29.17.3 Garden Management Pages

- [x] **29.17.3.1** Create garden dashboard page
- [x] **29.17.3.2** Create garden detail page
- [x] **29.17.3.3** Create garden planner (2D canvas)
- [x] **29.17.3.4** Create garden planner (3D view)
- [x] **29.17.3.5** Create bed management page
- [x] **29.17.3.6** Create planting management page
- [x] **29.17.3.7** Create bulk edit functionality
- [x] **29.17.3.8** Create print layouts
- [x] **29.17.3.9** Create garden comparison view
- [x] **29.17.3.10** Write garden page tests

#### 29.17.4 Plant Encyclopedia Pages

- [x] **29.17.4.1** Create plant search page
- [x] **29.17.4.2** Create advanced search filters
- [x] **29.17.4.3** Create plant detail page
- [x] **29.17.4.4** Create companion matrix view
- [x] **29.17.4.5** Create planting calendar view
- [x] **29.17.4.6** Create pest/disease browser
- [x] **29.17.4.7** Create comparison tool
- [x] **29.17.4.8** Create favorites management
- [x] **29.17.4.9** Create printable guides
- [x] **29.17.4.10** Write plant page tests

#### 29.17.5 Task & Calendar Pages

- [x] **29.17.5.1** Create task dashboard page
- [x] **29.17.5.2** Create calendar page (monthly/weekly/daily)
- [x] **29.17.5.3** Create task list page (sortable/filterable)
- [x] **29.17.5.4** Create task creation modal
- [x] **29.17.5.5** Create recurring task management
- [x] **29.17.5.6** Create drag-and-drop scheduling
- [x] **29.17.5.7** Create task templates
- [x] **29.17.5.8** Create bulk task operations
- [x] **29.17.5.9** Create calendar export
- [x] **29.17.5.10** Write task page tests

#### 29.17.6 Analytics & Reports Pages

- [x] **29.17.6.1** Create analytics dashboard
- [x] **29.17.6.2** Create yield reports page
- [x] **29.17.6.3** Create cost analysis page
- [x] **29.17.6.4** Create resource tracking page
- [x] **29.17.6.5** Create environmental impact page
- [x] **29.17.6.6** Create comparison reports
- [x] **29.17.6.7** Create custom report builder
- [x] **29.17.6.8** Create data export page
- [x] **29.17.6.9** Create printable reports
- [x] **29.17.6.10** Write analytics page tests

#### 29.17.7 IoT & Automation Pages

- [x] **29.17.7.1** Create device dashboard page
- [x] **29.17.7.2** Create device detail page
- [x] **29.17.7.3** Create sensor data visualization
- [x] **29.17.7.4** Create automation rules editor
- [x] **29.17.7.5** Create scene management page
- [x] **29.17.7.6** Create alert configuration page
- [x] **29.17.7.7** Create device pairing wizard
- [x] **29.17.7.8** Create real-time monitoring view
- [x] **29.17.7.9** Create automation history
- [x] **29.17.7.10** Write IoT page tests

#### 29.17.8 Settings & Admin Pages

- [x] **29.17.8.1** Create settings page
- [x] **29.17.8.2** Create profile page
- [x] **29.17.8.3** Create notification settings
- [x] **29.17.8.4** Create integration settings
- [x] **29.17.8.5** Create data management page
- [x] **29.17.8.6** Create import/export wizard
- [x] **29.17.8.7** Create subscription management
- [x] **29.17.8.8** Create help/documentation
- [x] **29.17.8.9** Create admin dashboard (if applicable)
- [x] **29.17.8.10** Write settings page tests

---

### 29.18 Testing & Quality Assurance

#### 29.18.1 Unit Testing

- [x] **29.18.1.1** Achieve 90%+ coverage on @demeter/core
- [x] **29.18.1.2** Achieve 90%+ coverage on @demeter/plants
- [x] **29.18.1.3** Achieve 90%+ coverage on @demeter/planner
- [x] **29.18.1.4** Achieve 90%+ coverage on @demeter/tasks
- [x] **29.18.1.5** Achieve 90%+ coverage on @demeter/inventory
- [x] **29.18.1.6** Achieve 90%+ coverage on @demeter/journal
- [x] **29.18.1.7** Achieve 90%+ coverage on @demeter/sensors
- [x] **29.18.1.8** Achieve 90%+ coverage on @demeter/automation
- [x] **29.18.1.9** Achieve 90%+ coverage on @demeter/intelligence
- [x] **29.18.1.10** Achieve 90%+ coverage on @demeter/weather
- [x] **29.18.1.11** Achieve 90%+ coverage on @demeter/community
- [x] **29.18.1.12** Achieve 90%+ coverage on @demeter/hydroponics
- [x] **29.18.1.13** Achieve 90%+ coverage on @demeter/preservation
- [x] **29.18.1.14** Achieve 90%+ coverage on @demeter/analytics
- [x] **29.18.1.15** Configure coverage reporting and thresholds

#### 29.18.2 Integration Testing

- [x] **29.18.2.1** Test API endpoints with database
  - Done 2026-05-31: completed the conversion of every user-data API endpoint in
    `apps/demeter/api` from in-memory Maps to real Postgres (Drizzle) and backed
    each with an integration test booting the real `buildServer()` against a
    live `demeter_test` database. Beyond the per-domain sub-tasks (2.2–2.10),
    this task closed the remaining persistence routes:
    - **Plantings** (`PlantingStore`): planting + stage-history written
      atomically; create verifies bed ownership (garden join) and plant-catalog
      FK; PATCH /:id/stage appends a stage. `plantings.integration.spec.ts`.
    - **Harvests** (`HarvestStore`): create verifies planting ownership; yield
      summary aggregates real rows. `harvests.integration.spec.ts`.
    - **Observations** (`ObservationStore`): create verifies garden ownership;
      jsonb metrics/photos/tags persisted. `observations.integration.spec.ts`.
    - **Community** (`CommunityStore`, migration 0005 — 5 new tables + an
      `is_public` flag on gardens): posts/feed, likes (toggle, counter resync),
      comments (counter resync), challenges (creator auto-join, status), public-
      garden browse with counts computed from live data, and a leaderboard
      computed from real harvests/posts/comments/completed-challenges (no static
      table). `community.integration.spec.ts`. Also removed the obsolete
      in-memory `requireOwnership`/`registerResourceStore` middleware
      (superseded by per-route inline DB ownership checks) and excised the
      DB-less route suites that exercised the old in-memory stores. Schema now
      29 tables / 28 relations; the server smoke test asserts all 29 are
      migrated. The plant **encyclopedia** route (`/v1/plants/*`) intentionally
      remains a read-only curated botanical reference layer (real domain
      content, unit-tested) — the same accepted category as the AI/notification
      knowledge bases; the `demeter_plants` FK catalog it complements is itself
      database- integration-tested via the plantings/harvests/community suites.
      Final state: 297 unit + 91 integration (api) and 324 `@demeter/core` tests
      pass.
- [x] **29.18.2.2** Test authentication flows end-to-end
  - Done 2026-05-31: converted `apps/demeter/api` auth from in-memory Maps to
    real Postgres (`@demeter/core` `AuthStore` + drizzle migrations) with real
    jose/Graph OAuth verification, then added
    `test/integration/auth.integration.spec.ts` — 17 e2e tests booting the real
    `buildServer()` against `demeter_test`: register/login/logout, refresh-token
    rotation + family reuse-detection, OAuth (google/apple/facebook), magic
    links (single-use), API keys, sessions, and rate limiting.
    `security.test.ts` (79 OWASP tests) migrated onto the same real DB. 411
    unit + 35 integration tests pass.
- [x] **29.18.2.3** Test garden CRUD operations
  - Done 2026-05-31: converted `routes/gardens.ts` from in-memory Maps to a
    Postgres-backed `GardenStore` (gardens, beds, sharing/members), adding the
    `demeter_garden_members` table + bed `is_raised`/`orientation` columns
    (migration 0002) and mapping the API shape to the schema (location object ↔
    lat/long/elevation/aspect, meters ↔ cm, soilType ↔ soil_composition).
    `test/integration/gardens.integration.spec.ts` — 12 e2e tests: garden CRUD
    with ownership enforcement, location round-trip, bed CRUD (dimension/soil
    mapping), and sharing/membership (role update on re-share, revoke). Invalid
    UUIDs → 404 and NUL bytes stripped (no 500s). 397 unit + 43 integration
    tests pass.
- [x] **29.18.2.4** Test task scheduling and completion
  - Done 2026-05-31: converted `routes/tasks.ts` to a Postgres-backed
    `TaskStore` (`demeter_tasks`); create now verifies garden ownership (FK) so
    a bad gardenId returns 404 instead of a 500; recurrence + seasonal
    suggestion logic kept as pure helpers.
    `test/integration/tasks.integration.spec.ts` — 7 e2e tests: CRUD, completion
    filters, recurring next-instance creation, snooze (+ refuse on completed),
    overdue urgency, calendar grouping, and seasonal generate. Removed the
    superseded in-memory "Task API Enhancements" suite from routes.test.ts.
    Added shared `src/db/text-utils.ts` (NUL strip + UUID guard). 384 unit + 50
    integration tests pass.
- [x] **29.18.2.5** Test sensor data ingestion pipeline
  - Done 2026-05-31: converted `routes/sensors.ts` to a Postgres-backed
    `SensorStore` (`demeter_sensors` + `demeter_sensor_readings` + new
    `demeter_sensor_alert_configs` table, migration 0003). Sensor ownership is
    derived from the owning garden (join); registration verifies garden + bed
    FKs (404 not 500); readings ingest as batches and retrieve by time range;
    alert configs upsert per (sensor, metric); dashboard/summary aggregate live
    data. `test/integration/sensors.integration.spec.ts` — 7 e2e tests
    (register, batch ingest + time-range retrieval, ownership, alert upsert,
    calibrate, dashboard triggered-alerts/battery, summary). Removed the
    superseded in-memory "Sensor & IoT API" suite from routes.test.ts. 375
    unit + 57 integration tests pass.
- [x] **29.18.2.6** Test automation rule execution
  - Done 2026-05-31: the `@demeter/automation` rule engine (condition/group
    evaluation, `evaluateRule`, `executeActions`, `processRules`) is real and
    unit-tested (70 tests). Added
    `test/integration/automation.integration.spec.ts` — exercises rule execution
    against **real persisted sensor data**: a sensor
    - reading are created through the live API (Postgres), read back, fed into a
      `RuleContext`, and evaluated/executed via `processRules` (fires a
      low-moisture auto-water rule when dry, skips when wet, respects the
      disabled flag). 3 integration tests; 60 integration tests total pass.
- [x] **29.18.2.7** Test weather API integration
  - Done 2026-05-31: replaced the `Math.random()` weather simulation with a real
    provider — `src/weather/weather-provider.ts` calls Open-Meteo (free, no key)
    for current/forecast/history, mapping WMO codes + fields; injectable for
    tests. Per-garden locations persist via `WeatherStore`
    (`demeter_weather_locations`, migration 0004); weather requires a location +
    owned garden (404 guards). Provider threaded through
    `buildServer({ weather })`. `test/integration/weather.integration.spec.ts` —
    7 e2e tests (set location/owner-guard, current + frost alerts, location/
    garden guards, forecast tips, aggregated alerts, history stats,
    garden-impact) with an injected deterministic provider. 366 unit + 67
    integration tests pass.
- [x] **29.18.2.8** Test AI model inference
  - Done 2026-05-31: verified `routes/ai.ts` is real, stateless algorithmic
    inference (symptom-keyword diagnosis scoring with confidence weighting,
    degree-day harvest prediction, planting-plan generation, layout
    optimization, chat topic matching) — no DB, no Math.random simulation, not a
    stub. Added `test/integration/ai.integration.spec.ts` — 6 e2e tests through
    the live HTTP stack: identify-plant, diagnose (keyword correlation →
    non-empty diagnoses with confidence), planting-plan, optimize-layout,
    harvest-predict, and chat (recognized topic → non-zero confidence). 366 unit
    - 73 integration tests pass.
- [x] **29.18.2.9** Test notification delivery
  - Done 2026-05-31: the `@demeter/tasks` notification layer
    (createNotification, `shouldSendNow` with channel prefs + quiet hours +
    critical override + snooze, digests) is real and unit-tested. Added
    `test/integration/notifications.integration.spec.ts` — exercises delivery
    decisions against a **real persisted task**: a task is created via the live
    API (Postgres), a notification built referencing its id, and `shouldSendNow`
    evaluated (delivered on enabled channel outside quiet hours; suppressed on a
    disabled channel; quiet-hours suppression with a working critical override;
    snoozed → suppressed). 4 integration tests; 77 integration tests total pass.
- [x] **29.18.2.10** Test data synchronization
  - Done 2026-05-31: the platform synchronizes user data across devices/sessions
    through the durable shared Postgres store (stateless REST). Added
    `test/integration/data-sync.integration.spec.ts` — verifies writes in one
    authenticated session are immediately visible to a second concurrent session
    for the same user (bidirectional), and that data persists across a full
    server restart (a brand-new `buildServer()` instance + connection pool reads
    back exactly what was written). 2 integration tests; 79 integration tests
    total pass.

#### 29.18.3 End-to-End Testing

- [ ] **29.18.3.1** Set up Detox for mobile E2E in `apps/demeter/mobile`: add
      `detox` (pnpm catalog) and a `.detoxrc.js` with an `ios.sim.debug`
      configuration, plus a first `e2e/login.e2e.ts` that launches the app and
      signs in against a locally booted `apps/demeter/api`. Run it on the Mac:
      the 2026-05-31 "headless Linux box" deferral covered only one of the two
      machines, and a simulator build needs no signing identity. Verify:
      `npx detox test -c ios.sim.debug` passes the login spec on the Mac, with
      the Xcode and simulator versions recorded here. Depends on the simulator
      build from 29.18.3.11 (stated 2026-09-18). `blocked:upstream`
- [x] **29.18.3.2** Set up Playwright for web E2E
- [x] **29.18.3.3** Test user registration flow
- [x] **29.18.3.4** Test garden creation flow
- [x] **29.18.3.5** Test plant search and add flow
- [x] **29.18.3.6** Test task creation and completion flow
- [x] **29.18.3.7** Test journal entry creation flow
- [x] **29.18.3.8** Test device pairing flow
- [x] **29.18.3.9** Test plant identification flow
- [x] **29.18.3.10** Test community features flow
- [ ] **29.18.3.11** Generate and build the native shells that the
      mobile-runtime items need (prerequisite added 2026-09-18: the app is Expo
      managed workflow, so there is no `ios/` or `android/` directory to build).
      First install the toolchain and record the exact commands and versions:
      Xcode with an iOS simulator runtime on the Mac (a simulator build needs no
      signing identity); for Android, the SDK command-line tools plus an
      emulator image on the Linux server (it needs `/dev/kvm`). Park either
      platform only with a named failed install attempt. Then run
      `npx expo prebuild` in `apps/demeter/mobile` and `npx expo run:ios` (or
      `run:android`) to build and boot the app; decide here whether the
      generated `ios/` and `android/` directories are committed or regenerated,
      and record the choice and the exact commands in
      `apps/demeter/mobile/README.md`. Verify: the simulator or emulator reaches
      the login screen, and the README names the commands and the toolchain
      versions used. Unblocks 29.18.3.1, 29.18.4.4 and §29.21.12.

#### 29.18.4 Performance Testing

- [x] **29.18.4.1** Load test API endpoints
  - Done 2026-05-31: added a `apps/demeter/api` performance suite
    (`test/performance/`, `vitest.performance.config.ts`,
    `pnpm --filter @demeter/api test:perf`) with a dependency-free in-process
    load harness (`harness.ts`: bounded-concurrency worker pool, nearest-rank
    percentiles, throughput). `api-load.performance.spec.ts` drives the hot
    endpoints (gardens/plantings/community feed reads at concurrency 16;
    community-post writes at concurrency 12) against the real server + live
    `demeter_test`, asserting zero errors, a throughput floor, a generous p99
    ceiling, and that all 200 concurrent writes persisted (no lost inserts).
    Added a config-driven `rateLimit.enabled` flag (default on; perf server sets
    `RATE_LIMIT_ENABLED= false`) so load tests aren't throttled by the per-user
    tier.
- [x] **29.18.4.2** Stress test sensor data ingestion
  - Done 2026-05-31: `sensor-ingestion.performance.spec.ts` ingests 300
    concurrent reading batches × 20 readings (6000 total) and asserts zero
    errors + that all 6000 are durably persisted (`total === 6000`, no drops
    under contention), reporting batch and per-reading throughput.
- [x] **29.18.4.3** Benchmark database queries
  - Done 2026-05-31: `query-benchmark.performance.spec.ts` times the heavy store
    query paths directly (no HTTP) on a seeded set — `GardenStore. listGardens`
    (30), `PlantingStore.listByUser` (300 + stage fan-out),
    `HarvestStore.listByUser` (300), `CommunityStore.getLeaderboard`
    aggregation, `CommunityStore.listPublicGardens` with computed counts —
    reporting p50/p95/p99 and asserting each under a generous ceiling (measured
    p95 all 1–5ms locally).
- [ ] **29.18.4.4** Profile mobile app performance: on the Mac, capture a Hermes
      sampling profile of `apps/demeter/mobile` in the iOS simulator for cold
      start → dashboard → garden detail, and write
      `apps/demeter/docs/performance/mobile-profile.md` with time to
      interactive, dropped JS frames and the five hottest functions. Verify: the
      doc is committed with the numbers and the capture command. Depends on the
      simulator build from 29.18.3.11 (stated 2026-09-18). `blocked:upstream`
  - Deferred 2026-05-31: requires React Native runtime profiling
    (Hermes/Flipper) on a device/emulator, which the headless Linux box cannot
    host. The Mac can (restated 2026-09-18).
- [ ] **29.18.4.5** Profile web app performance: build `apps/demeter/web`
      (`npx vite build`, then `npx vite preview`) and run Lighthouse in headless
      Chromium against `/login`, `/dashboard`, `/gardens` and `/analytics`, the
      way `.github/workflows/oshun-web-lighthouse.yml` does for the Oshun web
      app. Write `apps/demeter/docs/performance/web-profile.md` with LCP, TBT,
      CLS and the JS bundle size per route. Verify: the doc holds the measured
      numbers, and every route over LCP 2.5 s or TBT 300 ms has a follow-up item
      filed in this section.
  - Restated 2026-09-18: the 2026-05-31 deferral called this impractical in a
    headless context and named a Next.js server. The app is Vite
    (`apps/demeter/web/vite.config.ts`) and Lighthouse runs headless on the
    Linux server, so the item is actionable.
- [x] **29.18.4.6** Test concurrent user scenarios
  - Done 2026-05-31: `concurrent-users.performance.spec.ts` registers 25 users
    (distinct IPs) and runs a mixed workload (create garden → post → list
    gardens → read feed) at concurrency 16; asserts zero errors AND per-user
    data isolation (each user sees exactly their own 8 gardens) — catching
    cross-request state leakage / pool contention.
- [ ] **29.18.4.7** Test offline sync performance: add
      `apps/demeter/mobile/src/services/offline/__tests__/sync-performance.spec.ts`
      that queues 1,000 offline actions into `ActionQueue`, replays them through
      `SyncEngine` against a mocked transport, and asserts zero dropped actions,
      correct `ConflictResolver` outcomes on 100 deliberate conflicts, and a
      replay-throughput floor written into the spec. Verify:
      `npx jest src/services/offline` passes in `apps/demeter/mobile`. Depends
      on the jest-expo suite running at all, which is 29.18.6.11 (stated
      2026-09-18). `blocked:upstream`
  - Restated 2026-09-18: the 2026-05-31 deferral called this a mobile-runtime
    concern. The offline services under
    `apps/demeter/mobile/src/services/offline` are plain TypeScript classes
    exercised under jest, so the only real blocker is the broken suite.
- [x] **29.18.4.8** Test large garden performance
  - Done 2026-05-31: `large-garden.performance.spec.ts` seeds 500 plantings in
    one garden and asserts paginated listing stays bounded (p99) and correct
    (`total === 500`, page = 50) under concurrency, plus correct stage-filtered
    counts at scale.
- [x] **29.18.4.9** Test search performance at scale
  - Done 2026-05-31: `search-scale.performance.spec.ts` seeds 3000 public posts
    and asserts feed type/tag filters return correct counts (300 featured, 500
    per type) with bounded latency under concurrency.
- [x] **29.18.4.10** Create performance benchmarks
  - Done 2026-05-31: `benchmarks.performance.spec.ts` is a `tinybench` ops/sec
    baseline over the store read paths (listGardens/listPlantings/listHarvests/
    feed/leaderboard/publicGardens), printing a `[bench]` table and asserting
    every task ran without error at positive throughput. `tinybench` added to
    devDependencies; `test:perf` script wired.

#### 29.18.5 Security Testing

- [x] **29.18.5.1** Perform OWASP top 10 assessment
  - Done 2026-05-31: produced a code-grounded OWASP Top 10 (2021) assessment at
    `apps/demeter/api/docs/security/owasp-top-10-assessment.md` mapping every
    category (A01–A10) to the implemented controls (file references) and the
    verifying tests (the 61-case `security.test.ts` + integration suite),
    honestly recording residual gaps. The one application-layer gap surfaced —
    A05 missing hardening response headers — was remediated in the same pass
    with a dependency-free `src/plugins/security-headers.ts` (CSP
    `default-src 'none'`, X-Content-Type-Options, X-Frame-Options,
    Referrer-Policy, CORP, HSTS), registered early in `buildServer` and verified
    by a header assertion in `server.integration.spec.ts`. Remaining residual
    items (encryption at rest §29.18.5.8, TLS in transit §29.18.5.9, centralized
    monitoring) are deployment-layer controls tracked under §29.19. 297 unit +
    92 integration tests pass.
- [x] **29.18.5.2** Test authentication bypass attempts
- [x] **29.18.5.3** Test authorization boundary violations
- [x] **29.18.5.4** Test SQL injection prevention
- [x] **29.18.5.5** Test XSS prevention
- [x] **29.18.5.6** Test CSRF protection
- [x] **29.18.5.7** Test API rate limiting
- [ ] **29.18.5.8** Test data encryption at rest, scoped to what the application
      controls (restated 2026-09-18: the item named no environment, and the
      local Docker Postgres has no disk encryption to test). Add
      `apps/demeter/api/test/integration/secrets-at-rest.integration.spec.ts`
      that registers a user, issues an API key and a session, then reads the
      rows back with direct SQL and asserts the password, API-key and
      refresh-token columns hold hashes and never the submitted plaintext.
      Verify:
      `npx vitest run -c vitest.integration.config.ts test/integration/secrets-at-rest.integration.spec.ts`
      passes against `demeter_test`. Disk encryption of the Postgres volume is a
      property of the Hetzner box (`infra/hetzner/README.md`), not of this app.
- [ ] **29.18.5.9** Test data encryption in transit at the only place the plane
      terminates TLS, the Caddy edge (restated 2026-09-18: the item named no
      environment; Postgres and Redis sit on a private Docker network without
      TLS). Once Demeter is reachable on staging, assert that
      `http://demeter-api.<domain>/health` redirects to `https`, that the
      certificate chain validates, that TLS 1.0/1.1 handshakes are refused, and
      that the `strict-transport-security` header from
      `src/plugins/security-headers.ts` survives the proxy; keep the probe as
      `apps/demeter/api/scripts/tls-probe.sh`. Verify: the script exits 0
      against staging. Depends on the DNS records of 29.19.1.6, which need the
      owner's registrar account. `blocked:upstream`
- [x] **29.18.5.10** Perform dependency vulnerability scan

#### 29.18.6 Accessibility Testing

- [ ] **29.18.6.1** Test screen reader compatibility (mobile). The residual task
      is execution: run the suite that is already written,
      `apps/demeter/mobile/src/__tests__/accessibility.test.tsx`, and fix
      whatever it finds. Verify: `npx jest src/__tests__/accessibility.test.tsx`
      in `apps/demeter/mobile` passes with the screen-reader contract block
      executed (non-zero test count). Depends on 29.18.6.11 (stated 2026-09-18).
      `blocked:upstream`
  - Work done 2026-05-31, execution deferred: wrote
    `apps/demeter/mobile/src/__tests__/accessibility.test.tsx` (RNTL) asserting
    the screen-reader contract of the design-system primitives — Button/ListItem
    `accessibilityRole`+name, Input visible-label→field association, Modal title
    `header` role + labelled close button. Hardened the components to make those
    assertions real (see §29.18.6.6 list). `tsc --noEmit` passes on the whole
    mobile project. Execution is blocked on this headless box: the entire
    `jest-expo` mobile suite fails (react-native is hoisted to the workspace
    root so the app-local `node_modules/react-native` path the jest config
    expects is absent, and the expo "winter" runtime throws
    `require`-outside-scope under jest-runtime) — reproduced against an existing
    mobile test. Consistent with the deferred mobile-runtime items §29.18.3.1 /
    §29.18.4.4.
- [x] **29.18.6.2** Test screen reader compatibility (web)
  - Done 2026-05-31: added a "Screen Reader Compatibility — web" section to
    `apps/demeter/web/src/__tests__/accessibility.test.tsx` verifying the `main`
    landmark (`<main id="main-content">`), the new skip link as first focusable
    element targeting it, sr-only text alternatives, and distinct nav/main
    landmarks. Added a real skip link + focusable `<main>` to
    `components/layout/AppLayout.tsx` (WCAG 2.4.1). 92 web a11y tests pass.
- [x] **29.18.6.3** Test keyboard navigation (web)
- [x] **29.18.6.4** Test color contrast ratios
- [x] **29.18.6.5** Test font scaling support
  - Done 2026-05-31: web — added a "Font Scaling" section asserting no component
    pins text via inline `font-size:Npx` or arbitrary `text-[Npx]` classes
    (Button/Input/Card/FormField/Modal), so Tailwind's rem-based scale resizes
    with browser zoom/root font-size (WCAG 1.4.4). Mobile — grep confirms no
    primitive sets `allowFontScaling={false}` anywhere, so all `<Text>` honours
    the OS Dynamic Type setting; a font-scaling section in the mobile suite
    asserts this (execution deferred per §29.18.6.1).
- [ ] **29.18.6.6** Test VoiceOver/TalkBack support. The residual task is
      execution of the `accessibilityState` / `accessibilityValue` /
      `accessibilityViewIsModal` / live-region assertions already written in
      `apps/demeter/mobile/src/__tests__/accessibility.test.tsx`. Verify: that
      block passes under `npx jest` in `apps/demeter/mobile`. A spoken pass with
      VoiceOver or TalkBack on a physical phone stays a manual residual in
      `apps/demeter/docs/accessibility/audit-report.md`. Depends on 29.18.6.11
      (stated 2026-09-18). `blocked:upstream`
  - Work done 2026-05-31, execution deferred (same mobile-suite blocker as
    §29.18.6.1): the mobile a11y suite asserts `accessibilityState`
    (disabled/busy on Button, disabled on Input), `accessibilityValue` on
    ProgressBar, `accessibilityViewIsModal` focus-trap on Modal, and a polite
    live region for input errors. Component remediations shipped: Input
    (label→`accessibilityLabel`, error/helper→`accessibilityHint`, error
    `accessibilityLiveRegion="polite"`), Modal (`accessibilityViewIsModal`,
    hidden backdrop, `header` title role), ProgressBar (`progressbar` role +
    determinate `accessibilityValue`). `tsc --noEmit` passes.
- [x] **29.18.6.7** Test reduced motion support
- [x] **29.18.6.8** Validate WCAG 2.1 AA compliance
  - Done 2026-05-31: added a "WCAG 2.1 AA Validation" section running the
    **axe-core** engine (tags `wcag2a/wcag2aa/wcag21a/wcag21aa`) against
    composed trees — a labelled form, an open modal dialog, error-state inputs,
    and the full app shell — returning **0 violations**, plus a Success-Criteria
    checklist (1.1.1, 1.3.1, 2.4.1, 3.3.1, 4.1.2). `color-contrast` is delegated
    to the deterministic luminance suite (§29.18.6.4) since jsdom has no layout.
- [x] **29.18.6.9** Test with accessibility tools (axe, Lighthouse)
- [x] **29.18.6.10** Create accessibility audit report
  - Done 2026-05-31: `apps/demeter/docs/accessibility/audit-report.md` — a
    code-grounded WCAG 2.1 AA audit: executive summary, full test inventory (web
    92 tests + mobile suite), the 5 remediations applied, a per-Success-
    Criteria conformance table, known items (brand-accent AA-large-only contrast
    with darker-token guidance; jsdom contrast caveat), and residual items
    (manual AT passes; mobile suite execution env-blocked).
- [ ] **29.18.6.11** Make the `jest-expo` suite in `apps/demeter/mobile` run
      (prerequisite added 2026-09-18: the 2026-05-31 notes on 29.18.6.1 and
      29.18.6.6 record a repo defect as an environment blocker). Failing
      command:
      `cd apps/demeter/mobile && npx jest src/__tests__/accessibility.test.tsx`.
      Two recorded causes: (1) `jest.config.js` maps `^react-native$` to
      `<rootDir>/node_modules/react-native`, but pnpm hoists `react-native` to
      the workspace root, so resolve it with
      `require.resolve('react-native/package.json')` instead of a fixed path;
      (2) the Expo "winter" runtime throws `require` outside of scope under
      jest-runtime, so align `jest-expo` with the installed `expo` major or stub
      the winter runtime in a jest setup file. Verify: `npx jest` in
      `apps/demeter/mobile` exits 0 and executes `accessibility.test.tsx`,
      `OfflineServices.test.ts` and `WidgetServices.test.ts` with a non-zero
      test count on the Linux server. Unblocks 29.18.4.7, 29.18.6.1 and
      29.18.6.6.

---

### 29.19 Deployment & DevOps

#### 29.19.1 Infrastructure Setup

- [ ] **29.19.1.1** Add a `demeter-api` service to
      `infra/hetzner/docker-compose.yml`, built from
      `apps/demeter/api/Dockerfile`, behind a `demeter` compose profile (Demeter
      is outside the V1.0 release scope in
      `libs/oshun/navigation/src/release-scope.ts`, so it must not start with
      the default stack). Give it `DATABASE_URL` and `REDIS_URL` from the
      stack's `postgres` and `redis` services, `JWT_SECRET` from the box env
      file, a `/health` healthcheck, a `mem_limit` that fits the README §6
      resource budget, and `logging: *default-logging`. Add its row to the
      service table and the `service` choice list in
      `.github/workflows/deploy-hetzner.yml`. Verify:
      `docker compose -f infra/hetzner/docker-compose.yml --profile demeter config`
      exits 0 and lists `demeter-api`. _Rewritten 2026-09-18: AWS ECS was
      replaced by the Hetzner compose plane (deploy-hetzner.yml)._
- [ ] **29.19.1.2** Give Demeter its own database on the box's Postgres: add
      `demeter` to `POSTGRES_MULTIPLE_DATABASES` in
      `infra/hetzner/docker-compose.yml` (created by
      `infra/hetzner/initdb/init-multiple-databases.sh`, which only runs on an
      empty volume, so add the `CREATE DATABASE` one-liner for an existing box
      to `infra/hetzner/README.md`), and document the `db:migrate` apply step
      for this plane in
      `apps/demeter/api/docs/operations/migration-strategy.md`. TimescaleDB is
      dropped from this item: the box image is `pgvector/pgvector:pg16` without
      that extension, and `demeter_sensor_readings` is a plain table
      (migration-strategy.md §7). Verify: the compose config stays valid and
      migration-strategy.md names the Hetzner apply command. _Rewritten
      2026-09-18: AWS ECS was replaced by the Hetzner compose plane
      (deploy-hetzner.yml)._
- **29.19.1.3** Configure ElastiCache Redis for caching. _Withdrawn 2026-09-18:
  ElastiCache has no counterpart to configure. The Hetzner stack's `redis`
  (Valkey) service already exists, and wiring `REDIS_URL` is part of 29.19.1.1._
- [ ] **29.19.1.4** Configure object storage for photos and exports on the
      stack's MinIO: add a private `demeter-uploads` bucket to the `minio-init`
      command in `infra/hetzner/docker-compose.yml`, and add Zod-validated
      `S3_ENDPOINT`, `S3_BUCKET`, `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`
      to `apps/demeter/api/src/config.ts` (the API has no object-store
      configuration today), failing loud with a `not_configured` error when an
      upload is attempted without them. Verify: a config spec covers the four
      variables and the fail-loud path, and the compose config stays valid.
      _Rewritten 2026-09-18: AWS ECS was replaced by the Hetzner compose plane
      (deploy-hetzner.yml)._
- [ ] **29.19.1.5** Serve `@demeter/web` from the Caddy edge in place of a CDN:
      add a `demeter-web` static service (the `docker/Dockerfile.web` static
      pattern that `telegram-miniapp` uses) under the `demeter` profile, and
      `demeter.<domain>` / `demeter-api.<domain>` site blocks in
      `infra/hetzner/edge/sites/staging.caddy` with long-lived cache headers for
      the hashed Vite assets. Verify: the `--profile demeter config` output
      lists `demeter-web`, and `caddy validate` (run from the `caddy` image)
      accepts the site file. _Rewritten 2026-09-18: AWS ECS was replaced by the
      Hetzner compose plane (deploy-hetzner.yml)._
- [ ] **29.19.1.6** Create the DNS records for `demeter.<domain>` and
      `demeter-api.<domain>` pointing at the Hetzner box. Needs the owner's DNS
      registrar account (stated 2026-09-18). _Rewritten 2026-09-18: AWS ECS was
      replaced by the Hetzner compose plane (deploy-hetzner.yml)._
      `blocked:external`
- **29.19.1.7** Configure ACM for SSL certificates. _Withdrawn 2026-09-18: Caddy
  issues certificates by ACME on its own once the site blocks (29.19.1.5) and
  the DNS records (29.19.1.6) exist; nothing is left to configure._
- [ ] **29.19.1.8** Monitor Demeter from the stack's observability profile: add
      `http://demeter-api:<port>/health/ready` to the `blackbox-http` job in
      `infra/hetzner/observability/prometheus.yml.tmpl` and a
      `DemeterApiUnavailable` rule to
      `infra/hetzner/observability/rules/platform.yml`, modelled on
      `OshunBffUnavailable`. Verify: `promtool check rules` (run from the
      `prom/prometheus` image) passes. _Rewritten 2026-09-18: AWS ECS was
      replaced by the Hetzner compose plane (deploy-hetzner.yml)._
- [ ] **29.19.1.9** Add transactional email to the Demeter API over SMTP (the
      API sends no mail today): a `SMTP_URL` variable in
      `apps/demeter/api/src/config.ts`, a `nodemailer` sender (pnpm catalog) for
      verification and password-reset mail, and a fail-loud `not_configured`
      path when the variable is absent. Verify: an integration spec sends
      through the Mailpit service in `apps/demeter/docker-compose.yml` and reads
      the message back from Mailpit's HTTP API. The production relay credentials
      are an owner input and are not part of this item. _Rewritten 2026-09-18:
      AWS ECS was replaced by the Hetzner compose plane (deploy-hetzner.yml)._
- [ ] **29.19.1.10** Deliver push notifications through the Expo push service in
      place of SNS. _Rewritten 2026-09-18: AWS ECS was replaced by the Hetzner
      compose plane (deploy-hetzner.yml)._
  - [ ] **29.19.1.10.a** Add a push sender port to `apps/demeter/api` with an
        Expo adapter that calls Expo's push HTTP API with `fetch` (no new
        dependency), a `demeter_push_tokens` table for device tokens, and a
        fail-loud `not_configured` path when `EXPO_ACCESS_TOKEN` is unset; route
        the `@demeter/tasks` notification decisions (`shouldSendNow`) through
        it. Verify: an integration spec with a test double at the Expo HTTP
        boundary asserts token registration, batching and the removal of tokens
        Expo reports as `DeviceNotRegistered`.
  - [ ] **29.19.1.10.b** Provision the Expo access token and the APNs/FCM
        credentials for `com.demeter.mobile`. Needs the owner's Expo, Apple and
        Google accounts (stated 2026-09-18). `blocked:external`

#### 29.19.2 Container & Orchestration

- [x] **29.19.2.1** Create API Dockerfile
- [ ] **29.19.2.2** Add an MQTT broker for sensor ingestion: an
      `eclipse-mosquitto` service pinned by digest in
      `apps/demeter/docker-compose.yml`, configured from
      `apps/demeter/mqtt/mosquitto.conf` with password-file authentication and a
      per-device topic ACL (`demeter/<deviceId>/#`). A custom Dockerfile is only
      needed if the config must be baked into the image; say which was chosen.
      Verify: `docker compose -f apps/demeter/docker-compose.yml config` is
      valid, and a `mosquitto_pub` / `mosquitto_sub` round trip inside the
      container succeeds with credentials and is refused without them.
- [ ] **29.19.2.3** Create the ML inference image
      `apps/demeter/ml-inference/Dockerfile` (restated 2026-09-18: there is
      nothing to serve today, because `apps/demeter/api/src/routes/ai.ts`
      answers with heuristic algorithms and the repo holds no plant model
      weights). First obtain an openly licensed plant classifier: download the
      pretrained Pl@ntNet-300K ResNet weights published with that dataset,
      export them to ONNX, and record the source URL, licence and checksum; park
      only with a named failed download or export attempt. Then build a CPU
      image that serves `POST /v1/identify` with `onnxruntime` and returns the
      top-5 species with scores, and point the `tensorflow_lite`/`onnx` provider
      seam of `@demeter/intelligence` at it. Verify: `docker build` succeeds on
      the Linux server, and a spec posts three labelled test images from the
      dataset's test split and gets the right species in the top 5 for each.
- [x] **29.19.2.4** Create docker-compose for local dev
- **29.19.2.5** Configure ECS task definitions. _Withdrawn 2026-09-18: AWS ECS
  was replaced by the Hetzner compose plane (deploy-hetzner.yml); the compose
  service of 29.19.1.1 is the task definition._
- **29.19.2.6** Configure ECS services. _Withdrawn 2026-09-18: same reason; see
  29.19.1.1._
- **29.19.2.7** Configure auto-scaling policies. _Withdrawn 2026-09-18: one
  Hetzner box has nothing to scale out to. Capacity is the `mem_limit` set in
  29.19.1.1 against the resource budget in `infra/hetzner/README.md` §6._
- **29.19.2.8** Configure health checks. _Withdrawn 2026-09-18: covered by the
  container healthcheck in 29.19.1.1 and the blackbox probe in 29.19.1.8._
- **29.19.2.9** Configure load balancer. _Withdrawn 2026-09-18: the Caddy edge
  does the host routing; Demeter's site blocks are 29.19.1.5._
- **29.19.2.10** Configure service mesh (optional). _Withdrawn 2026-09-18: one
  box with one private Docker network has no mesh to configure._

#### 29.19.3 CI/CD Pipeline

- [x] **29.19.3.1** Configure GitHub Actions for CI
- [x] **29.19.3.2** Set up automated testing on PR
- [x] **29.19.3.3** Set up automated linting on PR
- [x] **29.19.3.4** Set up code coverage reporting
- [x] **29.19.3.5** Set up security scanning
- [ ] **29.19.3.6** Set up staging deployment: add `apps/demeter/api/**` and
      `apps/demeter/web/**` to the `paths` filter of
      `.github/workflows/deploy-hetzner.yml` and to the affected-service
      resolution in its `plan` job, so a change there builds
      `ghcr.io/greychimp/oshun/demeter-api` and `demeter-web` and deploys them
      to staging with the `demeter` profile enabled. Verify:
      `actionlint .github/workflows/deploy-hetzner.yml` passes, and the plan
      step resolves both service names for a diff that touches
      `apps/demeter/api`. Follows 29.19.1.1 and 29.19.1.5. _Rewritten
      2026-09-18: AWS ECS was replaced by the Hetzner compose plane
      (deploy-hetzner.yml)._
- [ ] **29.19.3.7** Set up production deployment. The mechanism is the same
      workflow's `approve-production` gate, so nothing technical is left after
      29.19.3.6. What is missing is an owner decision to launch Demeter at all:
      it is in no release in `libs/oshun/navigation/src/release-scope.ts`, and
      the box runs one monitored production stack at most (stated 2026-09-18).
      _Rewritten 2026-09-18: AWS ECS was replaced by the Hetzner compose plane
      (deploy-hetzner.yml)._ `blocked:governance`
- [x] **29.19.3.8** Configure mobile app builds (EAS)
  - Verified 2026-05-31: `apps/demeter/mobile/eas.json` is a complete EAS build
    config — `development`/`preview`/`production` profiles for both iOS and
    Android (distribution, channels, resource classes, APK vs app-bundle, prod
    `autoIncrement`), plus `submit` profiles (iOS bundle id
    `com.demeter.mobile`, Android internal-track draft). Remote
    `appVersionSource`, base env (`EXPO_PUBLIC_API_URL`). Genuinely done.
- **29.19.3.9** Configure web app deployment (CloudFront). _Withdrawn
  2026-09-18: CloudFront is gone with AWS. Serving the web app is 29.19.1.5 and
  deploying it is 29.19.3.6._
- **29.19.3.10** Set up deployment notifications. _Withdrawn 2026-09-18:
  `deploy-hetzner.yml` already writes the deploy result to the run summary and
  fails the run on an unhealthy smoke; Demeter inherits that once 29.19.3.6 adds
  it to the workflow._

#### 29.19.4 Database Operations

- **29.19.4.1** Configure automated backups. _Withdrawn 2026-09-18: the
  `pg-backup` sidecar in `infra/hetzner/docker-compose.yml` dumps every database
  in the instance nightly and `offbox-backup` ships the dumps off the box, so
  Demeter's database is covered the moment 29.19.1.2 creates it._
- **29.19.4.2** Configure point-in-time recovery. _Withdrawn 2026-09-18: RDS
  PITR went with AWS. The Hetzner plane's recovery model is nightly dumps plus
  encrypted off-box snapshots (`infra/hetzner/README.md` §5); WAL archiving
  would be a platform decision, not a Demeter task._
- **29.19.4.3** Set up read replicas for scaling. _Withdrawn 2026-09-18: a
  single box has no replica to provision._
  - Deferred 2026-05-31: RDS read-replica provisioning is a cloud-infra control
    (§29.19.1) with no local substrate.
- [x] **29.19.4.4** Configure connection pooling
  - Verified 2026-05-31: `src/plugins/database.ts` builds the pg.Pool via
    `@oshun/database` with `min`/`max` (from Zod-validated `DB_POOL_MIN`/
    `DB_POOL_MAX`, cross-validated min≤max in `config.ts`), `idleTimeoutMillis`
    30s, `connectionTimeoutMillis` 5s, a non-fatal pool `error` handler, and an
    `onClose` hook that drains the pool on shutdown. Production-grade and
    complete.
- **29.19.4.5** Set up database monitoring. _Withdrawn 2026-09-18:
  `postgres-exporter` in the observability profile already watches the whole
  instance, which includes Demeter's database after 29.19.1.2._
- [x] **29.19.4.6** Create database migration strategy
  - Done 2026-05-31: `apps/demeter/api/docs/operations/migration-strategy.md` —
    grounded in the real Drizzle setup (canonical schema in `@demeter/core`,
    `drizzle/0000–0005`, `db:generate`/`db:migrate`/`db:push`,
    `tablesFilter demeter_*`). Covers authoring (generate-don't-handedit,
    read-the-SQL, rename/backfill caveats), apply mechanism per env, the
    integration-harness replay + `demeter_test` reset rule + table-count smoke
    assertion, the expand→migrate→contract zero-downtime sequence, the
    forward-fix rollback policy, and the (currently-unused) TimescaleDB note.
- [ ] **29.19.4.7** Add a retention job for sensor readings on stock Postgres
      (restated 2026-09-18: TimescaleDB is not used, see migration-strategy.md
      §7). Add `SENSOR_READING_RETENTION_DAYS` to
      `apps/demeter/api/src/config.ts` and a scheduled task in the API that
      rolls readings older than the window up into hourly aggregates and then
      deletes the raw rows from `demeter_sensor_readings` in bounded batches.
      Verify: an integration spec seeds readings on both sides of the boundary
      and asserts that only the old raw rows are gone, the aggregates match
      them, and a second run is a no-op.
- **29.19.4.8** Set up database performance alerts. _Withdrawn 2026-09-18:
  instance-level Postgres alerts belong to
  `infra/hetzner/observability/rules/platform.yml` and are not Demeter-specific;
  Demeter's own API alerts are 29.19.5.6._
- [ ] **29.19.4.9** Create the disaster recovery runbook
      `apps/demeter/docs/operations/disaster-recovery.md`: restoring the
      `demeter` database from a `pg-backup` dump with the commands in
      `infra/hetzner/README.md` §5, recovering the `demeter-uploads` bucket, the
      recovery point and time the nightly schedule implies, and who to tell.
      Verify: every step is a copy-pasteable command, and the restore steps are
      the ones 29.19.4.10 actually ran.
- [ ] **29.19.4.10** Test backup restoration: add
      `apps/demeter/api/scripts/restore-drill.sh` that takes a custom-format
      `pg_dump` of the local `demeter_dev` database, restores it into a scratch
      database, and compares per-table row counts and the table-count smoke
      assertion from migration-strategy.md. Verify: the script exits 0 against
      the Postgres in `apps/demeter/docker-compose.yml` and fails when one table
      is truncated in the restored copy (run that negative case once and record
      it).

#### 29.19.5 Monitoring & Observability

- **29.19.5.1** Set up application logging (CloudWatch Logs). _Withdrawn
  2026-09-18: the API already logs structured JSON at `LOG_LEVEL`, and the
  rotated `default-logging` driver comes with the compose service of 29.19.1.1._
- **29.19.5.2** Set up distributed tracing (X-Ray). _Withdrawn 2026-09-18: the
  single-box plane runs no trace collector (none in
  `infra/hetzner/docker-compose.yml`). Request correlation is the request id
  that `src/plugins/request-context.ts` puts in every log line. Reopen if the
  platform adds a collector._
- [ ] **29.19.5.3** Set up metrics collection: add
      `apps/demeter/api/src/plugins/metrics.ts` exposing `/metrics` with
      `prom-client` (pnpm catalog): an HTTP request-duration histogram labelled
      by route and status class, and pg-pool gauges. Keep the route off the
      public Caddy site block. Add a `demeter-api` scrape job to
      `infra/hetzner/observability/prometheus.yml.tmpl`, modelled on the `bff`
      job. Verify: an integration spec asserts `/metrics` reports
      `http_request_duration_seconds` for a request just made. _Rewritten
      2026-09-18: AWS ECS was replaced by the Hetzner compose plane
      (deploy-hetzner.yml)._
- [ ] **29.19.5.4** Create the API performance dashboard
      `infra/hetzner/observability/grafana/dashboards/demeter-api.json` (request
      rate, p50/p95/p99 latency, error rate, pg-pool saturation) over the
      metrics from 29.19.5.3. Verify: every panel query names a metric that
      `/metrics` really exports, and Grafana's provisioning loads the file
      without an error in its log.
- **29.19.5.5** Create infrastructure dashboards. _Withdrawn 2026-09-18: the box
  is already covered by
  `infra/hetzner/observability/grafana/dashboards/v1-operations.json`; nothing
  here is Demeter-specific._
- [ ] **29.19.5.6** Set up alerting rules: add `DemeterApiHighErrorRate` and
      `DemeterApiHighLatency` to
      `infra/hetzner/observability/rules/platform.yml`, modelled on the two
      `OshunBff…` rules, over the metrics from 29.19.5.3. Verify:
      `promtool check rules` passes, and a `promtool test rules` file fires each
      alert on a synthetic series.
- [ ] **29.19.5.7** Configure PagerDuty/OpsGenie integration. Alertmanager
      already routes to an external incident receiver through a webhook URL
      secret (`infra/hetzner/observability/alertmanager.yml`), and Demeter's
      alerts ride the same route. What remains is choosing and paying for the
      paging vendor and placing its URL on the box, which is the owner's account
      (stated 2026-09-18). `blocked:external`
- [ ] **29.19.5.8** Set up error tracking (Sentry).
  - [ ] **29.19.5.8.a** Initialise `@sentry/node` (pnpm catalog) in
        `apps/demeter/api/src/server.ts` behind an optional `SENTRY_DSN` in
        `src/config.ts`; with no DSN the API boots and reports
        `errorTracking: {configured: false}` on `/health/ready`. Scrub
        authorization headers and request bodies before send. Verify: a unit
        spec asserts the scrubber and that the error handler forwards a 500 to a
        test transport but not a 4xx.
  - [ ] **29.19.5.8.b** Create the Sentry project and place its DSN in the box
        env file. Needs the owner's Sentry account (stated 2026-09-18).
        `blocked:external`
- [ ] **29.19.5.9** Create the operations runbook
      `apps/demeter/docs/operations/runbook.md` for the Hetzner plane
      (`troubleshooting.md` beside it covers local development only): API
      unavailable, pg-pool exhaustion, a failed migration and its forward fix,
      disk full, and restoring from a dump. Verify: each entry names the alert
      that fires (29.19.1.8, 29.19.5.6), the symptom, and the exact commands.
- **29.19.5.10** Set up uptime monitoring. _Withdrawn 2026-09-18: same
  deliverable as the blackbox probe and `DemeterApiUnavailable` rule in
  29.19.1.8._

#### 29.19.6 App Store Deployment

- [ ] **29.19.6.1** Create App Store Connect listing. Store work waits on a
      Demeter mobile release, and none is scheduled (stated 2026-09-18). It also
      needs the owner's Apple Developer account. `blocked:release`
- [ ] **29.19.6.2** Create Google Play Console listing. Store work waits on a
      Demeter mobile release, and none is scheduled (stated 2026-09-18). It also
      needs the owner's Google Play account. `blocked:release`
- [ ] **29.19.6.3** Prepare app screenshots (all device sizes). Store work waits
      on a Demeter mobile release, and none is scheduled (stated 2026-09-18).
      `blocked:release`
- [ ] **29.19.6.4** Write app store descriptions. Store work waits on a Demeter
      mobile release, and none is scheduled (stated 2026-09-18).
      `blocked:release`
- [ ] **29.19.6.5** Create app preview videos. Store work waits on a Demeter
      mobile release, and none is scheduled (stated 2026-09-18).
      `blocked:release`
- [ ] **29.19.6.6** Submit for App Store review. Store work waits on a Demeter
      mobile release, and none is scheduled (stated 2026-09-18).
      `blocked:release`
- [ ] **29.19.6.7** Submit for Google Play review. Store work waits on a Demeter
      mobile release, and none is scheduled (stated 2026-09-18).
      `blocked:release`
- [ ] **29.19.6.8** Configure in-app purchases (if applicable). Store work waits
      on a Demeter mobile release, and none is scheduled (stated 2026-09-18).
      Products are created inside the store accounts of 29.19.6.1 and 29.19.6.2.
      `blocked:release`
- [ ] **29.19.6.9** Configure subscription management. Store work waits on a
      Demeter mobile release, and none is scheduled (stated 2026-09-18). The
      entitlement logic already lives in `@demeter/monetization`; what is left
      is store-side product setup. `blocked:release`
- [ ] **29.19.6.10** Set up app store analytics. Store work waits on a Demeter
      mobile release, and none is scheduled (stated 2026-09-18).
      `blocked:release`

---

### 29.20 Documentation

#### 29.20.1 Technical Documentation

- [x] **29.20.1.1** Document API endpoints (OpenAPI/Swagger)
  - Done 2026-05-31: the API is self-documenting — `@fastify/swagger` generates
    an OpenAPI 3.1 spec from the route schemas (Swagger UI at `/docs`, JSON at
    `/docs/json`). Added `apps/demeter/docs/api/README.md` (entry point: where
    docs live, versioning, bearer auth, documented domains, spec export) and a
    new executable contract `test/integration/openapi.integration.spec.ts` (6
    tests) asserting the spec is OpenAPI 3.1, declares BearerAuth + all domain
    tags, documents ≥20 paths, and that **every operation has a summary, tag,
    and response** (fails if an endpoint ships undocumented). All 6 pass.
- [x] **29.20.1.2** Document database schema
  - Done 2026-05-31: `apps/demeter/docs/database/schema.md` — maps all 29
    `demeter_*` tables grouped by domain (identity/auth, gardens, plant catalog,
    planting lifecycle, operations, IoT, plant health, weather, community) with
    each table's purpose + foreign keys (extracted from the canonical
    `libs/demeter/core/src/db-schema.ts`), the full enum catalog, conventions
    (uuid PKs, soft-delete, demeter\_ namespace), an ASCII relationship
    overview, and the sync rule tied to the 29-table smoke assertion.
- [x] **29.20.1.3** Document library APIs (TypeDoc)
  - Done 2026-05-31: added a per-library `typedoc.json` to all 14
    `libs/demeter/*` libs (entryPoints `src/index.ts`, scoped to each
    `tsconfig.lib.json`, excludePrivate/Internal/Externals) +
    `apps/demeter/docs/library-api-docs.md` (setup, why per-lib not unified — a
    single base-tsconfig run OOMs at 9GB by pulling the whole monorepo —,
    generation commands, covered libs). Output `libs/demeter/*/docs/`
    git-ignored. Verified core/sensors/automation/plants generate with 0 errors.
- [x] **29.20.1.4** Document architecture decisions (ADRs)
  - Done 2026-05-31: `apps/demeter/docs/architecture/adr/` — an ADR log (README
    index + format) with 6 grounded, accepted ADRs reflecting real decisions:
    0001 Postgres+Drizzle over in-memory stores, 0002 Fastify-5 plugin
    architecture, 0003 OpenAPI-first docs, 0004 JWT + rotating refresh tokens
    with family reuse-detection, 0005 injectable external providers (no
    Math.random simulation), 0006 shared DB with `demeter_` namespace.
- [x] **29.20.1.5** Document deployment procedures
  - Done 2026-05-31: `apps/demeter/docs/operations/deployment.md` — grounded in
    the real artifacts: API multi-stage Dockerfile build, the validated runtime
    env matrix, migrate-first release sequence + health probes, local dev
    bring-up, web Vite bundle, EAS mobile build/submit profiles. Cloud (AWS)
    provisioning explicitly scoped to the deferred §29.19 infra.
- [x] **29.20.1.6** Document IoT device protocols
  - Done 2026-05-31: `apps/demeter/docs/protocols/iot-device-protocols.md` —
    grounded in `@demeter/sensors`: the 8-protocol catalog (MQTT/Zigbee/Z-Wave/
    Matter/Thread/Wi-Fi/BLE/LoRa) with characteristics, the `ProtocolAdapter`
    abstraction + factories, the `garden/bed/sensor` topic convention
    (`parseMQTTTopic`), the `NormalizedReading` payload format + per-protocol
    parsing, the bridge, end-to-end flow, and the in-memory-vs-production
    transport note.
- [x] **29.20.1.7** Document data models
  - Done 2026-05-31: `apps/demeter/docs/data-models.md` — the three-layer model
    (Postgres row → store domain record → Zod-validated API DTO), camelCase/ISO/
    undefined-not-null conventions, the cross-layer mapping table (cm↔m,
    location object↔columns, soilType JSONB, derived ownership), boundary
    validation, and where each layer lives in the tree.
- [x] **29.20.1.8** Document automation rule syntax
  - Done 2026-05-31: `apps/demeter/docs/automation/rule-syntax.md` — grounded in
    `@demeter/automation` rules.ts: rule anatomy, the 6 condition types, 8
    operators (+negate), nestable AND/OR `ConditionGroup`s, the 6 action types,
    the `RuleContext`, cooldown/priority, a worked moisture-irrigation example,
    and the alerts/irrigation/climate/scenes/history building blocks.
- [x] **29.20.1.9** Document integration guides
  - Done 2026-05-31:
    `apps/demeter/docs/integrations/third-party-integrations.md` — grounded in
    `@demeter/sensors` integrations.ts: the 10 supported platforms
    (GARDENA/Rachio/Orbit/Ecowitt/Ambient/Davis/Home Assistant/openHAB/Hubitat/
    SmartThings) with capabilities + auth methods, the create→test→sync→map→
    monitor lifecycle, the Home Assistant entity + MQTT-discovery bridges, an
    approach-selection table, and security notes.
- [x] **29.20.1.10** Document troubleshooting guides
  - Done 2026-05-31: `apps/demeter/docs/operations/troubleshooting.md` —
    concrete cause+fix for the real failure modes: env-validation boot failures,
    Fastify version mismatch, DB unreachable/pool-exhaustion/missing-tables,
    integration harness skip + the demeter_test schema-reset rule + table-count
    smoke + rate-limit IP gotcha, runtime
    401/refresh-rotation/family-revocation, 429 rate limiting, Redis
    degradation, and the mobile jest env blocker.

#### 29.20.2 User Documentation

- [x] **29.20.2.1** Create getting started guide
- [x] **29.20.2.2** Create garden setup guide
- [x] **29.20.2.3** Create plant encyclopedia usage guide
- [x] **29.20.2.4** Create task management guide
- [x] **29.20.2.5** Create journal usage guide
- [x] **29.20.2.6** Create IoT setup guide
- [x] **29.20.2.7** Create automation guide
- [x] **29.20.2.8** Create AI features guide
- [x] **29.20.2.9** Create community features guide
- [x] **29.20.2.10** Create FAQ section
  - Done 2026-05-31: 10 end-user guides in `apps/demeter/docs/guides/`
    (getting-started, garden-setup, plant-encyclopedia, task-management,
    journal, iot-setup, automation, ai-features, community, faq). Each grounded
    in the real web routes (`/gardens`, `/plants/*`, `/tasks/*`, `/sensors/*`,
    `/community`, …) and lib/API capabilities (AI endpoints identify-plant/
    diagnose/planting-plan/optimize-layout/harvest-predict/chat; the 8 sensor
    protocols + 10 integration platforms; the automation rule grammar), with
    cross-links between guides and to the technical docs.

#### 29.20.3 Developer Documentation

- [x] **29.20.3.1** Create contribution guidelines
- [x] **29.20.3.2** Create local development setup guide
- [x] **29.20.3.3** Create testing guidelines
- [x] **29.20.3.4** Create code style guide
- [x] **29.20.3.5** Create plugin/extension development guide
- [x] **29.20.3.6** Create DIY sensor development guide
- [x] **29.20.3.7** Create third-party integration guide
  - Done 2026-05-31: 7 developer docs in `apps/demeter/docs/development/`
    (contributing, local-development, testing, code-style, plugin-development,
    diy-sensor-development, building-on-the-api). Grounded in the real repo
    conventions (conventional commits + stub-linter, vitest unit/integration
    harness + demeter*test reset rule, Fastify-5 plugin ordering, the MQTT
    topic/payload contract for DIY sensors, OpenAPI-driven API consumption + the
    JWT/API-key auth model). `.3.7` = developer guide for building \_on* the
    Demeter API (complements §29.20.1.9 which covers integrating devices _into_
    Demeter).
- [x] **29.20.3.8** Create API client libraries
  - Done 2026-05-31: new `@demeter/api-client` library
    (`libs/demeter/api-client/`) — a real, dependency-free, typed TS client:
    `DemeterClient` with both auth modes (Bearer JWT + machine `X-API-Key`),
    **transparent refresh-token rotation** (one refresh+retry on 401, fires
    `onTokensRefreshed`, no loop), typed `DemeterApiError`, versioned URL/query
    building, and resource namespaces (auth/gardens/sensors + generic
    list/get/create). 10 vitest tests pass; `tsc` + eslint clean; typedoc config
    included. (Python SDK = §29.21.9.4.)
- [x] **29.20.3.9** Create example applications
  - Done 2026-05-31: `apps/demeter/examples/` — `quickstart.ts` (user login +
    refresh-rotation persistence, create/list/get gardens) and
    `sensor-ingest.ts` (API-key machine client pushing a reading batch,
    mirroring the DIY-sensor guide) using `@demeter/api-client`, plus a README
    with run commands. Both typecheck against the SDK (tsc clean).
- [x] **29.20.3.10** Create changelog and versioning policy
  - Done 2026-05-31: `apps/demeter/docs/development/changelog-versioning.md` —
    SemVer + `/vN` path versioning, the Conventional-Commit→changelog mapping
    table with SemVer bumps, forward-only DB migration versioning, and the
    deprecation policy.

---

### Phase 29 Summary Statistics

| Section                                  | Task Count |
| ---------------------------------------- | ---------- |
| 29.1 Foundation & Core Infrastructure    | 77         |
| 29.2 Plant Encyclopedia & Knowledge Base | 100        |
| 29.3 Garden Planning & Design            | 100        |
| 29.4 Task & Schedule Management          | 80         |
| 29.5 Seed & Inventory Management         | 70         |
| 29.6 Journal & Observation System        | 80         |
| 29.7 IoT & Sensor Integration            | 100        |
| 29.8 Automation & Rules Engine           | 80         |
| 29.9 AI/ML Intelligence                  | 100        |
| 29.10 Weather Integration                | 80         |
| 29.11 Community & Social Features        | 80         |
| 29.12 Hydroponics & Advanced Growing     | 90         |
| 29.13 Preservation & Post-Harvest        | 90         |
| 29.14 Analytics & Insights               | 90         |
| 29.15 API Backend                        | 100        |
| 29.16 Mobile Application (React Native)  | 130        |
| 29.17 Web Dashboard (React)              | 80         |
| 29.18 Testing & Quality Assurance        | 60         |
| 29.19 Deployment & DevOps                | 60         |
| 29.20 Documentation                      | 30         |
| **TOTAL Phase 29 (Demeter)**             | **~1,777** |

---

## Updated Grand Total

| Phase                                      | Task Count  |
| ------------------------------------------ | ----------- |
| Phase 0-14 (Original)                      | 796         |
| Phase 15: Physical Wellness & Fitness      | 503         |
| Phase 16: Video-to-Animation Pipeline      | 346         |
| Phase 17: State-of-the-Art AI Integration  | 424         |
| Phase 18: Production Readiness Remediation | 847         |
| Phase 19: AWS ECS + RunPod Infrastructure  | 126         |
| Phase 20: Eve/Aphrodite Platform           | 145         |
| Phase 21: Nyx Cosmic Observatory           | 251         |
| Phase 22: Tara Meditation Platform         | 318         |
| Phase 23: Veritas AI News Agency           | ~878        |
| Phase 24: Psyche AI Virtual Assistant      | ~866        |
| Phase 25: Metis Educational Platform       | ~679        |
| Phase 26: Yemaya Autonomous Platform       | 360         |
| Phase 27: Project Obsidian (Production)    | ~2,971      |
| Phase 28: Arete Personal Development       | ~1,225      |
| Phase 29: Demeter Home Gardening Platform  | ~1,777      |
| **GRAND TOTAL**                            | **~12,512** |

---

### 29.21 Gap Analysis Additions - SOTA Enhancement

> **Note:** These additional tasks were identified through competitive analysis
> against current market leaders (Planta, Greg, Gardenize, Gardenly, iScape,
> DreamzAR, Growee, etc.) and emerging technology trends in 2025-2026.

#### 29.21.1 Augmented Reality (AR) Features

> Deferred (native/device-bound, 2026-05-31; restated 2026-09-18): every task
> here is ARKit (iOS) / ARCore (Android) real-time camera + 3D rendering. The
> Mac can build for the iOS simulator, but the simulator has no AR camera
> session, so each item is tagged `blocked:hardware` until a physical phone
> exists — like the other mobile-runtime deferrals (§29.18.3.1, §29.18.6.1). The
> DATA these AR features consume already exists and is tested: mature plant
> dimensions + companion relationships (`@demeter/plants`), bed layout +
> sun-path (`@demeter/planner`), and the pest/disease catalog. Implementing the
> AR rendering belongs in the native mobile app on a device.

- [ ] **29.21.1.1** Create AR garden visualization engine using ARKit/ARCore.
      Needs a physical ARKit or ARCore phone: AR camera sessions do not run in
      the iOS simulator or on either fleet machine (stated 2026-09-18).
      `blocked:hardware`
- [ ] **29.21.1.2** Implement AR plant placement preview (see mature size in
      space). Needs a physical ARKit or ARCore phone: AR camera sessions do not
      run in the iOS simulator or on either fleet machine (stated 2026-09-18).
      `blocked:hardware`
- [ ] **29.21.1.3** Implement AR bed layout overlay on real garden space. Needs
      a physical ARKit or ARCore phone: AR camera sessions do not run in the iOS
      simulator or on either fleet machine (stated 2026-09-18).
      `blocked:hardware`
- [ ] **29.21.1.4** Create AR plant identification with live camera overlay.
      Needs a physical ARKit or ARCore phone: AR camera sessions do not run in
      the iOS simulator or on either fleet machine (stated 2026-09-18).
      `blocked:hardware`
- [ ] **29.21.1.5** Implement AR pest/disease detection with visual markers.
      Needs a physical ARKit or ARCore phone: AR camera sessions do not run in
      the iOS simulator or on either fleet machine (stated 2026-09-18).
      `blocked:hardware`
- [ ] **29.21.1.6** Create AR watering guide showing dry vs wet zones. Needs a
      physical ARKit or ARCore phone: AR camera sessions do not run in the iOS
      simulator or on either fleet machine (stated 2026-09-18).
      `blocked:hardware`
- [ ] **29.21.1.7** Implement AR sun exposure visualization (shadows through
      day). Needs a physical ARKit or ARCore phone: AR camera sessions do not
      run in the iOS simulator or on either fleet machine (stated 2026-09-18).
      `blocked:hardware`
- [ ] **29.21.1.8** Create AR measurement tool for garden dimensions. Needs a
      physical ARKit or ARCore phone: AR camera sessions do not run in the iOS
      simulator or on either fleet machine (stated 2026-09-18).
      `blocked:hardware`
- [ ] **29.21.1.9** Implement AR companion planting suggestions overlay. Needs a
      physical ARKit or ARCore phone: AR camera sessions do not run in the iOS
      simulator or on either fleet machine (stated 2026-09-18).
      `blocked:hardware`
- [ ] **29.21.1.10** Create AR garden tour mode for sharing with others. Needs a
      physical ARKit or ARCore phone: AR camera sessions do not run in the iOS
      simulator or on either fleet machine (stated 2026-09-18).
      `blocked:hardware`

#### 29.21.2 Virtual Reality (VR) Features

> Deferred (native/device-bound, 2026-05-31): VR walkthroughs/simulations target
> Meta Quest and Apple Vision Pro (native 3D/XR runtimes) — not buildable or
> verifiable in this headless TypeScript environment. The source data (3D garden
> plans, seasonal/growth state, plant models) lives in `@demeter/planner`; the
> XR rendering belongs in a native/Unity/WebXR client on the device.
>
> Restated 2026-09-18: build these as WebXR on the existing web 3D planner
> (`apps/demeter/web/src/pages/gardens/GardenPlanner3DPage.tsx`) and verify them
> in headless Chromium with Meta's open-source WebXR emulation runtime (`iwer`,
> installed as a dev dependency; record the version, and park only with a named
> failed install attempt). Only the on-headset check, 29.21.2.4, needs hardware.

- [ ] **29.21.2.1** Create VR garden walkthrough from 3D plans: add an "Enter
      VR" WebXR `immersive-vr` session to the 3D planner page with teleport
      locomotion between beds at real-world scale from the `@demeter/planner`
      plan. Verify: a chromium spec
      `apps/demeter/web/e2e/vr-walkthrough.spec.ts` starts an emulated session
      with `iwer`, teleports to a second bed and asserts the camera rig's new
      position and that the frame loop kept rendering.
- [ ] **29.21.2.2** Implement VR seasonal preview (see garden in
      spring/summer/fall): a season selector inside the XR session that swaps
      each planting's model state and the sun angle from `@demeter/planner`
      sun-path data. Verify: the emulated-session spec switches season and
      asserts the planting states and light direction changed to the expected
      values.
- [ ] **29.21.2.3** Create VR growth simulation over time: a time scrubber in
      the XR session that scales each planting between its planting date and
      mature dimensions from `@demeter/plants`. Verify: a unit spec for the
      interpolation (before planting, mid-growth, past maturity) and an
      emulated-session spec that scrubs and asserts the scale of one named
      planting.
- [ ] **29.21.2.4** Support Meta Quest and Apple Vision Pro: run the WebXR
      walkthrough of 29.21.2.1 in the Quest browser and in visionOS Safari and
      fix what differs from the emulator. Needs the physical headsets, and the
      fleet has neither (stated 2026-09-18). `blocked:hardware`
- [ ] **29.21.2.5** Create VR educational experiences (virtual garden classes):
      one guided lesson ("companion planting in a raised bed") as a sequence of
      narrated stops with highlighted plants inside the XR session, its script
      stored as data under `apps/demeter/web/src/pages/gardens/vr-lessons/`.
      Verify: the emulated-session spec advances through every stop and asserts
      the highlighted plant ids per stop. Further lessons are content, not code,
      and get their own items when someone writes them.

#### 29.21.3 Advanced Gamification System

- [x] **29.21.3.1** Create gamification engine with XP and leveling system
- [x] **29.21.3.2** Implement gardener skill trees (Vegetable Master, Flower
      Expert, etc.)
- [x] **29.21.3.3** Create streak tracking for daily garden care
- [x] **29.21.3.4** Implement seasonal challenges with rewards
- [x] **29.21.3.5** Create community leaderboards (local, regional, global)
- [x] **29.21.3.6** Implement achievement badge system (50+ badges)
- [x] **29.21.3.7** Create milestone celebrations (first harvest, 100th plant,
      etc.)
- [x] **29.21.3.8** Implement virtual garden currency for unlocking features
- [x] **29.21.3.9** Create gardening quests and missions
- [x] **29.21.3.10** Implement social sharing of achievements
- [x] **29.21.3.11** Create gardener rank titles (Seedling → Master Gardener)
- [x] **29.21.3.12** Implement progress visualization and stats dashboard
  - Done 2026-05-31: new `@demeter/gamification` library
    (`libs/demeter/gamification/`) — a pure, dependency-free domain lib with
    real algorithms + 26 vitest correctness tests (tsc + eslint clean). Modules:
    `leveling.ts` (closed-form XP power curve BASE·(L-1)^1.5 capped at L100 +
    level inversion + XP award table → .3.1; 8 rank bands Seedling→Grandmaster →
    .3.11), `streaks.ts` (consecutive-day current/longest with 1-day grace +
    milestone-weighted bonus → .3.3), `badges.ts` (**51 badges** — tiered
    counter ladders + special milestones, predicate-based unlock + newlyUnlocked
    diff isolating the milestone subset → .3.6/.3.7), `skill-trees.ts` (5
    category mastery trees with tiers/perks → .3.2), `challenges.ts`
    (delta-measured seasonal challenges + sequential quests with rewards →
    .3.4/.3.9), `currency.ts` (auditable earn/spend ledger + unlock catalog,
    never negative → .3.8), `leaderboard.ts` (composite gardenerScore +
    local/regional/global scope filtering + competition ranking with ties →
    .3.5), `sharing.ts` (badge/level/challenge share payloads → .3.10),
    `stats.ts` (buildDashboard view-model:
    level/rank/streak/badge-summary/next-milestone/skill-trees/ currency →
    .3.12). All 12 subtasks are real, tested logic; native share-sheet UI and
    the existing community-API leaderboard plumbing consume these.

#### 29.21.4 Enhanced Biodynamic & Lunar Features

- [x] **29.21.4.1** Create comprehensive biodynamic calendar engine
- [x] **29.21.4.2** Implement zodiac sign-based planting recommendations
- [x] **29.21.4.3** Create root/leaf/flower/fruit day notifications
- [x] **29.21.4.4** Implement Maria Thun-style biodynamic preparations tracking
- [x] **29.21.4.5** Create lunar phase widgets and visualizations
- [x] **29.21.4.6** Implement ascending/descending moon recommendations
- [x] **29.21.4.7** Create biodynamic task scheduling integration
- [x] **29.21.4.8** Implement planetary influence indicators (optional)
- [x] **29.21.4.9** Create biodynamic compost preparation guides
- [x] **29.21.4.10** Support toggle for scientific vs biodynamic mode
  - Done 2026-05-31: new `@demeter/biodynamic` library
    (`libs/demeter/biodynamic/`) — pure, dependency-free; 18 vitest tests (tsc +
    eslint clean). `astronomy.ts` implements faithful Meeus solar + lunar
    ecliptic longitude (verified vs the textbook examples: sun 199.9099° @
    JD2448908.5, moon 133.1627° @ JD2448724.5)
    - longitude-based lunar phase (verified ~new at the 2000-01-06 new Moon and
      ~full at the 2000-01-21 eclipse) → .4.5 (phase calc; widget UI consumes
      it). `biodynamic.ts` derives the sidereal constellation (Lahiri ayanāṁśa,
      equal signs — simplification documented vs Thun's unequal constellations)
      → element → Root/Leaf/Flower/Fruit day (.4.2/.4.3) + ascending/descending
      Moon (Sagittarius→Gemini arc) (.4.6) + `biodynamicCalendar` range engine
      (.4.1). `preparations.ts` = the Steiner/Thun preps 500–508 + Maria Thun
      barrel compost with traditional timing + the 502–507 compost set + spray
      recommender (.4.4/.4.9). `scheduling.ts` = day-type crop/task guidance +
      classical planetary ruler (.4.8) + `recommendActivities` with an honest
      **scientific⇄biodynamic toggle** that omits prescriptions and states the
      lack of experimental support in scientific mode (.4.7/.4.10).

#### 29.21.5 Light Meter & Environmental Scanning

- [x] **29.21.5.1** Create phone camera-based light meter (lux measurement)
- [x] **29.21.5.2** Implement PAR/PPFD estimation for grow lights
- [x] **29.21.5.3** Create DLI calculator from light readings
- [x] **29.21.5.4** Implement location-based light logging over time
- [x] **29.21.5.5** Create optimal placement recommendations based on readings
- [x] **29.21.5.6** Implement light comparison tool (compare spots)
- [x] **29.21.5.7** Create seasonal light tracking per location
- [x] **29.21.5.8** Integrate with sun path calculations for validation
  - Done 2026-05-31: new `@demeter/light-meter` library
    (`libs/demeter/light-meter/`) — pure photometric math; 17 vitest tests
    (tsc + eslint clean). `photometry.ts`: `luxFromExposure` (camera
    aperture/shutter/ISO → lux, verified vs Sunny-16 ≈ 80k lux) → .5.1;
    per-source lux↔PPFD table (sunlight 54 lux/µmol) → .5.2; `dli`
    (PPFD·photoperiod, verified 1000µmol·12h = 43.2) → .5.3. `logging.ts`:
    trapezoidal PPFD→DLI integration + location summary + monthly rollup →
    .5.4/.5.7. `placement.ts`: DLI requirement bands + suitability verdict +
    spot ranking/best-spot → .5.5/.5.6. `sunpath.ts`: Cooper declination +
    sunrise-equation day length + clear-sky DLI model + `validateAgainstSunPath`
    (measured vs clear-sky exposure fraction; verified equinox/solstice
    declinations + polar day/night) → .5.8. Native camera read is the only
    non-lib piece; all conversions/recommendations are here.

#### 29.21.6 Multi-User & Family Features

- [ ] **29.21.6.1** Create family/household account management. The residual
      task (restated 2026-09-18) is the app layer over `@demeter/household`:
      `apps/demeter/api/src/routes/gardens.ts` already has share, revoke and
      list-members, so add `PATCH /:id/members/:userId` (role change, owner
      only, refusing to demote the last owner), and build a Members panel on
      `apps/demeter/web/src/pages/gardens/GardenDetailPage.tsx` that invites by
      email, changes roles and removes members through
      `apps/demeter/web/src/api/hooks/` (not placeholder constants). Verify:
      `test/integration/gardens.integration.spec.ts` gains the role-change and
      last-owner cases, and a chromium spec
      `apps/demeter/web/e2e/household.spec.ts` invites, re-roles and removes a
      member.
  - Logic done, CRUD is app-layer (2026-05-31): the household **member + role
    model** lives in `@demeter/household` (`members.ts`) and the persistent
    membership table is `demeter_garden_members` (owner/caretaker/viewer); the
    invite/remove account-management UI/endpoints are app-layer over that model.
- [x] **29.21.6.2** Implement role-based permissions (owner, caretaker, viewer)
- [x] **29.21.6.3** Create shared task assignment and tracking
- [x] **29.21.6.4** Implement activity feed for household members
- [x] **29.21.6.5** Create vacation mode with caretaker handoff
- [x] **29.21.6.6** Implement kid-friendly mode with simplified interface
- [x] **29.21.6.7** Create household statistics and contributions tracking
- [x] **29.21.6.8** Implement notification routing by family member
  - Done 2026-05-31: new `@demeter/household` library
    (`libs/demeter/household/`) — pure RBAC + collaboration logic; 14 vitest
    tests (tsc + eslint clean). `roles.ts` capability matrix + `can`/`assertCan`
    for owner/caretaker/viewer/ **kid** (kid = simplified safe-action set →
    .6.2/.6.6); `assignments.ts` role-validated task assignment/reassignment +
    load (.6.3); `vacation.ts` caretaker handoff that moves only the away
    member's tasks **due within the absence** (.6.5); `feed.ts` reverse-chron
    activity feed w/ filters (.6.4); `contributions.ts` per-member contribution
    shares (.6.7); `notifications.ts` preference-aware routing —
    task→assignee+owners, alert→all opted-in, reply→target (.6.8).
- [ ] **29.21.6.9** Create shared calendar with multiple contributors. The
      residual task (restated 2026-09-18) is the view: make
      `apps/demeter/web/src/pages/tasks/CalendarPage.tsx` (route
      `/tasks/calendar`) load the garden's tasks through
      `apps/demeter/web/src/api/hooks/useTasks.ts`, show each task's assignee
      from the `@demeter/household` assignment model with a per-member colour
      and filter, and let an owner or caretaker reassign from the calendar.
      Verify: a chromium spec `apps/demeter/web/e2e/shared-calendar.spec.ts`
      seeds two members with tasks, filters by member and reassigns one task,
      and the change is visible to the second user's session.
  - Data model done, UI is app-layer (2026-05-31): multi-contributor scheduling
    is the `@demeter/household` assignment model over the existing
    `demeter_tasks` (with due dates) + `@demeter/api` task routes; the calendar
    **view** is a web/ mobile rendering of that shared task data (see web
    `/tasks/calendar`).
- [ ] **29.21.6.10** Support syncing across family member devices. The store
      already makes one member's write visible to the others (note below), so
      the residual task (restated 2026-09-18) is freshness in an open client:
      make the web task and garden queries refetch on window focus and on a
      30-second interval via `apps/demeter/web/src/api/queryClient.ts`, and make
      the mobile `SyncEngine` pull on app foreground. Verify: a chromium spec
      with two browser contexts signed in as two members of one garden shows a
      task completed in one context as completed in the other within 35 seconds
      without a reload.
  - Infra already satisfied (2026-05-31): cross-device sync is provided by the
    durable stateless Postgres backend proven under §29.18.2.10 (writes in one
    session are immediately visible to others + survive restart) — no per-device
    sync layer needed; the household model rides on that same store.

#### 29.21.7 Subscription & Monetization Infrastructure

- [x] **29.21.7.1** Design freemium feature tier structure
- [x] **29.21.7.2** Implement free tier with core features
- [x] **29.21.7.3** Implement Premium tier ($9.99/mo or $35.99/yr)
- [x] **29.21.7.4** Implement Pro tier for advanced users/small farms
- [x] **29.21.7.5** Create in-app purchase for one-time features
- [x] **29.21.7.6** Implement trial period management (7-day free trial)
- [x] **29.21.7.7** Create trial expiration reminders (1 day before)
- [x] **29.21.7.8** Implement subscription restoration across devices
- [x] **29.21.7.9** Create promotional/discount code system
- [x] **29.21.7.10** Implement family sharing for subscriptions
  - Done 2026-05-31: new `@demeter/monetization` library
    (`libs/demeter/monetization/`) — pure entitlement/billing logic; 17 vitest
    tests (tsc + eslint clean). `tiers.ts`: free/Premium($9.99/$35.99)/Pro
    tiers, the feature→min-tier entitlement matrix +
    `hasFeature`/`requiredTier`/ `yearlySavings` + one-time IAP unlocks
    (.7.1-.5). `trial.ts`: deterministic 7-day trial clock —
    state/daysRemaining/expiresAt + `shouldRemind` 1 day before expiry
    (.7.6/.7.7). `promo.ts`: percent/fixed/free-months promo codes with expiry +
    min-spend validation and discount math (.7.9). `subscription.ts`:
    cross-device `resolveEntitlement` (strongest active record across devices →
    .7.8) + family-plan seat management `addFamilyMember`/`memberTier`/seat caps
    (.7.10). App-store IAP purchase flow + receipt validation that produce the
    entitlement records are the native/store layer over this logic.

#### 29.21.8 Data Import & Portability

- [x] **29.21.8.1** Create import wizard for Gardenize data
- [x] **29.21.8.2** Create import wizard for Planta data
- [x] **29.21.8.3** Create import wizard for Garden Planner data
- [x] **29.21.8.4** Create import from spreadsheet (CSV/Excel) templates
- [x] **29.21.8.5** Implement photo import with EXIF-based dating
- [x] **29.21.8.6** Create bulk plant import from nursery lists
- [x] **29.21.8.7** Implement GDPR-compliant full data export
- [x] **29.21.8.8** Create account transfer between users
- [x] **29.21.8.9** Implement data deletion with confirmation
- [x] **29.21.8.10** Create portable garden profile format (open standard)
  - Done 2026-05-31: new `@demeter/data-portability` library
    (`libs/demeter/data-portability/`) — pure import/export logic; 15 vitest
    tests (tsc + eslint clean). `format.ts`: versioned portable garden-profile
    open format + serialize/parse with validation (.8.10). `import.ts`: RFC-4180
    CSV parser + field-mapped importers with preset column maps for the
    canonical Demeter template, Gardenize, Planta, Garden Planner, plus a
    nursery-list parser (.8.1-.4/.6). `photos.ts`: EXIF `DateTimeOriginal` → ISO
    with file-mtime fallback + batch dating (.8.5). `lifecycle.ts`: GDPR
    full-export assembly (.8.7), `transferOwnership` re-owner (.8.8), and a
    confirmation-gated deletion flow requiring the user to echo an exact phrase
    (.8.9). The import-wizard UI + binary EXIF extraction are the app/native
    layers over this.

#### 29.21.9 Developer API & SDK

- [x] **29.21.9.1** Create public REST API for third-party developers
  - Satisfied by existing work: the Demeter API (`apps/demeter/api`, `/v1/*`) is
    the OpenAPI-3.1-documented public REST API (Swagger UI `/docs`, JSON
    `/docs/json`; §29.20.1.1) with bearer + API-key auth.
- [ ] **29.21.9.2** Implement OAuth2 for third-party app authorization: an
      authorization server in `apps/demeter/api/src/routes/oauth.ts` with client
      registration, the authorization-code grant with PKCE (S256 only), a
      consent screen on the web app, scoped access tokens reusing the API-key
      scope vocabulary, refresh-token rotation with reuse detection, and
      revocation; clients, grants and tokens persisted in Postgres with tokens
      stored hashed. Verify: `test/integration/oauth.integration.spec.ts` covers
      the happy path, a wrong `code_verifier`, a replayed code, a redirect URI
      that is not registered, scope narrowing, a reused refresh token revoking
      the family, and revocation.
  - Partial/app-layer: third-party _machine_ access uses scoped, hashed API keys
    (`/v1/auth` API-key endpoints + `apiKeyAuth`), and OAuth _login_ verifiers
    exist (jose, ADR-0005). A full OAuth2 **authorization server** (issuing
    tokens to third-party apps on a user's behalf, consent screen) is a larger
    app-layer feature — left for a dedicated effort.
- [x] **29.21.9.3** Create JavaScript/TypeScript SDK
  - Done (§29.20.3.8): `@demeter/api-client` (`libs/demeter/api-client`), typed,
    auth + refresh rotation, 10 tests.
- [x] **29.21.9.4** Create Python SDK for data science integrations
  - Done 2026-05-31: `clients/demeter-python/` — dependency-free (stdlib
    `urllib`) `DemeterClient` mirroring the TS SDK (Bearer + API-key auth, typed
    `DemeterAPIError`, gardens/sensors helpers, injectable transport); 7 pytest
    tests pass offline; PEP-621 `pyproject.toml` + README.
- [x] **29.21.9.5** Create webhook system for event notifications
  - Done 2026-05-31: new `@demeter/webhooks` library (`libs/demeter/webhooks/`)
    — HMAC-SHA256 sign/verify with replay protection (`node:crypto`,
    constant-time), the event catalog + endpoint-subscription matching with
    `domain.*` wildcards, and a deterministic exponential-backoff retry policy
    (retry only transient 408/429/5xx/network); 10 vitest tests (tsc + eslint
    clean). The HTTP dispatcher is the app layer over this.
- [x] **29.21.9.6** Implement rate limiting and usage tiers for API
  - Satisfied by existing work: per-user/IP rate limiting in
    `apps/demeter/api/src/plugins/rate-limit.ts` (config-driven,
    `RATE_LIMIT_ENABLED`) + usage tiers in `@demeter/monetization` (§29.21.7).
- [ ] **29.21.9.7** Create developer portal with documentation. The residual
      task (restated 2026-09-18) is the self-service surface: a `/developers`
      section in `apps/demeter/web` where a signed-in user creates, names,
      scopes and revokes API keys through the existing `/v1/auth` API-key
      endpoints, sees per-key request counts for the last 30 days, and reaches
      the API reference and SDK guides. Verify: a chromium spec
      `apps/demeter/web/e2e/developer-portal.spec.ts` creates a key, shows the
      secret exactly once, calls the API with it, sees the count rise, and
      revokes it.
  - Partial/app-layer: the interactive API explorer (Swagger UI `/docs`) + the
    API reference, building-on-the-API guide, and SDK READMEs exist; a branded,
    self-service developer **portal** (key self-issue, usage dashboards) is an
    app/marketing surface left for a dedicated effort.
- [x] **29.21.9.8** Implement API key management
  - Satisfied by existing work: `AuthStore` create/find/list/revoke/touch API
    keys (hashed, prefixed, scoped, expiring) + the `/v1/auth` API-key routes +
    `apiKeyAuth` verification.
- [x] **29.21.9.9** Create sample applications and tutorials
  - Done (§29.20.3.9 + this): `apps/demeter/examples/` (quickstart +
    sensor-ingest using the JS SDK), the Python SDK README usage, and the
    building-on-the-API developer guide.
- [ ] **29.21.9.10** Establish partner program for integrations. This is a
      commercial decision for the owner, not engineering (restated 2026-09-18).
      `blocked:governance`
  - Business/non-code: a partner program is a commercial/marketing initiative,
    not a locally-actionable engineering task.

#### 29.21.10 Internationalization & Localization

- [x] **29.21.10.1** Implement i18n framework for all text
- [x] **29.21.10.2** Create translations for Spanish (es)
- [x] **29.21.10.3** Create translations for French (fr)
- [x] **29.21.10.4** Create translations for German (de)
- [x] **29.21.10.5** Create translations for Portuguese (pt)
- [x] **29.21.10.6** Create translations for Japanese (ja)
- [x] **29.21.10.7** Create translations for Mandarin Chinese (zh)
- [x] **29.21.10.8** Implement region-specific plant databases
  - Framework done: `@demeter/i18n` `regions.ts` provides per-country
    `RegionProfile` (climate-zone system + default units + locale) that
    region-specific plant filtering keys off; the plant data itself is the
    `@demeter/plants` catalog, filtered by the resolved climate zone.
- [x] **29.21.10.9** Support metric and imperial unit preferences
- [x] **29.21.10.10** Implement date/time format localization
- [x] **29.21.10.11** Create region-specific climate zone mappings
- [x] **29.21.10.12** Support right-to-left (RTL) languages
  - Done 2026-05-31: new `@demeter/i18n` library (`libs/demeter/i18n/`) — pure,
    dependency-free; 11 vitest tests (tsc + eslint clean). `core.ts`:
    `createI18n` translator with `{var}` interpolation, `Intl.PluralRules`
    plural selection, and a locale→en fallback chain (.10.1). `catalogs.ts`:
    **real** (non-echo) translations of the core UI/plural strings for en +
    es/fr/de/pt/ ja/zh, with a test enforcing full key coverage and that
    non-English strings differ (.10.2-.7). `format.ts`: Intl number/date/time
    formatting (.10.10) + metric⇄imperial conversion & formatting for
    temp/length/volume/mass (.10.9). `locale.ts`: RTL detection (ar/he/fa/ur…) +
    direction + `Accept-Language` negotiation (.10.12). `regions.ts`:
    country→climate-zone-system/units/locale profiles (.10.11/.10.8).

#### 29.21.11 Enhanced Wearable Integration

> Deferred (native/device-bound, 2026-05-31): Apple Watch complications +
> WatchKit, Wear OS tiles, on-watch Siri/haptics, and HealthKit/Google Fit
> fitness integration are native watchOS/Wear OS surfaces — not buildable or
> verifiable in this headless TS environment. The underlying data (next task,
> frost alert, sensor glance, harvest log) is served by the existing API; the
> watch UIs belong in the native mobile companion targets.
>
> Restated 2026-09-18: Xcode's watchOS simulator (Mac) and the Wear OS emulator
> run complications, tiles and watch apps without a physical watch, so those
> items are attempts that start once the native shells of 29.18.3.11 exist. The
> watch targets are added through an Expo config plugin and read
> `apps/demeter/mobile/src/services/widgets/WatchService.ts` data over
> WatchConnectivity (or the Wearable Data Layer). Haptics, on-wrist Siri and
> motion-based workouts cannot be verified in a simulator and stay parked on a
> physical watch.

- [ ] **29.21.11.1** Create Apple Watch complication for next task (WidgetKit
      complication families `accessoryCircular`, `accessoryRectangular`,
      `accessoryInline`). Verify: a watchOS simulator screenshot per family with
      a seeded next task, and a unit spec for the empty and overdue states.
      Depends on 29.18.3.11 (stated 2026-09-18). `blocked:upstream`
- [ ] **29.21.11.2** Create Apple Watch complication for weather/frost alert.
      Verify: simulator screenshots for the no-alert and frost-tonight states,
      and a unit spec for the threshold. Depends on 29.18.3.11 (stated
      2026-09-18). `blocked:upstream`
- [ ] **29.21.11.3** Implement haptic reminders for watering. Cannot be verified
      in the watchOS simulator; needs a physical Apple Watch, and the fleet has
      none (stated 2026-09-18). `blocked:hardware`
- [ ] **29.21.11.4** Create quick-log harvest from watch: a watch screen that
      picks a planting and a quantity and posts the harvest through the phone.
      Verify: in the paired simulators the harvest appears in
      `demeter_harvests`, and it is queued and later delivered when the phone is
      unreachable. Depends on 29.18.3.11 (stated 2026-09-18). `blocked:upstream`
- [ ] **29.21.11.5** Implement voice commands on watch ("Hey Siri, water
      tomatoes"). Cannot be verified in the watchOS simulator; needs a physical
      Apple Watch, and the fleet has none (stated 2026-09-18).
      `blocked:hardware`
- [ ] **29.21.11.6** Create Wear OS tile for garden status (tasks due, frost
      alert, driest sensor). First install the Wear OS emulator image with
      `sdkmanager` and record the version; park only with a named failed install
      attempt. Verify: an emulator screenshot of the tile with seeded data.
      Depends on 29.18.3.11 (stated 2026-09-18). `blocked:upstream`
- [ ] **29.21.11.7** Implement watch-based task completion from the task list on
      the watch app. Verify: completing a task in the watchOS simulator marks it
      done in `demeter_tasks` and updates the complication of 29.21.11.1.
      Depends on 29.18.3.11 (stated 2026-09-18). `blocked:upstream`
- [ ] **29.21.11.8** Create sensor data glance on watch: latest reading and a
      24-hour sparkline per sensor. Verify: a simulator screenshot with seeded
      readings, and a unit spec for stale and missing readings. Depends on
      29.18.3.11 (stated 2026-09-18). `blocked:upstream`
- [ ] **29.21.11.9** Implement watch-based plant identification shortcut: a
      watch action that opens the phone app on the identification camera through
      a deep link. Verify: in the paired simulators the action opens the
      `demeter://ai/identify` deep link on the phone. Depends on 29.18.3.11
      (stated 2026-09-18). `blocked:upstream`
- [ ] **29.21.11.10** Create fitness integration (gardening as exercise):
      HealthKit / Health Connect workout sessions driven by wrist motion. Cannot
      be verified in the watchOS simulator; needs a physical Apple Watch, and
      the fleet has none (stated 2026-09-18). `blocked:hardware`

#### 29.21.12 Widget Customization

> Deferred (native/device-bound, 2026-05-31): home-screen widgets are native
> WidgetKit (iOS) / App Widgets (Android) surfaces (layouts, sizes, interactive
> widgets, refresh intervals) — not buildable/verifiable in this headless TS
> env. They render existing API data (tasks/weather/sensors/photos/harvest
> countdowns); the widget targets live in the native mobile app.
>
> Restated 2026-09-18: the Mac builds and runs WidgetKit extensions in the iOS
> simulator without a signing identity, so these items are actionable there once
> the native shells of 29.18.3.11 exist. Every item below is the iOS WidgetKit
> extension target of `apps/demeter/mobile` (added through an Expo config plugin
> so `expo prebuild` regenerates it), fed by
> `apps/demeter/mobile/src/services/widgets/WidgetDataProvider.ts` through an
> App Group. Android App Widgets follow the same items once an Android emulator
> build exists. Evidence for each item: a simulator screenshot per widget family
> plus a unit spec for the timeline data it renders.

- [ ] **29.21.12.1** Create customizable widget layouts: a widget configuration
      intent that lets the user pick which blocks (tasks, weather, sensors) a
      widget shows and in what order. Verify: the simulator's widget editor
      changes the rendered layout. Depends on 29.18.3.11 (stated 2026-09-18).
      `blocked:upstream`
- [ ] **29.21.12.2** Implement widget theme options: light, dark and the app
      accent, following the system appearance by default. Verify: one screenshot
      per theme. Depends on 29.18.3.11 (stated 2026-09-18). `blocked:upstream`
- [ ] **29.21.12.3** Create multiple widget sizes (small, medium, large): the
      three `systemSmall` / `systemMedium` / `systemLarge` families, each with a
      layout that truncates instead of clipping. Verify: one screenshot per
      family with a ten-task fixture. Depends on 29.18.3.11 (stated 2026-09-18).
      `blocked:upstream`
- [ ] **29.21.12.4** Implement widget content selection (tasks, weather,
      sensors) as a parameter of the configuration intent from 29.21.12.1.
      Verify: a unit spec asserts that `WidgetDataProvider` emits only the
      selected content, and the simulator shows each choice. Depends on
      29.18.3.11 (stated 2026-09-18). `blocked:upstream`
- [ ] **29.21.12.5** Create interactive widgets (complete task from widget): an
      App Intent button (iOS 17+) that completes the task through the API and
      reloads the timeline. Verify: tapping in the simulator marks the task done
      in `demeter_tasks`. Depends on 29.18.3.11 (stated 2026-09-18).
      `blocked:upstream`
- [ ] **29.21.12.6** Implement widget refresh intervals configuration: a user
      setting of 15, 30 or 60 minutes that drives the timeline reload policy.
      Verify: a unit spec asserts the next-reload date for each setting. Depends
      on 29.18.3.11 (stated 2026-09-18). `blocked:upstream`
- [ ] **29.21.12.7** Create photo widgets showing recent garden photos,
      downscaled into the App Group container so the extension stays within its
      memory limit. Verify: a screenshot with three seeded photos, and a spec
      for the downscale bound. Depends on 29.18.3.11 (stated 2026-09-18).
      `blocked:upstream`
- [ ] **29.21.12.8** Implement countdown widgets (days to harvest) from each
      planting's expected harvest date. Verify: a unit spec covers today,
      past-due and no-date plantings, plus a simulator screenshot. Depends on
      29.18.3.11 (stated 2026-09-18). `blocked:upstream`

#### 29.21.13 Public Garden Profiles & Social Proof

> Deferred (app/UX layer, 2026-05-31): public profile pages, virtual tours,
> featured/awards showcases, testimonials, and before/after galleries are
> web/marketing presentation surfaces built on existing data — the public-garden
> read model + live counts already exist (§29.18.2.1 community/`is_public`
> gardens). The small extractable logic (garden cloning = copy a plan; garden
> comparison; social-proof metric aggregation) belongs with the garden domain in
> the API rather than a standalone pure lib. Left for app-layer work.
>
> Restated 2026-09-18: each item below now names its route, page and spec. Note
> for whoever picks these up: most existing pages under
> `apps/demeter/web/src/pages/` still render `Placeholder Data` constants (only
> the auth pages call `src/api/hooks/`), so every new surface here must load
> real data from `apps/demeter/api`.

- [ ] **29.21.13.1** Create public garden profile pages (shareable URL): add
      `GET /v1/community/gardens/:id` to
      `apps/demeter/api/src/routes/community.ts` returning the public read model
      (name, climate zone, beds, plantings, photo count, harvest totals; never
      the address or member emails) for gardens with `is_public`, and an
      unauthenticated web route `/g/:id` outside `ProtectedRoute` in
      `apps/demeter/web/src/router.tsx` with Open Graph tags. Verify: an
      integration spec asserts a private garden returns 404 and that no private
      field leaks; a chromium spec `apps/demeter/web/e2e/public-garden.spec.ts`
      opens the URL signed out.
- [ ] **29.21.13.2** Implement virtual garden tours: an owner-ordered list of
      stops (a bed or a photo plus a caption) stored in a new
      `demeter_garden_tours` table with a Drizzle migration, CRUD under
      `/v1/gardens/:id/tour`, and a stepper on the public profile of 29.21.13.1.
      Verify: an integration spec covers ordering, ownership and the 404 for a
      private garden; the chromium spec steps through a three-stop tour.
- [ ] **29.21.13.3** Create "featured gardens" showcase: a `featured_at` column
      on public gardens set from
      `apps/demeter/web/src/pages/settings/AdminDashboardPage.tsx` through an
      admin-only route, a `featured=true` filter on `GET /v1/community/gardens`,
      and a Featured strip on `CommunityPage.tsx`. Verify: an integration spec
      asserts that a non-admin cannot feature a garden and that un-publishing a
      garden removes it from the strip.
- [ ] **29.21.13.4** Implement garden cloning (copy someone's plan):
      `POST /v1/gardens/:id/clone` in `apps/demeter/api/src/routes/gardens.ts`
      copies the beds and the planting plan (not harvests, journal, members or
      sensors) of the caller's own garden or of a public one into a new garden
      owned by the caller, in one transaction. Verify: an integration spec
      asserts equal bed and planting counts, a 404 for someone else's private
      garden, and that editing the clone leaves the source unchanged.
- [ ] **29.21.13.5** Create garden comparison tool. The page exists at
      `/gardens/compare`
      (`apps/demeter/web/src/pages/gardens/GardenComparisonPage.tsx`) but
      renders a `Placeholder Data` block. Replace it with real per-garden
      aggregates (area, beds, plantings, harvest weight, water use) from a new
      `GET /v1/gardens/compare?ids=` route that only accepts gardens the caller
      can read. Verify: an integration spec for the aggregates and the access
      check; a chromium spec seeds two gardens and sees their real numbers side
      by side.
- [ ] **29.21.13.6** Implement testimonials and success stories: a
      `success_story` post type in `apps/demeter/api/src/routes/community.ts`
      (title, body, linked garden, before/after photo ids) with admin approval
      before it appears on the public profile and on the community page. Verify:
      an integration spec asserts an unapproved story is visible to its author
      only.
- [ ] **29.21.13.7** Create before/after transformation galleries: pair two
      journal photos of one garden into a comparison with a slider component on
      the public profile; pairs are stored with the garden. Verify: a component
      spec for keyboard operation of the slider (arrow keys, `aria-valuenow`)
      and an integration spec that refuses photos from another garden. Follows
      the object storage of 29.19.1.4.
- [ ] **29.21.13.8** Implement social proof metrics (gardens created, harvests
      logged): `GET /v1/community/stats` returning platform totals computed in
      SQL and cached in Redis for five minutes, shown on the login and public
      profile pages. Verify: an integration spec seeds known counts and asserts
      the totals, and that soft-deleted gardens are excluded.
- [ ] **29.21.13.9** Create influencer/ambassador program features. Whether
      Demeter runs an ambassador program, and on what terms, is a commercial
      decision for the owner; no feature can be specified before it (stated
      2026-09-18). `blocked:governance`
- [ ] **29.21.13.10** Implement garden of the month/year awards: an admin action
      that awards a featured garden (29.21.13.3) for a named month or year,
      stored in a `demeter_garden_awards` table, with a badge on the public
      profile and an awards archive on the community page. Verify: an
      integration spec asserts one award per period and that only an admin can
      grant it.

#### 29.21.14 Advanced Tutorial & Onboarding System

> Deferred (app/UX layer, 2026-05-31): onboarding wizards, contextual tooltips,
> video tutorials, guided setup, and learning-module UIs are presentation/UX
> flows in the web + mobile apps. The data they surface (what to do this month)
> is served by the existing planting calendar + biodynamic/task engines; quiz
> scoring + tip-of-the-day selection are trivial app helpers. Left for app-layer
> work.
>
> Restated 2026-09-18: each item below names its web surface and its spec. The
> mobile screens follow the web ones and are not part of these criteria.

- [ ] **29.21.14.1** Create interactive onboarding wizard: a first-run flow in
      `apps/demeter/web/src/pages/onboarding/` (location and climate zone,
      experience level, goals) that writes the profile through the API and is
      skipped for users who finished it. Verify: a chromium spec
      `apps/demeter/web/e2e/onboarding.spec.ts` completes the wizard as a new
      user, reloads, and lands on the dashboard without seeing it again; axe
      reports no violations on each step.
- [ ] **29.21.14.2** Implement skill-based tutorial paths
      (beginner/intermediate/advanced): three ordered module lists stored as
      data in a new `libs/demeter/learning` library, selected by the experience
      level from 29.21.14.1. Verify: a unit spec asserts every module id
      referenced by a path exists and that no path is empty.
- [ ] **29.21.14.3** Create contextual tooltips throughout app: a `Coachmark`
      component in `apps/demeter/web/src/components/ui/` shown once per user per
      feature (dismissals persisted through the API) on the planner, the sensors
      page and the task scheduler. Verify: a component spec covers focus
      handling and Escape to dismiss; the chromium spec asserts a dismissed
      coachmark stays dismissed after a reload.
- [ ] **29.21.14.4** Implement video tutorials for complex features.
  - [ ] **29.21.14.4.a** Build the player surface: a captioned `<video>` lesson
        component on `apps/demeter/web/src/pages/settings/HelpPage.tsx` that
        reads a manifest of lessons (title, source URL, WebVTT captions,
        duration). Verify: a component spec asserts captions are on by default
        and the controls are keyboard operable.
  - [ ] **29.21.14.4.b** Record the tutorial videos themselves. No footage
        exists and recording it is the owner's act (stated 2026-09-18).
        `blocked:corpus`
- [ ] **29.21.14.5** Create guided first garden setup: a step-by-step flow after
      onboarding that creates a real garden, one bed and a first planting
      through the API, with suggestions from the climate zone. Verify: the
      chromium spec finishes the flow and finds the garden, bed and planting in
      the API responses.
- [ ] **29.21.14.6** Implement progress tracking for learning modules: a
      `demeter_learning_progress` table and `/v1/learning/progress` routes
      recording started and completed modules per user. Verify: an integration
      spec asserts completion is idempotent and scoped to the user.
- [ ] **29.21.14.7** Create quizzes to test gardening knowledge: a quiz schema
      and scoring function in `libs/demeter/learning`, with at least one
      ten-question quiz per tutorial path whose answers cite the
      `@demeter/plants` data they come from. Verify: a unit spec for scoring
      (all right, all wrong, partial, unanswered) and a schema check over every
      shipped quiz.
- [ ] **29.21.14.8** Implement personalized learning recommendations: a pure
      function in `libs/demeter/learning` that ranks the next modules from the
      user's level, completed modules, quiz misses and what is planted in their
      gardens. This is a documented rule-based ranking, not a model. Verify: a
      unit spec with four user fixtures asserts the top recommendation for each.
- [ ] **29.21.14.9** Create seasonal onboarding (what to do this month): a
      dashboard card that lists this month's actions for the user's climate zone
      and hemisphere from the existing planting calendar and task engines.
      Verify: a unit spec asserts that the same date yields different actions
      for a northern and a southern zone, and the chromium spec finds the card
      on the dashboard.
- [ ] **29.21.14.10** Implement "tip of the day" system: a deterministic daily
      pick (date plus user id as the seed, no `Math.random()`) from a seasonal
      tip set in `libs/demeter/learning`, filtered by zone and season. Verify: a
      unit spec asserts the pick is stable within a day, changes across days,
      and never returns an out-of-season tip.

#### 29.21.15 Voice Assistant Deep Integration

> Deferred (external-platform/native, 2026-05-31): Alexa Skills + Google
> Assistant Actions are hosted on those platforms' developer consoles with their
> own SDKs/certification, and on-device Siri/voice is native — none buildable or
> verifiable in this headless TS env. The intents they fulfil (today's tasks,
> mark watered, plant lookup, frost alerts, harvest logging, pest diagnosis) map
> onto existing API/AI endpoints; the skill/action handlers belong in dedicated
> platform projects.
>
> Restated 2026-09-18: the handler code does not need a vendor account. The
> Alexa Skills Kit SDK (`ask-sdk-core`) is open source and its request/response
> JSON can be exercised with fixtures, so the intents below are actionable as
> handlers in a new `apps/demeter/alexa-skill` package. Only publishing and
> certification need the owner's Amazon developer account.

- [ ] **29.21.15.1** Create Alexa skill for Demeter.
  - [ ] **29.21.15.1.a** Scaffold `apps/demeter/alexa-skill`: install
        `ask-sdk-core` (record the version; park only with a named failed
        install attempt), add `models/en-US.json` (invocation name, the intents
        of 29.21.15.3–.10, their slots and sample utterances), a handler entry
        point, request-signature verification, and account linking against the
        OAuth2 server of 29.21.9.2. Verify: a spec drives the Launch, Help, Stop
        and Fallback requests from JSON fixtures and asserts well-formed
        responses; the interaction model passes the ASK schema check.
  - [ ] **29.21.15.1.b** Publish and certify the skill. Needs the owner's Amazon
        developer account and their acceptance of its distribution terms (stated
        2026-09-18). `blocked:external`
- [ ] **29.21.15.2** Create Google Assistant action for Demeter. Google shut
      down Conversational Actions in 2023, so the only route left is Android App
      Actions: `shortcuts.xml` capabilities in the Android project, mapped to
      the intents that
      `apps/demeter/mobile/src/services/widgets/GoogleAssistantService.ts`
      already models. Testing App Actions requires the app to be uploaded to a
      Play Console account, which is the owner's (stated 2026-09-18).
      `blocked:external`
- [ ] **29.21.15.3** Implement "What should I do in my garden today?" query as
      an intent in `apps/demeter/alexa-skill` (after 29.21.15.1.a): read today's
      due and overdue tasks from the API and speak at most five, most urgent
      first. Verify: a fixture spec asserts the speech for no tasks, three tasks
      and twelve tasks.
- [ ] **29.21.15.4** Create voice-based task completion ("Mark tomatoes as
      watered") as an intent in `apps/demeter/alexa-skill` (after 29.21.15.1.a):
      resolve the plant slot against the user's plantings and complete the
      matching open task, asking which one when several match. Verify: a fixture
      spec covers one match, several matches and no match, and asserts the task
      is completed through the API.
- [ ] **29.21.15.5** Implement voice-based plant lookup as an intent in
      `apps/demeter/alexa-skill` (after 29.21.15.1.a): answer sun, water and
      spacing for a named plant from `@demeter/plants`. Verify: a fixture spec
      covers a known plant, a synonym and an unknown plant.
- [ ] **29.21.15.6** Create voice alerts for frost warnings as an intent in
      `apps/demeter/alexa-skill` (after 29.21.15.1.a): answer "is frost coming?"
      from the weather routes, and send an Alexa proactive-event notification
      when the API raises a frost alert. Verify: a fixture spec for the spoken
      answer, and a spec for the proactive-event payload at the HTTP boundary;
      delivery on a device waits on 29.21.15.1.b.
- [ ] **29.21.15.7** Implement voice-based harvest logging as an intent in
      `apps/demeter/alexa-skill` (after 29.21.15.1.a): a multi-slot dialog
      (plant, quantity, unit) that posts a harvest. Verify: a fixture spec walks
      the dialog with a missing slot and asserts the harvest payload.
- [ ] **29.21.15.8** Create voice-based pest/disease diagnosis as an intent in
      `apps/demeter/alexa-skill` (after 29.21.15.1.a): collect plant and symptom
      slots and answer from the pest/disease catalog with the top match and one
      treatment, saying plainly when nothing matches. Verify: a fixture spec for
      a catalogued symptom and for an unknown one.
- [ ] **29.21.15.9** Implement multi-turn conversations for complex queries as
      an intent in `apps/demeter/alexa-skill` (after 29.21.15.1.a): session
      attributes that carry the garden and plant in focus across turns, so "and
      when do I harvest it?" resolves. Verify: a fixture spec runs a three-turn
      conversation and asserts the carried context, and that it is dropped when
      the session ends.
- [ ] **29.21.15.10** Create routine integration (morning garden briefing) as an
      intent in `apps/demeter/alexa-skill` (after 29.21.15.1.a): a single
      briefing intent (weather, frost risk, tasks due, sensors out of range)
      that an Alexa Routine can trigger. Verify: a fixture spec asserts the
      briefing order and that empty sections are skipped.

#### 29.21.16 Soil Testing Integration

- [ ] **29.21.16.1** Integrate with home soil test kits (API where available).
      No kit vendor publishes an open API; each needs a partner agreement the
      owner would have to sign (restated 2026-09-18). Manual entry (29.21.16.2)
      already covers kit results. `blocked:external`
  - External-input layer: kit vendor APIs vary/require contracts; the lib
    reasons over the normalised `SoilTestResult` a kit/manual entry produces.
- [x] **29.21.16.2** Create manual soil test result entry
  - Model done: `SoilTestResult` (pH, N/P/K ppm, organic matter, texture,
    sampledAt) in `@demeter/soil-test`; the entry form is the app over this.
- [x] **29.21.16.3** Implement soil test history tracking
- [x] **29.21.16.4** Create amendment recommendations from test results
- [ ] **29.21.16.5** Implement lab test result import (PDF parsing): add
      `libs/demeter/soil-test/src/lab-import.ts` that takes the text layer of a
      lab report (extracted with `pdf-parse`, pnpm catalog) and normalises pH,
      organic matter, P, K, Ca, Mg and CEC into `SoilTestResult`, for two named
      report layouts chosen from publicly posted sample reports of university
      extension labs (record the source URLs), returning a typed
      `unrecognised_layout` error for anything else rather than a guess. Verify:
      `lab-import.spec.ts` parses one fixture per layout to exact values and
      rejects an unrelated PDF.
  - External-input layer: binary PDF parsing is native/3rd-party; the extracted
    fields normalise into `SoilTestResult` which the lib then interprets.
- [x] **29.21.16.6** Create soil improvement tracking over time
- [x] **29.21.16.7** Implement cover crop recommendations based on soil
- [x] **29.21.16.8** Create NPK deficiency alerts
- [ ] **29.21.16.9** Integrate with cooperative extension soil labs. The labs
      offer no public ordering or results API, so each integration needs an
      agreement with the lab (restated 2026-09-18). The PDF import of 29.21.16.5
      is the route that needs nobody's permission. `blocked:external`
  - External-input layer: extension-lab APIs require per-lab integration;
    results feed the same `SoilTestResult` interpretation pipeline.
- [x] **29.21.16.10** Implement soil type mapping by location
  - Texture classification done (USDA triangle: sand/silt/clay% → 12 classes);
    the location→composition lookup is an external soil-survey (e.g. SSURGO)
    integration that feeds `classifyTexture`.
  - Done 2026-05-31: new `@demeter/soil-test` library
    (`libs/demeter/soil-test/`) — pure agronomy; 13 vitest tests (tsc + eslint
    clean). `texture.ts` USDA texture triangle (12 classes, verified at known
    points) + drainage hint; `nutrients.ts` pH bands + NPK level ranges +
    deficiency alerts + lime/sulfur estimate scaled by texture buffering;
    `amendments.ts` combined pH/organic- matter/NPK amendment plan with excess
    cautions; `cover-crops.ts` deficiency-driven cover-crop recs (legumes for
    low N, deep-rooted for clay, biomass for low OM); `history.ts` multi-test
    improvement trends (pH→6.5, NPK/OM upward). Kit/lab/PDF inputs (.16.1/.5/.9)
    feed the `SoilTestResult`.

#### 29.21.17 Water Usage Dashboard

- [ ] **29.21.17.1** Create comprehensive water usage dashboard. The residual
      task (restated 2026-09-18): add `GET /v1/gardens/:id/water-usage` to
      `apps/demeter/api` returning the `@demeter/water-analytics` aggregates
      (per garden, bed and planting, by source, against the budget) computed
      from persisted watering events, and a `/analytics/water` page in
      `apps/demeter/web` that renders them.
      `apps/demeter/web/src/pages/analytics/ResourceTrackingPage.tsx` currently
      shows hardcoded `waterUsageDaily` constants, so replace its water view
      with the real data too. Verify: an integration spec asserts the aggregates
      for a seeded garden, and a chromium spec
      `apps/demeter/web/e2e/water-dashboard.spec.ts` sees the seeded totals and
      the budget state.
  - Data layer done; the dashboard **view** is app/UI rendering the
    `@demeter/water-analytics` aggregates (per garden/bed/planting + by source +
    budget).
- [ ] **29.21.17.2** Implement water usage visualization (charts/graphs) on the
      page from 29.21.17.1: a daily-use bar chart, a by-source stacked chart and
      a budget burn-down built with the `recharts` components in
      `apps/demeter/web/src/components/charts/`, each with a data-table
      alternative for screen readers. Verify: a component spec asserts the
      series passed to each chart equal the API response, and axe reports no
      violations on the page.
  - App/UI: charts render the same aggregates (the lib provides the series).
- [x] **29.21.17.3** Calculate gallons per plant/bed/garden
- [x] **29.21.17.4** Create water budget and tracking
- [x] **29.21.17.5** Implement drought tolerance scoring
- [x] **29.21.17.6** Create rainwater collection tracking
- [x] **29.21.17.7** Implement greywater usage tracking
- [x] **29.21.17.8** Create water cost calculator
- [x] **29.21.17.9** Implement municipality water restriction alerts
  - Rule engine done (`canWaterAt`: permitted weekdays, odd/even address-day,
    no-watering hour windows); the live per-locality restriction **data** is an
    external/municipal feed into the engine.
- [x] **29.21.17.10** Create water-saving recommendations
  - Done 2026-05-31: new `@demeter/water-analytics` library
    (`libs/demeter/water-analytics/`) — pure water math; 10 vitest tests (tsc +
    eslint clean). `usage.ts`: per-garden/bed/planting + by-source aggregation +
    budget status (.17.3/.4/.7). `rainwater.ts`: harvest potential (metric
    `1 mm·m⁻²=1 L` + imperial `0.623 gal·ft⁻²·in⁻¹`, both × runoff coeff) +
    tiered cost calculator (.17.6/.8). `conservation.ts`: drought-tolerance
    scoring (inverse of water need) + greywater guidance + water-saving
    recommendations (.17.5/.7/.10). `restrictions.ts`: municipal-restriction
    rule engine (.17.9). Dashboard/charts (.17.1/.2) are app/UI over these.

#### 29.21.18 Nursery & Store Integration

> Deferred (external-API/commercial, 2026-05-31): nursery inventory lookup,
> price comparison, "in stock near me", seed-catalog/store-app sync, affiliate
> partnerships, loyalty programs, and delivery tracking all require contracts +
> live third-party APIs that don't exist in this environment — no local
> substrate to build or verify against. Belongs with real partner integrations
> (cf. the §29.21.9.2 OAuth/partner deferral).

- [ ] **29.21.18.1** Create nursery inventory lookup integration. No nursery or
      retailer offers an open API for this; it needs a signed partner agreement
      and credentials from the owner (stated 2026-09-18). `blocked:external`
- [ ] **29.21.18.2** Implement price comparison across local nurseries. No
      nursery or retailer offers an open API for this; it needs a signed partner
      agreement and credentials from the owner (stated 2026-09-18).
      `blocked:external`
- [ ] **29.21.18.3** Create "in stock near me" plant finder. No nursery or
      retailer offers an open API for this; it needs a signed partner agreement
      and credentials from the owner (stated 2026-09-18). `blocked:external`
- [ ] **29.21.18.4** Implement online seed catalog integration. No nursery or
      retailer offers an open API for this; it needs a signed partner agreement
      and credentials from the owner (stated 2026-09-18). `blocked:external`
- [ ] **29.21.18.5** Create shopping list sync with store apps. No nursery or
      retailer offers an open API for this; it needs a signed partner agreement
      and credentials from the owner (stated 2026-09-18). `blocked:external`
- [ ] **29.21.18.6** Implement affiliate partnerships for purchases. Joining an
      affiliate network is a commercial agreement the owner signs, and it must
      be settled before any link-tagging code is written (stated 2026-09-18).
      `blocked:governance`
- [ ] **29.21.18.7** Create plant reservation/pre-order support. No nursery or
      retailer offers an open API for this; it needs a signed partner agreement
      and credentials from the owner (stated 2026-09-18). `blocked:external`
- [ ] **29.21.18.8** Implement loyalty program integration. No nursery or
      retailer offers an open API for this; it needs a signed partner agreement
      and credentials from the owner (stated 2026-09-18). `blocked:external`
- [ ] **29.21.18.9** Create bulk order coordination for groups: a community
      feature that needs no retailer. Add a `group_order` post type to
      `apps/demeter/api/src/routes/community.ts` where an organiser lists items
      and a deadline, members pledge quantities, and the organiser exports the
      totals as CSV. No payment is handled. Verify: an integration spec asserts
      that pledges close at the deadline, that totals sum per item, and that
      only the organiser can export.
- [ ] **29.21.18.10** Implement delivery tracking for online orders. It depends
      on orders placed through a retailer integration that does not exist. No
      nursery or retailer offers an open API for this; it needs a signed partner
      agreement and credentials from the owner (stated 2026-09-18).
      `blocked:external`

#### 29.21.19 Native Plant & Pollinator Focus

- [x] **29.21.19.1** Create native plant database by ecoregion
- [x] **29.21.19.2** Implement native plant finder by location
  - Region-code finder done; precise lat/lon→ecoregion needs a GIS dataset
    (external) — `ecoregionForRegion`/`nativePlantsForRegion` are the offline
    path.
- [x] **29.21.19.3** Create pollinator species database
- [x] **29.21.19.4** Implement bloom time calendar for pollinators
- [x] **29.21.19.5** Create pollinator-friendly garden score
- [x] **29.21.19.6** Implement monarch butterfly waystation guidelines
- [x] **29.21.19.7** Create bird-friendly garden features
- [x] **29.21.19.8** Implement wildlife habitat certification tracking
- [x] **29.21.19.9** Create invasive species alerts by region
  - Rule engine + sample region invasive lists done; a live invasive feed (per
    state/agency) is an external data layer into `invasiveAlerts`.
- [x] **29.21.19.10** Implement native seed source directory
  - Done 2026-05-31: new `@demeter/pollinators` library
    (`libs/demeter/pollinators/`) — pure logic + curated data; 8 vitest tests
    (tsc + eslint clean). `data.ts`: pollinator species, native plants keyed by
    Level-I ecoregion, region invasive lists, native-seed-source directory,
    Monarch/NWF criteria (.19.1/.3/.9/.10). `finder.ts`: native plants by
    ecoregion/region (.19.2). `bloom.ts`: month-by-month bloom calendar +
    growing-season gaps + continuity score (.19.4). `score.ts`:
    pollinator-friendly garden score (native share + bloom continuity +
    pollinator-type diversity + pesticide-free) (.19.5). `habitat.ts`: Monarch
    Waystation eval (.19.6), bird-friendly feature guidance/score (.19.7),
    NWF-style wildlife-habitat certification readiness (.19.8), and region
    invasive alerts (.19.9).

#### 29.21.20 Accessibility Enhancements

- [ ] **29.21.20.1** Implement high contrast mode. The residual task (restated
      2026-09-18): a high-contrast token set in `apps/demeter/web/src/styles/`
      switched by a `data-contrast="high"` attribute, a toggle on
      `apps/demeter/web/src/pages/settings/SettingsPage.tsx` that persists per
      user and defaults from `prefers-contrast: more`, with every
      text/background pair in the set reaching 7:1. Verify: a unit spec runs
      `meetsContrast` from `@demeter/accessibility` over every token pair at the
      AAA threshold, and a chromium spec toggles the mode and finds it still set
      after a reload.
  - Logic done; theme is CSS: contrast math (`contrastRatio`/`meetsContrast`) is
    in `@demeter/accessibility`; the high-contrast theme toggle is an app/CSS
    layer over verified tokens (§29.18.6.4).
- [x] **29.21.20.2** Create colorblind-friendly color schemes
- [ ] **29.21.20.3** Implement large text mode. The residual task (restated
      2026-09-18): a text-size setting (100 %, 125 %, 150 %) on the web settings
      page that scales the root font size, persisted per user. Verify: a
      chromium spec sets 150 % at a 1280-pixel viewport and asserts that
      `/dashboard`, `/gardens` and `/tasks` have no horizontal scroll and no
      clipped button labels.
  - Foundation done; toggle is app/CSS: text already scales with browser/OS
    settings (rem-based, §29.18.6.5); a dedicated large-text toggle is a UI
    mode.
- [ ] **29.21.20.4** Create simplified interface mode: a per-user setting in
      `apps/demeter/web` that reduces the navigation in
      `components/layout/AppLayout.tsx` to Dashboard, Gardens, Tasks and
      Journal, hides the analytics and automation entry points, and switches
      lists to the single-column card layout. Verify: a chromium spec turns the
      mode on and asserts the navigation holds exactly those four entries while
      the hidden routes still open by URL.
  - App/UI: a reduced-density layout variant (the data/logic is unchanged).
- [ ] **29.21.20.5** Implement one-handed operation mode in
      `apps/demeter/mobile`: a setting that moves primary actions and the
      navigation header controls into the bottom third of the screen and adds a
      reach-down gesture for the screen title. Verify: an RNTL spec asserts that
      every primary action on the dashboard, task list and garden detail screens
      renders inside the bottom-anchored action bar when the mode is on. Depends
      on the jest-expo suite of 29.18.6.11 (stated 2026-09-18).
      `blocked:upstream`
  - Native/mobile UI: reachability layout for one-handed use.
- [ ] **29.21.20.6** Create audio descriptions for images: a "listen" control on
      journal and plant photos in `apps/demeter/web` that speaks the image's
      stored text alternative with the browser `speechSynthesis` API, hidden
      when the image has no alternative text or the API is missing. Verify: a
      component spec with a test double at the `speechSynthesis` boundary
      asserts the spoken text, the stop control and the hidden state. Writing
      richer descriptions for the plant photo library is content work and is not
      part of this item.
  - App/content: images carry text alternatives (a11y suite checks alt text);
    spoken audio descriptions are a roadmap content feature.
- [ ] **29.21.20.7** Implement haptic feedback for confirmations in
      `apps/demeter/mobile`: call `expo-haptics` (success, warning, error) from
      one `useConfirmationHaptics` hook on task completion, harvest save and
      destructive confirmations, honouring a user setting and the OS
      reduce-motion preference. Verify: an RNTL spec with `expo-haptics` mocked
      asserts the right feedback type per action and none when the setting is
      off; how it feels on a phone is a manual residual. Depends on 29.18.6.11
      (stated 2026-09-18). `blocked:upstream`
  - Native/mobile: device haptics on confirmations.
- [x] **29.21.20.8** Create keyboard-only navigation (web)
  - Done (§29.18.6.3): full keyboard tab order, Enter/Space activation,
    Escape-to-close, focus trapping + visible focus, and the new skip link —
    verified by the web a11y suite.
- [ ] **29.21.20.9** Implement motor accessibility features in
      `apps/demeter/web`: minimum 44 × 44 CSS-pixel targets for every
      interactive control, a setting that extends toast and session-warning
      timeouts, and no action that requires a drag (the planner gets keyboard
      and click-to-place alternatives). Verify: a chromium spec measures the
      bounding box of every button and link on `/dashboard`, `/tasks` and
      `/gardens/:id/planner` and fails under 44 pixels, and places a plant in
      the planner with the keyboard alone.
  - App/UI: large touch targets, reduced precision requirements, generous
    timeouts — presentation-layer settings.
- [x] **29.21.20.10** Create accessibility statement and documentation
  - Done 2026-05-31: new `@demeter/accessibility` library
    (`libs/demeter/accessibility/`) — pure color a11y; 10 vitest tests (tsc +
    eslint clean): WCAG `contrastRatio`/`meetsContrast` (21:1 anchor) for
    high-contrast checks (.20.1); Machado-2009 CVD simulation + the Okabe–Ito
    colorblind-safe palette + `isPaletteCvdSafe` (verified distinguishable under
    protan/deutan/tritan) (.20.2). Plus the
    `apps/demeter/docs/accessibility/accessibility-statement.md` statement
    (conformance target, features, known limitations, feedback) (.20.10).
    Remaining UI modes (.20.1 theme/.3/.4/.5/.6/.7/.9) are app/CSS/native layers
    over this logic; keyboard nav (.20.8) shipped in §29.18.6.3.

---

### 29.22 Wire the web app to the API (found 2026-09-18)

The checked web-UI items in §29.x were checked against screens that render
hardcoded placeholder constants: outside the three auth pages, no page under
`apps/demeter/web/src/pages/` imports a hook from
`apps/demeter/web/src/api/hooks/`, and 19 pages carry a `Placeholder Data`
block. Those boxes are left as they are; §29.22 is the wiring they still owe.
The residual items restated on 2026-09-18 (§29.21.6, §29.21.13, §29.21.17) build
on the same hooks.

#### 29.22.1 Replace placeholder constants with API data

- [ ] **29.22.1.0** Commit the inventory this section works from as
      `apps/demeter/docs/development/web-placeholder-inventory.md`: the 19 pages
      that `grep -rli "Placeholder Data" apps/demeter/web/src/pages` returns,
      each with the constants it renders. As of 2026-09-18:
      `analytics/AnalyticsPage.tsx` (`yieldTrendData`, `harvestByPlantData`,
      `taskCompletionData`, `topPlantsData`);
      `analytics/ComparisonReportsPage.tsx` (`comparisonChartData`,
      `comparisonMetrics`); `analytics/EnvironmentalImpactPage.tsx`
      (`monthlyImpactData`, `organicMatterData`, `pollinatorPlantingData`,
      `badges`); `analytics/ResourceTrackingPage.tsx` (`waterUsageDaily`,
      `waterUsageMonthly`, `resourceCostBreakdown`, `fertilizerLog`,
      `seedInventory`, `toolInventory`, `seasonalPlanData`);
      `analytics/YieldReportsPage.tsx` (`yieldByPeriodData`, `yieldByPlantData`,
      `yieldByBedData`, `yieldPerSqFtData`, `qualityDistributionData`,
      `usageBreakdownData`, `yearComparisonData`); `dashboard/DashboardPage.tsx`
      (inline placeholder values in the component body);
      `gardens/GardenComparisonPage.tsx` (`GARDEN_SNAPSHOTS`);
      `gardens/GardensPage.tsx` (`placeholderGardens`);
      `gardens/PrintLayoutPage.tsx` (`PRINT_BEDS`, `MONTHLY_TASKS`);
      `plants/PlantsPage.tsx` (`placeholderPlants`);
      `sensors/AutomationHistoryPage.tsx` (`events`, `mostActiveRulesData`);
      `sensors/SensorDetailPage.tsx` (`device`, `readings`, `chartData`,
      `connectionLog`); `tasks/BulkTasksPage.tsx` (`placeholderTasks`);
      `tasks/CalendarExportPage.tsx` (`placeholderTasks`);
      `tasks/CalendarPage.tsx` (`generatePlaceholderTasks`);
      `tasks/RecurringTasksPage.tsx` (`placeholderRules`);
      `tasks/SchedulerPage.tsx` (`generatePlaceholderTasks`);
      `tasks/TaskTemplatesPage.tsx` (`builtInTemplates`, `customTemplates`);
      `tasks/TasksPage.tsx` (`placeholderTasks`). Verify: the doc's page list
      equals the grep output at the commit that adds it, and each listed
      constant is found in its file.
- [ ] **29.22.1.1** Wire
      `apps/demeter/web/src/pages/analytics/AnalyticsPage.tsx` to the API:
      remove `yieldTrendData`, `harvestByPlantData`, `taskCompletionData` and
      `topPlantsData`. Feed the yield and plant charts from `useHarvestSummary`
      (`apps/demeter/web/src/api/hooks/useHarvests.ts`,
      `GET /v1/harvests/summary`) and the task-completion chart from `useTasks`
      (`GET /v1/tasks`). Loading, empty and error states replace the constants,
      not a fallback to them. Verify: a vitest component spec with the API
      client mocked at the boundary asserts the rendered values come from the
      response, and a grep for `Placeholder Data` in that file returns nothing.
- [ ] **29.22.1.2** Wire
      `apps/demeter/web/src/pages/analytics/ComparisonReportsPage.tsx` to the
      API: remove `comparisonChartData` and `comparisonMetrics`. Compute the
      period-over-period deltas from two `useHarvestSummary` calls with
      different date ranges; if `GET /v1/harvests/summary` takes no date range
      yet, add `from`/`to` query parameters to
      `apps/demeter/api/src/routes/harvests.ts` with an integration case.
      Loading, empty and error states replace the constants, not a fallback to
      them. Verify: a vitest component spec with the API client mocked at the
      boundary asserts the rendered values come from the response, and a grep
      for `Placeholder Data` in that file returns nothing.
- [ ] **29.22.1.3** Wire
      `apps/demeter/web/src/pages/analytics/EnvironmentalImpactPage.tsx` to the
      API: remove `monthlyImpactData`, `organicMatterData`,
      `pollinatorPlantingData` and `badges`. No route serves these today: add
      `GET /v1/gardens/:id/environmental-impact` to
      `apps/demeter/api/src/routes/gardens.ts` over `@demeter/pollinators`,
      `@demeter/soil-test` and `@demeter/water-analytics`, and a
      `useEnvironmentalImpact` hook in
      `apps/demeter/web/src/api/hooks/useGardens.ts`. Loading, empty and error
      states replace the constants, not a fallback to them. Verify: a vitest
      component spec with the API client mocked at the boundary asserts the
      rendered values come from the response, and a grep for `Placeholder Data`
      in that file returns nothing.
- [ ] **29.22.1.4** Wire
      `apps/demeter/web/src/pages/analytics/ResourceTrackingPage.tsx` to the
      API: remove `waterUsageDaily`, `waterUsageMonthly`,
      `resourceCostBreakdown`, `fertilizerLog`, `seedInventory`, `toolInventory`
      and `seasonalPlanData`. The water view is 29.21.17.1. For the rest, add
      `GET /v1/gardens/:id/resources` over `@demeter/inventory` and a
      `useResources` hook in a new
      `apps/demeter/web/src/api/hooks/useResources.ts`. Loading, empty and error
      states replace the constants, not a fallback to them. Verify: a vitest
      component spec with the API client mocked at the boundary asserts the
      rendered values come from the response, and a grep for `Placeholder Data`
      in that file returns nothing.
- [ ] **29.22.1.5** Wire
      `apps/demeter/web/src/pages/analytics/YieldReportsPage.tsx` to the API:
      remove `yieldByPeriodData`, `yieldByPlantData`, `yieldByBedData`,
      `yieldPerSqFtData`, `qualityDistributionData`, `usageBreakdownData` and
      `yearComparisonData`. Feed every chart from `useHarvests` and
      `useHarvestSummary` (`GET /v1/harvests`, `GET /v1/harvests/summary`),
      adding a `groupBy=period|plant|bed` parameter to the summary route where
      the grouping is not served yet, with an integration case per grouping.
      Loading, empty and error states replace the constants, not a fallback to
      them. Verify: a vitest component spec with the API client mocked at the
      boundary asserts the rendered values come from the response, and a grep
      for `Placeholder Data` in that file returns nothing.
- [ ] **29.22.1.6** Wire
      `apps/demeter/web/src/pages/dashboard/DashboardPage.tsx` to the API:
      remove the inline placeholder values marked "For the scaffold, we show the
      UI structure with placeholder data". Compose the dashboard from
      `useGardens`, `useTasks` (due and overdue, `GET /v1/tasks/overdue`),
      `useCurrentWeather`, `useWeatherAlerts`, `useSensorAlerts` and
      `useHarvestSummary`. Loading, empty and error states replace the
      constants, not a fallback to them. Verify: a vitest component spec with
      the API client mocked at the boundary asserts the rendered values come
      from the response, and a grep for `Placeholder Data` in that file returns
      nothing.
- [ ] **29.22.1.7** Wire
      `apps/demeter/web/src/pages/gardens/GardenComparisonPage.tsx` to the API:
      remove `GARDEN_SNAPSHOTS`. This is the web half of 29.21.13.5: read the
      aggregates from `GET /v1/gardens/compare?ids=` through a new
      `useGardenComparison` hook in `useGardens.ts`. Close the two items
      together. Loading, empty and error states replace the constants, not a
      fallback to them. Verify: a vitest component spec with the API client
      mocked at the boundary asserts the rendered values come from the response,
      and a grep for `Placeholder Data` in that file returns nothing.
- [ ] **29.22.1.8** Wire `apps/demeter/web/src/pages/gardens/GardensPage.tsx` to
      the API: remove `placeholderGardens`. List gardens with `useGardens`
      (`GET /v1/gardens`) and create them with `useCreateGarden`; search and the
      type filter become query parameters or client-side filters over the
      response, stated in the spec. Loading, empty and error states replace the
      constants, not a fallback to them. Verify: a vitest component spec with
      the API client mocked at the boundary asserts the rendered values come
      from the response, and a grep for `Placeholder Data` in that file returns
      nothing.
- [ ] **29.22.1.9** Wire
      `apps/demeter/web/src/pages/gardens/PrintLayoutPage.tsx` to the API:
      remove `PRINT_BEDS` and `MONTHLY_TASKS`. Read the beds from `useGarden`
      (`GET /v1/gardens/:id`, `GET /v1/gardens/:id/beds`) and the month's tasks
      from `GET /v1/tasks/calendar`. Loading, empty and error states replace the
      constants, not a fallback to them. Verify: a vitest component spec with
      the API client mocked at the boundary asserts the rendered values come
      from the response, and a grep for `Placeholder Data` in that file returns
      nothing.
- [ ] **29.22.1.10** Wire `apps/demeter/web/src/pages/plants/PlantsPage.tsx` to
      the API: remove `placeholderPlants`. List and search with `usePlants`
      (`GET /v1/plants`, `GET /v1/plants/search`, `GET /v1/plants/faceted` for
      the filters), paginated. Loading, empty and error states replace the
      constants, not a fallback to them. Verify: a vitest component spec with
      the API client mocked at the boundary asserts the rendered values come
      from the response, and a grep for `Placeholder Data` in that file returns
      nothing.
- [ ] **29.22.1.11** Wire
      `apps/demeter/web/src/pages/sensors/AutomationHistoryPage.tsx` to the API:
      remove `events` and `mostActiveRulesData`. No route serves automation
      history today: add `GET /v1/sensors/automation/history` to
      `apps/demeter/api/src/routes/sensors.ts` over the persisted
      `@demeter/automation` executions (add the table and migration if
      executions are not stored yet), and a `useAutomationHistory` hook in
      `apps/demeter/web/src/api/hooks/useSensors.ts`. Loading, empty and error
      states replace the constants, not a fallback to them. Verify: a vitest
      component spec with the API client mocked at the boundary asserts the
      rendered values come from the response, and a grep for `Placeholder Data`
      in that file returns nothing.
- [ ] **29.22.1.12** Wire
      `apps/demeter/web/src/pages/sensors/SensorDetailPage.tsx` to the API:
      remove `device`, `readings`, `chartData` and `connectionLog`. Read the
      device with `useSensor`, the chart with `useSensorReadings`
      (`GET /v1/sensors/:id/readings`) and the alerts with `useSensorAlerts`;
      the connection log needs a `GET /v1/sensors/:id/connection-log` route, or
      the panel is removed and the removal stated in the item. Loading, empty
      and error states replace the constants, not a fallback to them. Verify: a
      vitest component spec with the API client mocked at the boundary asserts
      the rendered values come from the response, and a grep for
      `Placeholder Data` in that file returns nothing.
- [ ] **29.22.1.13** Wire `apps/demeter/web/src/pages/tasks/BulkTasksPage.tsx`
      to the API: remove `placeholderTasks`. List with `useTasks`; apply bulk
      complete, reschedule and delete through `useCompleteTask`, `useUpdateTask`
      and a `useDeleteTask` hook to add (`DELETE /v1/tasks/:id`), reporting
      per-task failures. Loading, empty and error states replace the constants,
      not a fallback to them. Verify: a vitest component spec with the API
      client mocked at the boundary asserts the rendered values come from the
      response, and a grep for `Placeholder Data` in that file returns nothing.
- [ ] **29.22.1.14** Wire
      `apps/demeter/web/src/pages/tasks/CalendarExportPage.tsx` to the API:
      remove `placeholderTasks`. Build the iCalendar export from `useTasks` over
      the selected date range; the spec asserts that the generated `.ics` holds
      exactly the tasks in the response. Loading, empty and error states replace
      the constants, not a fallback to them. Verify: a vitest component spec
      with the API client mocked at the boundary asserts the rendered values
      come from the response, and a grep for `Placeholder Data` in that file
      returns nothing.
- [ ] **29.22.1.15** Wire `apps/demeter/web/src/pages/tasks/CalendarPage.tsx` to
      the API: remove `generatePlaceholderTasks`. Load the visible month from
      `GET /v1/tasks/calendar` through a `useTaskCalendar` hook to add in
      `useTasks.ts`. This is the prerequisite of the shared calendar in
      29.21.6.9. Loading, empty and error states replace the constants, not a
      fallback to them. Verify: a vitest component spec with the API client
      mocked at the boundary asserts the rendered values come from the response,
      and a grep for `Placeholder Data` in that file returns nothing.
- [ ] **29.22.1.16** Wire
      `apps/demeter/web/src/pages/tasks/RecurringTasksPage.tsx` to the API:
      remove `placeholderRules`. Recurrence rules have no list route today: add
      `GET /v1/tasks/recurring` and `PATCH /v1/tasks/recurring/:id` (pause,
      resume, edit) to `apps/demeter/api/src/routes/tasks.ts` over the
      recurrence model in `@demeter/tasks`, and a `useRecurringTasks` hook.
      Loading, empty and error states replace the constants, not a fallback to
      them. Verify: a vitest component spec with the API client mocked at the
      boundary asserts the rendered values come from the response, and a grep
      for `Placeholder Data` in that file returns nothing.
- [ ] **29.22.1.17** Wire `apps/demeter/web/src/pages/tasks/SchedulerPage.tsx`
      to the API: remove `generatePlaceholderTasks`. Load the week from
      `GET /v1/tasks/calendar`, and persist a drag-reschedule with
      `useUpdateTask`, rolling the card back when the request fails. Loading,
      empty and error states replace the constants, not a fallback to them.
      Verify: a vitest component spec with the API client mocked at the boundary
      asserts the rendered values come from the response, and a grep for
      `Placeholder Data` in that file returns nothing.
- [ ] **29.22.1.18** Wire
      `apps/demeter/web/src/pages/tasks/TaskTemplatesPage.tsx` to the API:
      remove `builtInTemplates` and `customTemplates`. Built-in templates come
      from `@demeter/tasks` (imported, not copied into the page). Custom
      templates need persistence: add `demeter_task_templates` with a migration,
      CRUD under `/v1/tasks/templates`, and a `useTaskTemplates` hook; applying
      a template creates its tasks through `POST /v1/tasks`
      (`POST     /v1/tasks/generate` only returns suggestions). Loading, empty
      and error states replace the constants, not a fallback to them. Verify: a
      vitest component spec with the API client mocked at the boundary asserts
      the rendered values come from the response, and a grep for
      `Placeholder Data` in that file returns nothing.
- [ ] **29.22.1.19** Wire `apps/demeter/web/src/pages/tasks/TasksPage.tsx` to
      the API: remove `placeholderTasks`. List with `useTasks` (status and
      garden filters as query parameters), complete with `useCompleteTask`,
      snooze through `POST /v1/tasks/:id/snooze`, and show the overdue group
      from `GET /v1/tasks/overdue`. Loading, empty and error states replace the
      constants, not a fallback to them. Verify: a vitest component spec with
      the API client mocked at the boundary asserts the rendered values come
      from the response, and a grep for `Placeholder Data` in that file returns
      nothing.
- [ ] **29.22.1.20** Audit the pages the marker does not catch. On 2026-09-18,
      38 more `*Page.tsx` files under `apps/demeter/web/src/pages/` import no
      hook from `src/api/hooks/` and carry no `Placeholder Data` comment (for
      example `harvests/HarvestsPage.tsx`, `journal/JournalPage.tsx`,
      `sensors/SensorsPage.tsx`, `weather/WeatherPage.tsx`,
      `community/CommunityPage.tsx`, `gardens/GardenDetailPage.tsx`). Read each
      one, record in the inventory doc of 29.22.1.0 whether it is static by
      design or renders hardcoded data, and file one `29.22.2.N` wiring item per
      page that renders hardcoded data, in the same form as the items above.
      Verify: every `*Page.tsx` file appears in the inventory with one of the
      two verdicts and the evidence line.

---

### Phase 29 Updated Summary Statistics

| Section                                  | Task Count |
| ---------------------------------------- | ---------- |
| 29.1 Foundation & Core Infrastructure    | 77         |
| 29.2 Plant Encyclopedia & Knowledge Base | 100        |
| 29.3 Garden Planning & Design            | 100        |
| 29.4 Task & Schedule Management          | 80         |
| 29.5 Seed & Inventory Management         | 70         |
| 29.6 Journal & Observation System        | 80         |
| 29.7 IoT & Sensor Integration            | 100        |
| 29.8 Automation & Rules Engine           | 80         |
| 29.9 AI/ML Intelligence                  | 100        |
| 29.10 Weather Integration                | 80         |
| 29.11 Community & Social Features        | 80         |
| 29.12 Hydroponics & Advanced Growing     | 90         |
| 29.13 Preservation & Post-Harvest        | 90         |
| 29.14 Analytics & Insights               | 90         |
| 29.15 API Backend                        | 100        |
| 29.16 Mobile Application (React Native)  | 130        |
| 29.17 Web Dashboard (React)              | 80         |
| 29.18 Testing & Quality Assurance        | 60         |
| 29.19 Deployment & DevOps                | 60         |
| 29.20 Documentation                      | 30         |
| 29.21 SOTA Gap Analysis Additions        | 200        |
| **TOTAL Phase 29 (Demeter)**             | **~1,977** |

---

## Final Updated Grand Total

| Phase                                      | Task Count  |
| ------------------------------------------ | ----------- |
| Phase 0-14 (Original)                      | 796         |
| Phase 15: Physical Wellness & Fitness      | 503         |
| Phase 16: Video-to-Animation Pipeline      | 346         |
| Phase 17: State-of-the-Art AI Integration  | 424         |
| Phase 18: Production Readiness Remediation | 847         |
| Phase 19: AWS ECS + RunPod Infrastructure  | 126         |
| Phase 20: Eve/Aphrodite Platform           | 145         |
| Phase 21: Nyx Cosmic Observatory           | 251         |
| Phase 22: Tara Meditation Platform         | 318         |
| Phase 23: Veritas AI News Agency           | ~878        |
| Phase 24: Psyche AI Virtual Assistant      | ~866        |
| Phase 25: Metis Educational Platform       | ~679        |
| Phase 26: Yemaya Autonomous Platform       | 360         |
| Phase 27: Project Obsidian (Production)    | ~2,971      |
| Phase 28: Arete Personal Development       | ~1,225      |
| Phase 29: Demeter Home Gardening Platform  | ~1,977      |
| **GRAND TOTAL**                            | **~12,712** |

---
