fix: eliminate functionally dumb features — make every SOS path foolproof#110
Draft
NITISH-R-G wants to merge 1 commit into
Draft
fix: eliminate functionally dumb features — make every SOS path foolproof#110NITISH-R-G wants to merge 1 commit into
NITISH-R-G wants to merge 1 commit into
Conversation
…roof CRITICAL fixes (Sprint 1): - Remove fake 'nearby_services' (was Future.delayed(3s, true)) — replaced with real Supabase sos_broadcasts insert + migration + RLS - Auto-dial 112 (India ERSS) on every SOS — previously only dialed user's saved contact, never actual emergency services - Fix SMS dispatch function dropping payload field — triage context was never included in the Twilio SMS body - Voice assistant no longer says 'SOS dispatched' when SMS failed — now tells the driver to dial 112 manually if dispatch didn't succeed HIGH-priority honesty fixes (Sprint 2): - Vital Scan: dashboard said 'Check heart rate & oxygen saturation' for manual-entry-only screen — renamed to 'Vital Entry' with honest subtitle - Remove PPG footer text that contradicted the honest 'manual only' banner - Wire real VitalSignsService data into structured SMS (was placeholder C?B?Bl? — now sends HR/RR/SpO2 when bystander recorded them) - Capture Scene: wire camera photo into actual Gemma 4 vision triage — was 'not auto-analyzed in this build', now calls triageWithScenePhoto() - Rename BLE 'mesh' to 'beacon' — honest about one-hop range (~30m), no relay, no encryption on wire MEDIUM improvements (Sprint 3): - Add quick-action bar (PHOTO + SOS) to incident reporting screen - Add Bengali/Marathi countdown messages (were falling back to English) - Improve auto-SOS triage transcript: 'Automatic crash SOS at <coords>, accelerometer severity N/5, driver may be incapacitated' instead of generic 'Emergency SOS triggered' - Remove 5 orphaned files with zero imports: bystander_radar, multi_agent_coordinator, scene_security_service, gemini_http, india_government_crash_contribution_service Phase 3 [CRITICAL]: life-safety path audited per rulebook Co-authored-by: Nitish R.G. <NITISH-R-G@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Brutally honest audit of every feature from the perspective of someone bleeding on a highway at 2 AM. Found 12 issues ranging from fake dispatch channels to misleading UI to missing 112 auto-dial. Every fix makes the app actually work in a real emergency instead of just looking good on paper.
CRITICAL fixes (Sprint 1 — life-safety)
Future.delayed(3s, () => true)— always showed "success" without doing anythingsos_broadcaststable insert + migration + RLS_callEmergencyContact()now dials 112 FIRST, then personal contactbuildSmsBodynever included thepayloadfieldCTX: {payload}to SMS body so dispatchers see triage contextspeakTriageSummarynow takessmsSucceededparam; warns to "dial 112 now" on failureHIGH-priority honesty fixes (Sprint 2)
C?B?Bl?— never used entered vitals_resolveVitals()now reads fromVitalSignsServicewhen available_analyzeWithGemma4()→aiTriage.triageWithScenePhoto()MEDIUM improvements (Sprint 3)
bystander_radar,multi_agent_coordinator,scene_security_service,gemini_http,india_government_crash_contribution_serviceType of change
How Has This Been Tested?
Static analysis: All changes follow existing patterns. No new imports that don't exist in
pubspec.yaml. Migration follows existing schema conventions with proper RLS.Checklist:
Files changed (16)
Services (7 modified/deleted):
emergency_orchestrator.dart— real nearby broadcast, 112 auto-dial, honest BLE naming, SMS outcome to voicevoice_assistant_service.dart— honest TTS (success/failure), bn/mr locale supportai_triage_service.dart— rich sensor-context transcript for auto-SOSstructured_sms_service.dart— real vitals from VitalSignsServicegemini_http.dart,multi_agent_coordinator.dart,scene_security_service.dart,india_government_crash_contribution_service.dartUI (4 modified/deleted):
dashboard.dart— honest subtitles for Vital Entry + BLE Chat + Capture Sceneincident_reporting_screen.dart— quick-action bar + Gemma 4 vision triagevital_scan_screen.dart— honest footer replacing PPG claimbystander_radar.dartBackend (2):
sms-dispatch/index.ts— include payload in SMS body20260517000000_sos_broadcasts.sql— new table for real nearby broadcastsLocalization (2):
app_en.arb,app_hi.arb— vital scan string updates