Adds a zone_thresholds Neon table populated by the pipeline and consumed
by the zones serverless endpoint, so the Dashboard can show per-zone
alert/payout thresholds when zone-specific mode is active instead of
hardcoded city-wide defaults.
- src/database/schema.py: new zone_thresholds DDL (zone_id PK + alert/
payout thresholds + uhi_model + threshold_mode + computed_at).
- src/pricing/zone_thresholds.py: new persist_to_neon() helper that
UPSERTs current thresholds; no-op when THRESHOLD_MODE=global.
- src/pipeline.py: calls persist_to_neon at the start of _step_predict
so every pipeline run pushes current thresholds to Neon (dependent on
the active UHI_MODEL and THRESHOLD_MODE env vars).
- frontend/api/zones.ts: LEFT JOINs zone_thresholds and exposes
alert_threshold_c + payout_threshold_c + threshold_uhi_model +
threshold_mode. Risk-level bucketing now uses per-zone thresholds
when available, falling back to 35/38°C city-wide defaults.
- frontend/src/lib/api.ts: adds thr…
Coverage polish + DPI-style worker pilot with Disbursements drill-down
Coverage page:
- Cost section now renders Annual program cost, Cost per worker, and
3-year total in matching 44px Source Serif blocks (previously the
Annual cost was a 56px custom headline and the other two were default
MetricCards, creating an awkward size asymmetry).
- "Where it lands" table rebuilt: dropped the "Total / worker" column
(redundant with fast cash + insurance per worker), added a "Total to
neighborhood" column showing aggregate $ flowing to each triggered
neighborhood this week (per_worker × enrolled_workers), added a
"Workers" column, and renamed the zone header to "Neighborhood".
Reads as: "Kinondoni → $138,600 this week to 7,700 workers".
DPI-style worker pilot (the climate-risk equivalent of Market Intel's
Lakshmi/Kumar/Meena and Weather AI's 2k DPI farmer registry):
- New `workers` table in Neon (src/database/schema.py) with
worker_id / name / name_swahili / nida_id / phone / zone_id /
occupation / age / years_outdoor / household_size / mobile_…
Closes the AI/ML sophistication gap with Weather AI 2:
- ERA5 real climate data via Google ARCO archive (free, no API key)
- PyTorch LSTM heat predictor ensembled with XGBoost (4-tier degradation)
- FAISS+BM25 hybrid RAG for alert generation (44-doc index)
- Neon PostgreSQL schema (11 heat-specific tables) with asyncpg + InMemory fallback
- 19-test eval suite (UHI accuracy, predictor AUROC, RAG precision, healing recall)
- Fix broken flood-era pipeline/store/schema imports
- De-jargonify all frontend text for donor/program officer audience
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6-step ML pipeline for parametric heat insurance in East Africa.
Three XGBoost models (UHI correction, heat wave prediction, actuarial pricing),
Claude AI healing agent, interactive program designer with budget allocation.
20 urban zones across Nairobi, Dar es Salaam, Kampala, Kigali.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>