Skip to content

feat: scene intelligence — AI crash scene analyzer with Gemini Vision#103

Open
Abirami-2743 wants to merge 84 commits into
mainfrom
feature/scene-intelligence-abie
Open

feat: scene intelligence — AI crash scene analyzer with Gemini Vision#103
Abirami-2743 wants to merge 84 commits into
mainfrom
feature/scene-intelligence-abie

Conversation

@Abirami-2743
Copy link
Copy Markdown
Collaborator

Description

Adds Scene Intelligence screen for responders to capture and analyze crash scenes using AI.

  • Capture photo via camera or gallery
  • Gemini Vision AI analyzes scene and returns structured assessment
  • Shows severity level (CRITICAL/HIGH/MODERATE/LOW)
  • Lists vehicles involved, visible injuries, immediate risks
  • Recommends step-by-step responder actions
  • One-tap call buttons for 108/101/100
  • Graceful offline fallback with standard rescue procedure

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Manual Smoke Test (on physical device)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

NITISH-R-G and others added 30 commits April 17, 2026 19:57
Phase 3 - Edge AI Integration:
- Complete AiTriageService with llamadart FFI model loading and <|think|> prompting
- Model path discovery (scans documents dir for .gguf files)
- Graceful degraded mode when no model present (keyword-based fallback)
- LocationService with GPS + dead-reckoning 60s history cache

Emergency Orchestrator (new):
- Full SOS pipeline: GPS lock → AI triage → DB write → connectivity cascade
- 10-second audible countdown for false-positive cancellation
- SOSState lifecycle: idle → countdown → gps → triage → dispatch → active → resolved
- Connectivity cascade: Supabase cloud → SMS 112 → BLE mesh broadcast

Production UI:
- Animated pulsing SOS button with radial gradient and glow
- SOSCountdownWidget with animated ring painter
- TriageResultCard with severity badge, service chips, first-aid guidance
- StatusIndicatorBar (GPS/AI/Sync status chips)
- Full dashboard with 5 lifecycle views (idle/countdown/processing/active/resolved)
- Live event log with timestamps

Bug fixes:
- Fixed misplaced import in main.dart (was inside class scope)
- Fixed main.dart import ordering
- Added dark theme as default with Google Blue seed color

Team: CODESTREAK | Hackathon: Gemma 4 Good
- Added AUDIT_REPORT.md containing deep forensic review of architecture.
- Secured Supabase/PowerSync credentials by moving to .env.
- Implemented anonymous auth fallback for PowerSync to enable offline sync.
- Added extensive codebase warnings (Mesh, Crash, Triage) reflecting audit findings.

Co-authored-by: NITISH-R-G <225521762+NITISH-R-G@users.noreply.github.com>
…0179640712131

Security Audit & Initial Architectural Fixes
…Disclosure (AES), Vital Scan (Gemma Pulse), Offline Mesh Chat, and Hardened SOS Recovery. Refactored CI/CD pipeline.
This workflow file sets up CodeQL analysis for the repository, specifying triggers for pushes and pull requests on the main branch, as well as a scheduled analysis. It includes a matrix for different programming languages and build modes.
Removed the .env file from the assets section.
NITISH-R-G and others added 25 commits April 28, 2026 10:43
Use SOSPhase for blood-red theme; document family-track in supabase README; borderSubtle getter; run family link before activity log for accurate channel snapshot.

Made-with: Cursor
* fix(deps): resolve pubspec constraints

Made-with: Cursor

* audit: replace simulated features with real/honest flows

Made-with: Cursor

* chore: remove unused ai agent orchestrator

Made-with: Cursor

* audit-fixes: remove placeholders, add Safe Walk check-in

Make SOS status wording honest (on-device log), add Safe Walk check-in notification/actions, improve offline map download controls, and gate Nearby SOS opt-in when Firebase isn’t configured.

Made-with: Cursor

* fix: remove simulated UI and make dispatch/config honest

Rewire First Aid to real offline corpus lookup, remove misleading SOS overlay status, wire mesh settings to a real screen, and make crash/SMS/map links configurable via env.

Made-with: Cursor

* fix: unblock web release build

Co-authored-by: NITISH-R-G <NITISH-R-G@users.noreply.github.com>

* fix: make SOS/triage/mesh flows honest and safer

- Parallelize SOS dispatch channels and rename local incident logging
- Clarify SMS relay/device results as request acceptance (not delivery proof)
- Move Gemini triage + assistant prompts to Supabase Edge Functions
- Add tier-2 local triage model and upgrade mesh encryption to AES-GCM
- Remove simulated responder dashboard content; use real SOS + mesh signals
- Store medical profile in secure storage; soften misleading ETA placeholder

Made-with: Cursor

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: NITISH-R-G <NITISH-R-G@users.noreply.github.com>
Made-with: Cursor

Co-authored-by: Nitish R G <NITISH-R-G@users.noreply.github.com>
- Stop bundling secrets as assets; bootstrap config via dart-defines/local .env

- Encrypt SOS activity log at rest and reduce precision in UI

- Wire extended retention consent into incident persistence

- Add reported_incidents schema + RLS migration; harden Edge function triggers

- Make tests stable on desktop by disabling BLE scan on unsupported platforms

Made-with: Cursor
* mesh radar modification

* updation of scene intelligence

---------

Co-authored-by: vijay-125ni <vijaybashkaran.12142005@gmail.com>
Bumps [build_runner](https://github.com/dart-lang/build) from 2.13.1 to 2.14.1.
- [Release notes](https://github.com/dart-lang/build/releases)
- [Commits](dart-lang/build@build_runner-v2.13.1...build_runner-v2.14.1)

---
updated-dependencies:
- dependency-name: build_runner
  dependency-version: 2.14.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [flutter_dotenv](https://github.com/java-james/flutter_dotenv) from 6.0.0 to 6.0.1.
- [Changelog](https://github.com/java-james/flutter_dotenv/blob/master/CHANGELOG.md)
- [Commits](java-james/flutter_dotenv@6.0.0...6.0.1)

---
updated-dependencies:
- dependency-name: flutter_dotenv
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@Abirami-2743 Abirami-2743 requested a review from NITISH-R-G as a code owner May 16, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants