RUST DOMAIN CORE · AWS SERVERLESS · RESILIENT DATA FLOW

Engineering Resilience
Into Every Digital Layer.

PRANA-VAYU is a secure, cloud-native systems architecture and environmental incident-response platform inspired by the Vedic principles of Prana (vital energy) and Vayu (continuous movement). Designed with strict Rust type boundaries, serverless Python Lambda compute, DynamoDB persistence, and zero-panic data integrity guarantees.

Rust Core Crate crates/prana-core Zero-panic validation, Serde normalization, typed lifecycle state machine.
Serverless Compute AWS Lambda 3.12 HTTP API Gateway v2, 128MB memory, pay-per-request DynamoDB storage.
Data Integrity Guarantee Explicitly Null Sensors Zero fabricated sensor readings; qualitative triage separated from unmeasured metrics.
Verification Suite 10/10 Tests Passed Automated event parsing, CORS, coordinate symmetry, and 503 fail-closed tests.

End-to-End System & Data Flow

PRANA-VAYU separates untrusted ingress, deterministic domain validation, serverless orchestration, and persistent storage into distinct isolation boundaries.

LAYER 01 · CLIENT & INTAKE

Operational Web Console

Single-page operational dashboard featuring Leaflet geospatial telemetry, real-time registry filters, Web Audio feedback, and formal letterhead generation.

index.html (ES2022 / Leaflet)
LAYER 02 · EDGE INGRESS

API Gateway HTTP API

AWS API Gateway v2 managing HTTP routing, explicit CORS preflight (OPTIONS), request rate limits, and 20KB payload bounding.

AWS::Serverless::HttpApi
LAYER 03 · SERVERLESS COMPUTE

Python 3.12 Lambda Handler

Boto3 orchestration microservice handling payload sanitization, dual AI routing (Gemini 3.8 Flash / Bedrock Claude 3.5 Sonnet), and fail-closed 503 error handling.

lambda_function.py
LAYER 04 · DOMAIN ENGINE

Rust 2021 prana-core

High-assurance domain crate with typed Severity rankings, geographic coordinate symmetry, and a 6-stage lifecycle state machine.

crates/prana-core (Serde / thiserror)
LAYER 05 · PERSISTENCE

Amazon DynamoDB Table

On-demand serverless NoSQL storage. Partition key: incident_id: String. Point-In-Time Recovery (PITR) and SSE encryption enabled.

AWS::DynamoDB::Table (On-Demand)
LAYER 06 · AI & FALLBACK

Dual AI & Fallback Engine

Google Gemini Interactions API with automatic failover to Bedrock and deterministic qualitative fallback that guarantees zero downtime.

Gemini 3.8 Flash + Bedrock Claude

Rust Domain Modeling & Type Safety

In PRANA-VAYU, critical business decisions and state transitions are handled by a dedicated Rust crate (crates/prana-core), preventing runtime panics, invalid coordinate pairs, and illegal lifecycle jumps.

crates/prana-core/src/severity.rs Type-Safe Severity
/// Operational severity classification for localized air pollution incidents.
pub enum Severity {
    Moderate = 1,
    High = 2,
    Severe = 3,
}

impl Severity {
    /// Protocol response urgency window (15m, 60m, 360m).
    pub fn response_window_minutes(&self) -> u32 {
        match self {
            Severity::Severe => 15,
            Severity::High => 60,
            Severity::Moderate => 360,
        }
    }

    pub fn requires_immediate_escalation(&self) -> bool {
        matches!(self, Severity::Severe | Severity::High)
    }
}
crates/prana-core/src/lifecycle.rs State Machine
/// Strict incident lifecycle state transitions:
/// Reported -> Validated -> Assessed -> ResponseActive -> Documented -> Resolved
pub enum LifecycleState {
    Reported,
    Validated,
    Assessed,
    ResponseActive,
    Documented,
    Resolved,
    Archived,
}

impl LifecycleState {
    pub fn can_transition_to(&self, next: LifecycleState) -> bool {
        match (self, next) {
            (s, n) if *s == n => true,
            (LifecycleState::Reported, LifecycleState::Validated) => true,
            (LifecycleState::Validated, LifecycleState::Assessed) => true,
            (LifecycleState::Assessed, LifecycleState::ResponseActive) => true,
            _ => false, // Backward or illegal jumps forbidden
        }
    }
}

AWS Serverless Architecture & SAM Configuration

PRANA-VAYU uses AWS SAM (Serverless Application Model) to deploy on-demand, cost-effective infrastructure with zero idle charges.

template.yaml (AWS SAM Infrastructure as Code) SAM Verified
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Globals:
  Function:
    Timeout: 30
    MemorySize: 128
    Runtime: python3.12

Resources:
  PranaVayuHttpApi:
    Type: AWS::Serverless::HttpApi
    Properties:
      CorsConfiguration:
        AllowOrigins: ['*']
        AllowMethods: ['GET', 'POST', 'OPTIONS']

  IncidentsTable:
    Type: AWS::DynamoDB::Table
    Properties:
      TableName: PRANA_VAYU_Incidents
      BillingMode: PAY_PER_REQUEST
      PointInTimeRecoverySpecification:
        PointInTimeRecoveryEnabled: true
TABLE_NAME PRANA_VAYU_Incidents Primary Key: incident_id (String). Scalable on-demand read/write capacity.
AI_PROVIDER AUTO / GEMINI / BEDROCK Environment variable switch for model execution with fallback.
BEDROCK_MODEL_ID Claude 3.5 Sonnet anthropic.claude-3-5-sonnet-20240620-v1:0 via scoped IAM policy.
AMPLIFY_HOSTING amplify.yml Zero-config static deployment directly connected to GitHub repository.

