Repository navigation
Nova Assistant v1.3.0 - Nova Reliability Fix V3
NOVA RELIABILITY FIX V3 SPECIFICATION & IMPLEMENTATION
Repository: wtrg/nova-voice-assistant
Baseline audited HEAD: f7df7a35a1ab5f34e07b6470be16aa47aa00fc8f
Invariants & Architecture Rules
- One Reminder, Exactly One Delivery:
- Android native runtime uses
AlarmManageras the exclusive authority. - Browser runtime uses local
setIntervalfallback only whenwindow.AndroidNovais absent. - When native alarm fires, the exact local reminder is marked delivered by canonical
reminder_id.
- Android native runtime uses
- Request-Scoped Audio Events:
MainActivity.dispatchAudioEvent()emits onlyonNovaAudioEvent(requestId, event)whenrequestIdis present.- Legacy global callbacks (
onNovaSpeechStarted,onNovaSpeechEnded,onNativeAudioFailed) are restricted to empty/no-request-ID calls only. - Stale completions and stale failures are rejected without affecting active turns.
- Interrupt Cancels Timers & Eliminates Fallback:
- Each audio request owns its lifecycle (
connectTimeout,cancelled). - Interrupt/cancel operations clear pending timeouts, mark requests cancelled, invoke native audio stop, and suppress error clip playback.
- Each audio request owns its lifecycle (
- Authoritative Alarm Session Lifetime:
NovaAlarmServiceloops alarm audio until explicitSTOP,SNOOZE, successfulCLAIMfrom WebView, or a 120s safety timeout.- Audio completion does not terminate the session prematurely.
- WebView claims session via
claimAlarmSession; stale sessions are rejected and do not cause duplicate triggers.
- Turn ID End-to-End Correlation:
- Client creates
turn_idand transmits it to/api/dialogueand/api/chat. - Server reuses client
turn_id(generating UUID only if omitted) and echoes it in responses. - Conversation state machine handles direct text input transition from
IDLE->WAITING_LLM.
- Client creates
- Backend Dependency Hardening:
python-multipartadded to runtime and dev dependencies to ensure robust FastAPIFile/Formsupport.
- Android CI Hardening:
- Workflow upgraded to Node 22 with
npx cap sync androidstep. - Zero
|| trueonlintDebugand unit tests.
- Workflow upgraded to Node 22 with
- Canonical Reminder Identity Persistence & Reboot Survival:
- Backend DB persists
reminder_idandscheduling_statuswith automatic non-destructive column migration. - Android persists
reminderId + "|||" + title + "|||" + timestampin SharedPreferences. NovaBootReceiverrestores native alarms using the identical canonical UUID and deterministic request codes.
- Backend DB persists
- Two-Phase Reminder Commit (Device ACK):
- Status transitions:
pending_device_ack->confirmed/device_schedule_failed. POST /api/reminders/{reminder_id}/device-ackupdates DB state; queries for active/due tasks exclude failed schedules.
- Status transitions:
- TTS Prefetch Ordering:
- Chunk N playback starts first; chunk N+1 prefetch is requested only after chunk N is actively playing.
- Cancelled turns immediately abort downstream prefetching.
- Feature Claims Accuracy:
- Background/screen-off hotword and default assistant are marked
DEVICE TEST REQUIREDand not claimed complete.
- Background/screen-off hotword and default assistant are marked