Skip to content
Niss54Public

About

Autonomous Multi-Agent Climate Resilience & Parametric Finance Protocol for Pluvial Inundation. Features 30m NASA DEM Hydrology, FEMA HAZUS Curves, RFC-8785 Canonical State Roots & Smart Disaster Bonds. Track 4: Climate Data & Environmental Monitoring.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

326 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AEGIS-CLIMATE

Try the evidence tools

With Node 20+ in this checkout, run node bin/aegis.js demo. It checks the archived Smritivan report and 12 satellite images, then changes one byte in memory to test detection. Run node bin/aegis.js mcp config to generate a local MCP client configuration.

Developers can install the npm tarball, verify signed reviews in CI and compare pumping schedules through the AEGIS Hub. Developer quickstart

Evidence-Verified Climate Planning, Resource Accounting & Tamper-Evident Audit Platform

AEGIS connects geospatial flood screening, physical water-balance conservation, satellite vegetation replay, spatial intervention planning, document quantity extraction, and Split-CQR uncertainty calibration into one fail-closed review pipeline.

Truth & Settlement Boundary: Assessments are not settled automatically on-chain (settlement_eligible: false in the integrated evidence runtime). Legacy automatic payout/minting endpoints fail closed, local Hardhat contracts (blockchain/) operate only as a deterministic EVM testbed, and live AI/voice integrations activate only when user keys are configured in .env.


Core Non-Negotiable Invariants

Domain Fail-Closed Rule Enforced in Runtime Primary Modules
Satellite Evidence No vegetation restoration/deforestation claim passes without control comparison, boundary/placebo checks, and replay digest parity. verify.py, forest.py
Water Conservation No apparent carbon credit passes if supply demand creates a WATER_DEBT or reserve deficit (exact integer balance across time steps). water_accounting.py
Spatial Planning No flood/ecological intervention is placed on top of OpenStreetMap buildings or roads (422 on invalid geometry); budgets strictly obey USD caps and exclusion lists. intervention_planner.py, geo_providers.py, planning_intent.py
Document Traceability No quantity calculation runs before human reviewer approval; selective disclosure requires reviewer-signed reviewed-document-disclosure-v1 attestations; duplicate semantic claims abort atomically. document_ocr.py, document_quantities.py, traceable_accounting.py, claim_registry.py
Uncertainty & Review Sample-only screen_uncertainty refuses calibrated labels (CALIBRATION_UNAVAILABLE); calibrated intervals come strictly from SHA-256 verified Split-CQR models (conformal_hydrology_cqr_v1, conformal_emissions_cqr_v1), signed with Ed25519 + optional Scrypt/AES-256-GCM export. evidence_bundle.py, conformal_calibrator.py, portable_evidence.py, evidence_cli.py

System Architecture

  [1] Satellite & Water Source Ingestion
      • Sentinel-2 / archive replay (forest_engine) + constrained integer water ledger (water_accounting.py)
                     │
                     ▼
  [2] Spatial Intervention Planning (Eco-Planner++)
      • Live OSM Overpass mirrors + Open-Meteo 90m DEM slope (fail-closed LIVE_OSM_UNAVAILABLE; verified disk cache)
      • Guarded hybrid Gemini / Groq intent compiler strictly bounded by deterministic USD caps & exclusions
                     │
                     ▼
  [3] Grounded Procurement & MRV Documents (Ingot++)
      • UTF-8 CSV, selectable PDF (pdfplumber), and image OCR (Gemini Multimodal / local Tesseract fallback)
      • Localized number & unit normalization, copy-watermark detection, reviewer overrides, AST unit DAG, salted disclosure
                     │
                     ▼
  [4] Split-CQR Conformal Screening & Enrolled Ed25519 Review (EmbedProof++)
      • Pure scikit-learn HistGradientBoostingRegressor(loss="quantile") Split-CQR artifacts pinned by SHA-256
      • SQLite optimistic version history, amendment claim revocation, Ed25519 signing, AES-256-GCM & CLI/Node verification

Track 1–3 Capabilities & Verified Metrics

1. Grounded PDF & Image OCR (document_ocr.py, routes/assessment.py)

  • Accepts .csv, selectable/scanned .pdf, and .png/.jpg/.jpeg/.webp via POST /api/v1/integrated/traceable/documents/upload-binary and /upload-file.
  • Supports 1.234,56, 1,234.56, and 1,23,456 number parsing, SI unit normalization (3,000 kg -> 3.0 t), copy-watermark warnings, verbatim-snippet grounding verification, and reviewer corrected_values overrides prior to formula calculation.
  • Live vision extraction on scanned PDFs/photos activates when GEMINI_API_KEY is configured in .env (with local tesseract fallback when offline).