Defense-in-Depth Engineering Principles

Security and operational resilience are woven into the system from protocol design to cloud execution.

Input Boundary Sanitization

Strict server-side and Rust domain validation limits notes to 3000 chars, zones to 180 chars, and ensures coordinate symmetry (both lat & lng must be present).

Fail-Closed 503 Handling

On database or runtime errors, the API fails closed with HTTP 503 without leaking Python stack traces, AWS account numbers, or table metadata.

Least-Privilege IAM

The Lambda execution role is strictly scoped to GetItem, PutItem, and Scan on the specific DynamoDB table ARN and model invoke ARN.

No Secrets on Client

Gemini and AWS credentials reside exclusively in server-side environment variables. The web console operates safely in local mode without credentials.

Sensor Reading Integrity

The platform explicitly displays PM2.5, PM10, NOx, and VOCs as NULL / UNMEASURED unless certified physical sensors are attached, preventing fabricated metrics.

Volunteer Safety Protocol

Guidance emphasizes physical separation (120m cordon, 15m hose dousing). Volunteers are explicitly advised never to confront operators or enter smoke.

Setup, Testing & Deployment Guide

Reproducible developer instructions grounded in the actual codebase.

Terminal · Local Testing Verified 10/10
# Run the comprehensive 10-test suite (0 external network calls)
python -m unittest test_lambda.py

# Output:
Ran 10 tests in 0.008s
OK

# Run Rust domain crate unit tests
cargo test --manifest-path crates/prana-core/Cargo.toml
Terminal · Cloud Deployment AWS SAM
# 1. Build serverless artifacts
sam build

# 2. Deploy guided to AWS
sam deploy --guided

# 3. Static Web Hosting via Amplify
git push origin main
# Amplify auto-builds index.html globally via amplify.yml

Verified Implementation & Research Horizons

Transparently categorizing what is verified today, underway, and planned for future research.

Verified Implemented

Production Ready
Rust Domain Core (prana-core)

Severity rating, lifecycle state machine, Serde normalization, coordinate bounds.

AWS Serverless Microservice

Python 3.12 Lambda, HTTP API Gateway v2, DynamoDB on-demand table with PITR.

Dual AI & Fallback Engine

Gemini 3.8 Flash Interactions API + Bedrock Claude 3.5 Sonnet + deterministic fallback.

Full Operations Console

Interactive Leaflet GIS, real-time registry, research dossier, and regulatory print engine.

In Development

Underway
WebAssembly (WASM) Rust Build

Compiling prana-core directly to WASM for in-browser client-side rule validation.

Automated Regulatory Webhooks

Secure payload transmission to State Pollution Control Board complaint portals.

Offline PWA Service Worker

IndexedDB background sync for zero-connectivity field spotter data ingestion.

Research Direction

Future Research
Federated Micro-Sensor Ingestion

Edge IoT calibration and cryptographic signing for low-cost optical particulate counters.

Formal Verification

Mathematical verification of incident state machine transitions using TLA+ / Kani.

Live Environmental Incident Operations Console

Explore the functional, anti-vibe-coding operational console. Submit a report, inspect the geospatial plume grid, review qualitative research dossiers, and generate official regulatory notices.

LOCAL DEMO READY
BACKEND ENGINE:
LOCAL SANDBOX
Total Records 0 Active in local or synced registry
Severe Plumes 0 Requiring 15-minute physical interventions
Verified Coordinates 0 Grounded with verified latitude & longitude
Sample Incident One-click realistic campus leaf burning scenario

Select a tab above to log an observation, inspect geospatial downwind plumes, or generate formal Section 19(5) Air Act administrative representations.

Timestamp Incident ID Zone Source Severity Status Action
Loading registry...
BASEMAP:
📍 Cursor: 10.9205° N, 78.7410° E
💡 Click anywhere on the map to drop a pin, view Google Maps links, and auto-populate the Intake Form. Tiles: CartoDB Dark Matter (High-Contrast Tactical)
LIFECYCLE FSM STATE: Reported → Next Allowed: Validated
1. PARTICULATE PROFILE

Select an incident in the Registry to inspect its qualitative chemical speciation.

PM2.5NULL
PM10NULL
NOxNULL
VOCsNULL
Metrics remain unmeasured in accordance with anti-vibe-coding data integrity standards.
2. IMMEDIATE PHYSICAL ACTIONS

Prioritized non-confrontational safety actions will appear here.

3. LONG-TERM MITIGATION

Native high-APTI plant buffers (Peepal, Neem, Kaner) and source controls will appear here.

4. STATUTORY LEGAL REFERRAL

Section 19(5) Air (Prevention & Control of Pollution) Act, 1981 reference memo will appear here.

High-contrast double-bordered official representation under Section 19(5) of India's Air Act, 1981.

AS PHENIX & Architectural Attribution

“PRANA-VAYU explores how thoughtful systems architecture, secure software engineering, and efficient execution can work together to build resilient digital infrastructure.”

Architectural Philosophy: Vedic Cosmology Meets Digital Resilience

In Vedic cosmology, life exists at the intersection of the five primordial elements: Prithvi (Earth), Jala (Water), Agni (Fire), Vayu (Air), and Akasha (Space). While humans survive weeks without food and days without water, cellular irreversible brain death occurs in under three minutes without clean air. Localized air pollution must be treated as an acute, life-critical violation.

PRANA-VAYU translates this biological urgency into computational resilience: deterministic error containment, strict boundary sanitization, and immutable verification.

Lead Architect & Creator

SARVEPALLI AUDI SIVA BHANUVARDHAN
Brand: AS PHENIX
Category: Secure Systems Engineering & Cloud Resilience