Inspiration

Inspiration

JKUAT's Conduit@Empathy climate station (built with JHUB Africa and SPACE-SI) records heat, humidity, rain, wind, and radiation every minute — yet people standing right next to the sculpture still decide whether to go outside, water crops, or ventilate storage by looking at the sky. When we pulled the organisers' 5-day extract (7,060 rows, ~1-minute cadence), we found the real gap wasn't "not enough data." It was trust: Rain Gauge 2 never moves, wind gust direction is a byte-for-byte clone of gust speed, battery voltage is empty, and a firmware health flag spikes to 33501705 every night. A dashboard that plots this data straight through would be lying to the person reading it. We decided not to build another weather app. We built the missing last mile: a trust gate between the sensor and the decision.

What it does

Hatua (Kiswahili for "step / action") is a trust-gated action layer on top of Conduit@Empathy:

  1. Trust gate — every timestep from CHORDS instrument 61 is audited before it's allowed to drive anything: stuck-gauge detection, cloned-field detection, garbage health-flag filtering, and cross-sensor thermometer disagreement checks.
  2. Insight — heat/UV exposure, overnight humidity (leaf-wetness / crop storage risk), rain onset from gauge 1 only (gauge 2 is provably dead), and a water-demand proxy from temperature, humidity, wind, and radiation. No fabricated soil moisture — that sensor isn't in the feed, so we don't pretend it is.
  3. Ground vs. model — Conduit gauge 1 residual-checks a public Open-Meteo forecast for Juja, so a model can't silently overstate rain against what the station actually measured.
  4. Action — role-aware recommendation cards (Campus / Farm / Science): go outside / seek shade / hydrate, ventilate overnight, don't irrigate, don't feed this timestep into AquaTwin.
  5. Reach beyond the browser — the same trust-gated advisories are dispatched over Africa's Talking USSD (*384*61#) and SMS (keywords like HATUA, JOTO, MVUA, KILIMO), because the outdoor workers and farmers this is built for don't sit at a dashboard. TypeSafe's Jev System One (jev-latest) turns raw telemetry into calibrated, typed judgments (dominant risk regime, action confidence) and bilingual English/Swahili advisory text, with a deterministic rule-based fallback if the model is unavailable.

How we built it

  • packages/core — the domain layer: trust policy (trust_v1.yaml) and action policy (actions_v1.yaml), both versioned so judging can see exactly which rule fired.
  • apps/worker — ingests the organiser CSV and (optionally) live CHORDS data, runs it through trust → actions → residual-check, and writes to Postgres/SQLite.
  • apps/api — FastAPI service exposing reads, a /v1/replay endpoint judges can use to replay any timestamp (e.g. the RAIN_ONSET event at 2026-08-31T03:41:33Z), Server-Sent Events, and the Africa's Talking SMS/USSD webhook router.
  • apps/web — Next.js 16 + React 19 + Tailwind + shadcn/ui console (Home / Today / Why / role switch), talking only to our API — it never calls CHORDS directly.
  • Deployed as two Vercel services (Next.js web + FastAPI api) behind one vercel.json routing table; Docker Compose for local Postgres + full stack.

Challenges we ran into

  • Proving sensor faults instead of assuming clean data: we had to build fixtures directly from the organiser extract to hard-code the stuck-gauge and cloned-field detectors, rather than trusting field names or metadata.
  • Resisting the temptation to "complete" the sensor suite — soil moisture, vegetation index, and water quality are advertised for Conduit but simply aren't in this station's feed. Faking them to look more complete would have undermined the whole premise of a trust-gated system.
  • Making the USSD/SMS path work for genuinely low-connectivity users while keeping the browser console in sync with the same policy engine, not a parallel copy of it.
  • Keeping the Jev integration honest: it augments the deterministic rule engine with calibrated judgments and bilingual phrasing, but never becomes the sole source of truth — if it's offline, the rules still fire.

Accomplishments that we're proud of

  • A trust layer that can point to the exact row and exact rule that flagged a fault, not a black box.
  • A real replay endpoint judges can hit with curl and watch /today react live.
  • Genuine multi-channel delivery (web + USSD + SMS) to the people who actually need the decision, not just a browser demo.
  • 80%+ test coverage over trust fixtures (from the real extract), action hysteresis, idempotent ingest, and replay.

What we learned

  • "More sensors" isn't the bottleneck for climate data in the field — trust in what's already streaming is. A single dead gauge silently corrupts every downstream average unless something is watching for it.
  • Designing the action policy as versioned YAML (not inline logic) made it possible to reason about and test independently of the API/UI, and to show judges exactly what changed between versions.

What's next

  • Campus estates as the first real operator of heat/UV actions at JKUAT.
  • Extending to the longer CHORDS archive (May 2025–present) for Kiambu horticulture.
  • A trusted-timestep feed that AquaTwin / SPACE-SI can use to know which minutes of data are safe to calibrate against.
  • Porting the same trust + action engine to other Kenyan 3D-PAWS stations. ## What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for Hatua — Trust-Gated Climate Action

Built With

Share this project:

Updates

Submission history