2. Live OSM/DEM Auto-Fetch & Guarded LLM Compiler (geo_providers.py, planning_intent.py)

  • Queries 5 public Overpass mirrors (OVERPASS_ENDPOINTS) + Open-Meteo Copernicus DEM 90m Grid, clips building/highway/waterway/green spaces to the EPSG:4326 AOI, persists verified responses to disk cache (runtime/osm_cache/) with 24h TTL (use_cache=True), and fails closed with LIVE_OSM_UNAVAILABLE if public mirrors throttle/time out (never fabricating buildings/roads).
  • compile_constraints_hybrid (POST /api/v1/integrated/planning/parse-intent) uses Gemini primary / Groq failover when keys are set, unconditionally bounded by deterministic USD parsing and exclusion rules.

3. Trained Split-CQR Conformal Calibration (scripts/train_conformal_models.py, conformal_calibrator.py)

Frozen Model (SPLIT_CQR_HGBR_V1) Dataset & Split test_with_prior Coverage (Raw -> Calibrated) test_no_prior Coverage (Raw -> Calibrated) MAE Improvement vs Baseline
conformal_hydrology_cqr_v1.joblib 31,482 daily ERA5 + GloFAS rows (2018–2025, 12 corridors; hydro-month block split 18,907 / 6,252 / 6,323) 0.7934 -> 0.8789 0.8874 -> 0.9133 0.4702 (179.64 vs 339.06 m3/s baseline) / 0.1357
conformal_emissions_cqr_v1.joblib Climate TRACE + Ember plant-month series (grouped-plant split 30,621 / 11,658 / 10,590) 0.8679 -> 0.9162 0.8332 -> 0.9213 0.7812 / 0.4924

Runtime screening is exposed via GET /api/v1/integrated/conformal/models, POST /api/v1/integrated/conformal/hydrology, POST /api/v1/integrated/conformal/emissions, and the Planning & Review workspace (EvidenceWorkspace.tsx). Note that canonical serialization explicitly uses AEGIS Canonical Sorted JSON (aegis-canonical-json-v1 / Keccak256-AEGIS-SortedJSON-v1, not full RFC 8785 JCS), and the acute classifier in backend/app/agent1_ml.py uses a scikit-learn GradientBoostingClassifier.


Local Verification & Quickstart

Prerequisites

  • Python 3.12+, Node.js 20+, optional Docker Desktop & Tesseract binary (tesseract-ocr)

1. Run Backend, Frontend Build & Preflight

cd AEGIS
$env:PYTHONPATH = "$PWD\.forest-deps;$PWD"

# Backend test suite
py -3.12 -m pytest tests/ -q

# Deployment preflight & draft checks
py -3.12 scripts/verify_deployment_preflight.py
node frontend/scripts/test-evidence-draft.mjs

# Frontend TypeScript check & production build
npm.cmd --prefix frontend run build

2. Run Hardhat EVM Testbed Contracts

cd AEGIS/blockchain
npx hardhat test

3. Run Containerized Stack (Docker)

cd AEGIS
docker build -t aegis-climate:local-verify .
docker run --rm -p 8080:8080 --env-file .env aegis-climate:local-verify

4. Verify Optional External API Credentials

Copy .env.example to .env, supply whichever keys you want live (GEMINI_API_KEY, GROQ_API_KEY, optional SARVAM_API_KEY, ELEVENLABS_API_KEY, BHASHINI_USER_ID/BHASHINI_API_KEY, PINATA_API_KEY/PINATA_API_SECRET), and run:

py -3.12 scripts/test_live_keys.py

Verified Local Evidence & Open Host Gates

See RELEASE_COMPLETION.md, REMEDIATION_VALIDATION.md, PRODUCTION_READINESS.md, and todo.md for full run logs:

  • Verified locally: 36-suite Python regression (289 passed), Hardhat EVM testbed (40 passing), Docker container build & runtime endpoint checks (aegis-climate:local-verify with scikit-learn 1.8.0, pdfplumber 0.11.11, tesseract 5.5.0), frontend tsc -b && vite build (1903 modules), deployment preflight (5/5), offline Python CLI & Node (scripts/verify-portable.mjs) bundle verification.
  • Explicit open / external items: Optional .env credentials (GEMINI_API_KEY / GROQ_API_KEY / voice / IPFS), interactive Chrome remote-debugging walkthrough (DevToolsActivePort disabled on host), field telemetry enrollment, and any separately authorized settlement adapter (settlement_eligible remains false).

Licensing & Attributions

Licensed under project terms in LICENSE, THIRD_PARTY_INTEGRATIONS.md, and docs/licenses/.

About

Autonomous Multi-Agent Climate Resilience & Parametric Finance Protocol for Pluvial Inundation. Features 30m NASA DEM Hydrology, FEMA HAZUS Curves, RFC-8785 Canonical State Roots & Smart Disaster Bonds. Track 4: Climate Data & Environmental Monitoring.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages